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.

Canonicalize recovery filter default labels

rcourtman2c3f995b0555
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index a87c27603b..bdbcae922f 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -499,7 +499,8 @@ querying, and the operator-facing storage health presentation layer.
9. Letting whitespace-padded recovery timeline params fall off canonical route state; shared recovery URLs must trim and normalize `day`, `range`, `scope`, `status`, `verification`, `cluster`, `node`, `namespace`, `itemType`, and adjacent history filters before the page model validates them so pasted or hand-edited links resolve to the same canonical timeline and filter state as UI-authored routes
10. Letting explicit recovery `all` sentinels survive in canonical route state; shared recovery URLs must collapse case- or whitespace-variant `all` values for `cluster`, `node`, `namespace`, and `itemType` back to the canonical unset route state so copied links do not preserve fake active filters
11. Letting non-canonical recovery platform values survive in route or transport state; shared recovery URLs must collapse unsupported or fake `platform` values back to the canonical unset state, and only owned source-platform options or canonical legacy aliases may reach rollups, points, series, and facets transport filters
- 11c. Letting route-owned recovery platform selections disappear while filter options are still hydrating; the recovery page state owner must keep the current canonical `platform` query value present in the platform option set until transport-backed facets and records arrive so shared filter selects keep the user-visible TrueNAS or other owned platform selection instead of flashing back to `All Platforms`
+ 11c. Letting route-owned recovery platform selections disappear while filter options are still hydrating; the recovery page state owner must keep the current canonical `platform` query value present in the platform option set until transport-backed facets and records arrive so shared filter selects keep the user-visible TrueNAS or other owned platform selection instead of flashing back to `All platforms`
+ 11d. Letting recovery filter default labels drift between protected inventory and recovery events; both recovery filter surfaces must consume the shared `recoveryTablePresentation` labels (`All item types`, `All platforms`, and `Any item`) instead of hard-coding title-case local variants.
11a. Letting adjacent workload-route changes in shared `frontend-modern/src/routing/resourceLinks.ts` perturb recovery parse/build semantics; expanding canonical `/workloads` platform scoping must not alter the owned `/recovery` `platform` and `itemType` vocabulary, legacy alias rewrites, or recovery drill-down workspace selection
11b. Letting adjacent storage-link additions in shared `frontend-modern/src/routing/resourceLinks.ts` perturb recovery route semantics; expanding canonical `/storage` deep links for unified resources must not reuse recovery-owned query names or alter the owned `/recovery` parse/build contract while those surfaces continue sharing the same route-helper module
12. Letting protected-inventory protection posture overload recovery-event outcome filtering; the protected inventory protection-state control must drive the route-backed `state` field and local rollup posture filtering, while the recovery events `status` field remains the canonical outcome filter for points, series, and facets transport filters
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistoryItemFilter.tsx b/frontend-modern/src/components/Recovery/RecoveryHistoryItemFilter.tsx
index fff265fd0f..a0df73ded3 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistoryItemFilter.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistoryItemFilter.tsx
@@ -10,6 +10,7 @@ import {
filterPanelTitleClass,
filterSelectClass,
} from '@/components/shared/FilterToolbar';
+import { getRecoveryAnyItemLabel } from '@/utils/recoveryTablePresentation';
export interface RecoveryHistoryItemFilterOption {
rollupId: string;
@@ -109,7 +110,7 @@ export const RecoveryHistoryItemFilter: Component<RecoveryHistoryItemFilterProps
setIsOpen(true);
}}
>
- <span class="truncate">{props.selectedLabel() || 'Any Item'}</span>
+ <span class="truncate">{props.selectedLabel() || getRecoveryAnyItemLabel()}</span>
<ChevronDownIcon
class={`ml-auto h-3.5 w-3.5 shrink-0 transition-transform ${isOpen() ? 'rotate-180' : ''}`}
/>
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
index 476bf91e7c..cbcadc3745 100644
--- a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx
@@ -37,6 +37,8 @@ import {
import { normalizeRecoveryModeQueryValue } from '@/utils/recoveryRecordPresentation';
import {
getRecoveryArtifactColumnLabel,
+ getRecoveryAllItemTypesLabel,
+ getRecoveryAllPlatformsLabel,
getRecoveryHistorySearchPlaceholder,
getRecoverySearchHistoryEmptyMessage,
RECOVERY_ADVANCED_FILTER_FIELD_CLASS,
@@ -419,7 +421,7 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p
{(itemType) => (
<option value={itemType}>
{itemType === 'all'
- ? 'All Item Types'
+ ? getRecoveryAllItemTypesLabel()
: getRecoveryItemTypePresentation(itemType)?.label || itemType}
</option>
)}
@@ -441,7 +443,9 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p
<For each={props.platformOptions()}>
{(platform) => (
<option value={platform}>
- {platform === 'all' ? 'All Platforms' : getSourcePlatformLabel(platform)}
+ {platform === 'all'
+ ? getRecoveryAllPlatformsLabel()
+ : getSourcePlatformLabel(platform)}
</option>
)}
</For>
diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
index d329b04fb2..82e1090ddf 100644
--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx
@@ -46,6 +46,8 @@ import {
getRecoveryProtectedSearchPlaceholder,
getRecoverySearchHistoryEmptyMessage,
getRecoveryRollupTimestampMs,
+ getRecoveryAllItemTypesLabel,
+ getRecoveryAllPlatformsLabel,
STALE_ISSUE_THRESHOLD_MS,
type RecoveryRollupInventoryStatus,
} from '@/utils/recoveryTablePresentation';
@@ -306,7 +308,7 @@ export const RecoveryProtectedInventorySection: Component<
{(itemType) => (
<option value={itemType}>
{itemType === 'all'
- ? 'All Item Types'
+ ? getRecoveryAllItemTypesLabel()
: getRecoveryItemTypePresentation(itemType)?.label || itemType}
</option>
)}
@@ -328,7 +330,9 @@ export const RecoveryProtectedInventorySection: Component<
<For each={props.platformOptions()}>
{(platform) => (
<option value={platform}>
- {platform === 'all' ? 'All Platforms' : getSourcePlatformLabel(platform)}
+ {platform === 'all'
+ ? getRecoveryAllPlatformsLabel()
+ : getSourcePlatformLabel(platform)}
</option>
)}
</For>
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 041b004048..9c273a64ab 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -1054,7 +1054,7 @@ describe('Recovery', () => {
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(screen.getByTestId('recovery-history-item-filter-trigger')).toHaveTextContent(
- 'Any Item',
+ 'Any item',
);
expect(screen.queryByRole('button', { name: 'Reset all' })).not.toBeInTheDocument();
});
@@ -1074,7 +1074,7 @@ describe('Recovery', () => {
const controls = await screen.findByRole('group', { name: /recovery events controls/i });
const itemFilterTrigger = within(controls).getByTestId('recovery-history-item-filter-trigger');
- expect(itemFilterTrigger).toHaveTextContent('Any Item');
+ expect(itemFilterTrigger).toHaveTextContent('Any item');
fireEvent.click(itemFilterTrigger);
expect(await screen.findByTestId('recovery-history-item-filter-panel')).toBeInTheDocument();
@@ -1101,7 +1101,7 @@ describe('Recovery', () => {
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(screen.getByTestId('recovery-history-item-filter-trigger')).toHaveTextContent(
- 'Any Item',
+ 'Any item',
);
});
});
diff --git a/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts b/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts
index 4da0ecf46a..ad25c4a741 100644
--- a/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryTablePresentation.test.ts
@@ -5,6 +5,9 @@ import {
getRecoveryArtifactColumnHeaderClass,
getRecoveryArtifactRowClass,
getRecoveryArtifactTableMinWidth,
+ getRecoveryAllItemTypesLabel,
+ getRecoveryAllPlatformsLabel,
+ getRecoveryAnyItemLabel,
getRecoveryEventTimeTextClass,
getRecoveryGroupNoTimestampLabel,
getRecoveryHistorySearchPlaceholder,
@@ -18,6 +21,9 @@ import {
isRecoveryRollupStale,
RECOVERY_ADVANCED_FILTER_FIELD_CLASS,
RECOVERY_ADVANCED_FILTER_LABEL_CLASS,
+ RECOVERY_ALL_ITEM_TYPES_LABEL,
+ RECOVERY_ALL_PLATFORMS_LABEL,
+ RECOVERY_ANY_ITEM_LABEL,
RECOVERY_ARTIFACT_COLUMN_LABELS,
RECOVERY_GROUP_HEADER_ROW_CLASS,
RECOVERY_GROUP_HEADER_TEXT_CLASS,
@@ -37,10 +43,16 @@ describe('recoveryTablePresentation', () => {
expect(RECOVERY_PROTECTED_SEARCH_PLACEHOLDER).toBe('Search protected items...');
expect(RECOVERY_HISTORY_SEARCH_PLACEHOLDER).toBe('Search recovery history...');
expect(RECOVERY_SEARCH_HISTORY_EMPTY_MESSAGE).toBe('Recent searches appear here.');
+ expect(RECOVERY_ALL_ITEM_TYPES_LABEL).toBe('All item types');
+ expect(RECOVERY_ALL_PLATFORMS_LABEL).toBe('All platforms');
+ expect(RECOVERY_ANY_ITEM_LABEL).toBe('Any item');
expect(getRecoveryGroupNoTimestampLabel()).toBe('No Timestamp');
expect(getRecoveryProtectedSearchPlaceholder()).toBe('Search protected items...');
expect(getRecoveryHistorySearchPlaceholder()).toBe('Search recovery history...');
expect(getRecoverySearchHistoryEmptyMessage()).toBe('Recent searches appear here.');
+ expect(getRecoveryAllItemTypesLabel()).toBe('All item types');
+ expect(getRecoveryAllPlatformsLabel()).toBe('All platforms');
+ expect(getRecoveryAnyItemLabel()).toBe('Any item');
expect(RECOVERY_ARTIFACT_COLUMN_LABELS.type).toBe('Item Type');
expect(RECOVERY_ARTIFACT_COLUMN_LABELS.item).toBe('Item');
expect(RECOVERY_ARTIFACT_COLUMN_LABELS.platform).toBe('Platform');
diff --git a/frontend-modern/src/utils/recoveryTablePresentation.ts b/frontend-modern/src/utils/recoveryTablePresentation.ts
index aba1741e00..b44e7ac094 100644
--- a/frontend-modern/src/utils/recoveryTablePresentation.ts
+++ b/frontend-modern/src/utils/recoveryTablePresentation.ts
@@ -27,6 +27,9 @@ export const RECOVERY_GROUP_NO_TIMESTAMP_LABEL = 'No Timestamp';
export const RECOVERY_PROTECTED_SEARCH_PLACEHOLDER = 'Search protected items...';
export const RECOVERY_HISTORY_SEARCH_PLACEHOLDER = 'Search recovery history...';
export const RECOVERY_SEARCH_HISTORY_EMPTY_MESSAGE = 'Recent searches appear here.';
+export const RECOVERY_ALL_ITEM_TYPES_LABEL = 'All item types';
+export const RECOVERY_ALL_PLATFORMS_LABEL = 'All platforms';
+export const RECOVERY_ANY_ITEM_LABEL = 'Any item';
export const RECOVERY_ARTIFACT_METADATA_TEXT_CLASS = 'text-[11px] font-medium text-base-content/80';
export const RECOVERY_ARTIFACT_COLUMN_LABELS: Record<string, string> = {
cluster: getRecoveryLocationFacetLabel('cluster'),
@@ -92,6 +95,18 @@ export function getRecoverySearchHistoryEmptyMessage(): string {
return RECOVERY_SEARCH_HISTORY_EMPTY_MESSAGE;
}
+export function getRecoveryAllItemTypesLabel(): string {
+ return RECOVERY_ALL_ITEM_TYPES_LABEL;
+}
+
+export function getRecoveryAllPlatformsLabel(): string {
+ return RECOVERY_ALL_PLATFORMS_LABEL;
+}
+
+export function getRecoveryAnyItemLabel(): string {
+ return RECOVERY_ANY_ITEM_LABEL;
+}
+
export function getRecoveryArtifactColumnLabel(id: string, fallback?: string): string {
return RECOVERY_ARTIFACT_COLUMN_LABELS[id] || fallback || id;
}