123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- import { identityOverrideProcessor, ThresholdsMode } from '@grafana/data';
- 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];
- }
|