From 2dc19a0241b7d0279f342dc0d07f1a168bcd61ba Mon Sep 17 00:00:00 2001 From: Alexa V <239999+axelavargas@users.noreply.github.com> Date: Wed, 8 May 2024 15:42:36 +0200 Subject: [PATCH] Chore: Update deprecated layout components HorizontalGroup and VerticalGroup in dashboard scene code (#87447) * Chore: update deprecated layout components in scene code * Add missing css for missing selectionOptionsForm --- .betterer.results | 18 ------------------ .../inspect/HelpWizard/HelpWizard.tsx | 5 ++--- .../PanelDataPane/PanelDataQueriesTab.tsx | 6 +++--- .../settings/VersionsEditView.tsx | 6 +++--- .../annotations/AnnotationSettingsEdit.tsx | 17 +++-------------- .../components/SelectionOptionsForm.tsx | 6 +++--- .../dashboard-scene/sharing/ShareExportTab.tsx | 6 +++--- 7 files changed, 17 insertions(+), 47 deletions(-) diff --git a/.betterer.results b/.betterer.results index 450c80a418c..1b1be082a78 100644 --- a/.betterer.results +++ b/.betterer.results @@ -1507,9 +1507,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use export all (\`export * from ...\`)", "0"], [0, 0, 0, "Do not use export all (\`export * from ...\`)", "1"] ], - "public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] - ], "public/app/features/dashboard-scene/inspect/HelpWizard/utils.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], @@ -1521,9 +1518,6 @@ exports[`better eslint`] = { "public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataPane.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] - ], "public/app/features/dashboard-scene/saving/getDashboardChanges.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], @@ -1567,19 +1561,10 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "7"], [0, 0, 0, "Do not use any type assertions.", "8"] ], - "public/app/features/dashboard-scene/settings/VersionsEditView.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] - ], - "public/app/features/dashboard-scene/settings/annotations/AnnotationSettingsEdit.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] - ], "public/app/features/dashboard-scene/settings/annotations/index.tsx:5381": [ [0, 0, 0, "Do not re-export imported variable (\`./AnnotationSettingsEdit\`)", "0"], [0, 0, 0, "Do not re-export imported variable (\`./AnnotationSettingsList\`)", "1"] ], - "public/app/features/dashboard-scene/settings/variables/components/SelectionOptionsForm.tsx:5381": [ - [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] - ], "public/app/features/dashboard-scene/settings/variables/components/VariableSelectField.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], @@ -1593,9 +1578,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not re-export imported variable (\`./VersionHistoryButtons\`)", "3"], [0, 0, 0, "Do not re-export imported variable (\`./VersionHistoryComparison\`)", "4"] ], - "public/app/features/dashboard-scene/sharing/ShareExportTab.tsx:5381": [ - [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] - ], "public/app/features/dashboard-scene/utils/DashboardModelCompatibilityWrapper.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], diff --git a/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx b/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx index ca08356354a..4b903c05b93 100644 --- a/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx +++ b/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.tsx @@ -12,7 +12,6 @@ import { CodeEditor, useStyles2, Field, - HorizontalGroup, InlineSwitch, Button, Spinner, @@ -153,7 +152,7 @@ export function HelpWizard({ panel, onClose }: Props) { label="Randomize data" description="Modify the original data to hide sensitve information. Note the lengths will stay the same, and duplicate values will be equal." > - + service.onToggleRandomize('values')} /> - + diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx index 3d8b2369158..04bc7c4295c 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx @@ -5,7 +5,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { config, getDataSourceSrv } from '@grafana/runtime'; import { SceneObjectBase, SceneComponentProps, sceneGraph, SceneQueryRunner } from '@grafana/scenes'; import { DataQuery } from '@grafana/schema'; -import { Button, HorizontalGroup, Tab } from '@grafana/ui'; +import { Button, Stack, Tab } from '@grafana/ui'; import { addQuery } from 'app/core/utils/query'; import { dataSource as expressionDatasource } from 'app/features/expressions/ExpressionDatasource'; import { GroupActionComponents } from 'app/features/query/components/QueryActionComponent'; @@ -209,7 +209,7 @@ export function PanelDataQueriesTabRendered({ model }: SceneComponentProps - + {showAddButton && (