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.

Remove redundant policy routing row

rcourtman460067e9e1c9
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index 968c5495e2..eae8342ff4 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -56,7 +56,6 @@ import { ResourceAPI } from '@/api/resources';
import {
getResourcePolicyBadges,
getResourcePolicyRedactionLabels,
- getResourcePolicyRoutingDecisionSummaries,
getResourceRoutingScopeLabel,
getResourceSensitivityLabel,
} from '@/utils/resourcePolicyPresentation';
@@ -160,9 +159,6 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
const policyRedactions = createMemo(() =>
getResourcePolicyRedactionLabels(props.resource.policy),
);
- const policyRoutingDecisions = createMemo(() =>
- getResourcePolicyRoutingDecisionSummaries(props.resource.policy),
- );
const hasGovernanceData = createMemo(
() => policyBadges().length > 0 || Boolean(props.resource.aiSafeSummary),
);
@@ -1015,14 +1011,6 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
{getResourceRoutingScopeLabel(props.resource.policy?.routing.scope)}
</span>
</div>
- <For each={policyRoutingDecisions()}>
- {(decision) => (
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">{decision.label}</span>
- <span class="font-medium text-base-content">{decision.value}</span>
- </div>
- )}
- </For>
</Show>
<Show when={policyRedactions().length > 0}>
<div class="flex flex-col gap-1">
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
index 894eea322b..0154367747 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
@@ -306,8 +306,6 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
expect(getAllByText('Restricted').length).toBeGreaterThan(0);
expect(getAllByText('Local Only').length).toBeGreaterThan(0);
expect(getByText('Data Governance')).toBeInTheDocument();
- expect(getByText('Cloud Summary')).toBeInTheDocument();
- expect(getAllByText('Blocked').length).toBe(1);
expect(getByText('Redactions')).toBeInTheDocument();
expect(getByText('Hostname')).toBeInTheDocument();
expect(getByText('IP Address')).toBeInTheDocument();
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index fde9ec14c7..12e3543057 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -1898,7 +1898,6 @@ describe('frontend resource type boundaries', () => {
expect(resourceDetailDrawerSource).toContain('getResourceChangeKindPresentation');
expect(resourceDetailDrawerSource).toContain('getResourceChangeSourceTypePresentation');
expect(resourceDetailDrawerSource).toContain('getResourceChangeSourceAdapterPresentation');
- expect(resourceDetailDrawerSource).toContain('getResourcePolicyRoutingDecisionSummaries');
expect(resourceChangeSummarySource).toContain('getResourceChangeKindPresentation');
expect(resourceChangeSummarySource).toContain('getResourceChangeSourceTypePresentation');
expect(resourceChangeSummarySource).toContain(
diff --git a/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.test.ts b/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.test.ts
index 985d9d2037..4d4a16b697 100644
--- a/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.test.ts
@@ -8,8 +8,6 @@ import {
getResourcePolicyRoutingSummaries,
getResourcePolicySensitivitySummaries,
getResourcePolicyRedactionLabels,
- getResourcePolicyRoutingDecisionLabel,
- getResourcePolicyRoutingDecisionSummaries,
getResourceRedactionHintLabel,
getResourceRoutingScopeLabel,
getResourceSensitivityLabel,
@@ -19,8 +17,6 @@ describe('resourcePolicyPresentation utils', () => {
it('formats canonical policy labels', () => {
expect(getResourceSensitivityLabel('restricted')).toBe('Restricted');
expect(getResourceRoutingScopeLabel('local-only')).toBe('Local Only');
- expect(getResourcePolicyRoutingDecisionLabel(true)).toBe('Allowed');
- expect(getResourcePolicyRoutingDecisionLabel(false)).toBe('Blocked');
expect(getResourceRedactionHintLabel('platform-id')).toBe('Platform ID');
});
@@ -36,18 +32,6 @@ describe('resourcePolicyPresentation utils', () => {
).toEqual(['Hostname', 'IP Address']);
});
- it('formats canonical policy routing decision summaries', () => {
- expect(
- getResourcePolicyRoutingDecisionSummaries({
- sensitivity: 'sensitive',
- routing: {
- scope: 'local-first',
- redact: [],
- },
- }),
- ).toEqual([{ label: 'Cloud Summary', value: 'Allowed' }]);
- });
-
it('formats canonical policy count summaries', () => {
expect(
getResourcePolicySensitivitySummaries({
diff --git a/frontend-modern/src/utils/resourcePolicyPresentation.ts b/frontend-modern/src/utils/resourcePolicyPresentation.ts
index ed49f332fe..d9ea2b2e28 100644
--- a/frontend-modern/src/utils/resourcePolicyPresentation.ts
+++ b/frontend-modern/src/utils/resourcePolicyPresentation.ts
@@ -12,11 +12,6 @@ type PolicyBadgePresentation = {
className: string;
};
-export type ResourcePolicyRoutingDecisionPresentation = {
- label: string;
- value: string;
-};
-
export type ResourcePolicyCountSummary = {
label: string;
count: number;
@@ -112,26 +107,6 @@ export const getResourceSensitivityLabel = (sensitivity?: ResourceSensitivity):
export const getResourceRoutingScopeLabel = (scope?: ResourceRoutingScope): string =>
scope ? routingPresentation[scope].label : 'Unrouted';
-export const getResourcePolicyRoutingDecisionLabel = (allowed?: boolean): string =>
- allowed ? 'Allowed' : 'Blocked';
-
-export const getResourcePolicyRoutingDecisionSummaries = (
- policy?: ResourcePolicy,
-): ResourcePolicyRoutingDecisionPresentation[] => {
- if (!policy) {
- return [];
- }
-
- return [
- {
- label: 'Cloud Summary',
- value: getResourcePolicyRoutingDecisionLabel(
- policy.routing.scope !== 'local-only',
- ),
- },
- ];
-};
-
export const getResourceRedactionHintLabel = (hint?: ResourceRedactionHint): string =>
hint ? redactionLabels[hint] ?? hint : 'Unclassified';