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 hidden-upgrade feature gates neutral

rcourtman6b95532044f2
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 508f4800e7..25bace18ce 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1645,9 +1645,9 @@ The audit webhook settings surface now follows that same owner split.
`frontend-modern/src/components/Settings/AuditWebhookPanel.tsx` stays the
canonical `SettingsPanel` shell, while
`frontend-modern/src/components/Settings/useAuditWebhookPanelState.ts` owns the
-license/paywall lifecycle, webhook fetch/save flow, validation, and trial
-startup orchestration. The shell must not re-accumulate API calls or paywall
-tracking inline.
+license/paywall lifecycle, webhook fetch/save flow, validation, paywall
+tracking, and hidden-upgrade copy posture. The shell must not re-accumulate API
+calls or paywall tracking inline.
The diagnostics settings surface now follows that same owner split.
`frontend-modern/src/components/Settings/DiagnosticsPanel.tsx` stays the
diff --git a/docs/release-control/v6/internal/subsystems/organization-settings.md b/docs/release-control/v6/internal/subsystems/organization-settings.md
index 6e866d44aa..4abef01faf 100644
--- a/docs/release-control/v6/internal/subsystems/organization-settings.md
+++ b/docs/release-control/v6/internal/subsystems/organization-settings.md
@@ -246,3 +246,7 @@ RBAC trial CTAs, hard-sell upgrade copy, or paid-only Roles/Users/Audit
navigation by default. Direct routes may recover to the canonical free
settings surface, and entitled or hosted-mode installs may still render the
governed RBAC surfaces.
+The hidden-upgrade posture also applies to locked-card titles and bodies
+themselves: RBAC gates may show neutral unavailable-capability copy, but must
+not keep `(Pro)`, plan-tier labels, or paid-action wording after the CTA is
+suppressed.
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index 1212a5501a..c83325e56d 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -196,6 +196,10 @@ capability truth where feature availability matters, but billing identity,
trial posture, and upgrade routing stay on the dedicated commercial boundary,
and public-demo suppression must resolve from the shared `presentationPolicy`
contract instead of security-surface entitlement reads or local demo flags.
+Security/privacy feature gates that are suppressed by
+`presentationPolicy.hideUpgrade` must also use neutral unavailable-capability
+copy: privacy and audit surfaces must not leave `(Pro)`, trial, plan-tier, or
+upgrade wording visible after their commercial actions are hidden.
That shared token-management boundary now also includes
`frontend-modern/src/utils/apiTokenPresentation.ts`, so API-token load,
generate, and revoke errors stay on one governed customer-facing wording path
diff --git a/frontend-modern/src/components/Settings/AuditWebhookPanel.tsx b/frontend-modern/src/components/Settings/AuditWebhookPanel.tsx
index 235d09bac6..d7a54ff7fd 100644
--- a/frontend-modern/src/components/Settings/AuditWebhookPanel.tsx
+++ b/frontend-modern/src/components/Settings/AuditWebhookPanel.tsx
@@ -43,7 +43,8 @@ export const AuditWebhookPanel: Component<AuditWebhookPanelProps> = (props) => {
upgradeDestination,
webhookUrls,
} = useAuditWebhookPanelState(props.canManage);
- const featureGateCopy = () => getAuditWebhookFeatureGateCopy();
+ const featureGateCopy = () =>
+ getAuditWebhookFeatureGateCopy({ showCommercialCopy: showUpgradePrompts() });
const emptyStateCopy = () => getAuditWebhookEmptyStateCopy();
if (!isAuditLoggingEnabled()) {
diff --git a/frontend-modern/src/components/Settings/ReportingPanel.tsx b/frontend-modern/src/components/Settings/ReportingPanel.tsx
index b845d35d8a..d1e29a05a4 100644
--- a/frontend-modern/src/components/Settings/ReportingPanel.tsx
+++ b/frontend-modern/src/components/Settings/ReportingPanel.tsx
@@ -67,7 +67,17 @@ export function ReportingPanel() {
const performanceReport = () => reportingCatalog()?.performanceReport ?? null;
const inventoryDefinition = () => reportingCatalog()?.vmInventoryExport ?? null;
- const lockedState = () => reportingCatalog()?.lockedState ?? null;
+ const lockedState = () => {
+ const catalog = reportingCatalog();
+ const state = catalog?.lockedState ?? null;
+ if (!catalog || !state || showUpgradePrompts()) {
+ return state;
+ }
+ return {
+ title: catalog.title,
+ description: catalog.description,
+ };
+ };
const guidance = () => reportingCatalog()?.guidance ?? null;
const catalogReady = () => reportingCatalog() !== null;
const supportsMetricFilter = () => performanceReport()?.supportsMetricFilter ?? false;
diff --git a/frontend-modern/src/components/Settings/__tests__/RBACPaywallPanels.test.tsx b/frontend-modern/src/components/Settings/__tests__/RBACPaywallPanels.test.tsx
index 10db5a13af..fdb0e6b556 100644
--- a/frontend-modern/src/components/Settings/__tests__/RBACPaywallPanels.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/RBACPaywallPanels.test.tsx
@@ -150,9 +150,10 @@ describe('RBAC paywall settings panels', () => {
render(() => <RolesPanel />);
await waitFor(() => {
- expect(screen.getByText('Custom Roles (Pro)')).toBeInTheDocument();
+ expect(screen.getByText('Custom Roles')).toBeInTheDocument();
});
+ expect(screen.queryByText('Custom Roles (Pro)')).not.toBeInTheDocument();
expect(screen.queryByRole('link', { name: 'View plans' })).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'Start trial' })).not.toBeInTheDocument();
expect(trackPaywallViewedMock).not.toHaveBeenCalled();
@@ -205,6 +206,24 @@ describe('RBAC paywall settings panels', () => {
expect(screen.getByPlaceholderText('Search users...')).not.toBeDisabled();
});
+ it('keeps user assignment upgrade actions quiet when self-hosted upgrade prompts are hidden', async () => {
+ hasFeatureMock.mockImplementation((feature: string) => feature !== 'rbac');
+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(true);
+
+ render(() => <UserAssignmentsPanel />);
+
+ await waitFor(() => {
+ expect(screen.getByText('Centralized Access Control')).toBeInTheDocument();
+ });
+
+ expect(screen.queryByText('Centralized Access Control (Pro)')).not.toBeInTheDocument();
+ expect(screen.queryByRole('link', { name: 'View plans' })).not.toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: 'Start trial' })).not.toBeInTheDocument();
+ expect(trackPaywallViewedMock).not.toHaveBeenCalled();
+ expect(getUsersMock).not.toHaveBeenCalled();
+ expect(getRolesMock).not.toHaveBeenCalled();
+ });
+
it('shows the canonical update error when self role modification is denied', async () => {
updateUserRolesMock.mockRejectedValueOnce(
Object.assign(new Error('Cannot modify your own role assignments'), {
diff --git a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
index 537f291b4f..7032a7d39e 100644
--- a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
@@ -164,6 +164,23 @@ describe('ReportingPanel', () => {
expect(screen.getByText('Catalog-owned locked teaser copy')).toBeInTheDocument();
});
+ it('uses neutral locked copy when upgrade prompts are hidden', () => {
+ useReportingPanelStateMock.mockReturnValue(
+ buildState({
+ isLocked: () => true,
+ isReportingEnabled: () => false,
+ showUpgradePrompts: () => false,
+ }),
+ );
+
+ render(() => <ReportingPanel />);
+
+ expect(screen.getAllByText('Detailed Reporting').length).toBeGreaterThan(0);
+ expect(screen.getAllByText('Canonical reporting surfaces').length).toBeGreaterThan(0);
+ expect(screen.queryByText('Advanced Reporting (Pro)')).not.toBeInTheDocument();
+ expect(screen.queryByRole('link', { name: 'View plans' })).not.toBeInTheDocument();
+ });
+
it('uses catalog-owned guidance copy for the enabled explainer callout', () => {
useReportingPanelStateMock.mockReturnValue(
buildState({
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index f3ec18fa7c..46e7a7c423 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -13,6 +13,8 @@ import settingsNavigationHookSource from '../useSettingsNavigation.ts?raw';
import aiSettingsStateSource from '../useAISettingsState.ts?raw';
import settingsPanelRegistryContextSource from '../settingsPanelRegistryContext.tsx?raw';
import dataHandlingPanelSource from '../DataHandlingPanel.tsx?raw';
+import auditWebhookPanelSource from '../AuditWebhookPanel.tsx?raw';
+import reportingPanelSource from '../ReportingPanel.tsx?raw';
import infrastructureWorkspaceSource from '../InfrastructureWorkspace.tsx?raw';
import infrastructureSourceManagerSource from '../InfrastructureSourceManager.tsx?raw';
import infrastructureSourcePickerSource from '../InfrastructureSourcePicker.tsx?raw';
@@ -151,6 +153,13 @@ describe('settings architecture guardrails', () => {
expect(dataHandlingPanelSource).not.toContain('higher limits');
expect(dataHandlingPanelSource).not.toContain('Upgrade');
expect(dataHandlingPanelSource).not.toContain('Pro');
+ expect(auditWebhookPanelSource).toContain(
+ 'getAuditWebhookFeatureGateCopy({ showCommercialCopy: showUpgradePrompts() })',
+ );
+ expect(auditWebhookPanelSource).not.toContain('Audit Webhooks (Pro)');
+ expect(reportingPanelSource).toContain('if (!catalog || !state || showUpgradePrompts())');
+ expect(reportingPanelSource).toContain('title: catalog.title');
+ expect(reportingPanelSource).not.toContain('Advanced Reporting (Pro)');
expect(aiRuntimeControlsSectionSource).toContain('showAutonomousControlOption');
expect(aiRuntimeControlsSectionSource).toContain("state.form.controlLevel === 'autonomous'");
expect(aiRuntimeControlsSectionSource).not.toContain('without approval (Pro)');
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx b/frontend-modern/src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx
index 6f504a3306..bcf3c40248 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx
@@ -15,6 +15,9 @@ const showSuccessMock = vi.fn();
const showErrorMock = vi.fn();
const showWarningMock = vi.fn();
const loggerErrorMock = vi.fn();
+const presentationPolicyHidesUpgradePromptsMock = vi.fn();
+const trackPaywallViewedMock = vi.fn();
+const trackUpgradeClickedMock = vi.fn();
vi.mock('../QuickSecuritySetup', () => ({
QuickSecuritySetup: () => <div data-testid="quick-security-setup">Quick Security Setup</div>,
@@ -24,10 +27,14 @@ vi.mock('@/stores/license', () => ({
hasFeature: (...args: unknown[]) => hasFeatureMock(...args),
runtimeCapabilitiesLoaded: () => true,
loadRuntimeCapabilities: (...args: unknown[]) => loadLicenseStatusMock(...args),
+}));
+
+vi.mock('@/stores/licenseCommercial', () => ({
getUpgradeActionDestination: () => ({ href: 'https://example.com/upgrade', external: true }),
- getUpgradeActionUrlOrFallback: () => '/upgrade',
- startProTrial: vi.fn(),
- entitlements: () => ({ trial_eligible: false }),
+}));
+
+vi.mock('@/stores/sessionPresentationPolicy', () => ({
+ presentationPolicyHidesUpgradePrompts: () => presentationPolicyHidesUpgradePromptsMock(),
}));
vi.mock('@/api/relay', () => ({
@@ -63,8 +70,8 @@ vi.mock('@/utils/logger', () => ({
}));
vi.mock('@/utils/upgradeMetrics', () => ({
- trackPaywallViewed: vi.fn(),
- trackUpgradeClicked: vi.fn(),
+ trackPaywallViewed: (...args: unknown[]) => trackPaywallViewedMock(...args),
+ trackUpgradeClicked: (...args: unknown[]) => trackUpgradeClickedMock(...args),
}));
describe('settings read-only panel states', () => {
@@ -78,8 +85,12 @@ describe('settings read-only panel states', () => {
showErrorMock.mockReset();
showWarningMock.mockReset();
loggerErrorMock.mockReset();
+ presentationPolicyHidesUpgradePromptsMock.mockReset();
+ trackPaywallViewedMock.mockReset();
+ trackUpgradeClickedMock.mockReset();
hasFeatureMock.mockReturnValue(true);
+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(false);
loadLicenseStatusMock.mockResolvedValue(undefined);
getRelayConfigMock.mockResolvedValue({
enabled: true,
@@ -155,4 +166,21 @@ describe('settings read-only panel states', () => {
expect(screen.getByDisplayValue('')).toBeDisabled();
expect(screen.getByRole('button', { name: /add endpoint/i })).toBeDisabled();
});
+
+ it('keeps audit webhook locked copy neutral when upgrade prompts are hidden', async () => {
+ hasFeatureMock.mockImplementation((feature: string) => feature !== 'audit_logging');
+ presentationPolicyHidesUpgradePromptsMock.mockReturnValue(true);
+
+ render(() => <AuditWebhookPanel />);
+
+ await waitFor(() => {
+ expect(screen.getAllByText('Audit Webhooks').length).toBeGreaterThan(0);
+ });
+
+ expect(screen.queryByText('Audit Webhooks (Pro)')).not.toBeInTheDocument();
+ expect(screen.queryByText(/require Pro/i)).not.toBeInTheDocument();
+ expect(screen.queryByRole('link', { name: 'View plans' })).not.toBeInTheDocument();
+ expect(trackPaywallViewedMock).not.toHaveBeenCalled();
+ expect(apiFetchJSONMock).not.toHaveBeenCalled();
+ });
});
diff --git a/frontend-modern/src/components/Settings/useRBACFeatureGateState.ts b/frontend-modern/src/components/Settings/useRBACFeatureGateState.ts
index d91966943d..ad4dc2ff94 100644
--- a/frontend-modern/src/components/Settings/useRBACFeatureGateState.ts
+++ b/frontend-modern/src/components/Settings/useRBACFeatureGateState.ts
@@ -15,11 +15,11 @@ interface UseRBACFeatureGateStateOptions {
}
export function useRBACFeatureGateState(options: UseRBACFeatureGateStateOptions) {
+ const showUpgradePrompts = createMemo(() => !presentationPolicyHidesUpgradePrompts());
const featureGateCopy = createMemo<RBACFeatureGateCopy>(() =>
- getRBACFeatureGateCopy(options.kind),
+ getRBACFeatureGateCopy(options.kind, { showCommercialCopy: showUpgradePrompts() }),
);
const licenseReady = createMemo(() => runtimeCapabilitiesLoaded());
- const showUpgradePrompts = createMemo(() => !presentationPolicyHidesUpgradePrompts());
const rbacEnabled = createMemo(() => licenseReady() && hasFeature('rbac'));
const paywallVisible = createMemo(
() => licenseReady() && !hasFeature('rbac') && !options.loading(),
diff --git a/frontend-modern/src/utils/__tests__/auditWebhookPresentation.test.ts b/frontend-modern/src/utils/__tests__/auditWebhookPresentation.test.ts
index 26e9f1f130..a0a73ceaae 100644
--- a/frontend-modern/src/utils/__tests__/auditWebhookPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/auditWebhookPresentation.test.ts
@@ -16,6 +16,13 @@ describe('auditWebhookPresentation', () => {
});
});
+ it('returns neutral feature gate copy when commercial prompts are hidden', () => {
+ expect(getAuditWebhookFeatureGateCopy({ showCommercialCopy: false })).toMatchObject({
+ title: 'Audit Webhooks',
+ body: expect.not.stringContaining('Pro'),
+ });
+ });
+
it('returns canonical empty state copy and shell classes', () => {
expect(getAuditWebhookEmptyStateCopy()).toMatchObject({
title: 'No audit webhooks configured yet.',
diff --git a/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts b/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts
index ab658034ea..40e7e40370 100644
--- a/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts
@@ -21,6 +21,19 @@ describe('rbacPresentation', () => {
});
});
+ it('returns neutral feature gate copy when commercial prompts are hidden', () => {
+ expect(getRBACFeatureGateCopy('roles', { showCommercialCopy: false })).toMatchObject({
+ title: 'Custom Roles',
+ body: expect.not.stringContaining('Pro'),
+ });
+ expect(
+ getRBACFeatureGateCopy('user-assignments', { showCommercialCopy: false }),
+ ).toMatchObject({
+ title: 'Centralized Access Control',
+ body: expect.not.stringContaining('Pro'),
+ });
+ });
+
it('returns canonical user assignments empty state copy', () => {
expect(getUserAssignmentsEmptyStateCopy()).toMatchObject({
title: 'No users yet',
diff --git a/frontend-modern/src/utils/auditWebhookPresentation.ts b/frontend-modern/src/utils/auditWebhookPresentation.ts
index 4e464d84b1..574497dbc9 100644
--- a/frontend-modern/src/utils/auditWebhookPresentation.ts
+++ b/frontend-modern/src/utils/auditWebhookPresentation.ts
@@ -17,11 +17,26 @@ export interface AuditWebhookFeatureGateCopy {
body: string;
}
+export interface AuditWebhookFeatureGateCopyOptions {
+ showCommercialCopy?: boolean;
+}
+
export interface AuditWebhookEmptyStateCopy {
title: string;
}
-export function getAuditWebhookFeatureGateCopy(): AuditWebhookFeatureGateCopy {
+export function getAuditWebhookFeatureGateCopy(
+ options: AuditWebhookFeatureGateCopyOptions = {},
+): AuditWebhookFeatureGateCopy {
+ const showCommercialCopy = options.showCommercialCopy !== false;
+
+ if (!showCommercialCopy) {
+ return {
+ title: 'Audit Webhooks',
+ body: 'Audit webhook delivery is not enabled for this instance.',
+ };
+ }
+
return {
title: 'Audit Webhooks (Pro)',
body: 'Audit webhooks are part of the audit logging feature set and require Pro.',
diff --git a/frontend-modern/src/utils/rbacPresentation.ts b/frontend-modern/src/utils/rbacPresentation.ts
index 22dc048e8a..4f5cb17bd2 100644
--- a/frontend-modern/src/utils/rbacPresentation.ts
+++ b/frontend-modern/src/utils/rbacPresentation.ts
@@ -3,6 +3,10 @@ export interface RBACFeatureGateCopy {
body: string;
}
+export interface RBACFeatureGateCopyOptions {
+ showCommercialCopy?: boolean;
+}
+
export interface UserAssignmentsEmptyStateCopy {
title: string;
body: string;
@@ -10,17 +14,27 @@ export interface UserAssignmentsEmptyStateCopy {
syncHint: string;
}
-export function getRBACFeatureGateCopy(kind: 'roles' | 'user-assignments'): RBACFeatureGateCopy {
+export function getRBACFeatureGateCopy(
+ kind: 'roles' | 'user-assignments',
+ options: RBACFeatureGateCopyOptions = {},
+): RBACFeatureGateCopy {
+ const showCommercialCopy = options.showCommercialCopy !== false;
if (kind === 'roles') {
return {
- title: 'Custom Roles (Pro)',
- body: 'Define granular permissions and custom access tiers for your team.',
+ title: showCommercialCopy ? 'Custom Roles (Pro)' : 'Custom Roles',
+ body: showCommercialCopy
+ ? 'Define granular permissions and custom access tiers for your team.'
+ : 'Define granular permissions and custom access tiers when RBAC is enabled for this instance.',
};
}
return {
- title: 'Centralized Access Control (Pro)',
- body: 'Assign multi-tier roles to users and manage infrastructure-wide security policies.',
+ title: showCommercialCopy
+ ? 'Centralized Access Control (Pro)'
+ : 'Centralized Access Control',
+ body: showCommercialCopy
+ ? 'Assign multi-tier roles to users and manage infrastructure-wide security policies.'
+ : 'Assign roles to users and review access policy when RBAC is enabled for this instance.',
};
}