From 84126222c4e1551de2ec2bbc3c50f00e8723afd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Jim=C3=A9nez=20S=C3=A1nchez?= Date: Tue, 4 Mar 2025 16:34:54 +0100 Subject: [PATCH] Same onboarding page regarless of migration (#101557) --- .betterer.results | 3 +- .../features/provisioning/OnboardingPage.tsx | 75 ++++++++----------- 2 files changed, 34 insertions(+), 44 deletions(-) diff --git a/.betterer.results b/.betterer.results index ff3a9f2ab96..09d20205df6 100644 --- a/.betterer.results +++ b/.betterer.results @@ -5688,8 +5688,7 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] ], "public/app/features/provisioning/RecentJobs.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], diff --git a/public/app/features/provisioning/OnboardingPage.tsx b/public/app/features/provisioning/OnboardingPage.tsx index 2e086eacf0f..4f6bf6c88e7 100644 --- a/public/app/features/provisioning/OnboardingPage.tsx +++ b/public/app/features/provisioning/OnboardingPage.tsx @@ -10,55 +10,46 @@ import { NEW_URL, MIGRATE_URL } from './constants'; export default function OnboardingPage({ legacyStorage }: { legacyStorage?: boolean }) { const settingsQuery = useGetFrontendSettingsQuery(); const navigate = useNavigate(); + + const onClick = async () => { + if (legacyStorage) { + await settingsQuery.refetch(); + navigate(MIGRATE_URL); + } else { + navigate(NEW_URL); + } + }; + return ( - {legacyStorage ? ( - <> - - When you connect your whole instance, dashboards will be unavailable while running the migration. We - recommend warning your users before starting the process. - - } - button={ - - } - > - - Store and provision your Grafana resources externally by connecting to a repository. - We currently support GitHub and local storage. - - Learn more - - - - - ) : ( - - Create repository config - - } - /> + {legacyStorage && ( + + When you connect your whole instance, dashboards will be unavailable while running the migration. We + recommend warning your users before starting the process. + )} + } + button={ + + } + > + + Store and provision your Grafana resources externally by connecting to a repository. + We currently support GitHub and local storage. + + Learn more + + + );