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
ac0140d5
Commit
ac0140d5
authored
Feb 01, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed dashboard row title not updating when variable changed, fixes #15133
parent
e54689a9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
15 deletions
+20
-15
public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx
+18
-13
public/sass/_variables.scss
+1
-1
public/sass/components/_submenu.scss
+1
-1
No files found.
public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx
View file @
ac0140d5
...
@@ -18,13 +18,18 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
...
@@ -18,13 +18,18 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
collapsed
:
this
.
props
.
panel
.
collapsed
,
collapsed
:
this
.
props
.
panel
.
collapsed
,
};
};
this
.
toggle
=
this
.
toggle
.
bind
(
this
);
appEvents
.
on
(
'template-variable-value-updated'
,
this
.
onVariableUpdated
);
this
.
openSettings
=
this
.
openSettings
.
bind
(
this
);
this
.
delete
=
this
.
delete
.
bind
(
this
);
this
.
update
=
this
.
update
.
bind
(
this
);
}
}
toggle
()
{
componentWillUnmount
()
{
appEvents
.
off
(
'template-variable-value-updated'
,
this
.
onVariableUpdated
);
}
onVariableUpdated
=
()
=>
{
this
.
forceUpdate
();
}
onToggle
=
()
=>
{
this
.
props
.
dashboard
.
toggleRow
(
this
.
props
.
panel
);
this
.
props
.
dashboard
.
toggleRow
(
this
.
props
.
panel
);
this
.
setState
(
prevState
=>
{
this
.
setState
(
prevState
=>
{
...
@@ -32,23 +37,23 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
...
@@ -32,23 +37,23 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
});
});
}
}
update
()
{
onUpdate
=
()
=>
{
this
.
props
.
dashboard
.
processRepeats
();
this
.
props
.
dashboard
.
processRepeats
();
this
.
forceUpdate
();
this
.
forceUpdate
();
}
}
o
penSettings
()
{
o
nOpenSettings
=
()
=>
{
appEvents
.
emit
(
'show-modal'
,
{
appEvents
.
emit
(
'show-modal'
,
{
templateHtml
:
`<row-options row="model.row" on-updated="model.onUpdated()" dismiss="dismiss()"></row-options>`
,
templateHtml
:
`<row-options row="model.row" on-updated="model.onUpdated()" dismiss="dismiss()"></row-options>`
,
modalClass
:
'modal--narrow'
,
modalClass
:
'modal--narrow'
,
model
:
{
model
:
{
row
:
this
.
props
.
panel
,
row
:
this
.
props
.
panel
,
onUpdated
:
this
.
update
.
bind
(
this
)
,
onUpdated
:
this
.
onUpdate
,
},
},
});
});
}
}
delete
()
{
onDelete
=
()
=>
{
appEvents
.
emit
(
'confirm-modal'
,
{
appEvents
.
emit
(
'confirm-modal'
,
{
title
:
'Delete Row'
,
title
:
'Delete Row'
,
text
:
'Are you sure you want to remove this row and all its panels?'
,
text
:
'Are you sure you want to remove this row and all its panels?'
,
...
@@ -81,7 +86,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
...
@@ -81,7 +86,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
return
(
return
(
<
div
className=
{
classes
}
>
<
div
className=
{
classes
}
>
<
a
className=
"dashboard-row__title pointer"
onClick=
{
this
.
t
oggle
}
>
<
a
className=
"dashboard-row__title pointer"
onClick=
{
this
.
onT
oggle
}
>
<
i
className=
{
chevronClass
}
/>
<
i
className=
{
chevronClass
}
/>
{
title
}
{
title
}
<
span
className=
"dashboard-row__panel_count"
>
<
span
className=
"dashboard-row__panel_count"
>
...
@@ -90,16 +95,16 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
...
@@ -90,16 +95,16 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
</
a
>
</
a
>
{
canEdit
&&
(
{
canEdit
&&
(
<
div
className=
"dashboard-row__actions"
>
<
div
className=
"dashboard-row__actions"
>
<
a
className=
"pointer"
onClick=
{
this
.
openSettings
}
>
<
a
className=
"pointer"
onClick=
{
this
.
o
nO
penSettings
}
>
<
i
className=
"fa fa-cog"
/>
<
i
className=
"fa fa-cog"
/>
</
a
>
</
a
>
<
a
className=
"pointer"
onClick=
{
this
.
d
elete
}
>
<
a
className=
"pointer"
onClick=
{
this
.
onD
elete
}
>
<
i
className=
"fa fa-trash"
/>
<
i
className=
"fa fa-trash"
/>
</
a
>
</
a
>
</
div
>
</
div
>
)
}
)
}
{
this
.
state
.
collapsed
===
true
&&
(
{
this
.
state
.
collapsed
===
true
&&
(
<
div
className=
"dashboard-row__toggle-target"
onClick=
{
this
.
t
oggle
}
>
<
div
className=
"dashboard-row__toggle-target"
onClick=
{
this
.
onT
oggle
}
>
</
div
>
</
div
>
)
}
)
}
...
...
public/sass/_variables.scss
View file @
ac0140d5
...
@@ -135,7 +135,7 @@ $input-padding-y-sm: 4px !default;
...
@@ -135,7 +135,7 @@ $input-padding-y-sm: 4px !default;
$input-padding-x-lg
:
20px
!
default
;
$input-padding-x-lg
:
20px
!
default
;
$input-padding-y-lg
:
10px
!
default
;
$input-padding-y-lg
:
10px
!
default
;
$input-height
:
((
$font-size-base
*
$line-height-base
)
+
(
$input-padding-y
*
2
))
!
default
;
$input-height
:
35px
!
default
;
$gf-form-margin
:
0
.2rem
;
$gf-form-margin
:
0
.2rem
;
$gf-form-input-height
:
35px
;
$gf-form-input-height
:
35px
;
...
...
public/sass/components/_submenu.scss
View file @
ac0140d5
...
@@ -40,9 +40,9 @@
...
@@ -40,9 +40,9 @@
background-color
:
$input-bg
;
background-color
:
$input-bg
;
border
:
1px
solid
$input-border-color
;
border
:
1px
solid
$input-border-color
;
border-radius
:
$input-border-radius
;
border-radius
:
$input-border-radius
;
box-sizing
:
content-box
;
display
:
inline-block
;
display
:
inline-block
;
color
:
$text-color
;
color
:
$text-color
;
height
:
$gf-form-input-height
;
.label-tag
{
.label-tag
{
margin
:
0
5px
;
margin
:
0
5px
;
...
...
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