refactor(frontend): remove addToast bridge — migrate all call sites to notifications API
BREAKING: addToast() removed. Use notify() or notifications facade instead.
- Replace addToast(msg, type, duration?) → notify({ message, type, duration? })
- Introduce notifications.success/info/warning/error/show() semantic facade
- Add dismissAllToasts(), timer management (clearTimeout on remove)
- Unify Toast component: single viewport, a11y (role/aria-live by type)
- Migrate 16 models, 2 stores, 38 components, 23 pages (76 files total)
- 147 test files / 3152 tests pass with updated mocks and assertions
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { t } from '$lib/i18n/index.svelte.js';
|
||||
import { Button, HelpTooltip, Icon } from '$lib/ui';
|
||||
import { addToast } from '$lib/toasts.svelte.js';
|
||||
import { notifications } from '$lib/toasts.svelte.js';
|
||||
import { resolveDefaultConfig } from '../../../services/git-utils.js';
|
||||
import { GitManagerModel } from '$lib/models/GitManagerModel.svelte.ts';
|
||||
import { ROUTES } from '$lib/routes';
|
||||
@@ -255,13 +255,13 @@
|
||||
model.selectVersion(dev.hash, true);
|
||||
const result = await model.getSelectedVersionsDiff();
|
||||
if (result?.diff) {
|
||||
model.workspaceDiff = result.diff;
|
||||
model.workspaceDiff = res.diff;
|
||||
model.activeTab = 'workspace';
|
||||
addToast($t.git?.viz_diff_ready || 'Dashboard changes loaded for comparison', 'success');
|
||||
notifications.success($t.git?.viz_diff_ready || 'Dashboard changes loaded for comparison');
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
{#if model.hasWorkspaceChanges}
|
||||
<section class="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-warning/30 bg-warning-light px-4 py-3" aria-label={$t.git?.workspace_pending_title || 'Несохранённые изменения'}>
|
||||
<div>
|
||||
@@ -327,7 +327,7 @@
|
||||
if (res?.diff) {
|
||||
model.workspaceDiff = res.diff;
|
||||
model.activeTab = 'workspace';
|
||||
addToast($t.git?.viz_diff_ready || 'Dashboard changes loaded for comparison', 'success');
|
||||
notifications.success($t.git?.viz_diff_ready || 'Dashboard changes loaded for comparison');
|
||||
}
|
||||
}}
|
||||
onDeployVersion={(hash) => model.openDeployModal('PREPROD', hash)}
|
||||
|
||||
Reference in New Issue
Block a user