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
7eb2558f
Commit
7eb2558f
authored
Feb 06, 2019
by
Dominik Prokop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with graph legend color picker disapearing on color selection
parent
6b1390b9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
public/app/core/utils/ConfigProvider.tsx
+1
-2
public/app/plugins/panel/graph/graph.ts
+4
-1
scripts/webpack/getThemeVariable.js
+1
-1
No files found.
public/app/core/utils/ConfigProvider.tsx
View file @
7eb2558f
...
...
@@ -21,8 +21,7 @@ export const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
return
(
<
ConfigConsumer
>
{
config
=>
{
const
currentTheme
=
getCurrentThemeName
();
return
<
ThemeContext
.
Provider
value=
{
getTheme
(
currentTheme
)
}
>
{
children
}
</
ThemeContext
.
Provider
>;
return
<
ThemeContext
.
Provider
value=
{
getCurrentTheme
()
}
>
{
children
}
</
ThemeContext
.
Provider
>;
}
}
</
ConfigConsumer
>
);
...
...
public/app/plugins/panel/graph/graph.ts
View file @
7eb2558f
...
...
@@ -28,6 +28,8 @@ import { GraphCtrl } from './module';
import
{
GrafanaThemeType
,
getValueFormat
}
from
'@grafana/ui'
;
import
{
provideTheme
}
from
'app/core/utils/ConfigProvider'
;
const
LegendWithThemeProvider
=
provideTheme
(
Legend
);
class
GraphElement
{
ctrl
:
GraphCtrl
;
tooltip
:
any
;
...
...
@@ -44,6 +46,7 @@ class GraphElement {
legendElem
:
HTMLElement
;
constructor
(
private
scope
,
private
elem
,
private
timeSrv
)
{
this
.
ctrl
=
scope
.
ctrl
;
this
.
dashboard
=
this
.
ctrl
.
dashboard
;
this
.
panel
=
this
.
ctrl
.
panel
;
...
...
@@ -110,7 +113,7 @@ class GraphElement {
onToggleAxis
:
this
.
ctrl
.
onToggleAxis
,
};
const
legendReactElem
=
React
.
createElement
(
provideTheme
(
Legend
)
,
legendProps
);
const
legendReactElem
=
React
.
createElement
(
LegendWithThemeProvider
,
legendProps
);
ReactDOM
.
render
(
legendReactElem
,
this
.
legendElem
,
()
=>
this
.
renderPanel
());
}
...
...
scripts/webpack/getThemeVariable.js
View file @
7eb2558f
...
...
@@ -29,7 +29,7 @@ function getThemeVariable(variablePath, themeName) {
const
variable
=
get
(
theme
,
variablePath
.
getValue
());
if
(
!
variable
)
{
throw
new
Error
(
`
${
variablePath
}
is not defined fo
${
themeName
}
`
);
throw
new
Error
(
`
${
variablePath
.
getValue
()}
is not defined for
${
themeName
.
getValue
()}
theme
`
);
}
if
(
isHex
(
variable
))
{
...
...
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