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
55277ca7
Unverified
Commit
55277ca7
authored
Feb 19, 2020
by
Dominik Prokop
Committed by
GitHub
Feb 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Field Config Editors: Remove namespacing from standard field config editors (#22296)
parent
943f9b29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
22 deletions
+10
-22
packages/grafana-ui/src/components/FieldConfigs/standardFieldConfigEditors.tsx
+10
-22
No files found.
packages/grafana-ui/src/components/FieldConfigs/standardFieldConfigEditors.tsx
View file @
55277ca7
...
@@ -10,9 +10,8 @@ import {
...
@@ -10,9 +10,8 @@ import {
}
from
'./thresholds'
;
}
from
'./thresholds'
;
import
{
DataLinksOverrideEditor
,
dataLinksOverrideProcessor
,
DataLinksValueEditor
}
from
'./links'
;
import
{
DataLinksOverrideEditor
,
dataLinksOverrideProcessor
,
DataLinksValueEditor
}
from
'./links'
;
// eslint-disable-next-line @typescript-eslint/no-namespace
export
const
getStandardFieldConfigs
=
()
=>
{
export
namespace
StandardFieldConfigEditors
{
const
title
:
FieldPropertyEditorItem
<
string
,
StringFieldConfigSettings
>
=
{
export
const
title
:
FieldPropertyEditorItem
<
string
,
StringFieldConfigSettings
>
=
{
id
:
'title'
,
// Match field properties
id
:
'title'
,
// Match field properties
name
:
'Title'
,
name
:
'Title'
,
description
:
'The field title'
,
description
:
'The field title'
,
...
@@ -27,7 +26,7 @@ export namespace StandardFieldConfigEditors {
...
@@ -27,7 +26,7 @@ export namespace StandardFieldConfigEditors {
shouldApply
:
field
=>
field
.
type
!==
FieldType
.
time
,
shouldApply
:
field
=>
field
.
type
!==
FieldType
.
time
,
};
};
export
const
unit
:
FieldPropertyEditorItem
<
string
,
StringFieldConfigSettings
>
=
{
const
unit
:
FieldPropertyEditorItem
<
string
,
StringFieldConfigSettings
>
=
{
id
:
'unit'
,
// Match field properties
id
:
'unit'
,
// Match field properties
name
:
'Unit'
,
name
:
'Unit'
,
description
:
'value units'
,
description
:
'value units'
,
...
@@ -43,7 +42,7 @@ export namespace StandardFieldConfigEditors {
...
@@ -43,7 +42,7 @@ export namespace StandardFieldConfigEditors {
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
};
};
export
const
min
:
FieldPropertyEditorItem
<
number
,
NumberFieldConfigSettings
>
=
{
const
min
:
FieldPropertyEditorItem
<
number
,
NumberFieldConfigSettings
>
=
{
id
:
'min'
,
// Match field properties
id
:
'min'
,
// Match field properties
name
:
'Min'
,
name
:
'Min'
,
description
:
'Minimum expected value'
,
description
:
'Minimum expected value'
,
...
@@ -58,7 +57,7 @@ export namespace StandardFieldConfigEditors {
...
@@ -58,7 +57,7 @@ export namespace StandardFieldConfigEditors {
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
};
};
export
const
max
:
FieldPropertyEditorItem
<
number
,
NumberFieldConfigSettings
>
=
{
const
max
:
FieldPropertyEditorItem
<
number
,
NumberFieldConfigSettings
>
=
{
id
:
'max'
,
// Match field properties
id
:
'max'
,
// Match field properties
name
:
'Max'
,
name
:
'Max'
,
description
:
'Maximum expected value'
,
description
:
'Maximum expected value'
,
...
@@ -74,7 +73,7 @@ export namespace StandardFieldConfigEditors {
...
@@ -74,7 +73,7 @@ export namespace StandardFieldConfigEditors {
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
};
};
export
const
decimals
:
FieldPropertyEditorItem
<
number
,
NumberFieldConfigSettings
>
=
{
const
decimals
:
FieldPropertyEditorItem
<
number
,
NumberFieldConfigSettings
>
=
{
id
:
'decimals'
,
// Match field properties
id
:
'decimals'
,
// Match field properties
name
:
'Decimals'
,
name
:
'Decimals'
,
description
:
'How many decimal places should be shown on a number'
,
description
:
'How many decimal places should be shown on a number'
,
...
@@ -93,7 +92,7 @@ export namespace StandardFieldConfigEditors {
...
@@ -93,7 +92,7 @@ export namespace StandardFieldConfigEditors {
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
};
};
export
const
thresholds
:
FieldPropertyEditorItem
<
ThresholdsConfig
,
ThresholdsFieldConfigSettings
>
=
{
const
thresholds
:
FieldPropertyEditorItem
<
ThresholdsConfig
,
ThresholdsFieldConfigSettings
>
=
{
id
:
'thresholds'
,
// Match field properties
id
:
'thresholds'
,
// Match field properties
name
:
'Thresholds'
,
name
:
'Thresholds'
,
description
:
'Manage Thresholds'
,
description
:
'Manage Thresholds'
,
...
@@ -109,7 +108,7 @@ export namespace StandardFieldConfigEditors {
...
@@ -109,7 +108,7 @@ export namespace StandardFieldConfigEditors {
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
shouldApply
:
field
=>
field
.
type
===
FieldType
.
number
,
};
};
export
const
noValue
:
FieldPropertyEditorItem
<
string
,
StringFieldConfigSettings
>
=
{
const
noValue
:
FieldPropertyEditorItem
<
string
,
StringFieldConfigSettings
>
=
{
id
:
'noValue'
,
// Match field properties
id
:
'noValue'
,
// Match field properties
name
:
'No Value'
,
name
:
'No Value'
,
description
:
'What to show when there is no value'
,
description
:
'What to show when there is no value'
,
...
@@ -125,7 +124,7 @@ export namespace StandardFieldConfigEditors {
...
@@ -125,7 +124,7 @@ export namespace StandardFieldConfigEditors {
shouldApply
:
()
=>
true
,
shouldApply
:
()
=>
true
,
};
};
export
const
links
:
FieldPropertyEditorItem
<
DataLink
[],
StringFieldConfigSettings
>
=
{
const
links
:
FieldPropertyEditorItem
<
DataLink
[],
StringFieldConfigSettings
>
=
{
id
:
'links'
,
// Match field properties
id
:
'links'
,
// Match field properties
name
:
'DataLinks'
,
name
:
'DataLinks'
,
description
:
'Manage date links'
,
description
:
'Manage date links'
,
...
@@ -137,17 +136,6 @@ export namespace StandardFieldConfigEditors {
...
@@ -137,17 +136,6 @@ export namespace StandardFieldConfigEditors {
},
},
shouldApply
:
()
=>
true
,
shouldApply
:
()
=>
true
,
};
};
}
export
const
getStandardFieldConfigs
=
()
=>
{
return
[
unit
,
min
,
max
,
decimals
,
thresholds
,
title
,
noValue
,
links
];
return
[
StandardFieldConfigEditors
.
unit
,
StandardFieldConfigEditors
.
min
,
StandardFieldConfigEditors
.
max
,
StandardFieldConfigEditors
.
decimals
,
StandardFieldConfigEditors
.
thresholds
,
StandardFieldConfigEditors
.
title
,
StandardFieldConfigEditors
.
noValue
,
StandardFieldConfigEditors
.
links
,
];
};
};
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