mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
FieldOverrides: Add value mappings editor to standard config properties registry (#22648)
This commit is contained in:
@@ -136,8 +136,6 @@ export function applyFieldOverrides(options: ApplyFieldOverrideOptions): DataFra
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(config)
|
||||
|
||||
// Try harder to set a real value that is not 'other'
|
||||
let type = field.type;
|
||||
if (!type || type === FieldType.other) {
|
||||
@@ -242,7 +240,6 @@ function setDynamicConfigValue(config: FieldConfig, value: DynamicConfigValue, c
|
||||
export function setFieldConfigDefaults(config: FieldConfig, defaults: FieldConfig, context: FieldOverrideEnv) {
|
||||
if (defaults) {
|
||||
const keys = Object.keys(defaults);
|
||||
|
||||
for (const key of keys) {
|
||||
if (key === 'custom') {
|
||||
if (!context.custom) {
|
||||
@@ -275,6 +272,11 @@ const processFieldConfigValue = (
|
||||
const currentConfig = destination[key];
|
||||
if (currentConfig === null || currentConfig === undefined) {
|
||||
const item = registry.getIfExists(key);
|
||||
if (!item) {
|
||||
console.warn(`No processor available for ${key} config property`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item && item.shouldApply(context.field!)) {
|
||||
const val = item.process(source[key], context, item.settings);
|
||||
if (val !== undefined && val !== null) {
|
||||
|
||||
Reference in New Issue
Block a user