mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
113 lines
2.3 KiB
TypeScript
113 lines
2.3 KiB
TypeScript
import { identityOverrideProcessor, ThresholdsMode } from '../../src';
|
|
|
|
export function mockStandardFieldConfigOptions() {
|
|
const category = ['Standard options'];
|
|
|
|
const unit = {
|
|
category,
|
|
id: 'unit',
|
|
path: 'unit',
|
|
name: 'Unit',
|
|
description: 'Value units',
|
|
// @ts-ignore
|
|
editor: () => null,
|
|
// @ts-ignore
|
|
override: () => null,
|
|
process: identityOverrideProcessor,
|
|
shouldApply: () => true,
|
|
};
|
|
|
|
const decimals = {
|
|
category,
|
|
id: 'decimals',
|
|
path: 'decimals',
|
|
name: 'Decimals',
|
|
description: 'Number of decimal to be shown for a value',
|
|
// @ts-ignore
|
|
editor: () => null,
|
|
// @ts-ignore
|
|
override: () => null,
|
|
process: identityOverrideProcessor,
|
|
shouldApply: () => true,
|
|
};
|
|
|
|
const boolean = {
|
|
category,
|
|
id: 'boolean',
|
|
path: 'boolean',
|
|
name: 'Boolean',
|
|
description: '',
|
|
// @ts-ignore
|
|
editor: () => null,
|
|
// @ts-ignore
|
|
override: () => null,
|
|
process: identityOverrideProcessor,
|
|
shouldApply: () => true,
|
|
};
|
|
|
|
const fieldColor = {
|
|
category,
|
|
id: 'color',
|
|
path: 'color',
|
|
name: 'color',
|
|
description: '',
|
|
// @ts-ignore
|
|
editor: () => null,
|
|
// @ts-ignore
|
|
override: () => null,
|
|
process: identityOverrideProcessor,
|
|
shouldApply: () => true,
|
|
};
|
|
|
|
const text = {
|
|
category,
|
|
id: 'text',
|
|
path: 'text',
|
|
name: 'text',
|
|
description: '',
|
|
// @ts-ignore
|
|
editor: () => null,
|
|
// @ts-ignore
|
|
override: () => null,
|
|
process: identityOverrideProcessor,
|
|
shouldApply: () => true,
|
|
};
|
|
|
|
const number = {
|
|
category,
|
|
id: 'number',
|
|
path: 'number',
|
|
name: 'number',
|
|
description: '',
|
|
// @ts-ignore
|
|
editor: () => null,
|
|
// @ts-ignore
|
|
override: () => null,
|
|
process: identityOverrideProcessor,
|
|
shouldApply: () => true,
|
|
};
|
|
|
|
const thresholds = {
|
|
category: ['Thresholds'],
|
|
id: 'thresholds',
|
|
path: 'thresholds',
|
|
name: 'thresholds',
|
|
description: '',
|
|
// @ts-ignore
|
|
editor: () => null,
|
|
// @ts-ignore
|
|
override: () => null,
|
|
process: identityOverrideProcessor,
|
|
shouldApply: () => true,
|
|
defaultValue: {
|
|
mode: ThresholdsMode.Absolute,
|
|
steps: [
|
|
{ value: -Infinity, color: 'green' },
|
|
{ value: 80, color: 'red' },
|
|
],
|
|
},
|
|
};
|
|
|
|
return [unit, decimals, boolean, fieldColor, text, number, thresholds];
|
|
}
|