From eef4e18b629c214cbc8108ebfa16f0232b46e309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 27 Apr 2021 15:36:48 +0200 Subject: [PATCH] Theme: Use outline buttons for Cancel & Back actions (#33418) * Buttons: Use new outline button for cancel & back buttons * More buttons * More tweaks * Updated row snapshot --- .../components/ConfirmModal/ConfirmModal.tsx | 2 +- .../components/RowOptions/RowOptionsForm.tsx | 4 +- .../SaveDashboard/SaveDashboardErrorProxy.tsx | 6 +-- .../SaveDashboard/UnsavedChangesModal.tsx | 2 +- .../forms/SaveDashboardAsForm.tsx | 2 +- .../SaveDashboard/forms/SaveDashboardForm.tsx | 2 +- .../forms/SaveProvisionedDashboardForm.tsx | 2 +- .../components/ShareModal/ShareExport.tsx | 2 +- .../components/ShareModal/ShareSnapshot.tsx | 2 +- .../datasources/NewDataSourcePage.tsx | 4 +- .../datasources/settings/ButtonRow.tsx | 24 ++++----- .../settings/DataSourceSettingsPage.tsx | 2 +- .../__snapshots__/ButtonRow.test.tsx.snap | 50 ++++++++++--------- .../AddLibraryPanelModal.tsx | 6 +-- .../DeleteLibraryPanelModal.tsx | 2 +- .../SaveLibraryPanelModal.tsx | 2 +- 16 files changed, 59 insertions(+), 55 deletions(-) diff --git a/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.tsx b/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.tsx index 0f4301ad727..c70146cb196 100644 --- a/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.tsx +++ b/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.tsx @@ -69,7 +69,7 @@ export const ConfirmModal = ({ ) : null} - - + )} diff --git a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx index d6b731edd94..cdbc570937d 100644 --- a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx @@ -90,6 +90,9 @@ const ConfirmPluginDashboardSaveModal: React.FC = ({ on + - diff --git a/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx b/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx index 8f6142a62af..b50b921ca3d 100644 --- a/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx @@ -29,7 +29,7 @@ export const UnsavedChangesModal: React.FC = ({ >
Do you want to save your changes?
- dashboardJSON} elType={Button} onSuccess={onCopyToClipboardSuccess}> diff --git a/public/app/features/dashboard/components/ShareModal/ShareExport.tsx b/public/app/features/dashboard/components/ShareModal/ShareExport.tsx index 581f5103c73..5a19a17b542 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareExport.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareExport.tsx @@ -96,7 +96,7 @@ export class ShareExport extends PureComponent { - {externalEnabled && ( diff --git a/public/app/features/datasources/NewDataSourcePage.tsx b/public/app/features/datasources/NewDataSourcePage.tsx index 0a2befcad12..946c7dcefdd 100644 --- a/public/app/features/datasources/NewDataSourcePage.tsx +++ b/public/app/features/datasources/NewDataSourcePage.tsx @@ -96,7 +96,9 @@ class NewDataSourcePage extends PureComponent {
- Cancel + + Cancel +
{!searchQuery && ( diff --git a/public/app/features/datasources/settings/ButtonRow.tsx b/public/app/features/datasources/settings/ButtonRow.tsx index 28e1e9e6067..7631b47bd40 100644 --- a/public/app/features/datasources/settings/ButtonRow.tsx +++ b/public/app/features/datasources/settings/ButtonRow.tsx @@ -14,6 +14,18 @@ export interface Props { const ButtonRow: FC = ({ isReadOnly, onDelete, onSubmit, onTest }) => { return (
+ + Back + + {!isReadOnly && ( )} - - - Back -
); }; diff --git a/public/app/features/datasources/settings/DataSourceSettingsPage.tsx b/public/app/features/datasources/settings/DataSourceSettingsPage.tsx index e128c4bf021..4b09df66fb3 100644 --- a/public/app/features/datasources/settings/DataSourceSettingsPage.tsx +++ b/public/app/features/datasources/settings/DataSourceSettingsPage.tsx @@ -174,7 +174,7 @@ export class DataSourceSettingsPage extends PureComponent { Delete )} - + Back
diff --git a/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap b/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap index d553d347570..c9e5ccbaed7 100644 --- a/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap +++ b/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap @@ -4,13 +4,13 @@ exports[`Render should render component 1`] = `
- + Back + - - Back - + Test +
`; @@ -33,15 +34,13 @@ exports[`Render should render with buttons enabled 1`] = `
- + Back + - - Back - + Save & test +
`; diff --git a/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx b/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx index b41ace7247c..46c61993f9f 100644 --- a/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx +++ b/public/app/features/library-panels/components/AddLibraryPanelModal/AddLibraryPanelModal.tsx @@ -24,6 +24,9 @@ export const AddLibraryPanelContents = ({ panel, initialFolderId, onDismiss }: A + - ); diff --git a/public/app/features/library-panels/components/DeleteLibraryPanelModal/DeleteLibraryPanelModal.tsx b/public/app/features/library-panels/components/DeleteLibraryPanelModal/DeleteLibraryPanelModal.tsx index 1264faf2f4c..87f8db6d10c 100644 --- a/public/app/features/library-panels/components/DeleteLibraryPanelModal/DeleteLibraryPanelModal.tsx +++ b/public/app/features/library-panels/components/DeleteLibraryPanelModal/DeleteLibraryPanelModal.tsx @@ -36,7 +36,7 @@ export const DeleteLibraryPanelModal: FC = ({ libraryPanel, onDismiss, on {!connected ? : null} -