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.

Make portal section metadata literal

rcourtman401808ee6674
diff --git a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
index 137abf82b7..c67462ccf2 100644
--- a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
+++ b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
@@ -265,10 +265,10 @@ Core rules:
not rely on commentary such as `obvious`, `actual work`, `trustworthy`,
or `settled` when the runtime already knows the concrete state, action,
or failure being shown. The same rule applies to shell badges, section
- labels, and error headings: they must say the exact state or action (for
- example `Manage access`, `Hosted billing attached`, or `Failed to load
- roster`) instead of shorthand such as `Manage`, `Hosted`, `Email`, or
- generic alert labels.
+ labels, context chips, route labels, and error headings: they must say
+ the exact state or action (for example `Manage access`, `Hosted billing
+ attached`, `Email support`, or `Failed to load roster`) instead of
+ shorthand such as `Manage`, `Hosted`, `Email`, or generic alert labels.
## Screen Model
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 3b172d4a21..593d918c09 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -375,9 +375,10 @@ literal across the account surface: customer-facing wording may not use
commentary such as `obvious`, `actual work`, `trustworthy`, or `settled` when
the runtime already knows the concrete state, action, or failure being
rendered. The same typed contract applies to shell badges, section labels,
-and error headings: they must render the exact action or state (`Manage
-access`, `Hosted billing attached`, `Failed to load roster`) instead of
-shorthand such as `Manage`, `Hosted`, or generic alert labels.
+context chips, route labels, and error headings: they must render the exact
+action or state (`Manage access`, `Hosted billing attached`, `Email support`,
+`Failed to load roster`) instead of shorthand such as `Manage`, `Hosted`, or
+generic alert labels.
That same typed overview contract must also preserve a sharp, high-density enterprise visual aesthetic (e.g. Cloudflare/GCP density standards) across all portal scenarios, removing gradients and heavy box-shadows to ensure a calm, rigorous visual language with standard 256px sidebars, Inter-grade typography, clean text-transform rules, and cleanly unboxed typography without excessive pills or stacked metrics.
plus a package-local `tsc --noEmit` gate, so future account-shell work should
extend the typed source boundary instead of reviving opaque global runtime
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index b6fa72893b..066765d3e1 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -942,10 +942,10 @@ That same portal shell/runtime boundary must also keep task and status copy
literal across the account surface: customer-facing wording may not lean on
commentary such as `obvious`, `actual work`, `trustworthy`, or `settled` when
the runtime already knows the concrete state, action, or failure being shown.
-That includes shell badges, section labels, and error headings: they must use
-the exact action or state (`Manage access`, `Hosted billing attached`,
-`Failed to load roster`) instead of shorthand such as `Manage`, `Hosted`, or
-generic alert labels.
+That includes shell badges, section labels, context chips, route labels, and
+error headings: they must use the exact action or state (`Manage access`,
+`Hosted billing attached`, `Email support`, `Failed to load roster`) instead
+of shorthand such as `Manage`, `Hosted`, or generic alert labels.
That same canonical shell/runtime boundary now also owns the bootstrap truth
for when self-hosted commercial history is relevant. Hosted-only accounts must
not render self-hosted license, refund, privacy, or support-escalation copy
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.json
index 59366ed632..9107f04ad4 100644
--- a/internal/cloudcp/portal/dist/build_manifest.json
+++ b/internal/cloudcp/portal/dist/build_manifest.json
@@ -1,5 +1,5 @@
{
- "source_hash": "646baefa83486237ab1a2dabf6fb5fb019d16f45cbe8632aa8e881d986d9bb71",
+ "source_hash": "efabad85565864017562509ae60da3b064b5d2dd20585cd8490be6d5f93452b7",
"build_inputs": [
"package.json",
"tsconfig.json",
diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.js
index db04c96b44..55da4e11af 100644
--- a/internal/cloudcp/portal/dist/portal_app.js
+++ b/internal/cloudcp/portal/dist/portal_app.js
@@ -1973,12 +1973,18 @@
function workspaceCountLabel(count) {
return count === 1 ? "1 workspace" : String(count) + " workspaces";
}
+ function workspaceTotalChipLabel(count) {
+ return count === 1 ? "1 workspace total" : String(count) + " workspaces total";
+ }
function reviewWorkspaceHeadline(count) {
return count === 1 ? "1 workspace needs review" : String(count) + " workspaces need review";
}
function readyWorkspaceHeadline(count) {
return count === 1 ? "1 workspace is ready to use" : String(count) + " workspaces are ready to use";
}
+ function readyWorkspaceSectionChipLabel(count) {
+ return count === 1 ? "1 workspace ready to use" : String(count) + " workspaces ready to use";
+ }
function reviewWorkspaceChipLabel(count) {
return count === 1 ? "1 workspace to review" : String(count) + " workspaces to review";
}
@@ -1988,6 +1994,9 @@
function suspendedWorkspaceChipLabel(count) {
return count === 1 ? "1 suspended workspace" : String(count) + " suspended workspaces";
}
+ function suspendedWorkspaceSectionChipLabel(count) {
+ return count === 1 ? "1 workspace suspended" : String(count) + " workspaces suspended";
+ }
function overviewNavBadgeLabel(hosted, attentionCount, readyCount) {
if (!hosted) return "Billing available";
if (attentionCount > 0) return reviewWorkspaceChipLabel(attentionCount);
@@ -2007,6 +2016,22 @@
function supportNavBadgeLabel() {
return "Escalation only";
}
+ function billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial) {
+ return [
+ hostedBillingCount > 0 ? "Hosted billing attached" : "No hosted billing attached",
+ showSelfHostedCommercial ? "Self-hosted billing available" : "Hosted billing only"
+ ];
+ }
+ function supportSectionChipLabels(hasHostedAccounts2, hostedViewOnly, supportEmail) {
+ if (hasHostedAccounts2) {
+ return [
+ "Escalation only",
+ hostedViewOnly ? "Review Workspaces or Access, or contact owner/admin first" : "Open Workspaces, Access, or Billing first",
+ supportEmail ? "Email support" : "Support route"
+ ];
+ }
+ return ["Escalation only", "Open Billing first", supportEmail ? "Email support" : "Support route"];
+ }
function hasHostedAccounts(accounts) {
return accounts.length > 0;
}
@@ -2377,9 +2402,9 @@
return renderWorkspaceCard(account, workspace, accountAPIBasePath);
}).join("") + "</div></div>" : '<div class="empty-state"><p>' + escapeHTML(account.can_manage ? "No hosted workspaces yet. Create one to get started." : "No hosted workspaces are attached yet. An owner or admin must create the first one.") + "</p></div>";
return '<section class="account-content-panel account-content-panel-workspaces"><div class="account-stage-header"><div class="account-stage-header-row"><div><div class="account-panel-kicker">Workspaces</div><h3>Workspaces</h3><p>' + escapeHTML(sectionCopy) + "</p>" + renderSectionContextChips([
- String(workspaces.length) + " total",
- String(readyCount) + " ready",
- String(suspendedCount) + " suspended"
+ workspaceTotalChipLabel(workspaces.length),
+ readyWorkspaceSectionChipLabel(readyCount),
+ suspendedWorkspaceSectionChipLabel(suspendedCount)
]) + '</div><div class="account-stage-header-actions">' + workspaceHeaderActions + '</div></div></div><div class="workspace-operations-shell workspace-operations-shell-idle" id="workspace-operations-shell-' + escapeAttr(account.id) + '"><div class="workspace-operations-main">' + workspaceHTML + '</div><div class="workspace-operations-detail" id="workspace-operations-detail-' + escapeAttr(account.id) + '" hidden>' + workspaceManagement + "</div></div></section>";
}
function renderAccountAccessSection(account) {
@@ -2423,8 +2448,8 @@
}
var hostedViewOnly = hasHostedAccounts2 && !canManageHostedTasks;
var supportLead = hasHostedAccounts2 ? hostedViewOnly ? showSelfHostedCommercial ? "Use support only when the same Workspaces review, Access review, owner/admin, or Billing path has already stopped you." : "Use support only when the same Workspaces review, Access review, owner/admin, or hosted Billing path has already stopped you." : showSelfHostedCommercial ? "Use support only when the Workspaces, Access, or Billing path has already stopped you." : "Use support only when the Workspaces, Access, or hosted Billing path has already stopped you." : "Use support only when the Billing path has already stopped you.";
- var supportChips = hasHostedAccounts2 ? ["Escalation only", hostedViewOnly ? "Owner/admin first" : showSelfHostedCommercial ? "Bring context" : "Hosted only", supportEmail ? "Email" : "Support"] : ["Escalation only", "Billing only", supportEmail ? "Email" : "Support"];
- var routeCards = hasHostedAccounts2 ? '<div class="portal-support-route-card"><div class="account-panel-kicker">Hosted path</div><h3>' + (hostedViewOnly ? "Hosted review or owner/admin path failed" : "Workspace or access path failed") + "</h3><p>" + (hostedViewOnly ? "Go back to the hosted task first. Review the same workspace or roster here, then have an owner or admin run the blocked change before you escalate." : "Go back to the hosted task first. Escalate only when the same workspace or access path still cannot finish the job.") + '</p><div class="portal-support-points"><div class="portal-support-point"><strong>' + (hostedViewOnly ? "Review the same task" : "Start from the same task") + "</strong><span>" + (hostedViewOnly ? "Use Workspaces to confirm workspace state and Access to confirm the current roster before you escalate." : "Use Workspaces for lifecycle issues and Access for roster issues before you escalate.") + '</span></div><div class="portal-support-point"><strong>' + (hostedViewOnly ? "Name the blocked owner/admin action" : "Keep the hosted context intact") + "</strong><span>" + (hostedViewOnly ? "Include the account, workspace, and the lifecycle or access change that still needs an owner or admin." : "Include the account, workspace, and failed action so support inherits the same request.") + '</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">' + (hostedViewOnly ? "Review workspaces" : "Open workspaces") + '</button><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">' + (hostedViewOnly ? "Review access" : "Open access") + '</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + '</a></div></div><div class="portal-support-route-card"><div class="account-panel-kicker">Billing path</div><h3>' + (hostedViewOnly ? showSelfHostedCommercial ? "Billing or owner/admin path failed" : "Hosted billing or owner/admin path failed" : showSelfHostedCommercial ? "Billing path failed" : "Hosted billing path failed") + "</h3><p>" + (hostedViewOnly ? showSelfHostedCommercial ? "Use this route only after the relevant billing job has failed, or the affected hosted account still needs an owner or admin to finish hosted billing." : "Use this route only after the affected hosted account still needs an owner or admin to finish hosted billing and that path still cannot complete cleanly." : showSelfHostedCommercial ? "Use this route only after hosted billing or one self-hosted billing job has failed to complete cleanly." : "Use this route only after hosted billing has failed to complete cleanly.") + '</p><div class="portal-support-points"><div class="portal-support-point"><strong>Name the billing job</strong><span>' + (hostedViewOnly ? showSelfHostedCommercial ? "Say whether the failed path was hosted billing, licenses, refunds, or privacy, and whether hosted billing still needed an owner or admin." : "Say whether the failed path was hosted billing and whether the account still needed an owner or admin to open it." : showSelfHostedCommercial ? "Say whether the failed path was hosted billing, licenses, refunds, or privacy." : "Say whether the failed path was hosted billing.") + '</span></div><div class="portal-support-point"><strong>Keep the request intact</strong><span>' + (hostedViewOnly ? showSelfHostedCommercial ? "Bring the same account or billing email and the failed owner/admin or billing step instead of reopening the story." : "Bring the same hosted account and the failed billing or owner/admin step instead of reopening the story." : showSelfHostedCommercial ? "Bring the same account or billing email and the failed action instead of reopening the story." : "Bring the same hosted account and the failed billing action instead of reopening the story.") + '</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + "</a></div></div>" : '<div class="portal-support-route-card"><div class="account-panel-kicker">Billing path</div><h3>Self-hosted billing path failed</h3><p>Use this route only after a self-hosted billing, license, refund, or privacy job has failed to complete cleanly.</p><div class="portal-support-points"><div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was billing, licenses, refunds, or privacy.</span></div><div class="portal-support-point"><strong>Keep the purchase context intact</strong><span>Bring the same commercial email and the failed action instead of reopening the story.</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + "</a></div></div>";
+ var supportChips = supportSectionChipLabels(hasHostedAccounts2, hostedViewOnly, supportEmail);
+ var routeCards = hasHostedAccounts2 ? '<div class="portal-support-route-card"><div class="account-panel-kicker">Hosted workspace or access</div><h3>' + (hostedViewOnly ? "Hosted review or owner/admin path failed" : "Workspace or access path failed") + "</h3><p>" + (hostedViewOnly ? "Go back to the hosted task first. Review the same workspace or roster here, then have an owner or admin run the blocked change before you escalate." : "Go back to the hosted task first. Escalate only when the same workspace or access path still cannot finish the job.") + '</p><div class="portal-support-points"><div class="portal-support-point"><strong>' + (hostedViewOnly ? "Review the same task" : "Start from the same task") + "</strong><span>" + (hostedViewOnly ? "Use Workspaces to confirm workspace state and Access to confirm the current roster before you escalate." : "Use Workspaces for lifecycle issues and Access for roster issues before you escalate.") + '</span></div><div class="portal-support-point"><strong>' + (hostedViewOnly ? "Name the blocked owner/admin action" : "Keep the hosted context intact") + "</strong><span>" + (hostedViewOnly ? "Include the account, workspace, and the lifecycle or access change that still needs an owner or admin." : "Include the account, workspace, and failed action so support inherits the same request.") + '</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Open Workspaces</button><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">Open Access</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + '</a></div></div><div class="portal-support-route-card"><div class="account-panel-kicker">' + (showSelfHostedCommercial ? "Billing" : "Hosted billing") + "</div><h3>" + (hostedViewOnly ? showSelfHostedCommercial ? "Billing or owner/admin path failed" : "Hosted billing or owner/admin path failed" : showSelfHostedCommercial ? "Billing path failed" : "Hosted billing path failed") + "</h3><p>" + (hostedViewOnly ? showSelfHostedCommercial ? "Use this route only after the relevant billing job has failed, or the affected hosted account still needs an owner or admin to finish hosted billing." : "Use this route only after the affected hosted account still needs an owner or admin to finish hosted billing and that path still cannot complete cleanly." : showSelfHostedCommercial ? "Use this route only after hosted billing or one self-hosted billing job has failed to complete cleanly." : "Use this route only after hosted billing has failed to complete cleanly.") + '</p><div class="portal-support-points"><div class="portal-support-point"><strong>Name the billing job</strong><span>' + (hostedViewOnly ? showSelfHostedCommercial ? "Say whether the failed path was hosted billing, licenses, refunds, or privacy, and whether hosted billing still needed an owner or admin." : "Say whether the failed path was hosted billing and whether the account still needed an owner or admin to open it." : showSelfHostedCommercial ? "Say whether the failed path was hosted billing, licenses, refunds, or privacy." : "Say whether the failed path was hosted billing.") + '</span></div><div class="portal-support-point"><strong>Keep the request intact</strong><span>' + (hostedViewOnly ? showSelfHostedCommercial ? "Bring the same account or billing email and the failed owner/admin or billing step instead of reopening the story." : "Bring the same hosted account and the failed billing or owner/admin step instead of reopening the story." : showSelfHostedCommercial ? "Bring the same account or billing email and the failed action instead of reopening the story." : "Bring the same hosted account and the failed billing action instead of reopening the story.") + '</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + "</a></div></div>" : '<div class="portal-support-route-card"><div class="account-panel-kicker">Self-hosted billing</div><h3>Self-hosted billing path failed</h3><p>Use this route only after a self-hosted billing, license, refund, or privacy job has failed to complete cleanly.</p><div class="portal-support-points"><div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was billing, licenses, refunds, or privacy.</span></div><div class="portal-support-point"><strong>Keep the purchase context intact</strong><span>Bring the same commercial email and the failed action instead of reopening the story.</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + "</a></div></div>";
var runbookSteps = hasHostedAccounts2 ? '<div class="portal-support-runbook-step"><strong>1. Failed path</strong><span>' + (hostedViewOnly ? showSelfHostedCommercial ? "Say whether the blocked path was Workspaces review, Access review, owner/admin hosted change, hosted billing, licenses, refunds, or privacy." : "Say whether the blocked path was Workspaces review, Access review, owner/admin hosted change, or hosted billing." : showSelfHostedCommercial ? "Say whether the blocked path was Workspaces, Access, hosted billing, licenses, refunds, or privacy." : "Say whether the blocked path was Workspaces, Access, or hosted billing.") + '</span></div><div class="portal-support-runbook-step"><strong>2. Account or email</strong><span>' + (hostedViewOnly ? showSelfHostedCommercial ? "Include the hosted account and workspace for the blocked review or owner/admin path, or the commercial billing email for self-hosted work." : "Include the hosted account and workspace or hosted billing account that still needed owner/admin action." : showSelfHostedCommercial ? "Include the hosted account and workspace when relevant, or the commercial billing email for self-hosted work." : "Include the hosted account and workspace or hosted billing account that the failed path belongs to.") + '</span></div><div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div>' : '<div class="portal-support-runbook-step"><strong>1. Billing job</strong><span>Say whether the blocked path was billing, licenses, refunds, or privacy.</span></div><div class="portal-support-runbook-step"><strong>2. Purchase email</strong><span>Include the commercial billing email used for the self-hosted purchase.</span></div><div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div>';
return '<section class="portal-support-panel"><div class="account-panel-kicker">Support</div><h2>Escalation only</h2><p>' + escapeHTML(supportLead) + "</p>" + renderSectionContextChips(supportChips) + '<div class="portal-support-layout"><div class="portal-support-route-grid">' + routeCards + '</div><div class="portal-support-runbook"><div class="account-panel-kicker">What to send</div><h3>Send these details</h3><p>Send the failed path, account or email, and failed action.</p><div class="portal-support-runbook-list">' + runbookSteps + "</div></div></div></section>";
}
@@ -2447,10 +2472,7 @@
var hostedContent = accounts.length ? accounts.map(function(account) {
return '<section class="account-surface"><div class="account-surface-body">' + renderAccountWorkspaceSection(account, context.accountAPIBasePath) + renderAccountAccessSection(account) + "</div></section>";
}).join("") : renderNoHostedWorkspacesSection() + renderNoHostedAccessSection();
- return '<div class="portal-shell" data-shell-section="' + activeSection + '"><div class="portal-shell-layout">' + renderShellNavigation(accounts, context.bootstrap.support_email || "", activeSection) + '<div class="portal-shell-main">' + (accounts.length === 1 ? renderAccountContextStrip(accounts[0]) : "") + '<section class="portal-content-panel portal-content-panel-overview">' + renderShellOverviewSection(context) + '<div id="accounts-root">' + hostedContent + '</div></section><section class="portal-content-panel portal-content-panel-billing billing-section" id="billing-section"><div class="billing-header"><div><div class="account-panel-kicker">Billing</div><h2>Billing</h2>' + renderSectionContextChips([
- hostedBillingCount > 0 ? "Hosted billing" : "No hosted billing",
- showSelfHostedCommercial ? "Self-hosted tools" : "Hosted only"
- ]) + '</div><div class="billing-note">' + billingNote + "</div></div>" + (hosted ? '<div class="billing-overview-grid">' + renderHostedBillingCards(accounts, showSelfHostedCommercial) + "</div>" : "") + (showSelfHostedCommercial ? '<div class="billing-shell billing-shell-idle"><div class="billing-shell-main"><div class="billing-shell-main-head"><div class="account-panel-kicker">Self-hosted billing</div><h3>Pick the self-hosted job</h3><p>Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.</p></div><div class="billing-action-list">' + renderBillingActionRow("open-manage-billing", "Self-hosted billing", "Manage subscriptions", "Billing", "Open Stripe for self-hosted plan, invoice, and payment changes.", "manage-billing-panel", "manage-inline-email", ["Plan changes", "Invoices"]) + renderBillingActionRow("open-retrieve-billing", "Licenses", "Retrieve licenses", "Licenses", "Recover the latest active self-hosted license and invoice link.", "retrieve-billing-panel", "retrieve-inline-email", ["Latest active license", "Invoice lookup"]) + renderBillingActionRow("open-refund-billing", "Refunds", "Refund requests", "Refunds", "Request a self-serve refund when the purchase is still eligible.", "refund-billing-panel", "refund-inline-email", ["Eligibility check", "Revocation"]) + renderBillingActionRow("open-data-billing", "Privacy", "Data and privacy", "Privacy", "Request export or deletion for commercial account data.", "data-billing-panel", "data-export-email", ["Export", "Deletion"]) + '</div><div class="billing-inline-support"><div class="account-panel-kicker">Escalation only</div><h4>Use Support only after Billing fails</h4><p>' + selfHostedBillingEscalationCopy + '</p><div class="billing-inline-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="support">Open support</button><a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a></div></div></div><div class="billing-shell-detail" id="billing-detail-shell" hidden>' + renderBillingTaskPanel(
+ return '<div class="portal-shell" data-shell-section="' + activeSection + '"><div class="portal-shell-layout">' + renderShellNavigation(accounts, context.bootstrap.support_email || "", activeSection) + '<div class="portal-shell-main">' + (accounts.length === 1 ? renderAccountContextStrip(accounts[0]) : "") + '<section class="portal-content-panel portal-content-panel-overview">' + renderShellOverviewSection(context) + '<div id="accounts-root">' + hostedContent + '</div></section><section class="portal-content-panel portal-content-panel-billing billing-section" id="billing-section"><div class="billing-header"><div><div class="account-panel-kicker">Billing</div><h2>Billing</h2>' + renderSectionContextChips(billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial)) + '</div><div class="billing-note">' + billingNote + "</div></div>" + (hosted ? '<div class="billing-overview-grid">' + renderHostedBillingCards(accounts, showSelfHostedCommercial) + "</div>" : "") + (showSelfHostedCommercial ? '<div class="billing-shell billing-shell-idle"><div class="billing-shell-main"><div class="billing-shell-main-head"><div class="account-panel-kicker">Self-hosted billing</div><h3>Pick the self-hosted job</h3><p>Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.</p></div><div class="billing-action-list">' + renderBillingActionRow("open-manage-billing", "Self-hosted billing", "Manage subscriptions", "Billing", "Open Stripe for self-hosted plan, invoice, and payment changes.", "manage-billing-panel", "manage-inline-email", ["Plan changes", "Invoices"]) + renderBillingActionRow("open-retrieve-billing", "Licenses", "Retrieve licenses", "Licenses", "Recover the latest active self-hosted license and invoice link.", "retrieve-billing-panel", "retrieve-inline-email", ["Latest active license", "Invoice lookup"]) + renderBillingActionRow("open-refund-billing", "Refunds", "Refund requests", "Refunds", "Request a self-serve refund when the purchase is still eligible.", "refund-billing-panel", "refund-inline-email", ["Eligibility check", "Revocation"]) + renderBillingActionRow("open-data-billing", "Privacy", "Data and privacy", "Privacy", "Request export or deletion for commercial account data.", "data-billing-panel", "data-export-email", ["Export", "Deletion"]) + '</div><div class="billing-inline-support"><div class="account-panel-kicker">Escalation only</div><h4>Use Support only after Billing fails</h4><p>' + selfHostedBillingEscalationCopy + '</p><div class="billing-inline-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="support">Open support</button><a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a></div></div></div><div class="billing-shell-detail" id="billing-detail-shell" hidden>' + renderBillingTaskPanel(
"Manage subscriptions",
"Open Stripe for self-hosted plan, invoice, and payment changes.",
"manage-billing-panel",
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
index 02eb5ac48f..0575d315d3 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
@@ -171,7 +171,7 @@ describe('shell view', function() {
expect(html).toContain('Beta Workspace');
expect(html).toContain('Gamma Workspace');
expect(html).toContain('Needs attention');
- expect(html).toContain('ready</span>');
+ expect(html).toContain('1 workspace ready to use');
expect(html).toContain('Unhealthy</span>');
expect(html).toContain('Checking</span>');
expect(html).toContain('Ready');
@@ -207,15 +207,21 @@ describe('shell view', function() {
expect(html).toContain('data-can-manage="true"');
expect(html).toContain('Remove stale access');
expect(html).toContain('data-action="workspace-action"');
- expect(html).toContain('Hosted billing');
- expect(html).toContain('Hosted only');
+ expect(html).toContain('Hosted billing attached');
+ expect(html).toContain('Hosted billing only');
expect(html).toContain('Use this billing surface only for hosted billing on your hosted workspace accounts.');
expect(html).toContain('Escalation only');
+ expect(html).toContain('Open Workspaces, Access, or Billing first');
+ expect(html).toContain('Email support');
+ expect(html).toContain('Hosted workspace or access');
expect(html).toContain('Workspace or access path failed');
+ expect(html).toContain('Open Workspaces');
+ expect(html).toContain('Open Access');
expect(html).toContain('Hosted billing path failed');
expect(html).toContain('Send these details');
expect(html).toContain('What to send');
expect(html).toContain('Open billing');
+ expect(html).not.toContain('Hosted only');
expect(html).not.toContain('Self-hosted tools');
expect(html).not.toContain('Self-hosted billing');
expect(html).not.toContain('Pick the self-hosted job');
@@ -259,7 +265,7 @@ describe('shell view', function() {
})
);
- expect(html).toContain('Self-hosted tools');
+ expect(html).toContain('Self-hosted billing available');
expect(html).toContain('Self-hosted billing');
expect(html).toContain('Pick the self-hosted job');
expect(html).toContain('Use hosted billing first when the request belongs to a hosted workspace account.');
@@ -398,15 +404,17 @@ describe('shell view', function() {
expect(html).toContain('Hosted billing is attached here, but an owner or admin must open it.');
expect(html).toContain('Escalation only after the review, owner/admin, or billing path is exhausted.');
expect(html).toContain('Use support only when the same Workspaces review, Access review, owner/admin, or hosted Billing path has already stopped you.');
- expect(html).toContain('Owner/admin first');
+ expect(html).toContain('Review Workspaces or Access, or contact owner/admin first');
+ expect(html).toContain('Email support');
+ expect(html).toContain('Hosted workspace or access');
expect(html).toContain('Hosted review or owner/admin path failed');
expect(html).toContain('Review the same workspace or roster here, then have an owner or admin run the blocked change before you escalate.');
expect(html).toContain('Review the same task');
expect(html).toContain('Use Workspaces to confirm workspace state and Access to confirm the current roster before you escalate.');
expect(html).toContain('Name the blocked owner/admin action');
expect(html).toContain('Include the account, workspace, and the lifecycle or access change that still needs an owner or admin.');
- expect(html).toContain('Review workspaces');
- expect(html).toContain('Review access');
+ expect(html).toContain('Open Workspaces');
+ expect(html).toContain('Open Access');
expect(html).toContain('Hosted billing or owner/admin path failed');
expect(html).toContain('Use this route only after the affected hosted account still needs an owner or admin to finish hosted billing and that path still cannot complete cleanly.');
expect(html).toContain('Say whether the failed path was hosted billing and whether the account still needed an owner or admin to open it.');
@@ -636,14 +644,16 @@ describe('shell view', function() {
expect(html).toContain('Use self-hosted billing only for self-hosted purchases. Open one path at a time when hosted billing does not apply.');
expect(html).toContain('Escalate with the same self-hosted billing path and the exact failed step.');
expect(html).toContain('Billing');
+ expect(html).toContain('Self-hosted billing available');
+ expect(html).toContain('Open Billing first');
+ expect(html).toContain('Email support');
expect(html).toContain('Use support only when the Billing path has already stopped you.');
expect(html).toContain('Self-hosted billing path failed');
expect(html).toContain('Purchase email');
- expect(html).not.toContain('No hosted billing attached');
+ expect(html).toContain('No hosted billing attached');
expect(html).not.toContain('Escalate with the same hosted billing action or self-hosted path and the exact failed step.');
expect(html).not.toContain('Workspace or access path failed');
- expect(html).not.toContain('Open workspaces');
- expect(html).not.toContain('Open access');
+ expect(html).not.toContain('Hosted workspace or access');
expect(html).not.toContain('Self-hosted commercial services');
});
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.ts
index f177c35c1e..a9cd6462a6 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts
@@ -57,6 +57,10 @@ function workspaceCountLabel(count: number): string {
return count === 1 ? '1 workspace' : String(count) + ' workspaces';
}
+function workspaceTotalChipLabel(count: number): string {
+ return count === 1 ? '1 workspace total' : String(count) + ' workspaces total';
+}
+
function reviewWorkspaceHeadline(count: number): string {
return count === 1 ? '1 workspace needs review' : String(count) + ' workspaces need review';
}
@@ -65,6 +69,10 @@ function readyWorkspaceHeadline(count: number): string {
return count === 1 ? '1 workspace is ready to use' : String(count) + ' workspaces are ready to use';
}
+function readyWorkspaceSectionChipLabel(count: number): string {
+ return count === 1 ? '1 workspace ready to use' : String(count) + ' workspaces ready to use';
+}
+
function reviewWorkspaceChipLabel(count: number): string {
return count === 1 ? '1 workspace to review' : String(count) + ' workspaces to review';
}
@@ -77,6 +85,10 @@ function suspendedWorkspaceChipLabel(count: number): string {
return count === 1 ? '1 suspended workspace' : String(count) + ' suspended workspaces';
}
+function suspendedWorkspaceSectionChipLabel(count: number): string {
+ return count === 1 ? '1 workspace suspended' : String(count) + ' workspaces suspended';
+}
+
function overviewNavBadgeLabel(hosted: boolean, attentionCount: number, readyCount: number): string {
if (!hosted) return 'Billing available';
if (attentionCount > 0) return reviewWorkspaceChipLabel(attentionCount);
@@ -101,6 +113,24 @@ function supportNavBadgeLabel(): string {
return 'Escalation only';
}
+function billingHeaderChipLabels(hostedBillingCount: number, showSelfHostedCommercial: boolean): string[] {
+ return [
+ hostedBillingCount > 0 ? 'Hosted billing attached' : 'No hosted billing attached',
+ showSelfHostedCommercial ? 'Self-hosted billing available' : 'Hosted billing only',
+ ];
+}
+
+function supportSectionChipLabels(hasHostedAccounts: boolean, hostedViewOnly: boolean, supportEmail: string): string[] {
+ if (hasHostedAccounts) {
+ return [
+ 'Escalation only',
+ hostedViewOnly ? 'Review Workspaces or Access, or contact owner/admin first' : 'Open Workspaces, Access, or Billing first',
+ supportEmail ? 'Email support' : 'Support route',
+ ];
+ }
+ return ['Escalation only', 'Open Billing first', supportEmail ? 'Email support' : 'Support route'];
+}
+
function hasHostedAccounts(accounts: PortalAccountSummary[]): boolean {
return accounts.length > 0;
}
@@ -974,9 +1004,9 @@ function renderAccountWorkspaceSection(account: PortalAccountSummary, accountAPI
'<h3>Workspaces</h3>' +
'<p>' + escapeHTML(sectionCopy) + '</p>' +
renderSectionContextChips([
- String(workspaces.length) + ' total',
- String(readyCount) + ' ready',
- String(suspendedCount) + ' suspended',
+ workspaceTotalChipLabel(workspaces.length),
+ readyWorkspaceSectionChipLabel(readyCount),
+ suspendedWorkspaceSectionChipLabel(suspendedCount),
]) +
'</div>' +
'<div class="account-stage-header-actions">' + workspaceHeaderActions + '</div>' +
@@ -1216,13 +1246,11 @@ function renderSupportSection(context: ShellViewContext): string {
? 'Use support only when the Workspaces, Access, or Billing path has already stopped you.'
: 'Use support only when the Workspaces, Access, or hosted Billing path has already stopped you.'))
: 'Use support only when the Billing path has already stopped you.';
- var supportChips = hasHostedAccounts
- ? ['Escalation only', hostedViewOnly ? 'Owner/admin first' : (showSelfHostedCommercial ? 'Bring context' : 'Hosted only'), supportEmail ? 'Email' : 'Support']
- : ['Escalation only', 'Billing only', supportEmail ? 'Email' : 'Support'];
+ var supportChips = supportSectionChipLabels(hasHostedAccounts, hostedViewOnly, supportEmail);
var routeCards = hasHostedAccounts
? (
'<div class="portal-support-route-card">' +
- '<div class="account-panel-kicker">Hosted path</div>' +
+ '<div class="account-panel-kicker">Hosted workspace or access</div>' +
'<h3>' + (hostedViewOnly ? 'Hosted review or owner/admin path failed' : 'Workspace or access path failed') + '</h3>' +
'<p>' + (hostedViewOnly
? 'Go back to the hosted task first. Review the same workspace or roster here, then have an owner or admin run the blocked change before you escalate.'
@@ -1236,13 +1264,13 @@ function renderSupportSection(context: ShellViewContext): string {
: 'Include the account, workspace, and failed action so support inherits the same request.') + '</span></div>' +
'</div>' +
'<div class="portal-support-actions">' +
- '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">' + (hostedViewOnly ? 'Review workspaces' : 'Open workspaces') + '</button>' +
- '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">' + (hostedViewOnly ? 'Review access' : 'Open access') + '</button>' +
+ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Open Workspaces</button>' +
+ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">Open Access</button>' +
'<a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + '</a>' +
'</div>' +
'</div>' +
'<div class="portal-support-route-card">' +
- '<div class="account-panel-kicker">Billing path</div>' +
+ '<div class="account-panel-kicker">' + (showSelfHostedCommercial ? 'Billing' : 'Hosted billing') + '</div>' +
'<h3>' + (hostedViewOnly
? (showSelfHostedCommercial ? 'Billing or owner/admin path failed' : 'Hosted billing or owner/admin path failed')
: (showSelfHostedCommercial ? 'Billing path failed' : 'Hosted billing path failed')) + '</h3>' +
@@ -1277,7 +1305,7 @@ function renderSupportSection(context: ShellViewContext): string {
)
: (
'<div class="portal-support-route-card">' +
- '<div class="account-panel-kicker">Billing path</div>' +
+ '<div class="account-panel-kicker">Self-hosted billing</div>' +
'<h3>Self-hosted billing path failed</h3>' +
'<p>Use this route only after a self-hosted billing, license, refund, or privacy job has failed to complete cleanly.</p>' +
'<div class="portal-support-points">' +
@@ -1396,10 +1424,7 @@ export function renderAuthenticatedPortalHTML(context: ShellViewContext): string
'<div>' +
'<div class="account-panel-kicker">Billing</div>' +
'<h2>Billing</h2>' +
- renderSectionContextChips([
- hostedBillingCount > 0 ? 'Hosted billing' : 'No hosted billing',
- showSelfHostedCommercial ? 'Self-hosted tools' : 'Hosted only',
- ]) +
+ renderSectionContextChips(billingHeaderChipLabels(hostedBillingCount, showSelfHostedCommercial)) +
'</div>' +
'<div class="billing-note">' + billingNote + '</div>' +
'</div>' +