diff --git a/public/app/plugins/panel/table/migrations.test.ts b/public/app/plugins/panel/table/migrations.test.ts index fd952995ce5..a40120c8857 100644 --- a/public/app/plugins/panel/table/migrations.test.ts +++ b/public/app/plugins/panel/table/migrations.test.ts @@ -126,6 +126,7 @@ describe('Table Migrations', () => { ], }, }; + const panel = {} as PanelModel; tablePanelChangedHandler(panel, 'table-old', oldStyles); expect(panel).toMatchInlineSnapshot(` @@ -269,6 +270,38 @@ describe('Table Migrations', () => { `); }); + it('migrates hidden fields to override', () => { + const oldStyles = { + angular: { + columns: [], + styles: [ + { + dateFormat: 'YYYY-MM-DD HH:mm:ss', + pattern: 'time', + type: 'hidden', + }, + ], + }, + }; + + const panel = {} as PanelModel; + tablePanelChangedHandler(panel, 'table-old', oldStyles); + expect(panel.fieldConfig.overrides).toEqual([ + { + matcher: { + id: 'byName', + options: 'time', + }, + properties: [ + { + id: 'custom.hidden', + value: true, + }, + ], + }, + ]); + }); + it('migrates DataFrame[] from format using meta.custom.parentRowIndex to format using FieldType.nestedFrames', () => { const mainFrame = (refId: string) => { return createDataFrame({ diff --git a/public/app/plugins/panel/table/migrations.ts b/public/app/plugins/panel/table/migrations.ts index f05ec19e051..f92d5b60836 100644 --- a/public/app/plugins/panel/table/migrations.ts +++ b/public/app/plugins/panel/table/migrations.ts @@ -150,6 +150,13 @@ const migrateTableStyleToOverride = (style: Style) => { }); } + if (style.type === 'hidden') { + override.properties.push({ + id: 'custom.hidden', + value: true, + }); + } + if (style.link) { override.properties.push({ id: 'links',