Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Keep configuration-transfer feedback in its active dialog

pulse-triage[bot]cebe1ae3566f
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 4ef6fe57fc..e8005ebfa9 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -10032,6 +10032,14 @@ Token entry saves a credential without submitting either transfer. The operator
must review the target and submit explicitly, including after a server refusal.
A failed/unknown import response is not proof that nothing applied: persistent
in-dialog guidance requires checking the destination before another attempt.
+Transfer errors and token-saved status belong to the active dialog, never a
+duplicate foreground toast on the inert notification portal. Token validation
+appears in the nested token prompt; closing it returns the retained import
+warning and explicit-resubmission status to the transfer dialog. Dialog content
+scrolls independently so feedback, fields and actions remain reachable on a
+short phone screen. An import completed for a workspace that is no longer
+selected keeps its original destination and no-reload outcome visible until
+the operator dismisses it, with the submitted credentials and file cleared.
Exports discard late data after a workspace change; successful imports identify
the original workspace and never reload a different one. Leaving Settings aborts
the client's wait and suppresses late downloads, notices and reload timers; it
diff --git a/frontend-modern/browser-verification/87e83edc0c8d35ab.json b/frontend-modern/browser-verification/87e83edc0c8d35ab.json
new file mode 100644
index 0000000000..7be37d4903
--- /dev/null
+++ b/frontend-modern/browser-verification/87e83edc0c8d35ab.json
@@ -0,0 +1,53 @@
+{
+ "version": 1,
+ "base_sha": "7cdf408449adb5fc4ecea4c1558c48d26545c78e",
+ "verified_at": "2026-10-25T11:29:52Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Settings/BackupTransferDialogs.tsx",
+ "frontend-modern/src/components/Settings/Settings.tsx",
+ "frontend-modern/src/components/Settings/SettingsDialogs.tsx",
+ "frontend-modern/src/components/Settings/useBackupTransferFlow.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Settings/BackupTransferDialogs.tsx": "026ce6da0d1804f8f475c1fe028536b6c237cca4308b30997c37e7b1d3da405c",
+ "frontend-modern/src/components/Settings/Settings.tsx": "b9cf1e667ef41ae707d3b9ac2365164a31bcb7ede604a9776947f8d182c359d9",
+ "frontend-modern/src/components/Settings/SettingsDialogs.tsx": "49625353f0cec1102a3bbc6cb2cc544ac6a972d48f9363b58c539cf0ec4dba70",
+ "frontend-modern/src/components/Settings/useBackupTransferFlow.ts": "67820073de2e275bf0097beadbd4fcc72d0b8f22dc3e3dd026dcbf860f4d23b6"
+ },
+ "routes": [
+ "/settings/system/recovery (offline consuming fixture: production RecoverySettingsPanel, transfer flow, SettingsDialogs, BackupTransferDialogs, API client, Dialog, Toast and CSS; not full-app authentication)"
+ ],
+ "states": [
+ "Transfer failures remain in one persistent active-dialog alert without a foreground transfer toast. Exact current server 409/503 messages and uncertain-import guidance are retained.",
+ "Nested token validation is inline and cleared on successful token entry. The original uncertain warning survives beside a persistent token-saved status, without automatic resubmission.",
+ "Phone dialog content scrolls to fields, warnings and actions; desktop light and 320px dark captures reviewed natively.",
+ "A synthetic import response after workspace selection changes retains the original destination and no-reload outcome in the open dialog, clearing submitted inputs."
+ ],
+ "interactions": [
+ "129 checks: explicit repeated refusals, pending/dismissal lock, keyboard and touch actions, Cancel/reopen focus and secret cleanup, token prompt/validation/save, dropped response, scope switch, and deliberate export download.",
+ "22 synthetic HTTP arrivals; dropped-response control records one application fetch and two HTTP arrivals per viewport, without claiming transport-level at-most-once behaviour. No page runtime errors.",
+ "All ten final captures and two adverse current-base captures opened with native view_image. Playwright 1.56.1 / Chromium 141.0.7390.37."
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 1000,
+ "browser": "Chromium",
+ "browser_version": "141.0.7390.37",
+ "theme": "light"
+ },
+ {
+ "width": 320,
+ "height": 760,
+ "browser": "Chromium",
+ "browser_version": "141.0.7390.37",
+ "touch": true,
+ "theme": "dark"
+ }
+ ],
+ "evidence": "Lane RECEIPTS.md, BROWSER-BINDING.json, PIXEL-REVIEW.md, browser/final-result.json and browser captures; fixture and drivers retained as evidence only.",
+ "limitations": [
+ "Synthetic HTTP reuses exact current handler refusal bodies; no handler execution, authentication/cryptography/import application, native recovery or full-app shell acceptance. No Back/reload operation requested."
+ ]
+}
diff --git a/frontend-modern/src/components/Settings/BackupTransferDialogs.tsx b/frontend-modern/src/components/Settings/BackupTransferDialogs.tsx
index 69493b2a34..c162d7c2d0 100644
--- a/frontend-modern/src/components/Settings/BackupTransferDialogs.tsx
+++ b/frontend-modern/src/components/Settings/BackupTransferDialogs.tsx
@@ -24,7 +24,9 @@ interface BackupTransferDialogsProps {
transferOrgID: Accessor<string>;
isTransferring: Accessor<boolean>;
transferError: Accessor<string>;
+ transferNotice: Accessor<string>;
apiTokenInput: Accessor<string>;
+ apiTokenError: Accessor<string>;
setApiTokenInput: (value: string) => void;
handleExport: () => void;
handleImport: () => void;
@@ -44,16 +46,21 @@ export const BackupTransferDialogs: Component<BackupTransferDialogsProps> = (pro
panelClass="max-w-md"
ariaLabel="Export configuration"
>
- <Card padding="lg" class="max-w-md w-full">
+ <Card padding="lg" class="max-w-md w-full min-h-0 overflow-y-auto">
<SectionHeader title="Export configuration" size="md" class="mb-4" />
<p class="mb-4 text-sm text-muted break-all">
Workspace ID: <strong class="text-base-content">{props.transferOrgID()}</strong>
</p>
- <Show when={props.transferError()}>
+ <Show when={props.transferError() && !props.showApiTokenModal()}>
<p role="alert" class="mb-4 text-sm text-red-700 dark:text-red-300">
{props.transferError()}
</p>
</Show>
+ <Show when={props.transferNotice() && !props.showApiTokenModal()}>
+ <p role="status" class="mb-4 text-sm text-muted">
+ {props.transferNotice()}
+ </p>
+ </Show>
<Show when={props.isTransferring()}>
<p role="status" class="mb-4 text-sm text-muted">
Exporting configuration. Keep this dialog open while Pulse waits for a response.
@@ -214,8 +221,13 @@ export const BackupTransferDialogs: Component<BackupTransferDialogsProps> = (pro
panelClass="max-w-md"
ariaLabel="API token required"
>
- <Card padding="lg" class="max-w-md w-full">
+ <Card padding="lg" class="max-w-md w-full min-h-0 overflow-y-auto">
<SectionHeader title="API token required" size="md" class="mb-4" />
+ <Show when={props.apiTokenError() || props.transferError()}>
+ <p role="alert" class="mb-4 text-sm text-red-700 dark:text-red-300">
+ {props.apiTokenError() || props.transferError()}
+ </p>
+ </Show>
<div class="space-y-4">
<p class="text-sm text-muted">
@@ -274,16 +286,21 @@ export const BackupTransferDialogs: Component<BackupTransferDialogsProps> = (pro
panelClass="max-w-md"
ariaLabel="Import configuration"
>
- <Card padding="lg" class="max-w-md w-full">
+ <Card padding="lg" class="max-w-md w-full min-h-0 overflow-y-auto">
<SectionHeader title="Import configuration" size="md" class="mb-4" />
<p class="mb-4 text-sm text-muted break-all">
Workspace ID: <strong class="text-base-content">{props.transferOrgID()}</strong>
</p>
- <Show when={props.transferError()}>
+ <Show when={props.transferError() && !props.showApiTokenModal()}>
<p role="alert" class="mb-4 text-sm text-red-700 dark:text-red-300">
{props.transferError()}
</p>
</Show>
+ <Show when={props.transferNotice() && !props.showApiTokenModal()}>
+ <p role="status" class="mb-4 text-sm text-muted">
+ {props.transferNotice()}
+ </p>
+ </Show>
<Show when={props.isTransferring()}>
<p role="status" class="mb-4 text-sm text-muted">
Importing configuration. Keep this dialog open while Pulse waits for a response.
diff --git a/frontend-modern/src/components/Settings/Settings.tsx b/frontend-modern/src/components/Settings/Settings.tsx
index ba1441e293..2425bb4405 100644
--- a/frontend-modern/src/components/Settings/Settings.tsx
+++ b/frontend-modern/src/components/Settings/Settings.tsx
@@ -231,7 +231,9 @@ const SettingsWorkspace: Component<SettingsProps> = (props) => {
transferOrgID={backupTransferFlow.transferOrgID}
isTransferring={backupTransferFlow.isTransferring}
transferError={backupTransferFlow.transferError}
+ transferNotice={backupTransferFlow.transferNotice}
apiTokenInput={backupTransferFlow.apiTokenInput}
+ apiTokenError={backupTransferFlow.apiTokenError}
setApiTokenInput={backupTransferFlow.setApiTokenInput}
handleExport={backupTransferFlow.handleExport}
handleImport={backupTransferFlow.handleImport}
diff --git a/frontend-modern/src/components/Settings/SettingsDialogs.tsx b/frontend-modern/src/components/Settings/SettingsDialogs.tsx
index f22735d18c..71c6b97dab 100644
--- a/frontend-modern/src/components/Settings/SettingsDialogs.tsx
+++ b/frontend-modern/src/components/Settings/SettingsDialogs.tsx
@@ -28,7 +28,9 @@ interface SettingsDialogsProps {
transferOrgID: Accessor<string>;
isTransferring: Accessor<boolean>;
transferError: Accessor<string>;
+ transferNotice: Accessor<string>;
apiTokenInput: Accessor<string>;
+ apiTokenError: Accessor<string>;
setApiTokenInput: (value: string) => void;
handleExport: () => void;
handleImport: () => void;
@@ -78,7 +80,9 @@ export const SettingsDialogs: Component<SettingsDialogsProps> = (props) => {
transferOrgID={props.transferOrgID}
isTransferring={props.isTransferring}
transferError={props.transferError}
+ transferNotice={props.transferNotice}
apiTokenInput={props.apiTokenInput}
+ apiTokenError={props.apiTokenError}
setApiTokenInput={props.setApiTokenInput}
handleExport={props.handleExport}
handleImport={props.handleImport}
diff --git a/frontend-modern/src/components/Settings/__tests__/BackupTransferDialogs.test.tsx b/frontend-modern/src/components/Settings/__tests__/BackupTransferDialogs.test.tsx
index 5db7a1163b..05b17e310f 100644
--- a/frontend-modern/src/components/Settings/__tests__/BackupTransferDialogs.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/BackupTransferDialogs.test.tsx
@@ -1,6 +1,10 @@
-import { cleanup, render, screen } from '@solidjs/testing-library';
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { BackupTransferDialogs } from '../BackupTransferDialogs';
+import { useBackupTransferFlow } from '../useBackupTransferFlow';
+import { ToastContainer } from '@/components/Toast/Toast';
+import { clearApiToken, setOrgID } from '@/utils/apiClient';
+import type { SecurityStatus } from '@/types/config';
function renderTransfer(
kind: 'export' | 'import',
@@ -25,7 +29,9 @@ function renderTransfer(
transferOrgID={() => 'tenant-fixture'}
isTransferring={() => pending}
transferError={() => error}
+ transferNotice={() => ''}
apiTokenInput={() => ''}
+ apiTokenError={() => ''}
setApiTokenInput={vi.fn()}
handleExport={vi.fn()}
handleImport={vi.fn()}
@@ -38,7 +44,12 @@ function renderTransfer(
}
describe('BackupTransferDialogs', () => {
- afterEach(cleanup);
+ afterEach(() => {
+ cleanup();
+ vi.unstubAllGlobals();
+ clearApiToken();
+ setOrgID(null);
+ });
it('discloses the actual archive scope before exporting', () => {
renderTransfer('export');
@@ -102,4 +113,134 @@ describe('BackupTransferDialogs', () => {
expect(text).toContain('Saving it does not repeat the transfer.');
expect(text).toContain('Review the workspace and submit again yourself.');
});
+
+ function renderFlow(kind: 'export' | 'import' = 'import', tokenOnly = false) {
+ const securityStatus = () =>
+ ({ hasAuthentication: !tokenOnly, apiTokenConfigured: tokenOnly }) as SecurityStatus;
+ let flow!: ReturnType<typeof useBackupTransferFlow>;
+ setOrgID('tenant-fixture');
+ document.cookie = 'pulse_csrf=synthetic-csrf; Path=/';
+ render(() => {
+ flow = useBackupTransferFlow({ securityStatus });
+ return (
+ <>
+ <button
+ onClick={() =>
+ kind === 'import' ? flow.setShowImportDialog(true) : flow.setShowExportDialog(true)
+ }
+ >
+ Open transfer
+ </button>
+ <BackupTransferDialogs {...flow} securityStatus={securityStatus} />
+ <ToastContainer />
+ </>
+ );
+ });
+ fireEvent.click(screen.getByRole('button', { name: 'Open transfer' }));
+ if (kind === 'import') {
+ flow.setImportPassphrase('synthetic-passphrase');
+ flow.setImportFile({ text: async () => '{"data":"synthetic-archive"}' } as File);
+ } else flow.setExportPassphrase('synthetic-passphrase');
+ return flow;
+ }
+
+ it.each(['export', 'import'] as const)(
+ 'keeps repeated %s failures in one persistent dialog alert without toast stacking',
+ async (kind) => {
+ const refusal =
+ 'A configuration import is still running for this workspace. This request has not been applied; wait for it to finish and check the configuration before retrying.';
+ const fetchMock = vi
+ .fn()
+ .mockImplementation(async () => new Response(refusal, { status: 409 }));
+ vi.stubGlobal('fetch', fetchMock);
+ const flow = renderFlow(kind);
+ const dialog = screen.getByRole('dialog');
+ for (let attempt = 1; attempt <= 2; attempt++) {
+ fireEvent.click(
+ within(dialog).getByRole('button', {
+ name: kind === 'import' ? 'Import' : 'Export',
+ exact: true,
+ }),
+ );
+ await waitFor(() => expect(flow.isTransferring()).toBe(false));
+ expect(fetchMock).toHaveBeenCalledTimes(attempt);
+ expect(within(dialog).getAllByRole('alert')).toHaveLength(1);
+ expect(within(dialog).getByRole('alert')).toHaveTextContent(refusal);
+ expect(
+ screen.queryByRole('button', { name: 'Dismiss notification', hidden: true }),
+ ).not.toBeInTheDocument();
+ expect(
+ screen.getByRole('region', { name: 'Notifications', hidden: true }),
+ ).toBeEmptyDOMElement();
+ }
+ if (kind === 'import') {
+ expect(within(dialog).getByRole('alert')).toHaveTextContent('Import was not confirmed');
+ expect(flow.importPassphrase()).toBe('synthetic-passphrase');
+ expect(flow.importFile()).not.toBeNull();
+ }
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Cancel' }));
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ expect(flow.importPassphrase()).toBe('');
+ expect(flow.exportPassphrase()).toBe('');
+ fireEvent.click(screen.getByRole('button', { name: 'Open transfer' }));
+ expect(screen.queryByRole('alert')).not.toBeInTheDocument();
+ expect(fetchMock).toHaveBeenCalledTimes(2);
+ },
+ );
+
+ it('keeps token validation and saved status in the active dialog without replaying import', async () => {
+ const fetchMock = vi.fn().mockResolvedValue(new Response('{}'));
+ vi.stubGlobal('fetch', fetchMock);
+ const flow = renderFlow('import', true);
+ fireEvent.click(screen.getByRole('button', { name: 'Import', exact: true }));
+ const prompt = await screen.findByRole('dialog', { name: 'API token required' });
+ fireEvent.input(within(prompt).getByLabelText('API Token'), { target: { value: ' ' } });
+ fireEvent.click(within(prompt).getByRole('button', { name: 'Authenticate' }));
+ expect(within(prompt).getByRole('alert')).toHaveTextContent('Please enter the API token');
+ expect(document.querySelectorAll('[role=alert]')).toHaveLength(1);
+ fireEvent.input(within(prompt).getByLabelText('API Token'), {
+ target: { value: 'synthetic-token' },
+ });
+ fireEvent.click(within(prompt).getByRole('button', { name: 'Authenticate' }));
+ const dialog = screen.getByRole('dialog', { name: 'Import configuration' });
+ expect(within(dialog).getByRole('status')).toHaveTextContent(
+ 'API token saved. Review the workspace',
+ );
+ expect(within(dialog).queryByRole('alert')).not.toBeInTheDocument();
+ expect(flow.apiTokenInput()).toBe('');
+ expect(fetchMock).not.toHaveBeenCalled();
+ expect(
+ screen.getByRole('region', { name: 'Notifications', hidden: true }),
+ ).toBeEmptyDOMElement();
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Cancel' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Open transfer' }));
+ expect(screen.queryByRole('status')).not.toBeInTheDocument();
+ });
+
+ it('returns the uncertain-import warning from a refused token prompt to the original dialog', async () => {
+ const fetchMock = vi
+ .fn()
+ .mockImplementation(
+ async () => new Response(JSON.stringify({ error: 'API token required' }), { status: 403 }),
+ );
+ vi.stubGlobal('fetch', fetchMock);
+ renderFlow();
+ fireEvent.click(screen.getByRole('button', { name: 'Import', exact: true }));
+ const prompt = await screen.findByRole('dialog', { name: 'API token required' });
+ expect(within(prompt).getByRole('alert')).toHaveTextContent('Import was not confirmed');
+ expect(document.querySelectorAll('[role=alert]')).toHaveLength(1);
+ fireEvent.input(within(prompt).getByLabelText('API Token'), {
+ target: { value: 'synthetic-token' },
+ });
+ fireEvent.click(within(prompt).getByRole('button', { name: 'Authenticate' }));
+ const dialog = screen.getByRole('dialog', { name: 'Import configuration' });
+ expect(within(dialog).getByRole('alert')).toHaveTextContent(
+ 'Check the destination before trying again',
+ );
+ expect(within(dialog).getByRole('status')).toHaveTextContent('submit the transfer again');
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ expect(
+ screen.getByRole('region', { name: 'Notifications', hidden: true }),
+ ).toBeEmptyDOMElement();
+ });
});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 3caa62e96f..de3f2682b9 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -116,8 +116,14 @@ const settingsRuntimeSources = import.meta.glob(['../*.tsx', '../ConnectionEdito
}) as Record<string, string>;
describe('settings architecture guardrails', () => {
- it('carries transfer target, pending and error state through the Settings dialog shell', () => {
- for (const name of ['transferOrgID', 'isTransferring', 'transferError']) {
+ it('carries transfer target, pending and dialog-owned feedback through the Settings shell', () => {
+ for (const name of [
+ 'transferOrgID',
+ 'isTransferring',
+ 'transferError',
+ 'transferNotice',
+ 'apiTokenError',
+ ]) {
expect(settingsSource).toContain(`${name}={backupTransferFlow.${name}}`);
expect(settingsDialogsSource).toContain(`${name}={props.${name}}`);
}
diff --git a/frontend-modern/src/components/Settings/__tests__/useBackupTransferFlow.test.ts b/frontend-modern/src/components/Settings/__tests__/useBackupTransferFlow.test.ts
index 40a2f6b1f1..b9636eb94c 100644
--- a/frontend-modern/src/components/Settings/__tests__/useBackupTransferFlow.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/useBackupTransferFlow.test.ts
@@ -94,9 +94,8 @@ describe('configuration transfers keep their confirmed workspace and one dispatc
await (kind === 'import' ? flow.handleImport() : flow.handleExport());
expect(fetchMock).not.toHaveBeenCalled();
expect(flow.transferOrgID()).toBe('tenant-a');
- expect(notificationStore.error).toHaveBeenCalledWith(
- expect.stringContaining('Organisation changed'),
- );
+ expect(flow.transferError()).toContain('Organisation changed');
+ expect(notificationStore.error).not.toHaveBeenCalled();
},
);
@@ -232,6 +231,8 @@ describe('configuration transfers keep their confirmed workspace and one dispatc
expect(reloadTimers()).toHaveLength(0);
expect(flow.importPassphrase()).toBe('');
expect(flow.importFile()).toBeNull();
+ expect(flow.showImportDialog()).toBe(true);
+ expect(notificationStore.error).not.toHaveBeenCalled();
});
it.each(['export', 'import'] as const)(
diff --git a/frontend-modern/src/components/Settings/useBackupTransferFlow.ts b/frontend-modern/src/components/Settings/useBackupTransferFlow.ts
index 6c088e44a8..5ca53a0d03 100644
--- a/frontend-modern/src/components/Settings/useBackupTransferFlow.ts
+++ b/frontend-modern/src/components/Settings/useBackupTransferFlow.ts
@@ -24,9 +24,11 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
const [showImportDialog, showImport] = createSignal(false);
const [showApiTokenModal, setShowApiTokenModal] = createSignal(false);
const [apiTokenInput, setApiTokenInput] = createSignal('');
+ const [apiTokenError, setApiTokenError] = createSignal('');
const [transferOrgID, setTransferOrgID] = createSignal('default');
const [isTransferring, setIsTransferring] = createSignal(false);
const [transferError, setTransferError] = createSignal('');
+ const [transferNotice, setTransferNotice] = createSignal('');
let active = true;
let controller: AbortController | undefined;
let reloadTimer: ReturnType<typeof setTimeout> | undefined;
@@ -39,8 +41,8 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
const currentOrgID = () => getOrgID() || 'default';
const fail = (message: string) => {
+ setTransferNotice('');
setTransferError(message);
- notificationStore.error(message);
};
const checkWorkspace = () => {
if (currentOrgID() === transferOrgID()) return true;
@@ -51,6 +53,7 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
const closeApiTokenModal = () => {
setShowApiTokenModal(false);
setApiTokenInput('');
+ setApiTokenError('');
};
const closeExportDialog = () => {
if (isTransferring()) return;
@@ -72,6 +75,7 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
closeExportDialog();
closeImportDialog();
setTransferError('');
+ setTransferNotice('');
setTransferOrgID(currentOrgID());
if (kind === 'export') showExport(true);
else showImport(true);
@@ -96,6 +100,7 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
const handleExport = async () => {
if (!active || !showExportDialog() || isTransferring() || !checkWorkspace()) return;
setTransferError('');
+ setTransferNotice('');
const passphrase = exportPassphrase();
if (!passphrase) {
fail(
@@ -154,6 +159,7 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
const handleImport = async () => {
if (!active || !showImportDialog() || isTransferring() || !checkWorkspace()) return;
setTransferError('');
+ setTransferNotice('');
const passphrase = importPassphrase();
const file = importFile();
if (!passphrase) {
@@ -207,7 +213,7 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
fail(
`Import completed for workspace ${orgID}. The selected workspace changed. No reload was performed.`,
);
- showImport(false);
+ // Keep the original destination and outcome readable in the dialog.
setImportPassphrase('');
setImportFile(null);
return;
@@ -241,17 +247,17 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
return;
}
if (!apiTokenInput().trim()) {
- fail('Please enter the API token');
+ setApiTokenError('Please enter the API token');
return;
}
setApiClientToken(apiTokenInput());
if (!getApiClientToken()) {
- fail('Please enter a valid API token');
+ setApiTokenError('Please enter a valid API token');
return;
}
closeApiTokenModal();
// Saving a credential is not consent to replay a possibly applied import.
- notificationStore.info('API token saved. Review the workspace and submit the transfer again.');
+ setTransferNotice('API token saved. Review the workspace and submit the transfer again.');
};
return {
@@ -269,10 +275,12 @@ export function useBackupTransferFlow({ securityStatus }: UseBackupTransferFlowP
setShowImportDialog,
showApiTokenModal,
apiTokenInput,
+ apiTokenError,
setApiTokenInput,
transferOrgID,
isTransferring,
transferError,
+ transferNotice,
handleExport,
handleImport,
closeExportDialog,