Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
9967f193
Unverified
Commit
9967f193
authored
Feb 22, 2021
by
Hugo Häggmark
Committed by
GitHub
Feb 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "StoryBook: Introduces Grafana Controls (#31351)" (#31388)
This reverts commit
c5797cc2
.
parent
f36601cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
71 deletions
+28
-71
packages/grafana-ui/.storybook/main.ts
+0
-1
packages/grafana-ui/src/addons/grafana-controls/preset.ts
+0
-5
packages/grafana-ui/src/addons/grafana-controls/register.tsx
+0
-43
packages/grafana-ui/src/components/BigValue/BigValue.story.tsx
+28
-22
No files found.
packages/grafana-ui/.storybook/main.ts
View file @
9967f193
...
@@ -14,7 +14,6 @@ module.exports = {
...
@@ -14,7 +14,6 @@ module.exports = {
addons
:
[
addons
:
[
'@storybook/addon-docs'
,
'@storybook/addon-docs'
,
'@storybook/addon-controls'
,
'@storybook/addon-controls'
,
'../src/addons/grafana-controls/preset.ts'
,
'@storybook/addon-knobs'
,
'@storybook/addon-knobs'
,
'@storybook/addon-actions'
,
'@storybook/addon-actions'
,
'storybook-dark-mode/register'
,
'storybook-dark-mode/register'
,
...
...
packages/grafana-ui/src/addons/grafana-controls/preset.ts
deleted
100644 → 0
View file @
f36601cd
module
.
exports
=
{
managerEntries
(
entry
=
[])
{
return
[...
entry
,
require
.
resolve
(
'./register'
)];
},
};
packages/grafana-ui/src/addons/grafana-controls/register.tsx
deleted
100644 → 0
View file @
f36601cd
import
React
from
'react'
;
import
{
ArgTypes
}
from
'@storybook/react'
;
import
{
addons
,
types
}
from
'@storybook/addons'
;
import
{
AddonPanel
,
ArgsTable
}
from
'@storybook/components'
;
import
{
useArgs
,
useArgTypes
,
useParameter
}
from
'@storybook/api'
;
const
ADDON_ID
=
'storybook/grafana-controls'
;
const
PANEL_ID
=
`
${
ADDON_ID
}
/controls`
;
const
PARAM_KEY
=
'grafanaControls'
;
const
GrafanaControlsPanel
=
()
=>
{
const
[
args
,
updateArgs
,
resetArgs
]
=
useArgs
();
const
rows
=
useArgTypes
();
const
argTypes
=
useParameter
<
ArgTypes
>
(
PARAM_KEY
,
{});
const
newRows
:
ArgTypes
=
{};
for
(
const
key
in
argTypes
)
{
if
(
!
Object
.
hasOwnProperty
.
call
(
argTypes
,
key
))
{
continue
;
}
if
(
Object
.
hasOwnProperty
.
call
(
rows
,
key
))
{
newRows
[
key
]
=
{
...
rows
[
key
],
...
argTypes
[
key
]
};
}
}
return
(
<
ArgsTable
rows=
{
newRows
}
args=
{
args
}
updateArgs=
{
updateArgs
}
resetArgs=
{
resetArgs
as
any
}
inAddonPanel
compact
/>
);
};
addons
.
register
(
ADDON_ID
,
(
api
)
=>
{
addons
.
add
(
PANEL_ID
,
{
type
:
types
.
PANEL
,
title
:
'Grafana Controls'
,
// eslint-disable-next-line react/display-name
render
:
({
active
,
key
})
=>
(
<
AddonPanel
active=
{
Boolean
(
active
)
}
key=
{
key
}
>
<
GrafanaControlsPanel
/>
</
AddonPanel
>
),
});
});
packages/grafana-ui/src/components/BigValue/BigValue.story.tsx
View file @
9967f193
...
@@ -11,6 +11,7 @@ import {
...
@@ -11,6 +11,7 @@ import {
import
{
withCenteredStory
}
from
'../../utils/storybook/withCenteredStory'
;
import
{
withCenteredStory
}
from
'../../utils/storybook/withCenteredStory'
;
import
mdx
from
'./BigValue.mdx'
;
import
mdx
from
'./BigValue.mdx'
;
import
{
useTheme
}
from
'../../themes'
;
import
{
useTheme
}
from
'../../themes'
;
import
{
NOOP_CONTROL
}
from
'@grafana/ui/.storybook/preview'
;
import
{
ArrayVector
,
FieldSparkline
,
FieldType
}
from
'@grafana/data'
;
import
{
ArrayVector
,
FieldSparkline
,
FieldType
}
from
'@grafana/data'
;
export
default
{
export
default
{
...
@@ -22,31 +23,36 @@ export default {
...
@@ -22,31 +23,36 @@ export default {
page
:
mdx
,
page
:
mdx
,
},
},
knobs
:
{
knobs
:
{
disable
:
true
,
disable
d
:
true
,
},
},
controls
:
{
},
disable
:
true
,
argTypes
:
{
},
width
:
{
control
:
{
type
:
'range'
,
min
:
200
,
max
:
800
}
},
grafanaControls
:
{
height
:
{
control
:
{
type
:
'range'
,
min
:
200
,
max
:
800
}
},
width
:
{
control
:
{
type
:
'range'
,
min
:
200
,
max
:
800
}
},
colorMode
:
{
control
:
{
type
:
'select'
,
options
:
[
BigValueColorMode
.
Value
,
BigValueColorMode
.
Background
]
}
},
height
:
{
control
:
{
type
:
'range'
,
min
:
200
,
max
:
800
}
},
graphMode
:
{
control
:
{
type
:
'select'
,
options
:
[
BigValueGraphMode
.
Area
,
BigValueGraphMode
.
None
]
}
},
colorMode
:
{
control
:
{
type
:
'select'
,
options
:
[
BigValueColorMode
.
Value
,
BigValueColorMode
.
Background
]
}
},
justifyMode
:
{
control
:
{
type
:
'select'
,
options
:
[
BigValueJustifyMode
.
Auto
,
BigValueJustifyMode
.
Center
]
}
},
graphMode
:
{
control
:
{
type
:
'select'
,
options
:
[
BigValueGraphMode
.
Area
,
BigValueGraphMode
.
None
]
}
},
textMode
:
{
justifyMode
:
{
control
:
{
type
:
'select'
,
options
:
[
BigValueJustifyMode
.
Auto
,
BigValueJustifyMode
.
Center
]
}
},
control
:
{
textMode
:
{
type
:
'radio'
,
control
:
{
options
:
[
type
:
'radio'
,
BigValueTextMode
.
Auto
,
options
:
[
BigValueTextMode
.
Name
,
BigValueTextMode
.
Auto
,
BigValueTextMode
.
ValueAndName
,
BigValueTextMode
.
Name
,
BigValueTextMode
.
None
,
BigValueTextMode
.
ValueAndName
,
BigValueTextMode
.
Value
,
BigValueTextMode
.
None
,
],
BigValueTextMode
.
Value
,
],
},
},
},
color
:
{
control
:
{
type
:
'color'
}
},
},
},
color
:
{
control
:
'color'
},
value
:
NOOP_CONTROL
,
sparkline
:
NOOP_CONTROL
,
onClick
:
NOOP_CONTROL
,
className
:
NOOP_CONTROL
,
alignmentFactors
:
NOOP_CONTROL
,
text
:
NOOP_CONTROL
,
count
:
NOOP_CONTROL
,
theme
:
NOOP_CONTROL
,
},
},
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment