Overrides: Show option group counters for options that represent collections (#23655)

This commit is contained in:
Dominik Prokop
2020-04-18 14:05:38 +02:00
committed by GitHub
parent 4e521a84b4
commit 539edba31b
6 changed files with 67 additions and 9 deletions

View File

@@ -143,6 +143,7 @@ export const getStandardFieldConfigs = () => {
},
shouldApply: field => field.type === FieldType.number,
category: ['Color & thresholds'],
getItemsCount: value => (value ? value.steps.length : 0),
};
const mappings: FieldConfigPropertyItem<any, ValueMapping[], ValueMappingFieldConfigSettings> = {
@@ -158,6 +159,7 @@ export const getStandardFieldConfigs = () => {
defaultValue: [],
shouldApply: field => field.type === FieldType.number,
category: ['Value mappings'],
getItemsCount: (value?) => (value ? value.length : 0),
};
const noValue: FieldConfigPropertyItem<any, string, StringFieldConfigSettings> = {
@@ -191,6 +193,7 @@ export const getStandardFieldConfigs = () => {
},
shouldApply: () => true,
category: ['Data links'],
getItemsCount: value => (value ? value.length : 0),
};
const color: FieldConfigPropertyItem<any, string, StringFieldConfigSettings> = {