fix: address onboarding review findings
This commit is contained in:
1 parent
9b7f189b02
commit
741e641bd2
6 files changed
+77
-22
No files matched your search
@@ -2,7 +2,11 @@
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { waitForServerReadinessAsync } from "./database-restore-flow";
|
||||
import { getStepAfterRestorePreview, waitForServerReadinessAsync } from "./database-restore-flow";
|
||||
|
||||
it("requires confirmation after every restore preview", () => {
|
||||
expect(getStepAfterRestorePreview()).toBe("confirm");
|
||||
});
|
||||
|
||||
describe("waitForServerReadinessAsync", () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -29,6 +29,8 @@ const RESTART_REQUEST_TIMEOUT_MS = 5_000;
|
||||
|
||||
export type ServerReadinessResult = "ready" | "timedOut" | "aborted";
|
||||
|
||||
export const getStepAfterRestorePreview = (): RestoreStep => "confirm";
|
||||
|
||||
interface WaitForServerReadinessOptions {
|
||||
restartAfterMs: number;
|
||||
signal: AbortSignal;
|
||||
@@ -289,11 +291,8 @@ export const DatabaseRestoreFlow = ({ variant = "card", onRestoreComplete }: Dat
|
||||
<>
|
||||
<BackupPreviewPanel analysis={analysis} />
|
||||
<Group justify="flex-end">
|
||||
<Button
|
||||
rightSection={<IconArrowRight size={16} />}
|
||||
onClick={() => (variant === "standalone" ? void handleConfirm() : setStep("confirm"))}
|
||||
>
|
||||
{variant === "standalone" ? t("confirm.submit") : t("continueToRestore")}
|
||||
<Button rightSection={<IconArrowRight size={16} />} onClick={() => setStep(getStepAfterRestorePreview())}>
|
||||
{t("continueToRestore")}
|
||||
</Button>
|
||||
</Group>
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user