#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere
TypeScript dockerhacktoberfestjavapdfpdf-converterpdf-editorpdf-manipulationpdf-mergerpdf-ocrpdf-toolspdf-web-appspdfmergerself-hosted
Enterprise page follow-ups (#8805)
Reece Browne2b7b1e1fffd8
diff --git a/frontend/public/locales/en-US/translation.toml b/frontend/public/locales/en-US/translation.tomlindex 537d9f5c8e..e30f2f0cd2 100644--- a/frontend/public/locales/en-US/translation.toml+++ b/frontend/public/locales/en-US/translation.toml@@ -9235,19 +9235,12 @@ tickCompliance = "SCIM, data residency and uptime SLAs"tickDeploy = "Run it on Stirling Cloud, your own servers, or fully air-gapped"title = "Stirling Enterprise"-[portal.enterprise.options]-label = "Ways to run it"-next = "Next"-previous = "Previous"-slideOf = "{{n}} of {{total}}"-[portal.enterprise.options.airgap]more = "Offline licence docs"point1 = "Activated with a licence file that works offline, not a key checked online"point2 = "Installs like self-hosted, from an image you bring across"point3 = "Sign-in stays inside your network"tagline = "Self-hosted on a network with no internet access."-title = "Air-gapped"[portal.enterprise.options.cloud]more = "Stirling Cloud docs"@@ -9255,7 +9248,6 @@ point1 = "Your team signs in at stirling.com/app"point2 = "Runs on AWS, with stored files encrypted at rest"point3 = "Single sign-on through your own identity provider needs self-hosting"tagline = "Hosted for you, with nothing to install."-title = "Stirling Cloud"[portal.enterprise.options.selfhost]more = "Self-hosting docs"@@ -9263,7 +9255,6 @@ point1 = "Install with Docker, or the Helm chart on Kubernetes"point2 = "Documents are processed on your own infrastructure"point3 = "OAuth2, OIDC or SAML single sign-on"tagline = "On your own servers, on-premises or in your own cloud."-title = "Self-hosted"[portal.enterprise.review]back = "Return to {{stage}}"@@ -9305,7 +9296,7 @@ body = "Bring in the people who'll use it, so the trial reflects real work."title = "Invite your team"[portal.enterprise.setup.licence]-body = "Open http://your-server:8080/settings/adminPlan, where your Enterprise licence should show as active. Installed another way? Add the key under premium.key in settings.yml and restart."+body = "Open <code>http://your-server:8080/settings/adminPlan</code>, where your Enterprise licence should show as active. Installed another way? Add the key under <code>premium.key</code> in <code>settings.yml</code> and restart."title = "Check your licence is active"[portal.enterprise.setup.links]@@ -9332,13 +9323,13 @@ body = "An air-gapped server can't reach our licence service, so it checks thistitle = "Download your offline licence"[portal.enterprise.setup.people]-bodyAirgap = "Create accounts at /settings/people, or point Stirling at your internal identity provider so sign-in never leaves your network."-bodySelfHosted = "Create accounts at /settings/people, or connect your identity provider so your team signs in with their work accounts. They use Stirling in the browser at your server's address, or in the desktop app pointed at it."+bodyAirgap = "Create accounts at <code>/settings/people</code>, or point Stirling at your internal identity provider so sign-in never leaves your network."+bodySelfHosted = "Create accounts at <code>/settings/people</code>, or connect your identity provider so your team signs in with their work accounts. They use Stirling in the browser at your server's address, or in the desktop app pointed at it."title = "Add your people"[portal.enterprise.setup.signIn]-body = "Open http://your-server:8080 and sign in with admin / stirling. You'll be asked to choose a new password straight away."-bodyAirgap = "Open http://your-server:8080 and sign in with admin / stirling, choose a new password, then check /settings/adminPlan shows your licence as active."+body = "Open <code>http://your-server:8080</code> and sign in with <code>admin</code> / <code>stirling</code>. You'll be asked to choose a new password straight away."+bodyAirgap = "Open <code>http://your-server:8080</code> and sign in with <code>admin</code> / <code>stirling</code>, choose a new password, then check <code>/settings/adminPlan</code> shows your licence as active."title = "Sign in as the admin"[portal.errorBoundary]@@ -10704,14 +10695,14 @@ poNumber = "PO number"poNumberPlaceholder = "e.g. PO-10042"postalCode = "Postal code"postalCodePlaceholder = "94105"-posture = "Governance"-posture_count = "~{{count}} policies"+posture = "Automation"+posture_count = "{{count}} pipelines per PDF"posture_essentials = "Essentials"-posture_essentialsSub = "Classification + Sharing — the defaults"+posture_essentialsSub = "Classification and sharing"posture_governed = "Governed"-posture_governedSub = "Adds Security and Routing"+posture_governedSub = "Adds security and routing"posture_regulated = "Regulated"-posture_regulatedSub = "Every category — Compliance, Retention, Ingestion"+posture_regulatedSub = "Adds compliance, retention and ingestion"qbr = "Quarterly business reviews"qbrSub = "Your SE reviews usage and roadmap each quarter"raiseUsage = "Raise estimated usage"@@ -10751,7 +10742,7 @@ trainingSub = "Live sessions to get your team running"users = "Total users"usersPlaceholder = "e.g. 250"viewEula = "Read it"-volEstimated = "Estimated from {{count}} users (~2,000 PDFs each, including automation). Edit if you know better."+volEstimated = "Based on {{count}} users at about 2,000 PDFs each a year. If you know your own figure, enter it instead."volManual = "Using your figure. Re-estimate from your team size any time."volNoUsers = "Not sure? Enter your team size and we'll estimate it."volume = "Annual PDF volume"@@ -10770,7 +10761,7 @@ seats_other = "{{users}} agreed users + SSO / RBAC / audit"seatsUnset = "Users + SSO / RBAC / audit"support = "Dedicated SE / CSM"training = "Onboarding & training"-usage = "PDF processing — {{volume}} PDFs/yr at {{rate}}/PDF ({{posture}} posture)"+usage = "PDF processing — {{volume}} PDFs/yr at {{rate}}/PDF ({{posture}} automation)"[portal.procurement.documents]agreement = "Enterprise Agreement"diff --git a/frontend/src/editor/core/constants/selfHosting.ts b/frontend/src/editor/core/constants/selfHosting.tsindex 1e596a118b..55f54daf0e 100644--- a/frontend/src/editor/core/constants/selfHosting.ts+++ b/frontend/src/editor/core/constants/selfHosting.ts@@ -4,8 +4,17 @@ export type DockerImageTag = "latest" | "latest-fat" | "latest-ultra-lite";export const DOCKER_IMAGE = "docker.stirlingpdf.com/stirlingtools/stirling-pdf";-export const dockerRunCommand = (tag: DockerImageTag = "latest") =>- `docker run -d --name stirling-pdf -p 8080:8080 \\\n -v ./stirling-data:/configs \\\n ${DOCKER_IMAGE}:${tag}`;+/** `env` adds settings the server starts with, such as a licence key. */+export const dockerRunCommand = (+ tag: DockerImageTag = "latest",+ env: Record<string, string> = {},+) =>+ [+ "docker run -d --name stirling-pdf -p 8080:8080 \\",+ " -v ./stirling-data:/configs \\",+ ...Object.entries(env).map(([name, value]) => ` -e ${name}=${value} \\`),+ ` ${DOCKER_IMAGE}:${tag}`,+ ].join("\n");export const DOCKER_COMPOSE_FILE = `# Save as docker-compose.yml, then run: docker compose up -dservices:diff --git a/frontend/src/processor/proprietary/api/procurement.ts b/frontend/src/processor/proprietary/api/procurement.tsindex 9a62c68cb7..6c9e3ebef0 100644--- a/frontend/src/processor/proprietary/api/procurement.ts+++ b/frontend/src/processor/proprietary/api/procurement.ts@@ -196,7 +196,7 @@ export interface ProcurementSnapshot {export interface QuoteConfigInput {volume: number;users: number;- /** Policy posture (governance) as runs per PDF: Essentials 2, Governed 4, Regulated 7. */+ /** Automation posture as pipeline runs per PDF: Essentials 2, Governed 4, Regulated 7. */intensity: number;/** PDF-size tier multiplier on the rate: Compact 1.0, Standard 1.4, Heavy 2.4. */sizeMult: number;diff --git a/frontend/src/processor/proprietary/components/procurement/CalendlyInline.tsx b/frontend/src/processor/proprietary/components/procurement/CalendlyInline.tsxindex acc1fdcfaf..b2ee49ab28 100644--- a/frontend/src/processor/proprietary/components/procurement/CalendlyInline.tsx+++ b/frontend/src/processor/proprietary/components/procurement/CalendlyInline.tsx@@ -44,6 +44,35 @@ function buildUrl(base: string): string {return `${base}${sep}hide_event_type_details=1&background_color=${WIDGET_COLORS.background}&text_color=${WIDGET_COLORS.text}&primary_color=${WIDGET_COLORS.primary}`;}+// Origins the embed fetches from: the widget script, then the scheduler iframe.+const CALENDLY_ORIGINS = [+ "https://assets.calendly.com",+ "https://calendly.com",+];++function preconnect(origin: string): void {+ if (typeof document === "undefined") return;+ if (document.querySelector(`link[rel="preconnect"][href="${origin}"]`))+ return;+ const link = document.createElement("link");+ link.rel = "preconnect";+ link.href = origin;+ link.crossOrigin = "anonymous";+ document.head.appendChild(link);+}++/**+ * Open connections to Calendly and start fetching widget.js ahead of use, so the scheduler opens+ * without a cold fetch. Idempotent; a failure is left for the embed's own load to show as the+ * fallback link.+ */+export function warmCalendly(): void {+ CALENDLY_ORIGINS.forEach(preconnect);+ void loadScript({ src: CALENDLY_SCRIPT, id: "calendly-widget-script" }).catch(+ () => {},+ );+}+export function CalendlyInline({url = CALENDLY_URL,height = 760,diff --git a/frontend/src/processor/proprietary/components/procurement/DealPanels.tsx b/frontend/src/processor/proprietary/components/procurement/DealPanels.tsxnew file mode 100644index 0000000000..e6388cfdc4--- /dev/null+++ b/frontend/src/processor/proprietary/components/procurement/DealPanels.tsx@@ -0,0 +1,468 @@+import { useTranslation } from "react-i18next";+import { Button } from "@editor/ui";+import { Icon } from "@editor/ui/Icon";+import {+ FLOW_JOURNEY,+ type DealStage,+ type QuoteResult,+} from "@processor/api/procurement";+import { openApiUrl } from "@processor/api/externalUrl";+import type { ProcurementController } from "@processor/components/procurement/useProcurement";+import {+ daysLeft,+ longDate,+ money,+ trialLeftLabel,+} from "@processor/components/procurement/format";+import "@processor/views/Procurement.css";+import "@processor/views/Enterprise.css";++/** The trial's clock, and extending it while the deal is still at the trial stage. */+export function TrialPanel({+ trialStartedAt,+ trialEndsAt,+ extensionsUsed,+ maxExtensions,+ busy,+ onExtend,+}: {+ trialStartedAt: string | null;+ trialEndsAt: string;+ extensionsUsed: number;+ /** How many extensions the server allows; it enforces the cap. */+ maxExtensions: number;+ busy: boolean;+ onExtend?: () => void;+}) {+ const { t } = useTranslation();+ const ends = longDate(trialEndsAt);+ const maxed = extensionsUsed >= maxExtensions;+ const start = trialStartedAt ? new Date(trialStartedAt).getTime() : null;+ const end = new Date(trialEndsAt).getTime();+ const used =+ start != null && end > start+ ? Math.min(1, Math.max(0, (Date.now() - start) / (end - start)))+ : null;+ return (+ <div className="ent__aside">+ <span className="ent__aside-label">+ {t("portal.procurement.trial.title")}+ </span>+ <span+ className="ent__aside-figure"+ data-expired={daysLeft(trialEndsAt) === 0 || undefined}+ >+ {trialLeftLabel(t, trialEndsAt)}+ </span>+ {used != null && (+ <span className="ent__trial-bar" aria-hidden>+ <span style={{ width: `${used * 100}%` }} />+ </span>+ )}+ <p className="ent__text">+ {t("portal.procurement.trial.subtitle", { date: ends })}+ </p>+ {onExtend && (+ <>+ <p className="ent__hint">+ {maxed+ ? t("portal.procurement.trial.bodyMaxed")+ : t("portal.procurement.trial.body")}+ </p>+ <div className="ent__actions">+ <Button+ variant="tertiary"+ loading={busy}+ disabled={maxed}+ onClick={onExtend}+ >+ {maxed+ ? t("portal.procurement.trial.maxed")+ : t("portal.procurement.trial.extend")}+ </Button>+ </div>+ </>+ )}+ </div>+ );+}++const SERVICE_LEVEL_LABEL: Record<string, string> = {+ standard: "portal.procurement.builder.slStandard",+ priority: "portal.procurement.builder.slPriority",+ dedicated: "portal.procurement.builder.slDedicated",+};++/** The issued quote's figures, so the buyer can weigh it without opening the paper. */+export function QuotePanel({+ quote,+ downloading,+ onDownload,+}: {+ quote: QuoteResult;+ downloading: boolean;+ onDownload: () => void;+}) {+ const { t } = useTranslation();+ return (+ <div className="ent__aside ent__quote">+ <span className="ent__aside-label">+ {t("portal.enterprise.quotePanel", "Your quote")}+ {quote.quoteNumber && (+ <span className="ent__quote-number">{quote.quoteNumber}</span>+ )}+ </span>+ <span className="ent__aside-figure">+ {money(quote.annualNetMinor, quote.currency)}+ </span>+ <span className="ent__quote-caption">+ {t("portal.procurement.review.annual")}+ </span>+ <dl className="ent__facts">+ {/* A seat count of 0 means none was recorded. */}+ {quote.config.users > 0 && (+ <div>+ <dt>{t("portal.procurement.builder.users")}</dt>+ <dd>{quote.config.users.toLocaleString()}</dd>+ </div>+ )}+ <div>+ <dt>{t("portal.enterprise.deployment", "Deployment")}</dt>+ <dd>{t(`portal.procurement.setup.${quote.config.deployment}`)}</dd>+ </div>+ <div>+ <dt>{t("portal.procurement.builder.serviceLevel")}</dt>+ <dd>+ {SERVICE_LEVEL_LABEL[quote.config.serviceLevel]+ ? t(SERVICE_LEVEL_LABEL[quote.config.serviceLevel])+ : quote.config.serviceLevel}+ </dd>+ </div>+ </dl>+ <p className="ent__text">+ {t("portal.procurement.review.tcv", {+ years: quote.config.termYears,+ tcv: money(quote.tcvMinor, quote.currency),+ })}+ </p>+ <p className="ent__hint">+ {t("portal.procurement.review.renewal", {+ amount: money(quote.renewalAnnualNetMinor, quote.currency),+ pct: quote.cpiRatePct,+ })}+ </p>+ <div className="ent__actions">+ <Button variant="tertiary" loading={downloading} onClick={onDownload}>+ {t("portal.procurement.review.downloadCta")}+ </Button>+ {/* An accepted quote is a commitment, so its offer window no longer applies. */}+ {quote.validUntil && quote.status !== "accepted" && (+ <span className="ent__quote-valid">+ {t("portal.procurement.review.validUntil", {+ date: new Date(quote.validUntil).toLocaleDateString(undefined, {+ timeZone: "UTC",+ }),+ })}+ </span>+ )}+ </div>+ </div>+ );+}++/** A finished stage as it was left, to look back on without changing anything. */+export function StageReview({+ stage,+ controller,+}: {+ stage: DealStage;+ controller: ProcurementController;+}) {+ const { t } = useTranslation();+ const { data, latest } = controller;+ if (stage === "quote") {+ return latest ? (+ <QuotePanel+ quote={latest}+ downloading={controller.downloading}+ onDownload={controller.onDownloadPdf}+ />+ ) : null;+ }+ if (!data) return null;+ const company = latest?.config.businessName || data.businessName;+ const invoiceUrl = latest?.invoiceUrl;+ const { invoicePdf } = controller;+ return (+ <div className="ent__aside">+ {stage === "trial" && (+ <>+ <span className="ent__aside-label">+ {t("portal.enterprise.review.trialTitle", "Your trial")}+ </span>+ <dl className="ent__facts">+ <div>+ <dt>{t("portal.enterprise.review.started", "Started")}</dt>+ <dd>{longDate(data.trialStartedAt)}</dd>+ </div>+ <div>+ <dt>+ {t("portal.enterprise.review.trialEnds", "Trial end date")}+ </dt>+ <dd>{longDate(data.trialEndsAt)}</dd>+ </div>+ <div>+ <dt>{t("portal.enterprise.deployment", "Deployment")}</dt>+ <dd>{t(`portal.procurement.setup.${data.deployment}`)}</dd>+ </div>+ {data.seats > 0 && (+ <div>+ <dt>{t("portal.enterprise.review.people", "People")}</dt>+ <dd>{data.seats.toLocaleString()}</dd>+ </div>+ )}+ <div>+ <dt>+ {t("portal.enterprise.review.extensions", "Extensions used")}+ </dt>+ <dd>{data.trialExtensionsUsed}</dd>+ </div>+ </dl>+ </>+ )}+ {stage === "security" && (+ <>+ <span className="ent__aside-label">+ {t("portal.procurement.documents.agreement")}+ </span>+ <dl className="ent__facts">+ {data.agreementSignedVersion && (+ <div>+ <dt>{t("portal.enterprise.review.version", "Version")}</dt>+ <dd>{data.agreementSignedVersion}</dd>+ </div>+ )}+ {company && (+ <div>+ <dt>{t("portal.enterprise.review.company", "Company")}</dt>+ <dd>{company}</dd>+ </div>+ )}+ </dl>+ {data.agreementSignedVersion && (+ <div className="ent__actions">+ <Button+ variant="tertiary"+ loading={controller.downloadingAgreement}+ onClick={controller.onDownloadSignedAgreement}+ >+ {t("portal.procurement.documents.download")}+ </Button>+ </div>+ )}+ </>+ )}+ {stage === "procurement" && (+ <>+ <span className="ent__aside-label">+ {t("portal.procurement.documents.invoice")}+ </span>+ <p className="ent__text">+ {t(+ "portal.enterprise.review.paid",+ "Paid. Your invoice stays available here.",+ )}+ </p>+ <div className="ent__actions">+ {invoiceUrl && (+ <Button variant="tertiary" onClick={() => openApiUrl(invoiceUrl)}>+ {t("portal.enterprise.review.viewInvoice", "View invoice")}+ </Button>+ )}+ {invoicePdf && (+ <Button variant="tertiary" onClick={() => openApiUrl(invoicePdf)}>+ {t("portal.procurement.payment.downloadInvoice")}+ </Button>+ )}+ </div>+ </>+ )}+ </div>+ );+}++/** The hero's call to action: the deal's next step, or that it is live. */+export function HeroAction({+ controller,+ canManage,+ roleKnown,+ stage,+}: {+ controller: ProcurementController;+ canManage: boolean;+ roleKnown: boolean;+ stage: DealStage;+}) {+ const { t } = useTranslation();+ if (stage === "active") {+ return (+ <div className="ent__live">+ <Icon name="circle-check" size={22} />+ <div>+ <h2 className="ent__h3">{t("portal.procurement.live.title")}</h2>+ <p className="ent__text">+ {t("portal.procurement.live.description")}+ </p>+ </div>+ </div>+ );+ }+ if (!roleKnown) return null;+ return (+ <NextStep controller={controller} canManage={canManage} stage={stage} />+ );+}++/** What the buyer does next at this stage; a member follows along instead. */+function NextStep({+ controller,+ canManage,+ stage,+}: {+ controller: ProcurementController;+ canManage: boolean;+ stage: DealStage;+}) {+ const { t } = useTranslation();+ const { isIssued, busy, setOpen, latest, invoicePdf } = controller;+ const invoiceUrl = latest?.invoiceUrl;+ if (!canManage) {+ return (+ <p className="ent__note">+ {t(+ "portal.enterprise.memberDeal",+ "Your team leader runs this deal. You can follow its progress here.",+ )}+ </p>+ );+ }+ return (+ <div className="ent__actions">+ {stage === "trial" && (+ <Button variant="primary" size="md" onClick={() => setOpen(true)}>+ {t("portal.procurement.hero.ctaTrial")}+ </Button>+ )}+ {stage === "quote" &&+ (isIssued ? (+ <>+ <Button+ variant="primary"+ size="md"+ loading={busy}+ onClick={() => void controller.onAcceptQuote()}+ >+ {t("portal.procurement.review.acceptCta")}+ </Button>+ <Button variant="secondary" size="md" onClick={() => setOpen(true)}>+ {t("portal.procurement.hero.ctaReviewQuote")}+ </Button>+ </>+ ) : (+ <Button variant="primary" size="md" onClick={() => setOpen(true)}>+ {t("portal.procurement.hero.ctaQuote")}+ </Button>+ ))}+ {stage === "security" && (+ <Button variant="primary" size="md" onClick={() => setOpen(true)}>+ {t("portal.procurement.hero.ctaAgreement")}+ </Button>+ )}+ {stage === "procurement" && (+ <>+ {invoiceUrl && (+ <Button+ variant="primary"+ size="md"+ onClick={() => openApiUrl(invoiceUrl)}+ >+ {t("portal.procurement.payment.viewInvoice")}+ </Button>+ )}+ {invoicePdf && (+ <Button+ variant="secondary"+ size="md"+ onClick={() => openApiUrl(invoicePdf)}+ >+ {t("portal.procurement.payment.downloadInvoice")}+ </Button>+ )}+ <p className="ent__hint ent__next-hint">+ {t("portal.procurement.payment.description")}+ </p>+ </>+ )}+ </div>+ );+}++/** Where the deal stands; stages with something to open are buttons. */+export function StageTracker({+ currentIdx,+ viewingIdx,+ isLive,+ actionFor,+}: {+ currentIdx: number;+ /** A finished stage open for review, marked apart from where the deal stands. */+ viewingIdx: number | null;+ isLive: boolean;+ actionFor: (index: number) => (() => void) | undefined;+}) {+ const { t } = useTranslation();+ return (+ <ol+ className="ent__stages"+ aria-label={t("portal.enterprise.stagesLabel", "Progress")}+ >+ {FLOW_JOURNEY.map((s, index) => {+ const done = index < currentIdx || (isLive && index === currentIdx);+ const action = actionFor(index);+ const content = (+ <>+ <span className="ent__stage-dot">+ {done ? <Icon name="check" size={14} /> : index + 1}+ </span>+ <span className="ent__stage-label">{t(s.label)}</span>+ </>+ );+ return (+ <li+ key={s.stage}+ className="ent__stage"+ data-state={+ done ? "done" : index === currentIdx ? "current" : "next"+ }+ data-viewing={index === viewingIdx || undefined}+ aria-current={+ index === viewingIdx+ ? "page"+ : index === currentIdx+ ? "step"+ : undefined+ }+ >+ {action ? (+ <button type="button" className="ent__stage-btn" onClick={action}>+ {content}+ </button>+ ) : (+ content+ )}+ </li>+ );+ })}+ </ol>+ );+}diff --git a/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.css b/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.cssnew file mode 100644index 0000000000..85049259e8--- /dev/null+++ b/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.css@@ -0,0 +1,65 @@+/* The deployment choices stacked on the left, the chosen one's details beside them; one column+ when the form is too narrow for both. */+.ent-deploy-wrap {+ container-type: inline-size;+}++.ent-deploy-choice {+ display: grid;+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);+ gap: 0.75rem;+ align-items: stretch;+}++.ent-deploy-choice .portal-qb__opts {+ flex-direction: column;+ flex-wrap: nowrap;+}++.ent-deploy-choice .portal-qb__opt {+ flex: none;+ min-width: 0;+}++@container (max-width: 26rem) {+ .ent-deploy-choice {+ grid-template-columns: minmax(0, 1fr);+ }+}++.ent-deploy {+ padding: 0.875rem 1rem;+ border-radius: 9px;+ background: var(--c-surface-sunken);+ font-size: 0.8125rem;+ color: var(--c-text-muted);+}++.ent-deploy__tagline {+ margin: 0;+ font-weight: 600;+ color: var(--c-text);+}++.ent-deploy__points {+ display: flex;+ flex-direction: column;+ gap: 0.375rem;+ margin: 0.625rem 0 0;+ padding-left: 1.125rem;+}++.ent-deploy__more {+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ margin-top: 0.75rem;+ font-weight: 600;+ color: var(--c-accent-text);+ text-decoration: none;+}++.ent-deploy__more:hover {+ text-decoration: underline;+ text-underline-offset: 0.2em;+}diff --git a/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.stories.tsx b/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.stories.tsxnew file mode 100644index 0000000000..ee08736367--- /dev/null+++ b/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.stories.tsx@@ -0,0 +1,24 @@+import type { Meta, StoryObj } from "@storybook/react-vite";+import { DeploymentDetails } from "@processor/components/procurement/DeploymentDetails";++/** What each way to run Enterprise involves, as shown beside the choice in the trial setup. */+const meta: Meta<typeof DeploymentDetails> = {+ title: "Portal/Procurement/Deployment details",+ component: DeploymentDetails,+ parameters: { layout: "padded" },+ decorators: [+ (Story) => (+ <div style={{ maxWidth: "20rem" }}>+ <Story />+ </div>+ ),+ ],+};+export default meta;+type Story = StoryObj<typeof DeploymentDetails>;++export const StirlingCloud: Story = { args: { deployment: "cloud" } };++export const SelfHosted: Story = { args: { deployment: "selfhost" } };++export const AirGapped: Story = { args: { deployment: "airgap" } };diff --git a/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.tsx b/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.tsxnew file mode 100644index 0000000000..fe3514a5ed--- /dev/null+++ b/frontend/src/processor/proprietary/components/procurement/DeploymentDetails.tsx@@ -0,0 +1,105 @@+import { useTranslation } from "react-i18next";+import { Icon } from "@editor/ui/Icon";+import type { Deployment } from "@processor/api/procurement";+import { ENTERPRISE_DOCS } from "@processor/components/procurement/enterpriseDocs";+import "@processor/components/procurement/DeploymentDetails.css";++const DOCS: Record<Deployment, string> = {+ cloud: ENTERPRISE_DOCS.cloud,+ selfhost: ENTERPRISE_DOCS.server,+ airgap: ENTERPRISE_DOCS.offlineLicence,+};++/**+ * What the chosen way to run Enterprise involves, with a link to its docs, beside the choice in+ * the trial setup. Buyers meet the deployment question there, often without a technical background.+ */+export function DeploymentDetails({ deployment }: { deployment: Deployment }) {+ const { t } = useTranslation();++ const copy = {+ cloud: {+ tagline: t(+ "portal.enterprise.options.cloud.tagline",+ "Hosted for you, with nothing to install.",+ ),+ points: [+ t(+ "portal.enterprise.options.cloud.point1",+ "Your team signs in at stirling.com/app",+ ),+ t(+ "portal.enterprise.options.cloud.point2",+ "Runs on AWS, with stored files encrypted at rest",+ ),+ t(+ "portal.enterprise.options.cloud.point3",+ "Single sign-on through your own identity provider needs self-hosting",+ ),+ ],+ more: t("portal.enterprise.options.cloud.more", "Stirling Cloud docs"),+ },+ selfhost: {+ tagline: t(+ "portal.enterprise.options.selfhost.tagline",+ "On your own servers, on-premises or in your own cloud.",+ ),+ points: [+ t(+ "portal.enterprise.options.selfhost.point1",+ "Install with Docker, or the Helm chart on Kubernetes",+ ),+ t(+ "portal.enterprise.options.selfhost.point2",+ "Documents are processed on your own infrastructure",+ ),+ t(+ "portal.enterprise.options.selfhost.point3",+ "OAuth2, OIDC or SAML single sign-on",+ ),+ ],+ more: t("portal.enterprise.options.selfhost.more", "Self-hosting docs"),+ },+ airgap: {+ tagline: t(+ "portal.enterprise.options.airgap.tagline",+ "Self-hosted on a network with no internet access.",+ ),+ points: [+ t(+ "portal.enterprise.options.airgap.point1",+ "Activated with a licence file that works offline, not a key checked online",+ ),+ t(+ "portal.enterprise.options.airgap.point2",+ "Installs like self-hosted, from an image you bring across",+ ),+ t(+ "portal.enterprise.options.airgap.point3",+ "Sign-in stays inside your network",+ ),+ ],+ more: t("portal.enterprise.options.airgap.more", "Offline licence docs"),+ },+ }[deployment];++ return (+ <div className="ent-deploy" aria-live="polite">+ <p className="ent-deploy__tagline">{copy.tagline}</p>+ <ul className="ent-deploy__points">+ {copy.points.map((point) => (+ <li key={point}>{point}</li>+ ))}+ </ul>+ <a+ className="ent-deploy__more"+ href={DOCS[deployment]}+ target="_blank"+ rel="noopener noreferrer"+ >+ {copy.more}+ <Icon name="external-link" size={14} />+ </a>+ </div>+ );+}diff --git a/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.css b/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.cssdeleted file mode 100644index 88f3e3b95c..0000000000--- a/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.css+++ /dev/null@@ -1,114 +0,0 @@-/* The ways to run it, one slide at a time beside the trial panel. */-.ent__options {- margin-top: 2rem;- padding: 1.125rem 1.25rem 1rem;- border: 1px solid var(--c-border-subtle);- border-radius: var(--radius-lg, 12px);- background: var(--c-surface);-}--.ent__options-head {- display: flex;- align-items: center;- justify-content: space-between;- margin-bottom: 0.75rem;-}--.ent__options-eyebrow {- font-size: 0.75rem;- font-weight: 600;- letter-spacing: 0.04em;- text-transform: uppercase;- color: var(--c-text-subtle);-}--.ent__options-nav {- display: flex;- gap: 0.25rem;-}--/* Stacked in one cell, so the card holds the tallest slide's height. */-.ent__options-slides {- display: grid;-}--.ent__options-slide {- grid-area: 1 / 1;- visibility: hidden;- opacity: 0;- transition:- opacity 160ms ease,- visibility 0s linear 160ms;-}--.ent__options-slide[data-active] {- visibility: visible;- opacity: 1;- transition: opacity 160ms ease;-}--@media (prefers-reduced-motion: reduce) {- .ent__options-slide,- .ent__options-slide[data-active] {- transition: none;- }-}--.ent__options-title {- display: flex;- align-items: flex-start;- gap: 0.75rem;-}--.ent__options-title strong {- display: block;- font-size: 1rem;-}--.ent__options-title span:not(.ent__options-icon) {- display: block;- margin-top: 0.125rem;- font-size: 0.875rem;- color: var(--c-text-muted);-}--.ent__options-icon {- display: grid;- flex: none;- place-items: center;- width: 2.25rem;- height: 2.25rem;- border-radius: var(--radius-md, 8px);- background: var(--c-primary-subtle);- color: var(--c-accent-text);-}--.ent__options-points {- display: flex;- flex-direction: column;- gap: 0.375rem;- margin: 0.875rem 0 0;- padding-left: 1.125rem;- font-size: 0.875rem;- color: var(--c-text-muted);-}--.ent__options-more {- display: inline-flex;- align-items: center;- gap: 0.375rem;- margin-top: 0.875rem;- font-size: 0.875rem;- font-weight: 600;- color: var(--c-accent-text);- text-decoration: none;-}--.ent__options-more:hover {- text-decoration: underline;- text-underline-offset: 0.2em;-}--.ent__options-dots {- margin-top: 1rem;-}diff --git a/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.stories.tsx b/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.stories.tsxdeleted file mode 100644index 4bd64dd5c1..0000000000--- a/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.stories.tsx+++ /dev/null@@ -1,34 +0,0 @@-import type { Meta, StoryObj } from "@storybook/react-vite";-import { expect, userEvent, waitFor, within } from "storybook/test";-import { DeploymentOptions } from "@processor/components/procurement/DeploymentOptions";--/** The ways to run Enterprise, a slide each, as shown beside the trial panel on the landing page. */-const meta: Meta<typeof DeploymentOptions> = {- title: "Portal/Procurement/Deployment options",- component: DeploymentOptions,- parameters: { layout: "padded" },- decorators: [- (Story) => (- <div className="ent" style={{ height: "auto", maxWidth: "32rem" }}>- <Story />- </div>- ),- ],-};-export default meta;-type Story = StoryObj<typeof DeploymentOptions>;--export const StirlingCloud: Story = {};--export const AirGapped: Story = {- play: async ({ canvasElement }) => {- const canvas = within(canvasElement);- await userEvent.click(canvas.getByRole("button", { name: "Previous" }));- // The slide fades in, so it is only visible once the transition ends.- await waitFor(() =>- expect(- canvas.getByRole("link", { name: /Offline licence docs/ }),- ).toBeVisible(),- );- },-};diff --git a/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.tsx b/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.tsxdeleted file mode 100644index 5d1ae3fe60..0000000000--- a/frontend/src/processor/proprietary/components/procurement/DeploymentOptions.tsx+++ /dev/null@@ -1,189 +0,0 @@-import { useState } from "react";-import { useTranslation } from "react-i18next";-import { ActionIcon, CarouselDots } from "@editor/ui";-import { Icon, type IconName } from "@editor/ui/Icon";-import type { Deployment } from "@processor/api/procurement";-import { ENTERPRISE_DOCS } from "@processor/components/procurement/enterpriseDocs";-import "@processor/components/procurement/DeploymentOptions.css";--interface Option {- id: Deployment;- icon: IconName;- docs: string;-}--const OPTIONS: Option[] = [- { id: "cloud", icon: "cloud", docs: ENTERPRISE_DOCS.cloud },- { id: "selfhost", icon: "server", docs: ENTERPRISE_DOCS.server },- { id: "airgap", icon: "shield-check", docs: ENTERPRISE_DOCS.offlineLicence },-];--/**- * The ways to run Enterprise, one slide each with a link to its docs, for buyers who meet the- * deployment question at the start of the trial without a technical background.- *- * Every slide shares one grid cell, so the card holds the tallest one's height and the page does- * not jump between slides.- */-export function DeploymentOptions() {- const { t } = useTranslation();- const [index, setIndex] = useState(0);- const step = (by: number) =>- setIndex((i) => (i + by + OPTIONS.length) % OPTIONS.length);-- const copy = {- cloud: {- title: t("portal.enterprise.options.cloud.title", "Stirling Cloud"),- tagline: t(- "portal.enterprise.options.cloud.tagline",- "Hosted for you, with nothing to install.",- ),- points: [- t(- "portal.enterprise.options.cloud.point1",- "Your team signs in at stirling.com/app",- ),- t(- "portal.enterprise.options.cloud.point2",- "Runs on AWS, with stored files encrypted at rest",- ),- t(- "portal.enterprise.options.cloud.point3",- "Single sign-on through your own identity provider needs self-hosting",- ),- ],- more: t("portal.enterprise.options.cloud.more", "Stirling Cloud docs"),- },- selfhost: {- title: t("portal.enterprise.options.selfhost.title", "Self-hosted"),- tagline: t(- "portal.enterprise.options.selfhost.tagline",- "On your own servers, on-premises or in your own cloud.",- ),- points: [- t(- "portal.enterprise.options.selfhost.point1",- "Install with Docker, or the Helm chart on Kubernetes",- ),- t(- "portal.enterprise.options.selfhost.point2",- "Documents are processed on your own infrastructure",- ),- t(- "portal.enterprise.options.selfhost.point3",- "OAuth2, OIDC or SAML single sign-on",- ),- ],- more: t("portal.enterprise.options.selfhost.more", "Self-hosting docs"),- },- airgap: {- title: t("portal.enterprise.options.airgap.title", "Air-gapped"),- tagline: t(- "portal.enterprise.options.airgap.tagline",- "Self-hosted on a network with no internet access.",- ),- points: [- t(- "portal.enterprise.options.airgap.point1",- "Activated with a licence file that works offline, not a key checked online",- ),- t(- "portal.enterprise.options.airgap.point2",- "Installs like self-hosted, from an image you bring across",- ),- t(- "portal.enterprise.options.airgap.point3",- "Sign-in stays inside your network",- ),- ],- more: t("portal.enterprise.options.airgap.more", "Offline licence docs"),- },- };-- return (- <section- className="ent__options"- aria-roledescription="carousel"- aria-label={t("portal.enterprise.options.label", "Ways to run it")}- >- <div className="ent__options-head">- <span className="ent__options-eyebrow">- {t("portal.enterprise.options.label", "Ways to run it")}- </span>- <div className="ent__options-nav">- <ActionIcon- variant="quiet"- size="sm"- aria-label={t("portal.enterprise.options.previous", "Previous")}- onClick={() => step(-1)}- >- <Icon name="chevron-left" size={16} />- </ActionIcon>- <ActionIcon- variant="quiet"- size="sm"- aria-label={t("portal.enterprise.options.next", "Next")}- onClick={() => step(1)}- >- <Icon name="chevron-right" size={16} />- </ActionIcon>- </div>- </div>-- <div className="ent__options-slides" aria-live="polite">- {OPTIONS.map((option, i) => {- const c = copy[option.id];- const active = i === index;- return (- <div- key={option.id}- className="ent__options-slide"- data-active={active || undefined}- aria-hidden={!active}- inert={!active}- aria-roledescription="slide"- aria-label={t("portal.enterprise.options.slideOf", {- defaultValue: "{{n}} of {{total}}",- n: i + 1,- total: OPTIONS.length,- })}- >- <div className="ent__options-title">- <span className="ent__options-icon">- <Icon name={option.icon} size={18} />- </span>- <div>- <strong>{c.title}</strong>- <span>{c.tagline}</span>- </div>- </div>- <ul className="ent__options-points">- {c.points.map((point) => (- <li key={point}>{point}</li>- ))}- </ul>- <a- className="ent__options-more"- href={option.docs}- target="_blank"- rel="noopener noreferrer"- >- {c.more}- <Icon name="external-link" size={14} />- </a>- </div>- );- })}- </div>-- <CarouselDots- count={OPTIONS.length}- activeIndex={index}- onSelect={setIndex}- label={t("portal.enterprise.options.label", "Ways to run it")}- dotLabel={(i) => copy[OPTIONS[i].id].title}- className="ent__options-dots"- />- </section>- );-}diff --git a/frontend/src/processor/proprietary/components/procurement/ProcurementExtras.tsx b/frontend/src/processor/proprietary/components/procurement/ProcurementExtras.tsxindex df0832219e..c4afcab161 100644--- a/frontend/src/processor/proprietary/components/procurement/ProcurementExtras.tsx+++ b/frontend/src/processor/proprietary/components/procurement/ProcurementExtras.tsx@@ -6,10 +6,12 @@ import { Button } from "@editor/ui";import {DEPLOYMENTS,fetchLegalDocument,+ type Deployment,type TrialSetupDetails,} from "@processor/api/procurement";import { StepModalHeader } from "@processor/components/shared/StepModalHeader";import { CalendlyInline } from "@processor/components/procurement/CalendlyInline";+import { DeploymentDetails } from "@processor/components/procurement/DeploymentDetails";import { FlowModal } from "@processor/components/shared/FlowModal";import { useAsync } from "@processor/hooks/useAsync";import type { TrialDraft } from "@processor/components/procurement/trialDraft";@@ -339,8 +341,8 @@ export function TrialSetupForm({const { t } = useTranslation();const prefill = useProcurementPrefill();const [step, setStep] = useState(initial ? 1 : 0);- const [deployment, setDeployment] = useState<string>(- initial?.deployment ?? "cloud",+ const [deployment, setDeployment] = useState<Deployment>(+ () => DEPLOYMENTS.find((d) => d === initial?.deployment) ?? "cloud",);const [seats, setSeats] = useState(initial ? String(initial.seats) : String(prefill?.seats ?? ""),@@ -446,16 +448,21 @@ export function TrialSetupForm({/></Field><FieldGroup label={t("portal.procurement.setup.deployment")}>- <div className="portal-qb__opts portal-qb__opts--across">- {DEPLOYMENTS.map((d) => (- <OptionCard- key={d}- on={deployment === d}- title={t(`portal.procurement.setup.${d}`)}- sub={t(`portal.procurement.setup.${d}Sub`)}- onClick={() => setDeployment(d)}- />- ))}+ <div className="ent-deploy-wrap">+ <div className="ent-deploy-choice">+ <div className="portal-qb__opts">+ {DEPLOYMENTS.map((d) => (+ <OptionCard+ key={d}+ on={deployment === d}+ title={t(`portal.procurement.setup.${d}`)}+ sub={t(`portal.procurement.setup.${d}Sub`)}+ onClick={() => setDeployment(d)}+ />+ ))}+ </div>+ <DeploymentDetails deployment={deployment} />+ </div></div></FieldGroup></>diff --git a/frontend/src/processor/proprietary/components/procurement/SetupChecklist.css b/frontend/src/processor/proprietary/components/procurement/SetupChecklist.cssindex ab05c29ff0..89c6edb1e4 100644--- a/frontend/src/processor/proprietary/components/procurement/SetupChecklist.css+++ b/frontend/src/processor/proprietary/components/procurement/SetupChecklist.css@@ -88,6 +88,11 @@text-underline-offset: 0.2em;}+.ent-setup__inline-code {+ font-family: var(--font-mono);+ font-size: 0.92em;+}+/* Copy sits in the corner so the command keeps the full width. */.ent-setup__code {position: relative;diff --git a/frontend/src/processor/proprietary/components/procurement/SetupChecklist.test.tsx b/frontend/src/processor/proprietary/components/procurement/SetupChecklist.test.tsxindex d7cd6e822e..7ae33ff569 100644--- a/frontend/src/processor/proprietary/components/procurement/SetupChecklist.test.tsx+++ b/frontend/src/processor/proprietary/components/procurement/SetupChecklist.test.tsx@@ -11,6 +11,9 @@ vi.mock("react-i18next", () => ({String(vars?.[name] ?? ""),),}),+ // The copy as plain text, so tests read it the way the buyer does.+ Trans: ({ defaults }: { defaults: string }) =>+ defaults.split(/<\/?\w+>/).join(""),}));const render = (ui: ReactElement) =>diff --git a/frontend/src/processor/proprietary/components/procurement/SetupChecklist.tsx b/frontend/src/processor/proprietary/components/procurement/SetupChecklist.tsxindex f085fe7033..af8d787731 100644--- a/frontend/src/processor/proprietary/components/procurement/SetupChecklist.tsx+++ b/frontend/src/processor/proprietary/components/procurement/SetupChecklist.tsx@@ -1,5 +1,5 @@import { useRef, useState, type ReactNode } from "react";-import { useTranslation } from "react-i18next";+import { Trans, useTranslation } from "react-i18next";import { Button, Card } from "@editor/ui";import { Icon } from "@editor/ui/Icon";import { EDITOR_URL } from "@processor/auth/editorUrl";@@ -8,6 +8,7 @@ import { useCopyFeedback } from "@processor/hooks/useCopyFeedback";import { useEditorInstalled } from "@processor/hooks/useEditorInstalled";import {DOCKER_IMAGE,+ dockerRunCommand,type DockerImageTag,} from "@editor/constants/selfHosting";import type { Deployment } from "@processor/api/procurement";@@ -16,10 +17,9 @@ import "@processor/views/Procurement.css";import "@processor/components/procurement/SetupChecklist.css";const DOC = ENTERPRISE_DOCS;-const image = (tag: DockerImageTag) => `${DOCKER_IMAGE}:${tag}`;-const IMAGE = image("latest");/** Bundles the fonts an offline server cannot download. */-const FULL_IMAGE = image("latest-fat");+const FULL_TAG: DockerImageTag = "latest-fat";+const FULL_IMAGE = `${DOCKER_IMAGE}:${FULL_TAG}`;interface StepLink {label: string;@@ -30,7 +30,7 @@ interface StepLink {interface Step {id: string;title: string;- body: string;+ body: ReactNode;links: StepLink[];/** A command to copy, for steps run on the buyer's own machines. */code?: string;@@ -86,24 +86,29 @@ export function SetupChecklist({deployment === "selfhost" || deployment === "airgap" ? deployment : "cloud";const key = licenseKey ?? "YOUR-LICENCE-KEY";- const runCommand = (image: string, licence: string) =>- [- "docker run -d --name stirling-pdf -p 8080:8080 \\",- ' -v "$(pwd)/stirling/configs:/configs" \\',- ' -v "$(pwd)/stirling/logs:/logs" \\',- " -e SECURITY_ENABLELOGIN=true \\",- " -e PREMIUM_ENABLED=true \\",- ` -e PREMIUM_KEY=${licence} \\`,- ` ${image}`,- ].join("\n");+ const runCommand = (tag: DockerImageTag, licence: string) =>+ dockerRunCommand(tag, {+ SECURITY_ENABLELOGIN: "true",+ PREMIUM_ENABLED: "true",+ PREMIUM_KEY: licence,+ });++ // Copy naming addresses, paths or settings, which it marks <code> so they read as typed.+ const withCode = (key: string, defaults: string) => (+ <Trans+ i18nKey={key}+ defaults={defaults}+ components={{ code: <code className="ent-setup__inline-code" /> }}+ />+ );// The same first sign-in on any server the buyer runs: the default admin, then the licence.const signInStep: Step = {id: "signIn",title: t("portal.enterprise.setup.signIn.title", "Sign in as the admin"),- body: t(+ body: withCode("portal.enterprise.setup.signIn.body",- "Open http://your-server:8080 and sign in with admin / stirling. You'll be asked to choose a new password straight away.",+ "Open <code>http://your-server:8080</code> and sign in with <code>admin</code> / <code>stirling</code>. You'll be asked to choose a new password straight away.",),links: [],};@@ -119,7 +124,7 @@ export function SetupChecklist({},];- const peopleStep = (body: string): Step => ({+ const peopleStep = (body: ReactNode): Step => ({id: "people",title: t("portal.enterprise.setup.people.title", "Add your people"),body,@@ -193,7 +198,7 @@ export function SetupChecklist({: [],done: teamSize > 1,},- // No single sign-on step: on Stirling Cloud it needs self-hosting (see DeploymentOptions).+ // No single sign-on step: on Stirling Cloud it needs self-hosting (see DeploymentDetails).]: kind === "selfhost"? [@@ -207,7 +212,7 @@ export function SetupChecklist({"portal.enterprise.setup.install.body","Run this on your server. It starts Stirling with your licence applied, and the image includes OCR and office conversion. For larger teams, use Kubernetes.",),- code: runCommand(IMAGE, key),+ code: runCommand("latest", key),links: [{label: t(@@ -232,9 +237,9 @@ export function SetupChecklist({"portal.enterprise.setup.licence.title","Check your licence is active",),- body: t(+ body: withCode("portal.enterprise.setup.licence.body",- "Open http://your-server:8080/settings/adminPlan, where your Enterprise licence should show as active. Installed another way? Add the key under premium.key in settings.yml and restart.",+ "Open <code>http://your-server:8080/settings/adminPlan</code>, where your Enterprise licence should show as active. Installed another way? Add the key under <code>premium.key</code> in <code>settings.yml</code> and restart.",),links: [{@@ -247,9 +252,9 @@ export function SetupChecklist({],},peopleStep(- t(+ withCode("portal.enterprise.setup.people.bodySelfHosted",- "Create accounts at /settings/people, or connect your identity provider so your team signs in with their work accounts. They use Stirling in the browser at your server's address, or in the desktop app pointed at it.",+ "Create accounts at <code>/settings/people</code>, or connect your identity provider so your team signs in with their work accounts. They use Stirling in the browser at your server's address, or in the desktop app pointed at it.",),),]@@ -296,9 +301,9 @@ export function SetupChecklist({`docker pull ${FULL_IMAGE}`,`docker save -o stirling-pdf.tar ${FULL_IMAGE}`,"",- "# On the air-gapped server, with stirling-enterprise.lic in ./stirling/configs",+ "# On the air-gapped server, with stirling-enterprise.lic in ./stirling-data","docker load -i stirling-pdf.tar",- runCommand(FULL_IMAGE, "file:/configs/stirling-enterprise.lic"),+ runCommand(FULL_TAG, "file:/configs/stirling-enterprise.lic"),].join("\n"),links: [{@@ -319,15 +324,15 @@ export function SetupChecklist({},{...signInStep,- body: t(+ body: withCode("portal.enterprise.setup.signIn.bodyAirgap",- "Open http://your-server:8080 and sign in with admin / stirling, choose a new password, then check /settings/adminPlan shows your licence as active.",+ "Open <code>http://your-server:8080</code> and sign in with <code>admin</code> / <code>stirling</code>, choose a new password, then check <code>/settings/adminPlan</code> shows your licence as active.",),},peopleStep(- t(+ withCode("portal.enterprise.setup.people.bodyAirgap",- "Create accounts at /settings/people, or point Stirling at your internal identity provider so sign-in never leaves your network.",+ "Create accounts at <code>/settings/people</code>, or point Stirling at your internal identity provider so sign-in never leaves your network.",),),];diff --git a/frontend/src/processor/proprietary/components/procurement/quotePricing.ts b/frontend/src/processor/proprietary/components/procurement/quotePricing.tsindex a18a96f785..e3ad9f2f4c 100644--- a/frontend/src/processor/proprietary/components/procurement/quotePricing.ts+++ b/frontend/src/processor/proprietary/components/procurement/quotePricing.ts@@ -7,7 +7,7 @@*/import type { QuoteConfigInput, RateCard } from "@processor/api/procurement";-// Governance posture: the intensity (runs per PDF) fed to the committed-volume curve.+// Automation posture: the pipelines each PDF runs through, fed to the committed-volume curve.export const POSTURES = [{ intensity: 2, key: "essentials" },{ intensity: 4, key: "governed" },@@ -39,7 +39,7 @@ export function estimateVolume(users: number): number {: 0;}-/** Committed runs a year: PDFs times the policies each one runs through. */+/** Committed runs a year: PDFs times the pipelines each one runs through. */function runVolume(cfg: QuoteConfigInput): number {return Math.max(0, cfg.volume) * Math.max(1, cfg.intensity);}diff --git a/frontend/src/processor/proprietary/components/procurement/useProcurement.ts b/frontend/src/processor/proprietary/components/procurement/useProcurement.tsindex 175148ffa7..c2db30c7e6 100644--- a/frontend/src/processor/proprietary/components/procurement/useProcurement.ts+++ b/frontend/src/processor/proprietary/components/procurement/useProcurement.ts@@ -152,8 +152,8 @@ export function useProcurement(): ProcurementController {try {await fn();queryClient.setQueryData(snapshotKey, await fetchSnapshot());+ // The wallet is left to the page, which refreshes its server-side cache first.await Promise.all([- queryClient.invalidateQueries({ queryKey: qk.wallet(true) }),queryClient.invalidateQueries({ queryKey: qk.teamMy() }),queryClient.invalidateQueries({ queryKey: ["portal", "users"] }),]);diff --git a/frontend/src/processor/proprietary/mocks/handlers/procurementSaas.ts b/frontend/src/processor/proprietary/mocks/handlers/procurementSaas.tsindex 2ebbaa4e52..5492157bcb 100644--- a/frontend/src/processor/proprietary/mocks/handlers/procurementSaas.ts+++ b/frontend/src/processor/proprietary/mocks/handlers/procurementSaas.ts@@ -129,7 +129,7 @@ export function priceQuote(cfg: Cfg) {? "Regulated": intensity === 4? "Governed"- : `${intensity}-policy`;+ : `${intensity}-pipeline`;const deployName =cfg.deployment === "airgap"? "Air-gapped"diff --git a/frontend/src/processor/proprietary/views/Enterprise.test.tsx b/frontend/src/processor/proprietary/views/Enterprise.test.tsxindex 7359256287..0a6e7a884a 100644--- a/frontend/src/processor/proprietary/views/Enterprise.test.tsx+++ b/frontend/src/processor/proprietary/views/Enterprise.test.tsx@@ -21,6 +21,9 @@ vi.mock("react-i18next", () => ({typeof value === "string" ? value : key,i18n: { language: "en-US" },}),+ // The copy as plain text, so tests read it the way the buyer does.+ Trans: ({ defaults }: { defaults: string }) =>+ defaults.split(/<\/?\w+>/).join(""),}));const state = vi.hoisted(() => ({@@ -59,6 +62,10 @@ vi.mock("@processor/components/procurement/trialDraft", () => ({saveTrialDraft,takeTrialDraft: () => state.draft,}));+vi.mock("@processor/components/procurement/CalendlyInline", async (actual) => ({+ ...(await actual<object>()),+ warmCalendly: vi.fn(),+}));vi.mock("@processor/components/procurement/useProcurement", () => ({useProcurement: () => state.useProcurement(),diff --git a/frontend/src/processor/proprietary/views/Enterprise.tsx b/frontend/src/processor/proprietary/views/Enterprise.tsxindex dccb6f6d4f..3021933411 100644--- a/frontend/src/processor/proprietary/views/Enterprise.tsx+++ b/frontend/src/processor/proprietary/views/Enterprise.tsx@@ -7,13 +7,8 @@ import { Icon } from "@editor/ui/Icon";import { useAuth } from "@editor/auth";import { stripBasePath, withBasePath } from "@editor/constants/app";import { rememberPendingDestination } from "@editor/services/pendingDestination";-import {- FLOW_JOURNEY,- type DealStage,- type QuoteResult,-} from "@processor/api/procurement";+import { FLOW_JOURNEY, type DealStage } from "@processor/api/procurement";import { refreshWalletCache } from "@processor/api/billing";-import { openApiUrl } from "@processor/api/externalUrl";import { qk } from "@processor/queries/keys";import { walletQuery } from "@processor/queries/wallet";import { useLinkOptional } from "@processor/contexts/LinkContext";@@ -35,15 +30,17 @@ import {ScheduleCallModal,TrialSetupForm,} from "@processor/components/procurement/ProcurementExtras";-import { DeploymentOptions } from "@processor/components/procurement/DeploymentOptions";+import { warmCalendly } from "@processor/components/procurement/CalendlyInline";+import {+ HeroAction,+ QuotePanel,+ StageReview,+ StageTracker,+ TrialPanel,+} from "@processor/components/procurement/DealPanels";import { LicensePanel } from "@processor/components/procurement/ProcurementStages";import { SetupChecklist } from "@processor/components/procurement/SetupChecklist";-import {- daysLeft,- longDate,- money,- trialLeftLabel,-} from "@processor/components/procurement/format";+import { trialLeftLabel } from "@processor/components/procurement/format";import {saveTrialDraft,takeTrialDraft,@@ -195,6 +192,10 @@ function SignedIn() {}, [data, isLinked, queryClient]);const schedule = () => procurement.setExtra("schedule");+ // Every view of the page offers a call.+ useEffect(() => {+ warmCalendly();+ }, []);// While the trial starts from the saved answers the page stays on its placeholder rather than// flashing the form it is about to leave. Settled by the attempt ending as well as by an error:@@ -486,7 +487,6 @@ function Landing({ children }: { children: ReactNode }) {</li>))}</ul>- <DeploymentOptions /></section><Card padding="loose" className="ent__panel">{children}@@ -873,453 +873,3 @@ function Deal({</>);}--/** The trial's clock, and extending it while the deal is still at the trial stage. */-function TrialPanel({- trialStartedAt,- trialEndsAt,- extensionsUsed,- maxExtensions,- busy,- onExtend,-}: {- trialStartedAt: string | null;- trialEndsAt: string;- extensionsUsed: number;- /** How many extensions the server allows; it enforces the cap. */- maxExtensions: number;- busy: boolean;- onExtend?: () => void;-}) {- const { t } = useTranslation();- const ends = longDate(trialEndsAt);- const maxed = extensionsUsed >= maxExtensions;- const start = trialStartedAt ? new Date(trialStartedAt).getTime() : null;- const end = new Date(trialEndsAt).getTime();- const used =- start != null && end > start- ? Math.min(1, Math.max(0, (Date.now() - start) / (end - start)))- : null;- return (- <div className="ent__aside">- <span className="ent__aside-label">- {t("portal.procurement.trial.title")}- </span>- <span- className="ent__aside-figure"- data-expired={daysLeft(trialEndsAt) === 0 || undefined}- >- {trialLeftLabel(t, trialEndsAt)}- </span>- {used != null && (- <span className="ent__trial-bar" aria-hidden>- <span style={{ width: `${used * 100}%` }} />- </span>- )}- <p className="ent__text">- {t("portal.procurement.trial.subtitle", { date: ends })}- </p>- {onExtend && (- <>- <p className="ent__hint">- {maxed- ? t("portal.procurement.trial.bodyMaxed")- : t("portal.procurement.trial.body")}- </p>- <div className="ent__actions">- <Button- variant="tertiary"- loading={busy}- disabled={maxed}- onClick={onExtend}- >- {maxed- ? t("portal.procurement.trial.maxed")- : t("portal.procurement.trial.extend")}- </Button>- </div>- </>- )}- </div>- );-}--const SERVICE_LEVEL_LABEL: Record<string, string> = {- standard: "portal.procurement.builder.slStandard",- priority: "portal.procurement.builder.slPriority",- dedicated: "portal.procurement.builder.slDedicated",-};--/** The issued quote's figures, so the buyer can weigh it without opening the paper. */-function QuotePanel({- quote,- downloading,- onDownload,-}: {- quote: QuoteResult;- downloading: boolean;- onDownload: () => void;-}) {- const { t } = useTranslation();- return (- <div className="ent__aside ent__quote">- <span className="ent__aside-label">- {t("portal.enterprise.quotePanel", "Your quote")}- {quote.quoteNumber && (- <span className="ent__quote-number">{quote.quoteNumber}</span>- )}- </span>- <span className="ent__aside-figure">- {money(quote.annualNetMinor, quote.currency)}- </span>- <span className="ent__quote-caption">- {t("portal.procurement.review.annual")}- </span>- <dl className="ent__facts">- {/* A seat count of 0 means none was recorded. */}- {quote.config.users > 0 && (- <div>- <dt>{t("portal.procurement.builder.users")}</dt>- <dd>{quote.config.users.toLocaleString()}</dd>- </div>- )}- <div>- <dt>{t("portal.enterprise.deployment", "Deployment")}</dt>- <dd>{t(`portal.procurement.setup.${quote.config.deployment}`)}</dd>- </div>- <div>- <dt>{t("portal.procurement.builder.serviceLevel")}</dt>- <dd>- {SERVICE_LEVEL_LABEL[quote.config.serviceLevel]- ? t(SERVICE_LEVEL_LABEL[quote.config.serviceLevel])- : quote.config.serviceLevel}- </dd>- </div>- </dl>- <p className="ent__text">- {t("portal.procurement.review.tcv", {- years: quote.config.termYears,- tcv: money(quote.tcvMinor, quote.currency),- })}- </p>- <p className="ent__hint">- {t("portal.procurement.review.renewal", {- amount: money(quote.renewalAnnualNetMinor, quote.currency),- pct: quote.cpiRatePct,- })}- </p>- <div className="ent__actions">- <Button variant="tertiary" loading={downloading} onClick={onDownload}>- {t("portal.procurement.review.downloadCta")}- </Button>- {/* An accepted quote is a commitment, so its offer window no longer applies. */}- {quote.validUntil && quote.status !== "accepted" && (- <span className="ent__quote-valid">- {t("portal.procurement.review.validUntil", {- date: new Date(quote.validUntil).toLocaleDateString(undefined, {- timeZone: "UTC",- }),- })}- </span>- )}- </div>- </div>- );-}--/** A finished stage as it was left, to look back on without changing anything. */-function StageReview({- stage,- controller,-}: {- stage: DealStage;- controller: ProcurementController;-}) {- const { t } = useTranslation();- const { data, latest } = controller;- if (stage === "quote") {- return latest ? (- <QuotePanel- quote={latest}- downloading={controller.downloading}- onDownload={controller.onDownloadPdf}- />- ) : null;- }- if (!data) return null;- const company = latest?.config.businessName || data.businessName;- const invoiceUrl = latest?.invoiceUrl;- const { invoicePdf } = controller;- return (- <div className="ent__aside">- {stage === "trial" && (- <>- <span className="ent__aside-label">- {t("portal.enterprise.review.trialTitle", "Your trial")}- </span>- <dl className="ent__facts">- <div>- <dt>{t("portal.enterprise.review.started", "Started")}</dt>- <dd>{longDate(data.trialStartedAt)}</dd>- </div>- <div>- <dt>- {t("portal.enterprise.review.trialEnds", "Trial end date")}- </dt>- <dd>{longDate(data.trialEndsAt)}</dd>- </div>- <div>- <dt>{t("portal.enterprise.deployment", "Deployment")}</dt>- <dd>{t(`portal.procurement.setup.${data.deployment}`)}</dd>- </div>- {data.seats > 0 && (- <div>- <dt>{t("portal.enterprise.review.people", "People")}</dt>- <dd>{data.seats.toLocaleString()}</dd>- </div>- )}- <div>- <dt>- {t("portal.enterprise.review.extensions", "Extensions used")}- </dt>- <dd>{data.trialExtensionsUsed}</dd>- </div>- </dl>- </>- )}- {stage === "security" && (- <>- <span className="ent__aside-label">- {t("portal.procurement.documents.agreement")}- </span>- <dl className="ent__facts">- {data.agreementSignedVersion && (- <div>- <dt>{t("portal.enterprise.review.version", "Version")}</dt>- <dd>{data.agreementSignedVersion}</dd>- </div>- )}- {company && (- <div>- <dt>{t("portal.enterprise.review.company", "Company")}</dt>- <dd>{company}</dd>- </div>- )}- </dl>- {data.agreementSignedVersion && (- <div className="ent__actions">- <Button- variant="tertiary"- loading={controller.downloadingAgreement}- onClick={controller.onDownloadSignedAgreement}- >- {t("portal.procurement.documents.download")}- </Button>- </div>- )}- </>- )}- {stage === "procurement" && (- <>- <span className="ent__aside-label">- {t("portal.procurement.documents.invoice")}- </span>- <p className="ent__text">- {t(- "portal.enterprise.review.paid",- "Paid. Your invoice stays available here.",- )}- </p>- <div className="ent__actions">- {invoiceUrl && (- <Button variant="tertiary" onClick={() => openApiUrl(invoiceUrl)}>- {t("portal.enterprise.review.viewInvoice", "View invoice")}- </Button>- )}- {invoicePdf && (- <Button variant="tertiary" onClick={() => openApiUrl(invoicePdf)}>- {t("portal.procurement.payment.downloadInvoice")}- </Button>- )}- </div>- </>- )}- </div>- );-}--/** The hero's call to action: the deal's next step, or that it is live. */-function HeroAction({- controller,- canManage,- roleKnown,- stage,-}: {- controller: ProcurementController;- canManage: boolean;- roleKnown: boolean;- stage: DealStage;-}) {- const { t } = useTranslation();- if (stage === "active") {- return (- <div className="ent__live">- <Icon name="circle-check" size={22} />- <div>- <h2 className="ent__h3">{t("portal.procurement.live.title")}</h2>- <p className="ent__text">- {t("portal.procurement.live.description")}- </p>- </div>- </div>- );- }- if (!roleKnown) return null;- return (- <NextStep controller={controller} canManage={canManage} stage={stage} />- );-}--/** What the buyer does next at this stage; a member follows along instead. */-function NextStep({- controller,- canManage,- stage,-}: {- controller: ProcurementController;- canManage: boolean;- stage: DealStage;-}) {- const { t } = useTranslation();- const { isIssued, busy, setOpen, latest, invoicePdf } = controller;- const invoiceUrl = latest?.invoiceUrl;- if (!canManage) {- return (- <p className="ent__note">- {t(- "portal.enterprise.memberDeal",- "Your team leader runs this deal. You can follow its progress here.",- )}- </p>- );- }- return (- <div className="ent__actions">- {stage === "trial" && (- <Button variant="primary" size="md" onClick={() => setOpen(true)}>- {t("portal.procurement.hero.ctaTrial")}- </Button>- )}- {stage === "quote" &&- (isIssued ? (- <>- <Button- variant="primary"- size="md"- loading={busy}- onClick={() => void controller.onAcceptQuote()}- >- {t("portal.procurement.review.acceptCta")}- </Button>- <Button variant="secondary" size="md" onClick={() => setOpen(true)}>- {t("portal.procurement.hero.ctaReviewQuote")}- </Button>- </>- ) : (- <Button variant="primary" size="md" onClick={() => setOpen(true)}>- {t("portal.procurement.hero.ctaQuote")}- </Button>- ))}- {stage === "security" && (- <Button variant="primary" size="md" onClick={() => setOpen(true)}>- {t("portal.procurement.hero.ctaAgreement")}- </Button>- )}- {stage === "procurement" && (- <>- {invoiceUrl && (- <Button- variant="primary"- size="md"- onClick={() => openApiUrl(invoiceUrl)}- >- {t("portal.procurement.payment.viewInvoice")}- </Button>- )}- {invoicePdf && (- <Button- variant="secondary"- size="md"- onClick={() => openApiUrl(invoicePdf)}- >- {t("portal.procurement.payment.downloadInvoice")}- </Button>- )}- <p className="ent__hint ent__next-hint">- {t("portal.procurement.payment.description")}- </p>- </>- )}- </div>- );-}--/** Where the deal stands; stages with something to open are buttons. */-function StageTracker({- currentIdx,- viewingIdx,- isLive,- actionFor,-}: {- currentIdx: number;- /** A finished stage open for review, marked apart from where the deal stands. */- viewingIdx: number | null;- isLive: boolean;- actionFor: (index: number) => (() => void) | undefined;-}) {- const { t } = useTranslation();- return (- <ol- className="ent__stages"- aria-label={t("portal.enterprise.stagesLabel", "Progress")}- >- {FLOW_JOURNEY.map((s, index) => {- const done = index < currentIdx || (isLive && index === currentIdx);- const action = actionFor(index);- const content = (- <>- <span className="ent__stage-dot">- {done ? <Icon name="check" size={14} /> : index + 1}- </span>- <span className="ent__stage-label">{t(s.label)}</span>- </>- );- return (- <li- key={s.stage}- className="ent__stage"- data-state={- done ? "done" : index === currentIdx ? "current" : "next"- }- data-viewing={index === viewingIdx || undefined}- aria-current={- index === viewingIdx- ? "page"- : index === currentIdx- ? "step"- : undefined- }- >- {action ? (- <button type="button" className="ent__stage-btn" onClick={action}>- {content}- </button>- ) : (- content- )}- </li>- );- })}- </ol>- );-}