From 7e6e76f4ffee67d4492e50bcf1a1223515cbaada Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Thu, 25 Jul 2024 16:03:59 +0100 Subject: [PATCH] E2C: Show rebuild snapshot button (#90941) * E2C: Show rebuild snapshot button * i18n * Update public/app/features/migrate-to-cloud/onprem/Page.tsx Co-authored-by: Alex Khomenko --------- Co-authored-by: Alex Khomenko --- .betterer.results | 3 -- .../features/migrate-to-cloud/api/index.ts | 5 ++- .../onprem/MigrationSummary.tsx | 16 +++++++ .../features/migrate-to-cloud/onprem/Page.tsx | 45 ++++++++++++++----- public/locales/en-US/grafana.json | 4 +- public/locales/pseudo-LOCALE/grafana.json | 4 +- 6 files changed, 60 insertions(+), 17 deletions(-) diff --git a/.betterer.results b/.betterer.results index 304db52d9ae..d7fb11a15f9 100644 --- a/.betterer.results +++ b/.betterer.results @@ -4751,9 +4751,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], - "public/app/features/migrate-to-cloud/onprem/Page.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] - ], "public/app/features/notifications/StoredNotifications.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], diff --git a/public/app/features/migrate-to-cloud/api/index.ts b/public/app/features/migrate-to-cloud/api/index.ts index 58e3bace435..75f33c8e728 100644 --- a/public/app/features/migrate-to-cloud/api/index.ts +++ b/public/app/features/migrate-to-cloud/api/index.ts @@ -49,8 +49,9 @@ export const cloudMigrationAPI = generatedAPI.enhanceEndpoints({ getShapshotList: { providesTags: ['cloud-migration-snapshot'], }, - createSnapshot: { - invalidatesTags: ['cloud-migration-snapshot'], + createSnapshot(endpoint) { + suppressErrorsOnQuery(endpoint); + endpoint.invalidatesTags = ['cloud-migration-snapshot']; }, uploadSnapshot: { invalidatesTags: ['cloud-migration-snapshot'], diff --git a/public/app/features/migrate-to-cloud/onprem/MigrationSummary.tsx b/public/app/features/migrate-to-cloud/onprem/MigrationSummary.tsx index f27383c62ec..19405d42be1 100644 --- a/public/app/features/migrate-to-cloud/onprem/MigrationSummary.tsx +++ b/public/app/features/migrate-to-cloud/onprem/MigrationSummary.tsx @@ -20,6 +20,8 @@ interface MigrationSummaryProps { showUploadSnapshot: boolean; uploadSnapshotIsLoading: boolean; onUploadSnapshot: () => void; + + showRebuildSnapshot: boolean; } export function MigrationSummary(props: MigrationSummaryProps) { @@ -29,6 +31,7 @@ export function MigrationSummary(props: MigrationSummaryProps) { isBusy, disconnectIsLoading, onDisconnect, + showBuildSnapshot, buildSnapshotIsLoading, onBuildSnapshot, @@ -36,6 +39,8 @@ export function MigrationSummary(props: MigrationSummaryProps) { showUploadSnapshot, uploadSnapshotIsLoading, onUploadSnapshot, + + showRebuildSnapshot, } = props; const totalCount = 0; @@ -96,6 +101,17 @@ export function MigrationSummary(props: MigrationSummaryProps) { )} + {showRebuildSnapshot && ( + + )} + {showUploadSnapshot && (