Same onboarding page regarless of migration (#101557)

This commit is contained in:
Roberto Jiménez Sánchez authored and GitHub committed 2025-03-04 16:34:54 +01:00
1 parent dc3152f5dc
commit 84126222c4
2 files changed
+34 -44

No files matched your search

+1 -2
View File
@@ -5688,8 +5688,7 @@ exports[`better eslint`] = {
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "3"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "5"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "6"]
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "5"]
],
"public/app/features/provisioning/RecentJobs.tsx:5381": [
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"],
@@ -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 (
<Page
navId="provisioning"
pageNav={{ text: 'Setup provisioning', subTitle: 'Configure this instance to use provisioning' }}
>
<Page.Contents>
{legacyStorage ? (
<>
<Alert severity="info" title="Setting up this connection could cause a temporary outage">
When you connect your whole instance, dashboards will be unavailable while running the migration. We
recommend warning your users before starting the process.
</Alert>
<EmptyState
variant="call-to-action"
message="Set up your provisioning connection!"
image={<SVG src="public/img/provisioning-empty.svg" width={300} />}
button={
<Button
size="lg"
icon="plus"
onClick={async () => {
await settingsQuery.refetch();
navigate(MIGRATE_URL);
}}
>
Connect Grafana to repository
</Button>
}
>
<Stack direction="column" alignItems="center">
<Text>Store and provision your Grafana resources externally by connecting to a repository.</Text>
<Text>We currently support GitHub and local storage.</Text>
<LinkButton fill="text" href="#" icon="external-link-alt">
Learn more
</LinkButton>
</Stack>
</EmptyState>
</>
) : (
<EmptyState
variant="call-to-action"
message="You haven't created any repository configs yet"
button={
<LinkButton icon="plus" href={NEW_URL} size="lg">
Create repository config
</LinkButton>
}
/>
{legacyStorage && (
<Alert severity="info" title="Setting up this connection could cause a temporary outage">
When you connect your whole instance, dashboards will be unavailable while running the migration. We
recommend warning your users before starting the process.
</Alert>
)}
<EmptyState
variant="call-to-action"
message="Set up your provisioning connection!"
image={<SVG src="public/img/provisioning-empty.svg" width={300} />}
button={
<Button size="lg" icon="plus" onClick={onClick}>
Connect Grafana to repository
</Button>
}
>
<Stack direction="column" alignItems="center">
<Text>Store and provision your Grafana resources externally by connecting to a repository.</Text>
<Text>We currently support GitHub and local storage.</Text>
<LinkButton fill="text" href="#" icon="external-link-alt">
Learn more
</LinkButton>
</Stack>
</EmptyState>
</Page.Contents>
</Page>
);