Commit 55277ca7 by Dominik Prokop Committed by GitHub

Field Config Editors: Remove namespacing from standard field config editors (#22296)

parent 943f9b29
...@@ -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,
];
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment