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
0b5d8187
Unverified
Commit
0b5d8187
authored
May 20, 2020
by
Hugo Häggmark
Committed by
GitHub
May 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PanelInspector: hides unsupported data display options for Panel type (#24918)
parent
460847f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
28 deletions
+47
-28
public/app/features/dashboard/components/Inspector/InspectDataTab.tsx
+47
-28
No files found.
public/app/features/dashboard/components/Inspector/InspectDataTab.tsx
View file @
0b5d8187
...
...
@@ -110,8 +110,53 @@ export class InspectDataTab extends PureComponent<Props, State> {
});
}
renderDataOptions
=
()
=>
{
const
{
options
,
onOptionsChange
,
panel
}
=
this
.
props
;
const
{
transformId
}
=
this
.
state
;
const
styles
=
getPanelInspectorStyles
();
const
panelTransformations
=
panel
.
getTransformations
();
const
showPanelTransformationsOption
=
panelTransformations
&&
panelTransformations
.
length
>
0
&&
(
transformId
as
any
)
!==
'join by time'
;
const
showFieldConfigsOption
=
!
panel
.
plugin
?.
fieldConfigRegistry
.
isEmpty
();
const
showDataOptions
=
showPanelTransformationsOption
||
showFieldConfigsOption
;
if
(
!
showDataOptions
)
{
return
null
;
}
return
(
<
div
className=
{
cx
(
styles
.
options
,
styles
.
dataDisplayOptions
)
}
>
<
QueryOperationRow
title=
{
'Data display options'
}
isOpen=
{
false
}
>
{
showPanelTransformationsOption
&&
(
<
div
className=
"gf-form-inline"
>
<
Switch
tooltip=
"Data shown in the table will be transformed using transformations defined in the panel"
label=
"Apply panel transformations"
labelClass=
"width-12"
checked=
{
!!
options
.
withTransforms
}
onChange=
{
()
=>
onOptionsChange
({
...
options
,
withTransforms
:
!
options
.
withTransforms
})
}
/>
</
div
>
)
}
{
showFieldConfigsOption
&&
(
<
div
className=
"gf-form-inline"
>
<
Switch
tooltip=
"Data shown in the table will have panel field configuration applied, for example units or display name"
label=
"Apply field configuration"
labelClass=
"width-12"
checked=
{
!!
options
.
withFieldConfig
}
onChange=
{
()
=>
onOptionsChange
({
...
options
,
withFieldConfig
:
!
options
.
withFieldConfig
})
}
/>
</
div
>
)
}
</
QueryOperationRow
>
</
div
>
);
};
render
()
{
const
{
isLoading
,
data
,
options
,
onOptionsChange
}
=
this
.
props
;
const
{
isLoading
,
data
}
=
this
.
props
;
const
{
dataFrameIndex
,
transformId
,
transformationOptions
}
=
this
.
state
;
const
styles
=
getPanelInspectorStyles
();
...
...
@@ -136,8 +181,6 @@ export class InspectDataTab extends PureComponent<Props, State> {
};
});
const
panelTransformations
=
this
.
props
.
panel
.
getTransformations
();
return
(
<
div
className=
{
styles
.
dataTabContent
}
aria
-
label=
{
selectors
.
components
.
PanelInspector
.
Data
.
content
}
>
<
div
className=
{
styles
.
actionsWrapper
}
>
...
...
@@ -169,31 +212,7 @@ export class InspectDataTab extends PureComponent<Props, State> {
</
Field
>
)
}
</
div
>
<
div
className=
{
cx
(
styles
.
options
,
styles
.
dataDisplayOptions
)
}
>
<
QueryOperationRow
title=
{
'Data display options'
}
isOpen=
{
false
}
>
{
panelTransformations
&&
panelTransformations
.
length
>
0
&&
(
transformId
as
any
)
!==
'join by time'
&&
(
<
div
className=
"gf-form-inline"
>
<
Switch
tooltip=
"Data shown in the table will be transformed using transformations defined in the panel"
label=
"Apply panel transformations"
labelClass=
"width-12"
checked=
{
!!
options
.
withTransforms
}
onChange=
{
()
=>
onOptionsChange
({
...
options
,
withTransforms
:
!
options
.
withTransforms
})
}
/>
</
div
>
)
}
<
div
className=
"gf-form-inline"
>
<
Switch
tooltip=
"Data shown in the table will have panel field configuration applied, for example units or display name"
label=
"Apply field configuration"
labelClass=
"width-12"
checked=
{
!!
options
.
withFieldConfig
}
onChange=
{
()
=>
onOptionsChange
({
...
options
,
withFieldConfig
:
!
options
.
withFieldConfig
})
}
/>
</
div
>
</
QueryOperationRow
>
</
div
>
{
this
.
renderDataOptions
()
}
</
div
>
<
div
className=
{
styles
.
options
}
>
...
...
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