Transform: Fixed issue in labels to fields and update docs (#27501)

(cherry picked from commit 61463aa123)
This commit is contained in:
Torkel Ödegaard
2020-09-17 10:44:02 +02:00
committed by Hugo Häggmark
parent adb6d93442
commit d842db21d2
3 changed files with 79 additions and 51 deletions
@@ -50,7 +50,16 @@ describe('Labels as Columns', () => {
name: 'A',
fields: [
{ name: 'time', type: FieldType.time, values: [1000, 2000] },
{ name: 'Value', type: FieldType.number, values: [1, 2], labels: { location: 'inside', name: 'Request' } },
{
name: 'Value',
type: FieldType.number,
values: [1, 2],
labels: { location: 'inside', name: 'Request' },
config: {
displayName: 'Custom1',
displayNameFromDS: 'Custom2',
},
},
],
});
@@ -51,7 +51,9 @@ export const labelsToFieldsTransformer: DataTransformerInfo<LabelsToFieldsOption
name,
config: {
...field.config,
// we need to clear thes for this transform as these can contain label names that we no longer want
displayName: undefined,
displayNameFromDS: undefined,
},
labels: undefined,
});