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.

refactor(recovery): rename detail platform helpers

rcourtmanc68792fc2199
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index ebd897eb44..5b24008c8a 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -196,6 +196,10 @@ The same runtime vocabulary rule applies to cross-section recovery props too.
Live page-to-section boundaries should carry item-focused names like
`selectedHistoryItemLabel` instead of preserving `subject` labels after the
shared recovery presenters already expose canonical item terminology.
+That same rule applies to recovery detail helpers. Provider-specific helper
+names like `isPbsProvider` should become platform-specific helpers like
+`isPbsPlatform` once the runtime recovery model is already canonically
+platform-first.
That same presenter boundary should also own canonical item-type derivation.
Recovery surfaces must resolve rollup and point item types through one shared
item-type helper instead of repeating `display.itemType` / `subjectType` /
diff --git a/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx b/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx
index df703959b2..015b12bf24 100644
--- a/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryPointDetails.tsx
@@ -81,7 +81,7 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
const platformBadge = createMemo(() =>
getSourcePlatformBadge(platformKey() || getRecoveryPointPlatform(point())),
);
- const isPbsProvider = createMemo(() => platformKey() === 'proxmox-pbs');
+ const isPbsPlatform = createMemo(() => platformKey() === 'proxmox-pbs');
const pbsComment = createMemo(() => {
const value = point().details?.comment;
@@ -103,7 +103,7 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
const matchedDatastore = createMemo<{ datastore: PBSDatastore; instanceName: string } | null>(
() => {
- if (!isPbsProvider() || typeof window === 'undefined') return null;
+ if (!isPbsPlatform() || typeof window === 'undefined') return null;
const repositoryRef = point().repositoryRef;
const instanceName =
@@ -128,7 +128,7 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
const hasPlatformDetails = createMemo(
() =>
- isPbsProvider() &&
+ isPbsPlatform() &&
(pbsComment().length > 0 ||
pbsOwner().length > 0 ||
point().immutable === true ||
@@ -332,7 +332,7 @@ export const RecoveryPointDetails: Component<RecoveryPointDetailsProps> = (props
</div>
</Show>
- <Show when={isPbsProvider() && point().verified != null}>
+ <Show when={isPbsPlatform() && point().verified != null}>
<div class="rounded border border-border bg-surface px-3 py-2 text-xs">
<div class="text-[10px] font-semibold uppercase tracking-wide text-muted">
Verification
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 24a3d95536..2853b4c9d9 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -282,8 +282,8 @@ describe('Recovery', () => {
try {
render(() => <Recovery />);
- const subject = await screen.findByText('Archive VM');
- fireEvent.click(subject);
+ const item = await screen.findByText('Archive VM');
+ fireEvent.click(item);
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith('/recovery?rollupId=res%3Avm-404', {
@@ -376,8 +376,8 @@ describe('Recovery', () => {
it('keeps recovery history width aligned with canonical column specs', async () => {
render(() => <Recovery />);
- const subject = await screen.findByText('VM 123');
- fireEvent.click(subject);
+ const item = await screen.findByText('VM 123');
+ fireEvent.click(item);
await screen.findByText(/Showing 1 - 1 of 1 recovery points/i);
const tables = await screen.findAllByRole('table');
diff --git a/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.ts b/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.ts
index fd4c03b078..d64988b612 100644
--- a/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
import recoveryActivitySectionSource from '@/components/Recovery/RecoveryActivitySection.tsx?raw';
import recoveryPageSource from '@/components/Recovery/Recovery.tsx?raw';
+import recoveryPointDetailsSource from '@/components/Recovery/RecoveryPointDetails.tsx?raw';
import recoverySummaryPresentationSource from '@/utils/recoverySummaryPresentation.ts?raw';
import recoveryHistorySectionSource from '@/components/Recovery/RecoveryHistorySection.tsx?raw';
import recoveryProtectedInventorySectionSource from '@/components/Recovery/RecoveryProtectedInventorySection.tsx?raw';
@@ -31,4 +32,13 @@ describe('recovery canonical vocabulary', () => {
'selectedHistorySubjectLabel: Accessor<string | null>;',
);
});
+
+ it('keeps recovery detail platform helpers platform-first', () => {
+ expect(recoveryPointDetailsSource).toContain(
+ "const isPbsPlatform = createMemo(() => platformKey() === 'proxmox-pbs');",
+ );
+ expect(recoveryPointDetailsSource).not.toContain(
+ "const isPbsProvider = createMemo(() => platformKey() === 'proxmox-pbs');",
+ );
+ });
});