AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(web): show sample data on the pages a plan has not unlocked (#15564)
Ahmad Tash0d5e080078ef
diff --git a/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.md b/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.mdindex 1bc5ab820d3..a36376c7cd0 100644--- a/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.md+++ b/brain/knowledge/decisions/000035-platform-admin-is-fifteen-pages-derived-from-one-registry.md@@ -173,13 +173,20 @@ fade** read as one surface but revealed only the top of a page and cut a form mifound products split between crisp-and-labelled and fade-an-empty-shell, and none sampling a form, sothere is no direct precedent to defer to here.-**The sample content is live, not inert.** The earlier call here was the opposite: `pointer-events: none`-on the region, filters and pagination disabled, one live CTA, on the grounds that wiring the controls to-the fixtures means a second implementation of every filter for customers who have not paid. That is-reversed. The fixtures already live in the browser, so client-side filtering and sorting of eight rows is-the cheap half, and a disabled toolbar teaches nobody what the feature does. The cost accepted is that a-locked write control looks completely ordinary until it is pressed: a person will occasionally press Save-expecting it to save. A visibly disabled Save was the alternative and it cannot show what the plan buys.+**The sample content is inert, and that is load bearing.** An "explore freely, upgrade on write" version+was designed, where filters filter and sorting sorts against the fixtures and only a write is refused. It+was not built. What ships ghosts the whole region at a quarter opacity and refuses every interaction,+because the fixtures are rendered by the real components: the controls in there are the live ones, wired+to the live mutations.++**Ghosting is not withholding.** `LockedFeatureGuard` returned a teaser *instead of* its children, so+nothing was mounted. `FeatureSample` mounts them and dims them, which is what makes the preview worth+looking at and also what puts live controls in the page. `aria-hidden` and `pointer-events: none` do not+remove anything from the tab order, so Tab reached those controls and Enter activated them, and a+portalled dialog then rendered *outside* the ghosted subtree at full opacity. `inert` is the attribute that+actually removes a subtree from focus, pointer and accessibility handling; `pointer-events: none` stays+underneath it only as the fallback for browsers without it. Treat the server as a backstop you have not+verified rather than one you have, and never reintroduce interactivity here without re-deciding this.Sample data is **generated in the browser and never crosses the API**. A locked page skips its plan-gatedquery outright rather than letting it answer 402, and the endpoints keep refusing. Serving fabricated rows@@ -313,9 +320,12 @@ guard before giving any surface an overlay.that already exist, so the diff is reviewable as pure refactor with identical screenshots, and thederivation is proven against the IA everyone knows before the data changes under it.-**The quiet Community treatment retires `RequestTrial` from platform admin**, which is currently the only-in-product path from a self-hosted install to sales, feeding `activepieces.com/sales` from 26 feature keys.-That is a growth decision as much as a design one and was taken with that understood.+**The quiet Community treatment was reversed in review: `RequestTrial` stays.** Retiring it would have+closed the only in-product path from a self-hosted install to sales, feeding `activepieces.com/sales` from+26 feature keys, and doing that inside a design refactor made it a growth decision smuggled in as one. Both+locked surfaces render it again on Community, gated by `showContactSales`, which only the billing shell+sets to `false` exactly as before. Each registry teaser therefore carries the `featureKey` the sales page+expects; a surface with no teaser shows no form rather than one tagged with the wrong feature.Old deep links must redirect. 22 items becoming 15 means eleven redirects on top of the fivethat exist, and `docs/docs.json` mirrors this IA across about twenty `admin-guide` pages, so a rename lands@@ -393,9 +403,11 @@ sign-in enforcement returns early on that edition anyway.web app already calls it for the test-destination flow. Reuse it there; only the other locked surfaces needfixtures written by hand.-**Community keeps its quiet copy inside the loud treatment.** It sees the same sample content, but the-strip names the feature as Enterprise with a docs link in place of the upgrade button, so the open-source-product still avoids a sales button on a dozen pages.+**Community gets its own call to action inside the loud treatment.** It sees the same sample content, but+where paid editions show `Upgrade to {tier}` and an `Included with the {tier} plan and above.` footer,+Community gets Contact Sales above a docs link, because a self-hosted install has no plan to buy in-app.+The tier is named only on the paid branch, so a Community reader is told what the feature is but never+which plan it belongs to.**Nothing renders the full-page teaser once all nine are sampled.** `LockedFeatureGuard` and the page-level`FeatureTeaser` lose their last callers in platform admin, and `overlay: true` in the registry is replaceddiff --git a/brain/knowledge/engineering/web-feature-anatomy.md b/brain/knowledge/engineering/web-feature-anatomy.mdindex 3067340f59c..8f933b3efd0 100644--- a/brain/knowledge/engineering/web-feature-anatomy.md+++ b/brain/knowledge/engineering/web-feature-anatomy.md@@ -50,6 +50,8 @@ Routes are registered in `app/routes/project-routes.tsx`, composed from `ProjectThe page component itself is `React.lazy()`-imported. `requiredPermissions` takes a single `Permission` or an array. Guards live in `app/guards/` — `permission-guard.tsx`, `flag-route-guard.tsx`, `project-route-wrapper.tsx`.+The platform-admin tree is a different shape and does not use any of that. `app/routes/platform-routes.tsx` is a flat array of hand-written entries, each repeating `PlatformLayout` > `PageTitle` > `SuspenseWrapper` by hand, with no React Router layout route and no `Outlet`. The admin check is not a guard in `app/guards/` either: `useIsPlatformAdmin()` is called inside `PlatformLayout` itself, which renders `<Navigate to="/" />` when it fails. So the guard holds only because every single route remembers to wrap in that layout, and a new admin route that forgets it is reachable by any logged-in user. The nav is a literal in one function, `PlatformSidebar` in `app/components/sidebar/platform/index.tsx`, so a route and its nav entry are edited in two unconnected places.+## Flags, gating, translations- Feature flags: `flagsHooks.useFlag()`, or `<FlagGuard>` / `flag-route-guard.tsx` for whole routes.@@ -68,10 +70,17 @@ changes the code under all three at once. Comparing editions and comparing brancgesture, and the give-away is a UI that looks a release behind on every port at once rather than on one.Read the edition off `/api/v1/flags`, not off the port you think you started.-Verify with `npx turbo run lint --filter=web`, or `npm run lint-dev` for the whole repo.+Verify with `npx turbo run lint --filter=web`, or `npm run lint-dev` for the whole repo. Run it from+`packages/web` or through turbo, never `npx eslint --fix <paths>` from the repo root: the root resolves a+different config, reports thousands of errors against files it should not be linting, and `--fix` rewrites+every one it touches. One such run reformatted 84 files that the change had never touched, and the only+way back was to stash the handful of intended edits, `git checkout` the package, and restore them.## Gotchas+- **A disabled TanStack query keeps `isPending: true` forever, so a skeleton driven by it never resolves.** `enabled: false` means "has no data and is not fetching", and `isPending` only reports the first half — the spinner spins for the life of the page. Drive loading UI off `isLoading` (`isPending && isFetching`), which is false while disabled. This bites hardest on the plan-gated queries the repo requires an `enabled: platform.plan.<flag>` on: every one of them is permanently pending for a platform without the feature. Also decide what the surface shows in that state — a count rendered from `data ?? 0` reads as a real zero, when the honest answer is that the feature is not on the plan.+- **The `showcase/*.mp4` upsell videos on the CDN are all from 2024 and show the retired Admin Console.** `cdn.activepieces.com/videos/showcase/` holds seven of them (projects, templates, pieces, appearance, api-keys, alerts, flow-issues), last touched March-June 2024, and every frame is the old sidebar, the old tables and the old purple buttons. `FeatureTeaser` renders whatever `videoUrl`/`lockVideoUrl` it is handed, and the Templates locked page still passes `templates.mp4`, so a customer on the paywall watches a product that no longer exists. Do not reach for these when building an upsell surface — either reshoot or leave the video out. Pull a frame with ffmpeg before trusting any CDN asset whose name sounds right.+- **`Button` tightens its own horizontal padding when a direct child is an `<svg>`, and the animated icons defeat it.** Every size variant carries a `has-[>svg]:px-*` pair (`sm` is `px-2.5 has-[>svg]:px-2`, so 10px normally and 8px with an icon) to stop an icon button reading as over-padded. The components in `components/icons/` wrap their `motion.svg` in a `<div>` to own the hover handlers, so `has-[>svg]` never matches and any `AnimatedIconButton` silently keeps the wider padding. Two buttons meant to look alike will differ by 2px a side the moment one uses a bare lucide icon and the other an animated one, so check the computed padding before assuming a diff caused it. To match the animated width deliberately, pass `cn('has-[>svg]:px-2.5', className)` — `Button` runs `cn(buttonVariants({ ..., className }))`, so tailwind-merge drops the variant's own value rather than leaving a specificity fight with `:has()`.- **A `packages/web` test runs in the `node` environment by default, so importing anything that touches `window` at module load fails at collection.** `vitest.config.ts` sets `environment: 'node'`; ~26 suites opt into a DOM with a `// @vitest-environment jsdom` docblock on line 1. The failure is a bare `ReferenceError: window is not defined` pointing at a *transitive* import (`embed-provider.tsx` reading `window.opener`, reached via `@/features/projects`), not at the test — so read the stack, don't hunt in your own file. Missing the docblock is why `chunk-reducer.test.ts` was red for as long as it was: CI did not run the web suite at all, so nothing surfaced it.- **Clicking through a Radix/cmdk component in a jsdom test needs the React root mounted on `document.body`, or the click never reaches React.** `createRoot(container)` attaches React's delegated listeners to `container`, but Radix `Popover` portals its content to `document.body` — a sibling of a nested root div — so synthetic events bubble body-ward, away from the listener. Items are queryable in the DOM and everything *looks* wired: the handler simply never runs, the assertion passes vacuously, and nothing tells you. `createRoot(document.body)` puts the portal inside the root container and the same dispatch fires. Three shims are needed first, each surfacing as an unrelated-looking error: `ResizeObserver` (cmdk, at mount), `Element.prototype.scrollIntoView` (cmdk, on open), and `PointerEvent` (absent in jsdom — alias it to `MouseEvent`). **And a throw inside an event handler is not a test failure.** React error boundaries only catch render/lifecycle errors, so an event-handler `TypeError` is re-thrown outside the act() call: `expect(...).toThrow()` sees nothing, the suite reports *passed*, and the only trace is vitest's `Unhandled Errors` block after the summary — which is easy to scroll past and which a `grep` for `passed|failed` hides completely. Grep the run for `Unhandled` too, and read that block as a failure. This is exactly how a crash in the multi-select property stayed invisible to a 101/101-green suite.- **A panel that hand-rolls its draft state gets none of the form validation the rest of the app assumes.** react-hook-form + `zodResolver` is what surfaces `formErrors.required` and friends; a `useState` draft with a Save button has no schema, so the usual mistake is to *substitute* a fallback for an empty field (`name.trim().length > 0 ? name.trim() : existing.name`) instead of rejecting it. That reads as a silent failure: the request succeeds, the old value returns, and nothing explains why. When a surface cannot use react-hook-form, derive the invalid state, render the message next to the field, and disable the submit — do not paper over the empty value. Bit the AI Center key-detail panel while its sibling connect dialog, on a zod resolver, was correct. The second failure mode is that such a draft never resyncs: seeded once from a prop, it outlives any refetch of the row it mirrors, so a mutation that changes the row without changing its `key` (the AI Center replaces a key's credentials, and the panel is keyed on the config id) leaves the draft describing the old row — phantom "unsaved changes", and a save that reverts what the mutation just wrote. Bump a version segment into the `key` at the site that performs the mutation rather than diffing props inside the panel: TanStack Query hands back a new object identity on every refetch, so a naive identity comparison discards the admin's unsaved edits on a window refocus.@@ -84,11 +93,13 @@ Verify with `npx turbo run lint --filter=web`, or `npm run lint-dev` for the who- **`api.isApError` throws on any error that has no response.** It reads `(error.response?.data as ApErrorParams).code` — optional-chaining the `response` but then dereferencing `.code` on the `undefined` that comes back, so a network failure, a timeout, or a CORS rejection raises a `TypeError` from inside whatever error handler called it. `queryClient`'s `mutationCache.onError` calls it unguarded on every mutation error, so a mutation that fails offline crashes there rather than showing its toast. When you need the `ApErrorParams` code on a path that can see transport failures, read it defensively (`(error.response?.data as ApErrorParams | undefined)?.code`) instead of reaching for the helper.+- **`refetch()` ignores `enabled`, so a retry handler walks straight through a plan gate.** `enabled: platform.plan.<flag>` stops the automatic fetch and nothing else; a manual `refetch()` fires the request whatever the flag says. A combined retry is where this bites, because the handler usually refetches every query the section draws from: on Connections the overview's Needs-attention retry called `refetchGlobal()` unconditionally, so a platform without Global Connections that hit Retry on an unrelated *project*-connections failure sent a guaranteed 402 to the gated endpoint. Nothing showed, since the error state was already gated on the flag, so the only trace is the failed request and the Sentry report behind it. The fix that generalises is to retry only what actually failed (`...(isError ? [refetch()] : [])`) rather than everything the section reads: the already-gated error flag then keeps the gated refetch unreachable, and a healthy query stops being re-requested because its neighbour broke. Read the repo's `enabled: platform.plan.<flag>` rule as covering both halves, the declaration and every hand-written refetch.- **`isLoading` is false while a failed query is retrying, so a retry button gated on it looks dead.** React Query sets `isLoading = isPending && isFetching`; once a query has errored its status is `error`, not `pending`, so `refetch()` raises only `isFetching`. Any skeleton or spinner keyed on `isLoading` therefore never fires on a retry — the user clicks and nothing visibly happens until the request resolves. `DataFetchErrorState` handles this itself rather than pushing `isFetching` out to every caller: it awaits whatever `onRetry` returns and drives the `Button`'s own `loading` prop, which is also the only option that works on the surfaces that have no skeleton branch to reuse. A retry wired to `invalidateQueries` needs the promise returned (`return Promise.all([...])`), or the spinner flashes for a single tick.- **`useWarnBeforeLosingChanges`'s `standDown` ref has to be set *after* the destructive request succeeds, not before it.** `components/custom/leave-without-saving.tsx` guards a dirty panel against navigation and `beforeunload`; `standDown` is how a deliberate exit (deleting the thing being edited) avoids prompting on its own way out. Setting it before `await`ing the delete disarms the guard for the whole request, so a refresh or tab close mid-flight discards the draft silently — and if the delete then fails, the row is still there and the edits are not. A `finally` that restores the ref does not help: the window has already passed. The ordering only works if the mutation and the navigation are separable, so the panel can stand down between them — keep the delete prop to the mutation alone and let the panel call its own `onBack`, rather than handing it one callback that does both.- **`Button`'s `keyboardShortcut` does not stop firing while the button is loading, and its listener lags a render behind.** Two separate gaps in `components/ui/button.tsx`. The element gets `disabled={disabled || loading}`, but `useKeyboardShortcut` was handed the raw `disabled` prop, so a button mid-request still ran its handler on ⌘/Ctrl+key — latent for years because every caller before the AI Center Save button was a non-loading `variant="outline"` button. Fixing that still leaves a window: the listener is registered in a passive effect, which runs after paint, so between a click and the effect re-running the old closure keeps `disabled=false`. Anything whose handler must not run twice (a mutation) needs its own guard set synchronously inside the handler — a ref, not a `disabled` prop — because no prop can close an effect-timing window. Separately, `Shortcut` renders in `text-muted-foreground`, which is invisible on a filled button; `Button` now tints it per variant, so pass nothing.- **Exported types and constants belong at the *end* of the file**, after the components and logic. Reading a file should start with what it does, not its type declarations.+- **The lock icon on a platform-admin nav item is decorative, and paid gating is done four different ways behind it.** `ApSidebarItem` renders a `LockKeyhole` when `item.locked`, but the click handler ignores `locked` entirely and navigates anyway, so the real gate is always whatever the destination page does. What that page does is not consistent: twelve pages wrap their whole body in `LockedFeatureGuard`, Pieces instead keeps the page fully usable under a `LockedAlert` banner, the branding fields in `setup/general` only set `disabled` with no explanation and no upgrade path at all, and AI Center gates on `PlatformRole.ADMIN` rather than a plan flag (`aiProvidersEnabled` gates the connect button inside it, not the page). Two of the thirteen locked nav items have no in-page hook at all. So reading the sidebar tells you a feature is paid but not what the user will actually meet, and "remove the locks" is a smaller change than it looks while "make gating consistent" is a much larger one. The active-item check is `pathname.startsWith(item.to)` with no `?tab=` awareness, so folding pages into tabs needs the `isActive` override that prop already offers and the platform sidebar never passes.- **The web has two independent "something went wrong" surfaces, and they cover different failures.** `GlobalErrorBoundary` (`app/components/global-error-boundary.tsx`) is a React error boundary: it catches *render* crashes and replaces the page with a reload/go-home fallback. It structurally cannot see a React Query failure — a failed query is stored as state, not thrown during render, unless the query opts into `throwOnError` or Suspense. Nothing global covers that async gap any more: a failed primary query is reported by the surface itself, through `DataFetchErrorState`. The two landed independently (the query surface first, in #12476 for tables; the boundary later, in #13743) and were never calibrated against each other, so for a long stretch a single 404 got a *blocking modal with raw JSON* while an actual app crash got a friendly reload button. Keep that ordering right: a failed fetch on a page that still renders is an in-place placeholder, a dead render tree is the full-page fallback. A modal is only correct when the error payload is something the user must read and copy — flow publish showing the trigger piece's stderr (`flow-hooks.tsx`) is the one case that still earns `ApErrorDialog`.- **`FriendlyErrorView` is the one renderer for a `FriendlyPieceError` — reach for it before hand-rolling a message line.** `app/builder/data-display/friendly-error-view.tsx` already turns the parsed payload into a status-keyed headline and hint (401 → "Authentication failed" + "Try reconnecting the account…"), an `HTTP {status}` badge, a labelled message block that prefers `apiMessage` over `message`, and its own `Technical Details` disclosure; it is wired to the run-details and test-step panels. For an auth failure the status-keyed *hint* is the part that actually prevents a misdiagnosis — naming whose credentials to fix beats quoting the third party's own sentence, which is what made a rejected Linear key read to a customer as their Activepieces session expiring (Pylon 5833). Three things make it non-trivial to drop into `ApErrorDialog` and all three are local fixes: it renders a second `Technical Details` next to the dialog's own, its disclosure shows `raw ?? payload` so it drops `standardOutput` (the piece's stderr, often the useful half of a failed trigger enable), and `useChangeFlowStatus` has only `flowId` so `pieceDisplayName` falls back to "What the service said". Fix those rather than growing a parallel renderer — a second one means the `message`-is-JSON trap (see *building pieces*) has to be fixed twice.- **Stubbing Radix `Select` in a jsdom test: render each `SelectItem` as a button that calls the real `onValueChange`, and never match a click by button text alone.** The component under test passes `onValueChange` to `Select`, so a stub that captures it in a `vi.hoisted` box and has `SelectItem` call it with its own `value` gives you the real state update without Radix's portal, pointer and `ResizeObserver` machinery. The trap is finding the button afterwards: the dropdown items and the UI they control often carry the same words (a Text/Image type picker next to chips whose badge also reads "Text"), and a `textContent` match takes whichever comes first in the DOM — silently clicking the dropdown item and asserting a no-op. Match on something structural (`button[title="Model Type"]` inside the chip) and give each helper a name that says which one it clicks. Also note `expect(value, 'message')` — valid vitest — is rejected by the repo's `vitest/valid-expect` lint rule, so put the identifying detail in the helper name rather than the assertion message.@@ -106,13 +117,50 @@ Verify with `npx turbo run lint --filter=web`, or `npm run lint-dev` for the who- **`--mode=cloud` also floods the terminal with `[vite] http proxy error: /ingest/... ETIMEDOUT 127.0.0.1:3000`.** The mode only redirects the API (`API_BASE_URL` → `https://cloud.activepieces.com` in `lib/api.ts`); PostHog still posts to the *relative* `api_host: '/ingest'` (a same-origin reverse proxy so ad blockers don't drop ingestion — `providers/telemetry-provider.tsx`, mirrored in prod by the `fastifyHttpProxy` in `server.ts`). Vite proxies `/ingest` to `127.0.0.1:3000`, which isn't running. Cloud flags also turn telemetry *on* (`TELEMETRY_ENABLED` + `EDITION=cloud`), unlike a local CE backend — so posthog-js keeps polling `/ingest/flags` and flushing `/ingest/e` every few seconds. Harmless, but note the same setup sends real dev clicks to production PostHog whenever `/ingest` does resolve; the clean fix is skipping `posthog.init` under `import.meta.env.DEV`.- **A motion `layout` animation fired from inside a mutation's `.then()` fast-forwards and reads as a jump — defer the state write two frames.** Motion measures the FLIP offset at the commit that reorders the DOM, then tweens from the first animation frame. When the write happens synchronously after a mutation resolves, that frame arrives tens of ms late (the same commit is refetching a table, tearing down a dialog, re-rendering the page), motion sees a huge time delta and skips most of the tween: a rail row travelling 228px was measured collapsing to 103px in one 6ms frame, then limping through 13 frames. Wrapping the write in `requestAnimationFrame(() => requestAnimationFrame(write))` lets the mutation's re-render settle first, and the same interaction then gives up only 7.6% on the first frame and eases properly. Two traps when checking this: driving the write yourself from a console eval runs on a *quiet* main thread and always looks smooth, so it proves nothing — reproduce through the real UI action; and a route change in the same tick (creating a flow navigates straight to the builder) interrupts the projection outright, which no deferral fixes.- **`projectCollection` runs on its own private `QueryClient`, fetches once, and never refetches — so any server-derived field on `ProjectWithLimits` is frozen at page load.** `features/projects/stores/project-collection.ts` builds the collection with `queryCollectionOptions({ queryKey: ['projects'], queryClient: collectionQueryClient })`, where `collectionQueryClient` is a `new QueryClient()` local to that module, *not* the app's. So `invalidateQueries(['projects'])` from anywhere else is a no-op, there is no `refetchOnWindowFocus`, and a field like `analytics.lastFlowUpdated` keeps its page-load value until something calls `projectCollectionUtils.refetchProjects()`. Two ways to keep such a field live, and the choice matters: `refetchProjects()` refetches every project (fine for a rare event like a piece-set change — its four existing callers — but wrong on a hot path such as the builder's per-edit autosave), or `projectCollection.utils.writeUpdate({ ...project, ... })` patches the row locally with no request, letting the next natural refetch restore server truth. Note `projectCollection.update()` is a *different* thing: it routes through `onUpdate` and POSTs, and its field allowlist silently drops anything not named there. **A local patch of a server-side *aggregate* also has to reproduce that aggregate's semantics, or it desyncs in two directions.** `analytics.lastFlowUpdated` is a `MAX(flow.updated)` over living flows, so: stamp the value from the mutation response, never `new Date()` (a skewed browser clock reorders against every server-supplied sibling); write only when the incoming value is *newer*, because concurrent mutations on one project resolve out of timestamp order — builder autosaves, and the bulk paths in `use-automations-mutations.ts` that fan out `flowIds.map(id => flowsApi.update(...))` — and an unconditional write lets a late older response move the row backwards; and when the aggregate can *decrease*, a local patch cannot express it at all, so refetch instead (deleting the newest flow lowers the MAX to a value only the server knows — cheap there because deletes are user-initiated, unlike autosave). And if the patch is *deferred* at all — it is here, by two frames, so the reorder animation does not fast-forward — a refetch that lands inside that window must invalidate it, or the pending write reapplies the pre-refetch value over the authoritative one and the newer-than guard happily waves it through; stamp each scheduled write with a generation the refetch bumps.-- **Never format `packages/web` with bare `prettier` — the web formatting contract lives in the eslint rule, not in `.prettierrc`.** Root `.prettierrc` sets only `singleQuote`, while `packages/web/.eslintrc.json` configures `prettier/prettier` with `trailingComma: "all"`, `printWidth: 80`, `tabWidth: 2`. The repo pins prettier **2.8.4**, whose default `trailingComma` is `es5` — so `npx prettier --write` on a web file silently **strips the trailing commas out of every multi-line function call it touches**, including lines you never edited, turning a 15-line change into a 130-line diff that reviewers have to read past. Format with `npx turbo run lint --filter=web --force -- --fix` instead; that is also what `npm run lint-dev` runs. If you already ran bare prettier, `git checkout` the file and redo the edit rather than trying to hand-restore the commas.+- **Never format `packages/web` with bare `prettier` — the web formatting contract lives in the eslint rule, not in `.prettierrc`.** Root `.prettierrc` sets only `singleQuote`, while `packages/web/.eslintrc.json` configures `prettier/prettier` with `trailingComma: "all"`, `printWidth: 80`, `tabWidth: 2`. The repo pins prettier **2.8.4**, whose default `trailingComma` is `es5` — so `npx prettier --write` on a web file silently **strips the trailing commas out of every multi-line function call it touches**, including lines you never edited, turning a 15-line change into a 130-line diff that reviewers have to read past. Format with `npx turbo run lint --filter=web --force -- --fix` instead; that is also what `npm run lint-dev` runs. If you already ran bare prettier, `git checkout` the file and redo the edit rather than trying to hand-restore the commas. **And `lint-dev` repairs rather than reports, so a green run is not a verification on its own.** It runs `--fix`, so running it *after* `git commit` writes the correction into the working tree and leaves the broken content in the commit you push: the terminal says 33 tasks successful while CI fails on the pushed code. Run it before staging, and treat `git status` immediately afterwards as the real check. Clean tree means lint found nothing; a modified file means it just fixed something that is not in your commit.- **`packages/web`'s lint script only globs `src/**`, so nothing under `packages/web/test/` is ever linted** — not by CI's `lint` job, not by `npm run lint-dev`. Running `npx eslint 'test/**/*.{ts,tsx}'` from `packages/web` today reports 21 errors nobody has seen, so a new web test needs a manual eslint pass or it ships with errors. Most common trap: `testing-library/render-result-naming-convention` fires on any local helper whose name merely *starts with* `render` even when testing-library is not involved — renaming `render` to `renderTabText` does not silence it, only a name that doesn't begin with `render` does. **The trap compounds with the rule that sends tests there.** `packages/web/CLAUDE.md` requires a test under `packages/web/test/`, mirroring its source path, so tests do not ship in the app bundle — but `test/` is exactly what lint does not glob. So the moment you move a test out of `src/`, it leaves the lint pass, and `npx turbo run lint --filter=web` (or `--fix`) then reports **0 errors for a file it never opened**. Seen in one session: two `prettier/prettier` errors were live in a test at `src/...`, the file was moved to `test/...`, the next `lint --fix` went green, and both errors were still there — `npx eslint 'test/**'` from `packages/web` found them. Lint the moved path directly after any such move; a green turbo run is not the check. Note the conventions pull against each other: five test files still sit under `src/` (`src/lib/test/`, `src/app/builder/data-selector/`, `src/features/projects/stores/`), which is why a new test tends to land there by precedent — those five *are* linted, which is the only reason nobody has noticed.- **A settings page gets its always-visible Save bar by passing `footer` to `CenteredPage`, and passing it switches the whole layout mode.** Without `footer` the page is the original `py-6` block that scrolls with the dashboard container; with it, the page becomes `h-full flex flex-col`, children move into a `ScrollArea`, and the footer pins below — so the Save button stays reachable however long the settings list grows. The wrapper around it has to be a flex child with a definite height (`flex flex-1 flex-col min-h-0` on the `<form>`), because `PlatformLayout` hands the route a `flex-1 overflow-auto` container and an `h-full` that cannot resolve just collapses. Reach for the prop rather than hand-rolling a second page shell; the six pages that omit it render byte-identically.+- **A `DataTable` row that spans all columns must count `table.getVisibleLeafColumns()`, never the authored+ `columns` array.** The two differ: the component prepends a select column and appends an actions column,+ and TanStack can hide others, so the authored length overshoots what the header renders. The loading,+ error and empty rows all render one `TableCell colSpan={...}`, and when that span is too high the table+ gains a column with no header. Because the table is `table-layout: fixed`, that phantom column is handed+ the leftover width, so on the platform Projects table the header covered 720px of a 1725px table and+ stopped two thirds of the way across, then looked fine the moment a row arrived, because real per-column+ cells override the phantom. It hid at laptop widths where the declared sizes were close to the container+ and only looked broken on a wide screen. Fixed in `components/custom/data-table`; the trap is reaching+ for `columns.length` again in a new spanning row.++- **Platform admin screens come in two alignments, and it follows the section rather than the page.**+ A settings screen is a centred `mx-auto max-w-[40rem]` column, a table screen is full width at the+ container's inset, and that split predates the redesign: on `CenteredPage` the title lived inside the+ centred column while `DashboardPageHeader` pages had a full-width one. Hoisting the title into a shared+ shell therefore has to carry the alignment with it, or the title lands at the inset while the content+ centres. `Security` is why the flag cannot live on the page: its API keys and Event streaming sections+ are centred lists while Secret managers and Audit logs are full-width tables, so the header has to+ re-align as you move between sections of one page.++- **`DataTable` carries its own spacing, so a table page wants no page padding.** It brings the toolbar,+ the filter row and the pagination footer with their insets already applied, and it is built to run edge+ to edge inside its container. Wrapping one in `px-6 pt-6` therefore pushes the table in from its own+ controls and opens a dead band between the page header and the toolbar. That padding belongs on the+ surfaces that have no spacing of their own, a card grid or a form, and not on a table. Bit the Projects+ and Users pages during the admin alignment pass, where the table was inset while its own toolbar was not.++- **Those two shells carry the page's layout, not just its header, so removing a header moves the content.**+ `CenteredPage` supplies `mx-auto` centring and a 40rem column; `DashboardPageHeader` supplies nothing, so+ its pages run flush to the container edge. Take the header away to hoist the title somewhere shared and+ the body keeps whichever of those it had: a `CenteredPage` body ends up centred hundreds of pixels right+ of the new header, a table body ends up flush left of it, and the page reads as broken without any one+ file looking wrong. Check the left edge of every converted page against its heading, not just that the+ heading renders.++- **Platform admin has two page shells that disagree, and one settings-row primitive that got cloned five times.** `DashboardPageHeader` (over `components/custom/page-header.tsx`) is `sticky top-0 z-30`, `text-base font-semibold`, full width, and respects `embedState.hidePageHeader`; `CenteredPage` is `max-w-[40rem] mx-auto py-6`, `text-xl font-medium`, and follows itself with a `Separator`. Twelve admin pages take the first, six the second, and four (billing, usage, embed, AI Center) hand-roll their own `h1` instead. Nothing marks which a new page should use, so the choice has been made per-page by whoever copied the nearest neighbour. Same story one level down: `components/custom/item.tsx` (`Item` / `ItemGroup` / `ItemTitle` / `ItemDescription` / `ItemActions`) is the intended label-left, control-right settings row and has nine call sites, eight of them in platform admin, with SSO the clearest reference. But five local re-implementations sit beside it and reuse none of it: `BillingSection` in `billing/index.tsx`, `HealthCard` plus `HealthRowItem` in `infra/health/components/system-health-tab.tsx` (a near-clone of `Item` + `ItemGroup` + `ItemSeparator`), `SectionHeader` under `setup/ai/components/`, an open-coded `Item variant="outline"` in `setup/general/danger-zone-section.tsx`, and `AutoIncludePill` in `piece-set-details-page.tsx`. Reach for `Item` before writing a row, and check whether the clone next to you is one of those five. The real outlier is `appearance-section.tsx`, which is a vertically stacked `FormItem` form rather than a row list, so it is the one file a standardisation pass has to decide about rather than mechanically convert.- **`packages/web/public/locales/en/translation.json` contains duplicate keys, so no JSON tool may rewrite it — edit it as text.** `agentMoveLosesConnections`, `No projects yet`, `All projects` and `Model` each appear twice today. Any parse-and-dump round-trip (Python's `json`, `jq`, a formatter) silently keeps only the last of each pair and drops the rest, and will additionally unescape every `\uXXXX` sequence in the file — one such round-trip to add a single key produced a 36-line diff with a key deletion buried in it. Add or rename a key with a targeted string replacement and check `git diff --stat` says 1 insertion.+- **Resolving a `translation.json` merge conflict is where that rule is hardest to keep and most worth keeping.** Both sides append to a flat map, so any long-lived web branch conflicts here, and the obvious resolution is to parse both sides and dump the union. That loses the duplicates and escapes exactly as above. It also has a three-way trap of its own: keeping every key that is in *ours* resurrects the keys main **deleted**, because our side never removed them either. Merge as main's bytes plus only the keys our side actually added (`in ours, not in the merge base`), appended as text before the closing brace, then confirm `git diff origin/main` is purely additive. Anything else and a reviewer sees deletions in a file they expected to grow.- **`AllowOnlyLoggedInUserOnlyGuard` calls its hooks after two early returns, and the linter only lets it.** `react-hooks/rules-of-hooks` does not flag member-expression calls, so `platformHooks.useCurrentPlatform()` / `flagsHooks.useFlags()` sail past it — but add a bare `useSomething()` there and the rule fires, correctly: `isLoggedIn()` can change between renders, so those calls really are conditional. Anything new that needs to run once a session is authenticated belongs in a null-rendering component placed inside the returned `<SocketProvider>` subtree, which mounts only after the guard passes. That is why automatic trial activation is `<AutomaticTrialActivation />` and not a hook.- **The layering is lint-enforced, not just a convention.** `packages/web/.eslintrc.json` has an `import/no-restricted-paths` zone making the codebase unidirectional: `src/app` may import `src/features`, and both may import `src/lib`/`hooks`/`components`/`types`/`utils` — never the reverse (the one exception is `app/query-client.ts`). So a hook that a public route needs belongs in `src/lib`, but anything rendering a feature's components has to live in that feature; you cannot keep the pair in one `lib` file. It fails as an `import/no-restricted-paths` **error**, not a warning, so it blocks lint.-- **Arbitrary Tailwind values for type, tracking and radius get sent back in review — `packages/web` has its own scale and it is not stock Tailwind.** There is no `tailwind.config.js`; this is Tailwind v4 and the theme lives in the `@theme` block of `src/styles.css`, which *adds* `--text-xss: 0.65rem`, *overrides* `--text-3xl` to 1.75rem and `--text-4xl` to 2rem (both smaller than stock), and derives `--radius-{sm,md,lg,xs,xss}` from a single `--radius: 0.5rem`. So `text-[13px]`, `tracking-[-0.025em]` and `rounded-[11px]` are not just style nits — they sit *between* real tokens and drift the page off the scale. Map them: 10–11px → `text-xss`, 11.5–12.5px → `text-xs`, 13–13.5px → `text-sm`, 15–15.5px → `text-base`; negative tracking → `tracking-tight`, uppercase-eyebrow tracking → `tracking-wide`/`wider`; any `rounded-[9–11px]` → `rounded-md`. Layout constraints are the exception and stay arbitrary — `max-w-[628px]` for a reading measure or `lg:w-[344px]` for a sidebar have no token equivalent and are idiomatic. Fractional spacing (`size-5.5`, `size-8.5`, `size-13`) is valid in v4 and beats `size-[22px]`. Neither eslint nor `tsc` catches any of this, so it only ever surfaces in review — the mapping is written up in the *Tailwind / Styling* section of `packages/web/AGENTS.md` so agents meet it before writing the class. Above 15.5px there is no px mapping, because heading sizes are a per-surface decision: copy the token the neighbouring heading on the same page already uses (a `text-[22px]` page heading becomes the `text-xl` its sibling section headings use) rather than rounding to the closest number.+- **Arbitrary Tailwind values for type, tracking and radius get sent back in review — `packages/web` has its own scale and it is not stock Tailwind.** There is no `tailwind.config.js`; this is Tailwind v4 and the theme lives in the `@theme` block of `src/styles.css`, which *adds* `--text-xss: 0.65rem`, *overrides* `--text-3xl` to 1.75rem and `--text-4xl` to 2rem (both smaller than stock), and derives `--radius-{sm,md,lg,xs,xss}` from a single `--radius: 0.5rem`. So `text-[13px]`, `tracking-[-0.025em]` and `rounded-[11px]` are not just style nits — they sit *between* real tokens and drift the page off the scale. Map them: 10–11px → `text-xss`, 11.5–12.5px → `text-xs`, 13–13.5px → `text-sm`, 15–15.5px → `text-base`; negative tracking → `tracking-tight`, uppercase-eyebrow tracking → `tracking-wide`/`wider`; any `rounded-[9–11px]` → `rounded-md`. **A colour handed over as a hex is usually a token at low opacity, and hardcoding it breaks dark mode**: `styles.css` redefines `--primary` inside `.dark` (violet `257 74% 57%` becomes blue `210 90% 50%`), so a light-mode lavender sits under dark-mode text unchanged. Composite the hex against the background before reaching for `bg-[#...]`; a design handing over `#f6f3fe` turned out to be `bg-primary/6` to within one unit per channel. Layout constraints are the exception and stay arbitrary — `max-w-[628px]` for a reading measure or `lg:w-[344px]` for a sidebar have no token equivalent and are idiomatic. Fractional spacing (`size-5.5`, `size-8.5`, `size-13`) is valid in v4 and beats `size-[22px]`, but **only at half-steps** — v4 generates `.5` and whole numbers, so a finer fraction like `ml-3.9` produces no rule at all and the property computes to `0`, with no build error and no lint error to say so. If a measured value falls between half-steps, either derive it from the geometry and round to the nearest real step, or use the arbitrary value; never invent a decimal and assume it took. Read the computed style back in the browser rather than trusting the class name. Neither eslint nor `tsc` catches any of this, so it only ever surfaces in review — the mapping is written up in the *Tailwind / Styling* section of `packages/web/AGENTS.md` so agents meet it before writing the class. Above 15.5px there is no px mapping, because heading sizes are a per-surface decision: copy the token the neighbouring heading on the same page already uses (a `text-[22px]` page heading becomes the `text-xl` its sibling section headings use) rather than rounding to the closest number.- **`npx prettier --check` lies about `packages/web` — it flags files nobody has touched, so never treat it as a gate.** Prettier is not in any CI workflow, and the root `.prettierrc` is a single `{"singleQuote": true}` while the resolved binary is prettier **2.8.4**, whose `trailingComma` default is `es5`. The checked-in code is formatted by prettier 3 (via the editor / eslint integration), which defaults to `all` — so every multi-line call with a trailing comma reads as a "code style issue". Running `--check` on a file straight out of `git show HEAD:` reproduces it. If you want to know whether your own edit is formatted, diff `npx prettier <file>` against the file and check the hunks are yours; the pass/fail verdict is meaningless. `npx turbo run lint --filter=web` is the real gate.- **A date test with hardcoded `Z` fixtures is a false green — CI runs UTC, and both `dayjs().isSame(x, 'day')` and `formatUtils.formatDate` are *local*.** Freezing the clock with `vi.setSystemTime(new Date('…Z'))` and then asserting against a literal `'2025-09-15T00:30:00Z'` only holds where local time is UTC. `grant-utils.test.ts` on [#15079](https://github.com/activepieces/activepieces/pull/15079) was 3/3 green in CI and on `TZ=UTC`, 1 failed on `TZ=America/New_York` (`00:30Z` is the *previous* local day, so "Active today" flips to "Last used Yesterday"), 2 failed on `TZ=Pacific/Honolulu` (the second being `formatDate` rendering `Aug 11` where the test asserted `Aug 12`). Nobody in the Americas can run the suite clean, and nothing in CI will ever tell you. Derive every fixture from the frozen clock instead of writing a literal — `dayjs(NOW).startOf('day').add(30, 'minute')`, `dayjs(NOW).subtract(34, 'day')` — and assert with the same local formatter the code uses (`earlier.format('MMM D')`), so fixture and assertion move together in any zone. Check any new date test with `TZ=America/New_York` and `TZ=Pacific/Honolulu` before pushing; those two straddle UTC on both sides and catch it. The production `isSame(…, 'day')` is *correct* — a user's "today" is their own day — so the bug is always in the test, never in the formatter.- **`ConfirmationDeleteDialog`'s `entityName` is a required prop that renders nowhere unless you also pass `showToast` — 25 of its 30 call sites compute a label and throw it away.** `components/custom/delete-dialog.tsx` mentions `entityName` three times: the prop type, the destructure, and one `toast.success(t('Removed {entityName}', …))` sitting inside `if (showToast)`. `showToast` is optional and there is no default, so every caller that omits it (or passes `false`) gets no toast and no other use of the value. The dialog body renders `title` and `message` only, so the confirmation never names what is about to be deleted. `project-member-card.tsx` builds `` `${firstName} ${lastName}` `` for nothing; `api-keys/index.tsx` passes `t('API Key')` for nothing. Nothing catches it — the prop is required, so TypeScript is satisfied, and lint has no opinion. Caught on [#15079](https://github.com/activepieces/activepieces/pull/15079), where it also made a newly added `revokedGrants` ICU plural rule unreachable in every locale — a dead translation key that `i18n:extract` will happily keep regenerating. When you want the name on screen, interpolate it into `message` yourself (`t('Revoking {entityName}. …', { entityName: label })`); passing `entityName` alone does nothing. Before adding a translation key for a dialog label, grep for where the prop you are feeding actually renders.diff --git a/brain/knowledge/platform-editions-ee/ee-platform-plans-billing.md b/brain/knowledge/platform-editions-ee/ee-platform-plans-billing.mdindex 83060a63be2..cd283ce7787 100644--- a/brain/knowledge/platform-editions-ee/ee-platform-plans-billing.md+++ b/brain/knowledge/platform-editions-ee/ee-platform-plans-billing.md@@ -31,7 +31,9 @@ Billing and entitlements are powered by [Autumn](https://useautumn.com). Each pl- **`RequestTrial` lives in `features/billing/components/`, not `app/components/`.** Anything under `features/*` that needs the sales call to action - the plan guards and the upgrade dialog - cannot reach into `app/`, because the `import/no-restricted-paths` zone is one-directional. Keeping it in billing lets both layers use it, since every `app/` caller is importing downward. It exports `FeatureKey`, the union the `activepieces.com/sales` page reads from the query string, and every `PLATFORM_FEATURES` entry carries one so a gated surface can hand over the right key.- Initial plan by edition: CE/EE → `OPEN_SOURCE_PLAN`, Cloud → `AUTUMN_FREE_PLAN`. CE and `TESTING` environments skip enrollment/sync entirely.- **Running billing locally means pointing a local backend at a *console*, not standing up Autumn.** Three gates must all pass or the provider is the empty no-op: `AP_EDITION` must be `cloud` or `ee` (`app.ts` sets `autumnBillingProvider` only there; Community returns `{ total: 0, byProject: [] }`), `AP_ENVIRONMENT` must **not** be `testing` (`triggerLazyBillingProviderSync`/`enrollBillingProviderOnCreate` early-return on it), and Redis must be up (billing reads/writes go through Redis caches). Enrollment is lazy — the first read of a billing/usage route fires `ensureEnrolled` → `enrollFree({ ownerEmail })` against `AUTUMN_CONSOLE_URL`. That prop **defaults to the production console** (`https://console.activepieces.com`), so an unconfigured local box enrolls a *real* customer keyed by the owner email; point it at the testing console instead. A freshly enrolled free customer has no events, so all usage aggregations read `0` until real `flow_run`/`ai`/`chat` credit events are metered for it. To merely eyeball the usage page with real data, `serve --filter=web -- --mode=cloud` against the cloud backend is far less setup than local billing.-- **Hand-editing `platform_plan` flags to unlock a feature locally does not stick, and the revert looks like the feature breaking itself.** The lazy entitlement projection above rewrites the plan columns from Autumn on any plan read, so a flag you set by hand survives only until the next sync. Because the throttle is 15 minutes and the web app leaves TanStack Query's `refetchOnWindowFocus` at its default `true`, the trigger in practice is *returning to the tab after a break*: alt-tab quickly and the flag survives, come back later and it is gone — which reads as an intermittent bug in whatever feature the flag gated, not as billing. `triggerLazyBillingProviderSync` is fire-and-forget, so nothing in the request that caused it says so. The clean fix for local work is to null **both** `autumnCustomerId` and `autumnApiKey` on the row: `loadAutumnCreds` returns null only when both are nil, `refreshEntitlements` then returns before its `update()`, and hand-set flags stay put. Null exactly one and you hit the worst case — an `error`-level `Autumn credentials incomplete for an enrolled platform` and every billing call silently no-oping.+- **Hand-editing `platform_plan` flags to unlock a feature locally does not stick, and the revert looks like the feature breaking itself.** The lazy entitlement projection above rewrites the plan columns from Autumn on any plan read, so a flag you set by hand survives only until the next sync. Because the throttle is 15 minutes and the web app leaves TanStack Query's `refetchOnWindowFocus` at its default `true`, the trigger in practice is *returning to the tab after a break*: alt-tab quickly and the flag survives, come back later and it is gone, which reads as an intermittent bug in whatever feature the flag gated, not as billing. `triggerLazyBillingProviderSync` is fire-and-forget, so nothing in the request that caused it says so.+- **To pin hand-set flags, set `autumnCustomerId` to any sentinel and leave `autumnApiKey` NULL.** `loadAutumnCreds` returns null whenever exactly one is missing, so `refreshEntitlements` returns before its `update()` and nothing overwrites the row. The cost is one `error`-level `Autumn credentials incomplete for an enrolled platform` per plan read, which is the no-op announcing itself and is harmless locally.+- **Do NOT null both credentials to achieve that**, even though `loadAutumnCreds` also returns null in that state. `ensureEnrolled` keys off `autumnCustomerId` alone: seeing it nil it treats the platform as never enrolled, calls the console's `enrollFree`, writes fresh credentials, and calls `refreshEntitlements` inline. Nulling both therefore *causes* the sync it was meant to prevent, and the free-plan flags come back within a minute or two along with a real Autumn customer. Verified 2026-09-14 on a local EE stack: flags reverted and both credential columns were repopulated.- **On `AP_EDITION=ce` the `platform_plan` row is ignored entirely, so there is nothing to hand-edit.** `platform.service.ts`'s `getPlan` returns the `OPEN_SOURCE_PLAN` literal for Community before it ever reads the DB — the row still exists (`createInitialBilling` writes it) and still shows the value you set, which is what makes SQL look like the fix. Unlocking a flag locally on CE means editing that literal in `packages/core/shared/src/lib/ee/billing/index.ts`; for a limit, `null` is unlimited on both sides (`isNil` short-circuits the frontend guard and `assertMaximumNumberOfProjectsReachedByEdition`), while `0` means *not available on this plan* and additionally hides the feature's UI. Two traps: the edit needs `packages/core/shared/dist/` patched too or rebuilt, because **the API resolves `@activepieces/shared` through node_modules to `main: ./dist/src/index.js` while the web app resolves it through the tsconfig path to `src/`** — edit only `src` and the browser flips while the API keeps enforcing the old value, which reads as a frontend/backend disagreement; and `src` is tracked, so revert it before committing.- The console base URL defaults to the production console and is overridable by an internal system prop (trailing slashes stripped) so our testing instance can point at the testing console. Deliberately absent from the self-hosting env-var reference: a self-hoster has no reason to change it, and the default must always be the one that works with zero setup. The Autumn SDK's own base URL is **not** configurable — nothing passes `serverURL` — so the console override cannot redirect entitlement reads.- Credit metering for managed AI happens post-run in centralized worker execution (decision 000016), so in-flight spend is invisible to the gate.@@ -64,6 +66,8 @@ Billing and entitlements are powered by [Autumn](https://useautumn.com). Each pl- **The `Required<>` in both guards is load-bearing.** `Nullable()` is `z.optional(z.nullable(...))`, so a column declared that way arrives as an *optional* key in the `Pick` and would slip past an unwrapped `Pick` unnoticed.- **Those build errors only appear once `@activepieces/shared` has been rebuilt.** `tsc -p packages/server/api/tsconfig.app.json` has `paths: {}` and resolves the package to `packages/core/shared/dist/src/index.d.ts`, not its source, so editing the schema and typechecking the API without a shared build proves nothing. vitest is the opposite — it aliases `@activepieces/shared` to `src`, so tests see schema edits immediately. Build shared first, and remember `tsc` does not clean `dist`, so a deleted module lingers there until you remove it.+- **Inside `BillingPageShell` every `isCommunity` check is dead code, and the billing page is full of them.** The shell wraps its children in `LockedFeatureGuard` keyed on `edition === COMMUNITY`, so nothing below it ever renders on Community. The billing page nonetheless computes `isCommunity` and guards its Current-subscription, Credits and Seats sections plus its Refresh button with `!isCommunity &&`, all of which is unreachable. Harmless, but it reads as if those sections were conditional when the only thing deciding them is a gate one level up, and it makes the page look edition-aware where it is not. Worth knowing before adding another guard in the same style, or before concluding a section is Community-visible because a check exists for it.+### Key filesEntry point: `platformPlanService` (`platform-plan.service.ts`) for projection, usage, and seat checks; `billingProvider.get(log)` for everything billing.diff --git a/packages/web/src/app/components/feature-sample.tsx b/packages/web/src/app/components/feature-sample.tsxnew file mode 100644index 00000000000..151e07fe9b7--- /dev/null+++ b/packages/web/src/app/components/feature-sample.tsx@@ -0,0 +1,108 @@+import { ApEdition, ApFlagId } from '@activepieces/shared';+import { t } from 'i18next';+import { ExternalLink, Lock } from 'lucide-react';+import { ReactNode } from 'react';++import { Button } from '@/components/ui/button';+import {+ FeatureKey,+ FeatureTier,+ RequestTrial,+ TIER_LABELS,+ useManagePlanDialogStore,+} from '@/features/billing';+import { flagsHooks } from '@/hooks/flags-hooks';++export function FeatureSample({+ locked,+ title,+ description,+ tier,+ documentationUrl,+ featureKey,+ showContactSales = true,+ children,+}: FeatureSampleProps) {+ const { openDialog: openManagePlanDialog } = useManagePlanDialogStore();+ const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);++ if (!locked) {+ return children;+ }++ const isCommunity = edition === ApEdition.COMMUNITY;++ return (+ <div className="relative flex flex-1 min-h-0 min-w-0 flex-col overflow-hidden">+ <div+ inert+ aria-hidden+ className="flex flex-1 min-h-0 min-w-0 flex-col pointer-events-none select-none opacity-25"+ >+ {children}+ </div>++ <div className="absolute inset-0 grid place-items-center overflow-auto p-6">+ <div className="pointer-events-auto flex w-full max-w-md flex-col items-center gap-5 rounded-2xl border bg-background px-8 py-9 text-center shadow-xl">+ <div className="grid size-12 place-items-center rounded-xl bg-primary/10">+ <Lock className="size-5.5 text-primary" />+ </div>+ <div className="flex flex-col gap-2">+ <h2 className="text-lg font-semibold">{t(title)}</h2>+ {description !== undefined && description !== '' && (+ <p className="text-sm leading-relaxed text-muted-foreground">+ {t(description)}+ </p>+ )}+ </div>+ {isCommunity ? (+ <div className="flex flex-col items-center gap-3">+ {showContactSales && featureKey !== undefined && (+ <RequestTrial featureKey={featureKey} />+ )}+ <a+ href={documentationUrl ?? ENTERPRISE_DOCUMENTATION_URL}+ target="_blank"+ rel="noopener noreferrer"+ className="inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline"+ >+ {t('Read the docs')}+ <ExternalLink className="size-3.5" />+ </a>+ </div>+ ) : (+ <Button className="w-full" onClick={() => openManagePlanDialog()}>+ {tier === undefined+ ? t('Upgrade to unlock')+ : t('Upgrade to {tier}', { tier: TIER_LABELS[tier] })}+ </Button>+ )}+ {tier !== undefined && !isCommunity && (+ <>+ <div className="h-px w-full bg-border" />+ <span className="text-xs text-muted-foreground">+ {t('Included with the {tier} plan and above.', {+ tier: TIER_LABELS[tier],+ })}+ </span>+ </>+ )}+ </div>+ </div>+ </div>+ );+}++const ENTERPRISE_DOCUMENTATION_URL =+ 'https://www.activepieces.com/docs/install/configuration/overview#enterprise-edition-optional';++export type FeatureSampleProps = {+ locked: boolean;+ featureKey?: FeatureKey;+ showContactSales?: boolean;+ title: string;+ description?: string;+ tier?: FeatureTier;+ documentationUrl?: string;+ children: ReactNode;+};diff --git a/packages/web/src/app/routes/agents/id/index.tsx b/packages/web/src/app/routes/agents/id/index.tsxindex 141c9786a8d..df9616812ed 100644--- a/packages/web/src/app/routes/agents/id/index.tsx+++ b/packages/web/src/app/routes/agents/id/index.tsx@@ -291,10 +291,10 @@ const AgentEditorPage = () => {const agentsAvailable = useAgentsAvailable();return (<LockedFeatureGuard+ featureKey="AGENTS"locked={!agentsAvailable}lockTitle={t('Unlock Agents')}lockDescription={t('Build an agent once, then use it in any flow.')}- featureKey="AGENTS"><AgentEditorContent /></LockedFeatureGuard>diff --git a/packages/web/src/app/routes/agents/index.tsx b/packages/web/src/app/routes/agents/index.tsxindex fc2e84dd8cb..6abefc4f832 100644--- a/packages/web/src/app/routes/agents/index.tsx+++ b/packages/web/src/app/routes/agents/index.tsx@@ -101,10 +101,10 @@ const AgentsPage = () => {const agentsAvailable = useAgentsAvailable();return (<LockedFeatureGuard+ featureKey="AGENTS"locked={!agentsAvailable}lockTitle={t('Unlock Agents')}lockDescription={t('Build an agent once, then use it in any flow.')}- featureKey="AGENTS"><AgentsPageContent /></LockedFeatureGuard>diff --git a/packages/web/src/app/routes/platform-routes.tsx b/packages/web/src/app/routes/platform-routes.tsxindex 0cc07183c05..1f1b611364f 100644--- a/packages/web/src/app/routes/platform-routes.tsx+++ b/packages/web/src/app/routes/platform-routes.tsx@@ -2,6 +2,7 @@ import { ApEdition, ApFlagId } from '@activepieces/shared';import React, { Suspense } from 'react';import { Navigate, useSearchParams } from 'react-router-dom';+import { FeatureSample } from '@/app/components/feature-sample';import { PageTitle } from '@/app/components/page-title';import { RouteLoadingBar } from '@/components/custom/route-loading-bar';import { flagsHooks } from '@/hooks/flags-hooks';@@ -29,9 +30,19 @@ function AdminRoute({ page }: { page: AdminPageSpec }) {const Page = page.component;if (Page !== undefined) {return (- <SuspenseWrapper>- <Page />- </SuspenseWrapper>+ <FeatureSample+ locked={page.sample === true && page.nav?.isLocked?.(context) === true}+ title={page.teaser?.title ?? page.nav?.label ?? page.title}+ description={page.teaser?.description}+ tier={page.teaser?.tier}+ documentationUrl={page.teaser?.documentationUrl}+ featureKey={page.teaser?.featureKey}+ showContactSales={page.teaser?.showContactSales}+ >+ <SuspenseWrapper>+ <Page />+ </SuspenseWrapper>+ </FeatureSample>);}@@ -40,9 +51,19 @@ function AdminRoute({ page }: { page: AdminPageSpec }) {const Overview = page.overview;if (Overview !== undefined && requested === null) {return (- <SuspenseWrapper>- <Overview />- </SuspenseWrapper>+ <FeatureSample+ locked={page.sample === true && page.nav?.isLocked?.(context) === true}+ title={page.teaser?.title ?? page.nav?.label ?? page.title}+ description={page.teaser?.description}+ tier={page.teaser?.tier}+ documentationUrl={page.teaser?.documentationUrl}+ featureKey={page.teaser?.featureKey}+ showContactSales={page.teaser?.showContactSales}+ >+ <SuspenseWrapper>+ <Overview />+ </SuspenseWrapper>+ </FeatureSample>);}@@ -57,9 +78,21 @@ function AdminRoute({ page }: { page: AdminPageSpec }) {const TabContent = activeTab.component;return (- <SuspenseWrapper>- <TabContent />- </SuspenseWrapper>+ <FeatureSample+ locked={+ activeTab.sample === true && activeTab.isLocked?.(context) === true+ }+ title={activeTab.teaser?.title ?? activeTab.label}+ description={activeTab.teaser?.description}+ tier={activeTab.teaser?.tier}+ documentationUrl={activeTab.teaser?.documentationUrl}+ featureKey={activeTab.teaser?.featureKey}+ showContactSales={activeTab.teaser?.showContactSales}+ >+ <SuspenseWrapper>+ <TabContent />+ </SuspenseWrapper>+ </FeatureSample>);}diff --git a/packages/web/src/app/routes/platform/admin-pages.ts b/packages/web/src/app/routes/platform/admin-pages.tsindex 1898fb7f4f4..bfe653a070f 100644--- a/packages/web/src/app/routes/platform/admin-pages.ts+++ b/packages/web/src/app/routes/platform/admin-pages.ts@@ -222,12 +222,38 @@ export const ADMIN_PAGES: AdminPage[] = [label: 'Single sign on',component: SSOPage,isLocked: ({ plan }) => !plan.ssoEnabled,+ sample: true,+ teaser: {+ featureKey: 'SSO',+ title: 'Enable Single Sign On',+ description:+ 'Let your users sign in with your current SSO provider or give them self serve sign up access',+ tier: 'team',+ bullets: [+ 'Works with SAML and OIDC providers',+ 'Enforce SSO for everyone on the platform',+ 'Control who can self-serve sign up',+ ],+ },},{id: 'roles',label: 'Project roles',component: ProjectRolePage,isLocked: ({ plan }) => !plan.projectRolesEnabled,+ sample: true,+ teaser: {+ featureKey: 'CUSTOM_ROLES',+ title: 'Project Role Management',+ description:+ 'Define custom roles and permissions to control what your team members can access and modify',+ tier: 'team',+ bullets: [+ 'Scope access per project, not per platform',+ 'Keep production flows safe from accidental edits',+ 'Assign roles when you invite someone',+ ],+ },},],},@@ -248,6 +274,18 @@ export const ADMIN_PAGES: AdminPage[] = [label: 'Global connections',component: GlobalConnectionsTable,isLocked: ({ plan }) => !plan.globalConnectionsEnabled,+ sample: true,+ teaser: {+ featureKey: 'GLOBAL_CONNECTIONS',+ title: 'Enable Global Connections',+ description: 'Manage platform-wide connections to external systems.',+ tier: 'team',+ bullets: [+ 'Create once, use in any project',+ 'Rotate credentials in a single place',+ 'Choose which projects can use each connection',+ ],+ },},],},@@ -297,6 +335,14 @@ export const ADMIN_PAGES: AdminPage[] = [},{id: 'templates',+ sample: true,+ teaser: {+ featureKey: 'TEMPLATES',+ title: 'Unlock Templates',+ description:+ 'Convert the most common automations into reusable templates 1 click away from your users',+ tier: 'enterprise',+ },path: '/platform/setup/templates',title: 'Templates',component: PlatformTemplatesPage,@@ -308,6 +354,13 @@ export const ADMIN_PAGES: AdminPage[] = [},{id: 'embed',+ sample: true,+ teaser: {+ featureKey: 'SIGNING_KEYS',+ title: 'Unlock Embedding Through JS SDK',+ description: 'Enable signing keys to access embedding functionalities.',+ tier: 'enterprise',+ },path: '/platform/security/embed',title: 'Embedding',component: EmbedPage,@@ -332,29 +385,88 @@ export const ADMIN_PAGES: AdminPage[] = [label: 'API keys',component: ApiKeysPage,isLocked: ({ plan }) => !plan.apiKeysEnabled,+ sample: true,+ teaser: {+ featureKey: 'API',+ title: 'Enable API Keys',+ description:+ 'Create and manage API keys to access Activepieces APIs.',+ tier: 'team',+ bullets: [+ 'Drive projects, flows and connections from your own tooling',+ 'Scope a key to the platform, not to a person',+ 'Revoke a key without touching anyone\u2019s login',+ ],+ },},{id: 'secrets',label: 'Secret managers',component: SecretManagersPage,isLocked: ({ plan }) => !plan.secretManagersEnabled,+ sample: true,+ teaser: {+ featureKey: 'SECRET_MANAGERS',+ title: 'Enable Secret Managers',+ description: 'Manage your secrets from a single and secure place',+ tier: 'enterprise',+ bullets: [+ 'AWS, Azure, GCP and HashiCorp Vault',+ 'Secrets never leave your infrastructure',+ 'One secure place to rotate everything',+ ],+ },},{id: 'audit',label: 'Audit logs',component: AuditLogsPage,isLocked: ({ plan }) => !plan.auditLogEnabled,+ sample: true,+ teaser: {+ featureKey: 'AUDIT_LOGS',+ title: 'Unlock Audit Logs',+ description:+ 'Comply with internal and external security policies by tracking activities done within your account',+ tier: 'enterprise',+ bullets: [+ 'Every user and system action, recorded',+ 'Filter by user, project and event type',+ 'Export for compliance reviews',+ ],+ },},{id: 'events',label: 'Event streaming',component: EventDestinationsPage,isLocked: ({ plan }) => !plan.eventStreamingEnabled,+ sample: true,+ teaser: {+ featureKey: 'EVENT_DESTINATIONS',+ title: 'Unlock Event Streaming',+ description:+ 'Forward every audit event we emit to a webhook, then handle it in a flow.',+ tier: 'enterprise',+ bullets: [+ 'Stream events to any endpoint',+ 'Wire alerts into Slack, PagerDuty or email',+ 'Build your own monitoring on top',+ ],+ },},],},{id: 'billing',+ sample: true,+ teaser: {+ featureKey: 'BILLING',+ showContactSales: false,+ title: 'Billing & usage',+ description:+ 'Plans, credits and usage tracking are part of the Enterprise and Cloud editions.',+ },path: '/platform/setup/billing',title: 'Billing & usage',overview: BillingOverview,diff --git a/packages/web/src/app/routes/platform/infra/event-destinations/index.tsx b/packages/web/src/app/routes/platform/infra/event-destinations/index.tsxindex 38200b941a4..2fcd365786b 100644--- a/packages/web/src/app/routes/platform/infra/event-destinations/index.tsx+++ b/packages/web/src/app/routes/platform/infra/event-destinations/index.tsx@@ -5,7 +5,6 @@ import { Workflow } from 'lucide-react';import { useMemo } from 'react';import { CenteredPage } from '@/app/components/centered-page';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { AnimatedIconButton } from '@/components/custom/animated-icon-button';import { PlusIcon } from '@/components/icons/plus';import { ItemGroup } from '@/components/ui/item';@@ -14,6 +13,8 @@ import { flowsApi } from '@/features/flows';import { flagsHooks } from '@/hooks/flags-hooks';import { platformHooks } from '@/hooks/platform-hooks';+import { sampleData } from '../../sample-data';+import { EventDestinationDialog } from './components/event-destination-dialog';import { EventDestinationRow } from './components/event-destination-row';import { eventDestinationsCollectionUtils } from './lib/event-destinations-collection';@@ -23,8 +24,12 @@ import { useEventLabels } from './lib/use-event-labels';const EventDestinationsPage = () => {const { platform } = platformHooks.useCurrentPlatform();const isEnabled = platform.plan.eventStreamingEnabled;- const { data: destinations, isLoading } =+ const { data: liveDestinations, isLoading } =eventDestinationsCollectionUtils.useAll(isEnabled);+ const isSample = !isEnabled;+ const destinations = isSample+ ? sampleData.eventDestinations()+ : liveDestinations;const { data: webhookPrefixUrl } = flagsHooks.useFlag<string>(ApFlagId.WEBHOOK_URL_PREFIX,);@@ -75,59 +80,50 @@ const EventDestinationsPage = () => {}, [flowQueries, flowIds]);return (- <LockedFeatureGuard- featureKey="EVENT_DESTINATIONS"- locked={!isEnabled}- lockTitle={t('Unlock Event Streaming')}- lockDescription={t(- 'Forward every audit event we emit to a webhook, then handle it in a flow — wire it to Slack, Gmail, PagerDuty, or anywhere else.',+ <CenteredPage+ title={t('Event Streaming')}+ description={t(+ 'Send a webhook for every audit event and build fully customizable alerts on top.',)}+ actions={+ <EventDestinationDialog destination={null}>+ <AnimatedIconButton icon={PlusIcon} iconSize={16} size="sm">+ {t('New Destination')}+ </AnimatedIconButton>+ </EventDestinationDialog>+ }>- <CenteredPage- title={t('Event Streaming')}- description={t(- 'Send a webhook for every audit event and build fully customizable alerts on top.',- )}- actions={- <EventDestinationDialog destination={null}>- <AnimatedIconButton icon={PlusIcon} iconSize={16} size="sm">- {t('New Destination')}- </AnimatedIconButton>- </EventDestinationDialog>- }- >- {isLoading && (- <SkeletonList numberOfItems={3} className="w-full h-[72px]" />- )}+ {isLoading && (+ <SkeletonList numberOfItems={3} className="w-full h-[72px]" />+ )}- {!isLoading && parsedDestinations.length === 0 && (- <div className="flex flex-col items-center gap-3 py-12 text-muted-foreground">- <Workflow className="size-10" />- <p className="text-sm">- {t('No destinations yet. Create one to get started.')}- </p>- </div>- )}+ {!isLoading && parsedDestinations.length === 0 && (+ <div className="flex flex-col items-center gap-3 py-12 text-muted-foreground">+ <Workflow className="size-10" />+ <p className="text-sm">+ {t('No destinations yet. Create one to get started.')}+ </p>+ </div>+ )}- {!isLoading && parsedDestinations.length > 0 && (- <ItemGroup className="gap-2">- {parsedDestinations.map(({ destination, parsed }) => (- <EventDestinationRow- key={destination.id}- destination={destination}- parsed={parsed}- flowDisplayName={- parsed.kind === 'flow'- ? flowDisplayNameById.get(parsed.flowId)- : undefined- }- eventLabels={eventLabels}- />- ))}- </ItemGroup>- )}- </CenteredPage>- </LockedFeatureGuard>+ {!isLoading && parsedDestinations.length > 0 && (+ <ItemGroup className="gap-2">+ {parsedDestinations.map(({ destination, parsed }) => (+ <EventDestinationRow+ key={destination.id}+ destination={destination}+ parsed={parsed}+ flowDisplayName={+ parsed.kind === 'flow'+ ? flowDisplayNameById.get(parsed.flowId)+ : undefined+ }+ eventLabels={eventLabels}+ />+ ))}+ </ItemGroup>+ )}+ </CenteredPage>);};diff --git a/packages/web/src/app/routes/platform/sample-data.ts b/packages/web/src/app/routes/platform/sample-data.tsnew file mode 100644index 00000000000..f6328e1e2c3--- /dev/null+++ b/packages/web/src/app/routes/platform/sample-data.ts@@ -0,0 +1,216 @@+import { RoleType } from '@activepieces/core-utils';+import {+ ApiKeyResponseWithoutValue,+ AppConnectionScope,+ AppConnectionStatus,+ AppConnectionType,+ AppConnectionWithoutSensitiveData,+ ApplicationEvent,+ ApplicationEventName,+ buildMockEvent,+ EventDestination,+ EventDestinationScope,+ ProjectRole,+ SecretManagerConnectionScope,+ SecretManagerConnectionWithStatus,+ SecretManagerProviderId,+ KeyAlgorithm,+ SeekPage,+ SigningKey,+ Template,+ TemplateStatus,+ TemplateType,+} from '@activepieces/shared';++const SAMPLE_PLATFORM_ID = 'sample-platform';+const SAMPLE_PROJECT_ID = 'sample-project';+const MINUTE_MS = 60 * 1000;++const SAMPLE_EVENT_NAMES: ApplicationEventName[] = [+ ApplicationEventName.FLOW_PUBLISHED,+ ApplicationEventName.CONNECTION_UPSERTED,+ ApplicationEventName.FLOW_UPDATED,+ ApplicationEventName.FLOW_CREATED,+ ApplicationEventName.FLOW_DELETED,+ ApplicationEventName.PROJECT_ROLE_CREATED,+ ApplicationEventName.FLOW_RUN_STARTED,+ ApplicationEventName.SIGNING_KEY_CREATED,+];++function agedTimestamps(minutesAgo: number) {+ const at = new Date(Date.now() - minutesAgo * MINUTE_MS).toISOString();+ return { created: at, updated: at };+}++function toPage<T>(data: T[]): SeekPage<T> {+ return { data, next: null, previous: null };+}++function auditEvents(): ApplicationEvent[] {+ return SAMPLE_EVENT_NAMES.map((event, index) => ({+ ...buildMockEvent({+ event,+ platformId: SAMPLE_PLATFORM_ID,+ projectId: SAMPLE_PROJECT_ID,+ }),+ ...agedTimestamps((index + 1) * 37),+ }));+}++function globalConnections(): AppConnectionWithoutSensitiveData[] {+ return [+ { displayName: 'Slack', pieceName: '@activepieces/piece-slack' },+ {+ displayName: 'Google Sheets',+ pieceName: '@activepieces/piece-google-sheets',+ },+ { displayName: 'Salesforce', pieceName: '@activepieces/piece-salesforce' },+ { displayName: 'HubSpot', pieceName: '@activepieces/piece-hubspot' },+ ].map((entry, index) => ({+ id: `sample-connection-${index}`,+ ...agedTimestamps((index + 2) * 26 * 60),+ externalId: `sample-connection-${index}`,+ displayName: entry.displayName,+ type: AppConnectionType.SECRET_TEXT,+ pieceName: entry.pieceName,+ pieceVersion: '0.0.1',+ projectIds: [],+ platformId: SAMPLE_PLATFORM_ID,+ scope: AppConnectionScope.PLATFORM,+ status:+ index === 3 ? AppConnectionStatus.ERROR : AppConnectionStatus.ACTIVE,+ ownerId: null,+ owner: null,+ metadata: null,+ flowIds: null,+ preSelectForNewProjects: false,+ usingSecretManager: false,+ }));+}++function projectRoles(): ProjectRole[] {+ return [+ { name: 'Release Manager', userCount: 3 },+ { name: 'Support Read Only', userCount: 8 },+ { name: 'Finance Auditor', userCount: 2 },+ ].map((entry, index) => ({+ id: `sample-role-${index}`,+ ...agedTimestamps((index + 1) * 9 * 24 * 60),+ name: entry.name,+ permissions: ['READ_FLOW', 'READ_RUN', 'READ_APP_CONNECTION'],+ platformId: SAMPLE_PLATFORM_ID,+ type: RoleType.CUSTOM,+ userCount: entry.userCount,+ }));+}++function eventDestinations(): EventDestination[] {+ return [+ 'https://splunk.acme.com/services/collector',+ 'https://http-intake.logs.datadoghq.com/api/v2/logs',+ 'https://siem.acme.com/hooks/activepieces',+ ].map((url, index) => ({+ id: `sample-destination-${index}`,+ ...agedTimestamps((index + 1) * 5 * 24 * 60),+ platformId: SAMPLE_PLATFORM_ID,+ scope: EventDestinationScope.PLATFORM,+ url,+ events: SAMPLE_EVENT_NAMES.slice(0, 4),+ }));+}++function secretManagers(): SecretManagerConnectionWithStatus[] {+ return [+ { name: 'Production vault', providerId: SecretManagerProviderId.AWS },+ {+ name: 'Shared secrets',+ providerId: SecretManagerProviderId.HASHICORP,+ },+ { name: 'Legacy store', providerId: SecretManagerProviderId.ONEPASSWORD },+ ].map((entry, index) => ({+ id: `sample-secret-manager-${index}`,+ ...agedTimestamps((index + 1) * 12 * 24 * 60),+ platformId: SAMPLE_PLATFORM_ID,+ providerId: entry.providerId,+ name: entry.name,+ scope: SecretManagerConnectionScope.PLATFORM,+ connection: { configured: true, connected: index !== 2 },+ }));+}++function apiKeys(): ApiKeyResponseWithoutValue[] {+ return [+ { displayName: 'CI deploy key', truncatedValue: 'sk_live_4f2c' },+ { displayName: 'Analytics export', truncatedValue: 'sk_live_9ab1' },+ { displayName: 'Terraform', truncatedValue: 'sk_live_c7d0' },+ ].map((entry, index) => ({+ id: `sample-api-key-${index}`,+ ...agedTimestamps((index + 1) * 21 * 24 * 60),+ platformId: SAMPLE_PLATFORM_ID,+ displayName: entry.displayName,+ truncatedValue: entry.truncatedValue,+ lastUsedAt: new Date(+ Date.now() - (index + 1) * 90 * MINUTE_MS,+ ).toISOString(),+ }));+}++function templates(): Template[] {+ return [+ {+ name: 'New lead to Salesforce',+ summary: 'Push every qualified form submission into Salesforce.',+ pieces: ['@activepieces/piece-forms', '@activepieces/piece-salesforce'],+ },+ {+ name: 'Weekly revenue digest',+ summary: 'Post a Monday summary of closed deals to Slack.',+ pieces: [+ '@activepieces/piece-slack',+ '@activepieces/piece-google-sheets',+ ],+ },+ {+ name: 'Onboard a new hire',+ summary: 'Create accounts and send the welcome pack on day one.',+ pieces: ['@activepieces/piece-gmail', '@activepieces/piece-hubspot'],+ },+ ].map((entry, index) => ({+ id: `sample-template-${index}`,+ ...agedTimestamps((index + 1) * 6 * 24 * 60),+ name: entry.name,+ type: TemplateType.CUSTOM,+ summary: entry.summary,+ description: entry.summary,+ tags: [],+ blogUrl: null,+ metadata: null,+ author: 'Acme Automation Team',+ categories: [],+ pieces: entry.pieces,+ platformId: SAMPLE_PLATFORM_ID,+ status: TemplateStatus.PUBLISHED,+ }));+}++function signingKeys(): SigningKey[] {+ return ['Customer portal', 'Partner dashboard'].map((displayName, index) => ({+ id: `sample-signing-key-${index}`,+ ...agedTimestamps((index + 1) * 30 * 24 * 60),+ platformId: SAMPLE_PLATFORM_ID,+ displayName,+ publicKey: 'LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1zYW1wbGU=',+ algorithm: KeyAlgorithm.RSA,+ }));+}++export const sampleData = {+ signingKeys,+ templatesPage: () => toPage(templates()),+ apiKeysPage: () => toPage(apiKeys()),+ auditEventsPage: () => toPage(auditEvents()),+ globalConnectionsPage: () => toPage(globalConnections()),+ projectRolesPage: () => toPage(projectRoles()),+ eventDestinations,+ secretManagers,+};diff --git a/packages/web/src/app/routes/platform/security/api-keys/index.tsx b/packages/web/src/app/routes/platform/security/api-keys/index.tsxindex b59cd49b800..ebf2f091bff 100644--- a/packages/web/src/app/routes/platform/security/api-keys/index.tsx+++ b/packages/web/src/app/routes/platform/security/api-keys/index.tsx@@ -3,7 +3,6 @@ import { t } from 'i18next';import { Key, MoreHorizontal, Trash } from 'lucide-react';import { CenteredPage } from '@/app/components/centered-page';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { NewApiKeyDialog } from '@/app/routes/platform/security/api-keys/new-api-key-dialog';import { AnimatedIconButton } from '@/components/custom/animated-icon-button';import { ConfirmationDeleteDialog } from '@/components/custom/delete-dialog';@@ -30,114 +29,105 @@ import { apiKeyApi, apiKeyQueries } from '@/features/platform-admin';import { platformHooks } from '@/hooks/platform-hooks';import { formatUtils } from '@/lib/format-utils';+import { sampleData } from '../../sample-data';+const ApiKeysPage = () => {const { platform } = platformHooks.useCurrentPlatform();-const { data, isLoading, refetch } = apiKeyQueries.useApiKeys();-- const keys: ApiKeyResponseWithoutValue[] = data?.data ?? [];+ const isSample = !platform.plan.apiKeysEnabled;+ const keys: ApiKeyResponseWithoutValue[] = isSample+ ? sampleData.apiKeysPage().data+ : data?.data ?? [];return (- <LockedFeatureGuard- featureKey="API"- locked={!platform.plan.apiKeysEnabled}- lockTitle={t('Enable API Keys')}- lockDescription={t(- 'Create and manage API keys to access Activepieces APIs.',- )}- lockVideoUrl="https://cdn.activepieces.com/videos/showcase/api-keys.mp4"+ <CenteredPage+ title={t('API Keys')}+ description={t('Manage API keys to access Activepieces APIs.')}+ actions={+ <NewApiKeyDialog onCreate={() => refetch()}>+ <AnimatedIconButton icon={PlusIcon} iconSize={16} size="sm">+ {t('New API Key')}+ </AnimatedIconButton>+ </NewApiKeyDialog>+ }>- <CenteredPage- title={t('API Keys')}- description={t('Manage API keys to access Activepieces APIs.')}- actions={- <NewApiKeyDialog onCreate={() => refetch()}>- <AnimatedIconButton icon={PlusIcon} iconSize={16} size="sm">- {t('New API Key')}- </AnimatedIconButton>- </NewApiKeyDialog>- }- >- {isLoading && (- <SkeletonList numberOfItems={3} className="w-full h-[72px]" />- )}+ {isLoading && !isSample && (+ <SkeletonList numberOfItems={3} className="w-full h-[72px]" />+ )}- {!isLoading && keys.length === 0 && (- <div className="flex flex-col items-center gap-3 py-12 text-muted-foreground">- <Key className="size-10" />- <p className="text-sm">- {t('No API keys yet. Create one to get started.')}- </p>- </div>- )}+ {!isLoading && keys.length === 0 && (+ <div className="flex flex-col items-center gap-3 py-12 text-muted-foreground">+ <Key className="size-10" />+ <p className="text-sm">+ {t('No API keys yet. Create one to get started.')}+ </p>+ </div>+ )}- {!isLoading && keys.length > 0 && (- <ItemGroup className="gap-2">- {keys.map((apiKey) => (- <Item key={apiKey.id} variant="outline" size="sm">- <ItemMedia variant="icon">- <Key />- </ItemMedia>- <ItemContent>- <ItemTitle>{apiKey.displayName}</ItemTitle>- <ItemDescription className="text-xs">- <span className="font-mono">- sk-...{apiKey.truncatedValue}- </span>- {' · '}- {t('Created')}{' '}- {formatUtils.formatDateToAgo(new Date(apiKey.created))}- {apiKey.lastUsedAt ? (- <>- {' '}- · {t('Last used')}{' '}- {formatUtils.formatDateToAgo(- new Date(apiKey.lastUsedAt),- )}- </>- ) : (- <> · {t('Never used')}</>- )}- </ItemDescription>- </ItemContent>- <ItemActions>- <DropdownMenu modal={true}>- <DropdownMenuTrigger asChild>- <Button variant="ghost" size="sm" className="size-8 p-0">- <MoreHorizontal className="size-4" />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <ConfirmationDeleteDialog- title={t('Revoke API Key')}- message={t(- 'Revoking this API key will immediately break any integrations using it. This action cannot be undone.',- )}- entityName={t('API Key')}- buttonText={t('Revoke')}- mutationFn={async () => {- await apiKeyApi.delete(apiKey.id);- refetch();- }}- onError={() => internalErrorToast()}+ {!isLoading && keys.length > 0 && (+ <ItemGroup className="gap-2">+ {keys.map((apiKey) => (+ <Item key={apiKey.id} variant="outline" size="sm">+ <ItemMedia variant="icon">+ <Key />+ </ItemMedia>+ <ItemContent>+ <ItemTitle>{apiKey.displayName}</ItemTitle>+ <ItemDescription className="text-xs">+ <span className="font-mono">+ sk-...{apiKey.truncatedValue}+ </span>+ {' · '}+ {t('Created')}{' '}+ {formatUtils.formatDateToAgo(new Date(apiKey.created))}+ {apiKey.lastUsedAt ? (+ <>+ {' '}+ · {t('Last used')}{' '}+ {formatUtils.formatDateToAgo(new Date(apiKey.lastUsedAt))}+ </>+ ) : (+ <> · {t('Never used')}</>+ )}+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <DropdownMenu modal={true}>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" size="sm" className="size-8 p-0">+ <MoreHorizontal className="size-4" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <ConfirmationDeleteDialog+ title={t('Revoke API Key')}+ message={t(+ 'Revoking this API key will immediately break any integrations using it. This action cannot be undone.',+ )}+ entityName={t('API Key')}+ buttonText={t('Revoke')}+ mutationFn={async () => {+ await apiKeyApi.delete(apiKey.id);+ refetch();+ }}+ onError={() => internalErrorToast()}+ >+ <DropdownMenuItem+ className="text-destructive focus:text-destructive"+ onSelect={(e) => e.preventDefault()}>- <DropdownMenuItem- className="text-destructive focus:text-destructive"- onSelect={(e) => e.preventDefault()}- >- <Trash className="size-4 mr-2 text-destructive" />- {t('Revoke API Key')}- </DropdownMenuItem>- </ConfirmationDeleteDialog>- </DropdownMenuContent>- </DropdownMenu>- </ItemActions>- </Item>- ))}- </ItemGroup>- )}- </CenteredPage>- </LockedFeatureGuard>+ <Trash className="size-4 mr-2 text-destructive" />+ {t('Revoke API Key')}+ </DropdownMenuItem>+ </ConfirmationDeleteDialog>+ </DropdownMenuContent>+ </DropdownMenu>+ </ItemActions>+ </Item>+ ))}+ </ItemGroup>+ )}+ </CenteredPage>);};diff --git a/packages/web/src/app/routes/platform/security/audit-logs/index.tsx b/packages/web/src/app/routes/platform/security/audit-logs/index.tsxindex 2a8c31a1fb2..a383bf5bcec 100644--- a/packages/web/src/app/routes/platform/security/audit-logs/index.tsx+++ b/packages/web/src/app/routes/platform/security/audit-logs/index.tsx@@ -30,7 +30,6 @@ import { Fragment, useState } from 'react';import { Link } from 'react-router-dom';import { DashboardPageHeader } from '@/app/components/dashboard-page-header';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { DataTable, DataTableFilters } from '@/components/custom/data-table';import { DataTableColumnHeader } from '@/components/custom/data-table/data-table-column-header';import { FormattedDate } from '@/components/custom/formatted-date';@@ -49,6 +48,8 @@ import { projectCollectionUtils } from '@/features/projects';import { platformHooks } from '@/hooks/platform-hooks';import { formatUtils } from '@/lib/format-utils';+import { sampleData } from '../../sample-data';+export default function AuditLogsPage() {const { platform } = platformHooks.useCurrentPlatform();const [selectedEvent, setSelectedEvent] = useState<ApplicationEvent | null>(@@ -111,244 +112,229 @@ export default function AuditLogsPage() {isError,refetch,} = auditLogQueries.useAuditLogs();+ const isSample = !platform.plan.auditLogEnabled;+ const rows = isSample ? sampleData.auditEventsPage() : auditLogsData;- const isEnabled = platform.plan.auditLogEnabled;return (- <LockedFeatureGuard- featureKey="AUDIT_LOGS"- locked={!isEnabled}- lockTitle={t('Unlock Audit Logs')}- lockDescription={t(- 'Comply with internal and external security policies by tracking activities done within your account',- )}- >- <div className="flex flex-col w-full">- <DashboardPageHeader- description={t('Track activities done within your platform')}- title={t('Audit Logs')}- />- <DataTable- emptyStateTextTitle={t('No audit logs found')}- emptyStateTextDescription={t(- 'Come back later when you have some activity to audit',- )}- emptyStateIcon={<History className="size-14" />}- filters={filters}- columns={[- {- accessorKey: 'action',- size: 180,- header: ({ column }) => (- <DataTableColumnHeader- column={column}- title={t('Action')}- icon={Wand}- />- ),- cell: ({ row }) => {- const icon = convertToIcon(row.original);- return (- <div className="text-left flex items-center gap-2">- {!isNil(icon?.icon) && (- <span className="text-muted-foreground shrink-0">- {icon.icon}- </span>- )}- {formatUtils.convertEnumToHumanReadable(- row.original.action,- )}- </div>- );- },- },- {- accessorKey: 'details',- size: 320,- header: ({ column }) => (- <DataTableColumnHeader- column={column}- title={t('Details')}- icon={FileText}- />- ),- cell: ({ row }) => {- return (- <div className="text-left">- {convertToDetails(row.original)}- </div>- );- },+ <div className="flex flex-col w-full">+ <DashboardPageHeader+ description={t('Track activities done within your platform')}+ title={t('Audit Logs')}+ />+ <DataTable+ emptyStateTextTitle={t('No audit logs found')}+ emptyStateTextDescription={t(+ 'Come back later when you have some activity to audit',+ )}+ emptyStateIcon={<History className="size-14" />}+ filters={filters}+ columns={[+ {+ accessorKey: 'action',+ size: 180,+ header: ({ column }) => (+ <DataTableColumnHeader+ column={column}+ title={t('Action')}+ icon={Wand}+ />+ ),+ cell: ({ row }) => {+ const icon = convertToIcon(row.original);+ return (+ <div className="text-left flex items-center gap-2">+ {!isNil(icon?.icon) && (+ <span className="text-muted-foreground shrink-0">+ {icon.icon}+ </span>+ )}+ {formatUtils.convertEnumToHumanReadable(row.original.action)}+ </div>+ );},- {- accessorKey: 'userId',- size: 200,- header: ({ column }) => (- <DataTableColumnHeader- column={column}- title={t('Performed By')}- icon={User}- />- ),- cell: ({ row }) => {- return (- <div className="text-left">{row.original.userEmail}</div>- );- },+ },+ {+ accessorKey: 'details',+ size: 320,+ header: ({ column }) => (+ <DataTableColumnHeader+ column={column}+ title={t('Details')}+ icon={FileText}+ />+ ),+ cell: ({ row }) => {+ return (+ <div className="text-left">+ {convertToDetails(row.original)}+ </div>+ );},- {- accessorKey: 'projectId',- size: 130,- header: ({ column }) => (- <DataTableColumnHeader- column={column}- title={t('Project')}- icon={Folder}- />- ),- cell: ({ row }) => {- return row.original.projectId &&- 'project' in row.original.data ? (- <Link to={`/projects/${row.original.projectId}`}>- <div className="text-left text-primary hover:underline">- {row.original.data.project?.displayName}- </div>- </Link>- ) : (- <div className="text-left">{t('N/A')}</div>- );- },+ },+ {+ accessorKey: 'userId',+ size: 200,+ header: ({ column }) => (+ <DataTableColumnHeader+ column={column}+ title={t('Performed By')}+ icon={User}+ />+ ),+ cell: ({ row }) => {+ return <div className="text-left">{row.original.userEmail}</div>;},- {- accessorKey: 'created',- size: 110,- header: ({ column }) => (- <DataTableColumnHeader- column={column}- title={t('Created')}- icon={Clock}- />- ),- cell: ({ row }) => {- return (- <div className="text-left">- <FormattedDate date={new Date(row.original.created)} />+ },+ {+ accessorKey: 'projectId',+ size: 130,+ header: ({ column }) => (+ <DataTableColumnHeader+ column={column}+ title={t('Project')}+ icon={Folder}+ />+ ),+ cell: ({ row }) => {+ return row.original.projectId &&+ 'project' in row.original.data ? (+ <Link to={`/projects/${row.original.projectId}`}>+ <div className="text-left text-primary hover:underline">+ {row.original.data.project?.displayName}</div>- );- },+ </Link>+ ) : (+ <div className="text-left">{t('N/A')}</div>+ );},- {- id: 'view',- size: 50,- cell: ({ row }) => (- <Button- variant="ghost"- size="icon"- className="size-8"- onClick={() => {- setSelectedEvent(row.original);- setIsSheetOpen(true);- }}- >- <Eye className="size-4 text-muted-foreground" />- </Button>- ),+ },+ {+ accessorKey: 'created',+ size: 110,+ header: ({ column }) => (+ <DataTableColumnHeader+ column={column}+ title={t('Created')}+ icon={Clock}+ />+ ),+ cell: ({ row }) => {+ return (+ <div className="text-left">+ <FormattedDate date={new Date(row.original.created)} />+ </div>+ );},- ]}- page={auditLogsData}- isLoading={isLoading}- isError={isError}- errorStateEntity={t('audit logs')}- onRetry={refetch}- />- <Sheet open={isSheetOpen} onOpenChange={setIsSheetOpen}>- <SheetContent className="w-[480px] sm:max-w-[480px] flex flex-col p-0">- <SheetHeader className="px-6 py-4 border-b shrink-0">- <SheetTitle className="text-base">- {formatUtils.convertEnumToHumanReadable(- selectedEvent?.action ?? '',- )}- </SheetTitle>- <p className="text-sm text-muted-foreground mt-1">- {selectedEvent && convertToDetails(selectedEvent)}+ },+ {+ id: 'view',+ size: 50,+ cell: ({ row }) => (+ <Button+ variant="ghost"+ size="icon"+ className="size-8"+ onClick={() => {+ setSelectedEvent(row.original);+ setIsSheetOpen(true);+ }}+ >+ <Eye className="size-4 text-muted-foreground" />+ </Button>+ ),+ },+ ]}+ page={rows}+ isLoading={isSample ? false : isLoading}+ isError={isSample ? false : isError}+ errorStateEntity={t('audit logs')}+ onRetry={refetch}+ />+ <Sheet open={isSheetOpen} onOpenChange={setIsSheetOpen}>+ <SheetContent className="w-[480px] sm:max-w-[480px] flex flex-col p-0">+ <SheetHeader className="px-6 py-4 border-b shrink-0">+ <SheetTitle className="text-base">+ {formatUtils.convertEnumToHumanReadable(+ selectedEvent?.action ?? '',+ )}+ </SheetTitle>+ <p className="text-sm text-muted-foreground mt-1">+ {selectedEvent && convertToDetails(selectedEvent)}+ </p>+ </SheetHeader>+ <div className="flex-1 overflow-y-auto">+ <div className="px-6 py-5 flex flex-col gap-4">+ <p className="text-xs font-semibold text-muted-foreground uppercase tracking-wide">+ {t('Who & When')}</p>- </SheetHeader>- <div className="flex-1 overflow-y-auto">- <div className="px-6 py-5 flex flex-col gap-4">- <p className="text-xs font-semibold text-muted-foreground uppercase tracking-wide">- {t('Who & When')}- </p>- <div className="grid grid-cols-[150px_1fr] gap-y-3 text-sm">- {selectedEvent?.userEmail && (- <>- <span className="text-muted-foreground">- {t('Performed By')}- </span>- <span className="font-medium">- {selectedEvent.userEmail}- </span>- </>- )}- {selectedEvent?.projectDisplayName && (- <>- <span className="text-muted-foreground">- {t('Project')}- </span>- <span className="font-medium">- {selectedEvent.projectDisplayName}- </span>- </>- )}- {selectedEvent?.ip && (- <>- <span className="text-muted-foreground">- {t('IP Address')}- </span>- <span className="font-medium">{selectedEvent.ip}</span>- </>- )}- <span className="text-muted-foreground">{t('Created')}</span>- <span className="font-medium">- {selectedEvent && (- <FormattedDate date={new Date(selectedEvent.created)} />- )}- </span>- </div>- </div>- {selectedEvent &&- extractEventDetails(selectedEvent).length > 0 && (+ <div className="grid grid-cols-[150px_1fr] gap-y-3 text-sm">+ {selectedEvent?.userEmail && (<>- <Separator />- <div className="px-6 py-5 flex flex-col gap-4">- <p className="text-xs font-semibold text-muted-foreground uppercase tracking-wide">- {t('Event Details')}- </p>- <div className="grid grid-cols-[150px_1fr] gap-y-3 text-sm">- {extractEventDetails(selectedEvent).map(- ({ label, value }) => (- <Fragment key={label}>- <span className="text-muted-foreground">- {label}- </span>- <span className="font-medium">{value}</span>- </Fragment>- ),- )}- </div>- </div>+ <span className="text-muted-foreground">+ {t('Performed By')}+ </span>+ <span className="font-medium">+ {selectedEvent.userEmail}+ </span></>)}- <Separator />- <div className="px-6 py-5 flex flex-col gap-4">- <p className="text-xs font-semibold text-muted-foreground uppercase tracking-wide">- {t('Full Payload')}- </p>- <SimpleJsonViewer data={selectedEvent?.data ?? {}} />+ {selectedEvent?.projectDisplayName && (+ <>+ <span className="text-muted-foreground">+ {t('Project')}+ </span>+ <span className="font-medium">+ {selectedEvent.projectDisplayName}+ </span>+ </>+ )}+ {selectedEvent?.ip && (+ <>+ <span className="text-muted-foreground">+ {t('IP Address')}+ </span>+ <span className="font-medium">{selectedEvent.ip}</span>+ </>+ )}+ <span className="text-muted-foreground">{t('Created')}</span>+ <span className="font-medium">+ {selectedEvent && (+ <FormattedDate date={new Date(selectedEvent.created)} />+ )}+ </span></div></div>- </SheetContent>- </Sheet>- </div>- </LockedFeatureGuard>+ {selectedEvent && extractEventDetails(selectedEvent).length > 0 && (+ <>+ <Separator />+ <div className="px-6 py-5 flex flex-col gap-4">+ <p className="text-xs font-semibold text-muted-foreground uppercase tracking-wide">+ {t('Event Details')}+ </p>+ <div className="grid grid-cols-[150px_1fr] gap-y-3 text-sm">+ {extractEventDetails(selectedEvent).map(+ ({ label, value }) => (+ <Fragment key={label}>+ <span className="text-muted-foreground">{label}</span>+ <span className="font-medium">{value}</span>+ </Fragment>+ ),+ )}+ </div>+ </div>+ </>+ )}+ <Separator />+ <div className="px-6 py-5 flex flex-col gap-4">+ <p className="text-xs font-semibold text-muted-foreground uppercase tracking-wide">+ {t('Full Payload')}+ </p>+ <SimpleJsonViewer data={selectedEvent?.data ?? {}} />+ </div>+ </div>+ </SheetContent>+ </Sheet>+ </div>);}diff --git a/packages/web/src/app/routes/platform/security/embed/index.tsx b/packages/web/src/app/routes/platform/security/embed/index.tsxindex b9851abe638..974e77ab14a 100644--- a/packages/web/src/app/routes/platform/security/embed/index.tsx+++ b/packages/web/src/app/routes/platform/security/embed/index.tsx@@ -14,7 +14,6 @@ import {} from 'lucide-react';import { useState } from 'react';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';import { Button } from '@/components/ui/button';import { Separator } from '@/components/ui/separator';@@ -26,6 +25,8 @@ import {import { flagsHooks } from '@/hooks/flags-hooks';import { platformHooks } from '@/hooks/platform-hooks';+import { sampleData } from '../../sample-data';+import { Stepper, StepKind, StepDef } from './stepper';import { AllowedDomainsStep } from './steps/allowed-domains-step';import { DnsStep } from './steps/dns-step';@@ -48,7 +49,10 @@ const EmbedPage = () => {isLoading: isKeysLoading,refetch,} = signingKeyQueries.useSigningKeys();- const signingKeys: SigningKey[] = data?.data ?? [];+ const isSample = !platform.plan.embeddingEnabled;+ const signingKeys: SigningKey[] = isSample+ ? sampleData.signingKeys()+ : data?.data ?? [];const isLoading = (isCloud && isSubdomainLoading) || isKeysLoading;@@ -126,72 +130,63 @@ const EmbedPage = () => {(displayedStep?.kind === 'hostname' || displayedStep?.kind === 'dns');return (- <LockedFeatureGuard- featureKey="SIGNING_KEYS"- locked={!platform.plan.embeddingEnabled}- lockTitle={t('Unlock Embedding Through JS SDK')}- lockDescription={t(- 'Enable signing keys to access embedding functionalities.',- )}- >- <div className="w-full max-w-4/5 2xl:max-w-6xl mx-auto py-6">- <div className="flex flex-col gap-1">- <h1 className="text-xl font-medium">{t('Embed Onboarding')}</h1>- <div className="text-sm text-muted-foreground">- {description}- <Button- variant="link"- size="sm"- className="h-auto p-0 mt-0.5 ml-1"- asChild+ <div className="w-full max-w-4/5 2xl:max-w-6xl mx-auto py-6">+ <div className="flex flex-col gap-1">+ <h1 className="text-xl font-medium">{t('Embed Onboarding')}</h1>+ <div className="text-sm text-muted-foreground">+ {description}+ <Button+ variant="link"+ size="sm"+ className="h-auto p-0 mt-0.5 ml-1"+ asChild+ >+ <a+ href="https://www.activepieces.com/docs/embedding/overview"+ target="_blank"+ rel="noopener noreferrer">- <a- href="https://www.activepieces.com/docs/embedding/overview"- target="_blank"- rel="noopener noreferrer"- >- {t('Read more')}- <ExternalLink className="size-3" />- </a>- </Button>- </div>+ {t('Read more')}+ <ExternalLink className="size-3" />+ </a>+ </Button></div>- <Separator className="mt-4 mb-12" />-- <div className="grid grid-cols-[16rem_1fr] gap-16">- <Stepper- steps={steps}- completion={stepCompletion}- activeStepIndex={activeStepIndex}- displayedIndex={displayedIndex}- onStepClick={handleStepClick}- />-- <div className="min-w-0">- {isLoading ? (- <SkeletonList numberOfItems={3} className="w-full h-[72px]" />- ) : subdomainStepFailed ? (- <DataFetchErrorState- entity={t('the embed subdomain')}- onRetry={refetchSubdomain}- />- ) : displayedStep?.kind === 'hostname' ? (- <HostnameStep subdomain={subdomain} />- ) : displayedStep?.kind === 'dns' ? (- <DnsStep subdomain={subdomain} />- ) : displayedStep?.kind === 'allowed-domains' ? (- <AllowedDomainsStep allowedEmbedOrigins={allowedEmbedOrigins} />- ) : displayedStep?.kind === 'signing-keys' ? (- <SigningKeysStep- signingKeys={signingKeys}- isLoading={isKeysLoading}- refetch={refetch}- />- ) : null}- </div>+ </div>+ <Separator className="mt-4 mb-12" />++ <div className="grid grid-cols-[16rem_1fr] gap-16">+ <Stepper+ steps={steps}+ completion={stepCompletion}+ activeStepIndex={activeStepIndex}+ displayedIndex={displayedIndex}+ onStepClick={handleStepClick}+ />++ <div className="min-w-0">+ {isLoading ? (+ <SkeletonList numberOfItems={3} className="w-full h-[72px]" />+ ) : subdomainStepFailed ? (+ <DataFetchErrorState+ entity={t('the embed subdomain')}+ onRetry={refetchSubdomain}+ />+ ) : displayedStep?.kind === 'hostname' ? (+ <HostnameStep subdomain={subdomain} />+ ) : displayedStep?.kind === 'dns' ? (+ <DnsStep subdomain={subdomain} />+ ) : displayedStep?.kind === 'allowed-domains' ? (+ <AllowedDomainsStep allowedEmbedOrigins={allowedEmbedOrigins} />+ ) : displayedStep?.kind === 'signing-keys' ? (+ <SigningKeysStep+ signingKeys={signingKeys}+ isLoading={isKeysLoading}+ refetch={refetch}+ />+ ) : null}</div></div>- </LockedFeatureGuard>+ </div>);};diff --git a/packages/web/src/app/routes/platform/security/project-role/index.tsx b/packages/web/src/app/routes/platform/security/project-role/index.tsxindex 0812a096d29..a860409d141 100644--- a/packages/web/src/app/routes/platform/security/project-role/index.tsx+++ b/packages/web/src/app/routes/platform/security/project-role/index.tsx@@ -1,7 +1,6 @@import { t } from 'i18next';import { CenteredPage } from '@/app/components/centered-page';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { AnimatedIconButton } from '@/components/custom/animated-icon-button';import { PlusIcon } from '@/components/icons/plus';import {@@ -12,6 +11,8 @@ import {import { projectRoleQueries } from '@/features/platform-admin';import { platformHooks } from '@/hooks/platform-hooks';+import { sampleData } from '../../sample-data';+import { ProjectRoleDialog } from './project-role-dialog';import { ProjectRolesTable } from './project-roles-table';@@ -21,6 +22,8 @@ const ProjectRolePage = () => {const { data, isLoading, refetch } = projectRoleQueries.useProjectRoles(platform.plan.projectRolesEnabled,);+ const isSample = !platform.plan.projectRolesEnabled;+ const roles = isSample ? sampleData.projectRolesPage() : data;const newRoleButton = !platform.plan.customRolesEnabled ? (<Tooltip>@@ -46,29 +49,19 @@ const ProjectRolePage = () => {);return (- <LockedFeatureGuard- featureKey="TEAM"- locked={!platform.plan.projectRolesEnabled}- lockTitle={t('Project Role Management')}- lockDescription={t(- 'Define custom roles and permissions to control what your team members can access and modify',+ <CenteredPage+ title={t('Project Role Management')}+ description={t(+ 'Define custom roles and permissions that can be assigned to your team members',)}- lockVideoUrl="https://cdn.activepieces.com/videos/showcase/roles.mp4"+ actions={newRoleButton}>- <CenteredPage- title={t('Project Role Management')}- description={t(- 'Define custom roles and permissions that can be assigned to your team members',- )}- actions={newRoleButton}- >- <ProjectRolesTable- projectRoles={data}- isLoading={isLoading}- refetch={refetch}- />- </CenteredPage>- </LockedFeatureGuard>+ <ProjectRolesTable+ projectRoles={roles}+ isLoading={isSample ? false : isLoading}+ refetch={refetch}+ />+ </CenteredPage>);};diff --git a/packages/web/src/app/routes/platform/security/secret-managers/index.tsx b/packages/web/src/app/routes/platform/security/secret-managers/index.tsxindex 7aa4ad96844..8dba1f1bdd9 100644--- a/packages/web/src/app/routes/platform/security/secret-managers/index.tsx+++ b/packages/web/src/app/routes/platform/security/secret-managers/index.tsx@@ -16,7 +16,6 @@ import {} from 'lucide-react';import { DashboardPageHeader } from '@/app/components/dashboard-page-header';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { AnimatedIconButton } from '@/components/custom/animated-icon-button';import { DataTable, RowDataWithActions } from '@/components/custom/data-table';import { DataTableColumnHeader } from '@/components/custom/data-table/data-table-column-header';@@ -34,6 +33,8 @@ import { PieceIcon } from '@/features/pieces';import { secretManagersHooks } from '@/features/secret-managers';import { platformHooks } from '@/hooks/platform-hooks';+import { sampleData } from '../../sample-data';+import AddEditSecretManagerConnectionDialog from './connect-secret-manager-dialog';const SecretManagersPage = () => {@@ -51,9 +52,9 @@ const SecretManagersPage = () => {const isLoading = isLoadingConnections;- const page = connections- ? { data: connections, next: null, previous: null }- : undefined;+ const isSample = !platform.plan.secretManagersEnabled;+ const rows = isSample ? sampleData.secretManagers() : connections;+ const page = rows ? { data: rows, next: null, previous: null } : undefined;const columns: ColumnDef<RowDataWithActions<SecretManagerConnectionWithStatus>,@@ -191,39 +192,32 @@ const SecretManagersPage = () => {];return (- <LockedFeatureGuard- featureKey="SECRET_MANAGERS"- locked={!platform.plan.secretManagersEnabled}- lockTitle={t('Enable Secret Managers')}- lockDescription={t('Manage your secrets from a single and secure place')}- >- <div className="flex-col w-full">- <DashboardPageHeader- title={t('Secret Managers')}- description={t('Manage Secret Manager connections')}- >- <AddEditSecretManagerConnectionDialog>- <AnimatedIconButton icon={PlusIcon} iconSize={16} size="sm">- {t('New Connection')}- </AnimatedIconButton>- </AddEditSecretManagerConnectionDialog>- </DashboardPageHeader>- <DataTable- emptyStateTextTitle={t('No connections found')}- emptyStateTextDescription={t(- 'Add a secret manager connection to manage your secrets',- )}- emptyStateIcon={<KeyRound className="size-14" />}- columns={columns}- page={page}- isLoading={isLoading}- isError={isConnectionsError}- errorStateEntity={t('secret managers')}- onRetry={refetchConnections}- hidePagination={true}- />- </div>- </LockedFeatureGuard>+ <div className="flex-col w-full">+ <DashboardPageHeader+ title={t('Secret Managers')}+ description={t('Manage Secret Manager connections')}+ >+ <AddEditSecretManagerConnectionDialog>+ <AnimatedIconButton icon={PlusIcon} iconSize={16} size="sm">+ {t('New Connection')}+ </AnimatedIconButton>+ </AddEditSecretManagerConnectionDialog>+ </DashboardPageHeader>+ <DataTable+ emptyStateTextTitle={t('No connections found')}+ emptyStateTextDescription={t(+ 'Add a secret manager connection to manage your secrets',+ )}+ emptyStateIcon={<KeyRound className="size-14" />}+ columns={columns}+ page={page}+ isLoading={isSample ? false : isLoading}+ isError={isSample ? false : isConnectionsError}+ errorStateEntity={t('secret managers')}+ onRetry={refetchConnections}+ hidePagination={true}+ />+ </div>);};diff --git a/packages/web/src/app/routes/platform/security/sso/index.tsx b/packages/web/src/app/routes/platform/security/sso/index.tsxindex 38b5a549f09..328e9c8ff1c 100644--- a/packages/web/src/app/routes/platform/security/sso/index.tsx+++ b/packages/web/src/app/routes/platform/security/sso/index.tsx@@ -4,7 +4,6 @@ import { CheckCircle, LockIcon, MailIcon, Earth } from 'lucide-react';import { toast } from 'sonner';import { CenteredPage } from '@/app/components/centered-page';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { AllowedDomainDialog } from '@/app/routes/platform/security/sso/allowed-domain';import { ConfigureSamlDialog } from '@/app/routes/platform/security/sso/saml-dialog';import { Badge } from '@/components/ui/badge';@@ -50,129 +49,118 @@ const SSOPage = () => {});return (- <LockedFeatureGuard- featureKey="SSO"- locked={!platform.plan.ssoEnabled}- lockTitle={t('Enable Single Sign On')}- lockDescription={t(- 'Let your users sign in with your current SSO provider or give them self serve sign up access',- )}+ <CenteredPage+ title={t('Single Sign On')}+ description={t('Manage single sign on providers')}>- <CenteredPage- title={t('Single Sign On')}- description={t('Manage single sign on providers')}- >- <div className="flex flex-col gap-4">- <Item variant="outline">- <ItemMedia variant="icon">- <Earth />- </ItemMedia>- <ItemContent>- <ItemTitle>{t('Allowed Domains')}</ItemTitle>- <ItemDescription>- {t('Restrict authentication to specific email domains.')}- </ItemDescription>- {(platform?.allowedAuthDomains ?? []).length > 0 && (- <div className="mt-1 gap-2 flex">- {(platform?.allowedAuthDomains ?? []).map((text, index) => (- <Badge key={index} variant={'outline'}>- {text}- </Badge>- ))}- </div>- )}- </ItemContent>- <ItemActions>- <AllowedDomainDialog platform={platform} refetch={refetch} />- </ItemActions>- </Item>+ <div className="flex flex-col gap-4">+ <Item variant="outline">+ <ItemMedia variant="icon">+ <Earth />+ </ItemMedia>+ <ItemContent>+ <ItemTitle>{t('Allowed Domains')}</ItemTitle>+ <ItemDescription>+ {t('Restrict authentication to specific email domains.')}+ </ItemDescription>+ {(platform?.allowedAuthDomains ?? []).length > 0 && (+ <div className="mt-1 gap-2 flex">+ {(platform?.allowedAuthDomains ?? []).map((text, index) => (+ <Badge key={index} variant={'outline'}>+ {text}+ </Badge>+ ))}+ </div>+ )}+ </ItemContent>+ <ItemActions>+ <AllowedDomainDialog platform={platform} refetch={refetch} />+ </ItemActions>+ </Item>- <Item variant="outline">- <ItemMedia variant="icon">- <img className="size-6" src={GoogleIcon} alt="icon" />- </ItemMedia>- <ItemContent>- <ItemTitle>Google</ItemTitle>- <ItemDescription>- {t(- "Allow logins through google's single sign-on functionality.",- )}- </ItemDescription>- </ItemContent>- <ItemActions>- <Switch- checked={platform.googleAuthEnabled}- onCheckedChange={() =>- toggleGoogleAuth({- googleAuthEnabled: !platform.googleAuthEnabled,- })- }- disabled={isGoogleAuthPending}- />- </ItemActions>- </Item>+ <Item variant="outline">+ <ItemMedia variant="icon">+ <img className="size-6" src={GoogleIcon} alt="icon" />+ </ItemMedia>+ <ItemContent>+ <ItemTitle>Google</ItemTitle>+ <ItemDescription>+ {t("Allow logins through google's single sign-on functionality.")}+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <Switch+ checked={platform.googleAuthEnabled}+ onCheckedChange={() =>+ toggleGoogleAuth({+ googleAuthEnabled: !platform.googleAuthEnabled,+ })+ }+ disabled={isGoogleAuthPending}+ />+ </ItemActions>+ </Item>- <Item variant="outline">- <ItemMedia variant="icon">- <LockIcon />- </ItemMedia>- <ItemContent>- <ItemTitle>{t('SAML 2.0')}</ItemTitle>- <ItemDescription>- {t(- "Allow logins through saml 2.0's single sign-on functionality.",- )}- </ItemDescription>- {platform.ssoDomain && (- <div className="mt-1 gap-2 flex items-center">- <Badge variant="outline">{platform.ssoDomain}</Badge>- {ssoDomainVerified ? (- <span className="flex items-center gap-1 text-xs text-success-600">- <CheckCircle className="size-3" />- {t('Verified')}- </span>- ) : (- <span className="text-xs text-warning">- {t('Pending verification')}- </span>- )}- </div>+ <Item variant="outline">+ <ItemMedia variant="icon">+ <LockIcon />+ </ItemMedia>+ <ItemContent>+ <ItemTitle>{t('SAML 2.0')}</ItemTitle>+ <ItemDescription>+ {t(+ "Allow logins through saml 2.0's single sign-on functionality.",)}- </ItemContent>- <ItemActions>- <ConfigureSamlDialog- platform={platform}- refetch={refetch}- connected={samlConnected}- />- </ItemActions>- </Item>+ </ItemDescription>+ {platform.ssoDomain && (+ <div className="mt-1 gap-2 flex items-center">+ <Badge variant="outline">{platform.ssoDomain}</Badge>+ {ssoDomainVerified ? (+ <span className="flex items-center gap-1 text-xs text-success-600">+ <CheckCircle className="size-3" />+ {t('Verified')}+ </span>+ ) : (+ <span className="text-xs text-warning">+ {t('Pending verification')}+ </span>+ )}+ </div>+ )}+ </ItemContent>+ <ItemActions>+ <ConfigureSamlDialog+ platform={platform}+ refetch={refetch}+ connected={samlConnected}+ />+ </ItemActions>+ </Item>- <Item variant="outline">- <ItemMedia variant="icon">- <MailIcon />- </ItemMedia>- <ItemContent>- <ItemTitle>{t('Allowed Email Login')}</ItemTitle>- <ItemDescription>- {t('Allow logins through email and password.')}- </ItemDescription>- </ItemContent>- <ItemActions>- <Switch- checked={emailAuthEnabled}- onCheckedChange={() =>- toggleEmailAuthentication({- emailAuthEnabled: !platform.emailAuthEnabled,- })- }- disabled={isEmailAuthPending}- />- </ItemActions>- </Item>- </div>- </CenteredPage>- </LockedFeatureGuard>+ <Item variant="outline">+ <ItemMedia variant="icon">+ <MailIcon />+ </ItemMedia>+ <ItemContent>+ <ItemTitle>{t('Allowed Email Login')}</ItemTitle>+ <ItemDescription>+ {t('Allow logins through email and password.')}+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <Switch+ checked={emailAuthEnabled}+ onCheckedChange={() =>+ toggleEmailAuthentication({+ emailAuthEnabled: !platform.emailAuthEnabled,+ })+ }+ disabled={isEmailAuthPending}+ />+ </ItemActions>+ </Item>+ </div>+ </CenteredPage>);};diff --git a/packages/web/src/app/routes/platform/setup/connections/index.tsx b/packages/web/src/app/routes/platform/setup/connections/index.tsxindex 8b9337c3e4c..44efc266948 100644--- a/packages/web/src/app/routes/platform/setup/connections/index.tsx+++ b/packages/web/src/app/routes/platform/setup/connections/index.tsx@@ -19,7 +19,6 @@ import { useMemo, useState } from 'react';import { useLocation } from 'react-router-dom';import { DashboardPageHeader } from '@/app/components/dashboard-page-header';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { NewConnectionDialog } from '@/app/connections/new-connection-dialog';import { ReconnectButtonDialog } from '@/app/connections/reconnect-button-dialog';import { AnimatedIconButton } from '@/components/custom/animated-icon-button';@@ -53,6 +52,8 @@ import { useAuthorization } from '@/hooks/authorization-hooks';import { platformHooks } from '@/hooks/platform-hooks';import { formatUtils } from '@/lib/format-utils';+import { sampleData } from '../../sample-data';+const STATUS_QUERY_PARAM = 'status';const filters: DataTableFilters<keyof AppConnectionWithoutSensitiveData>[] = [{@@ -76,13 +77,13 @@ const filters: DataTableFilters<keyof AppConnectionWithoutSensitiveData>[] = [];const GlobalConnectionsTable = () => {+ const { platform } = platformHooks.useCurrentPlatform();const [refresh, setRefresh] = useState(0);const [selectedRows, setSelectedRows] = useState<Array<AppConnectionWithoutSensitiveData>>([]);const { checkAccess } = useAuthorization();const location = useLocation();- const { platform } = platformHooks.useCurrentPlatform();const columns: ColumnDef<RowDataWithActions<AppConnectionWithoutSensitiveData>,@@ -229,6 +230,7 @@ const GlobalConnectionsTable = () => {staleTime: 0,gcTime: 0,});+ const isSample = !platform.plan.globalConnectionsEnabled;const userHasPermissionToWriteAppConnection = checkAccess(Permission.WRITE_APP_CONNECTION,@@ -308,40 +310,28 @@ const GlobalConnectionsTable = () => {return (<div className="flex-col w-full">- <LockedFeatureGuard- featureKey="GLOBAL_CONNECTIONS"- locked={!platform.plan.globalConnectionsEnabled}- lockTitle={t('Enable Global Connections')}- lockDescription={t(- 'Manage platform-wide connections to external systems.',+ <DashboardPageHeader+ description={t('Manage platform-wide connections to external systems.')}+ title={t('Global Connections')}+ />+ <DataTable+ emptyStateTextTitle={t('No global connections found')}+ emptyStateTextDescription={t(+ 'Create a global connection that can be shared to multiple projects',)}- lockVideoUrl="https://cdn.activepieces.com/videos/showcase/global-connections.mp4"- >- <DashboardPageHeader- description={t(- 'Manage platform-wide connections to external systems.',- )}- title={t('Global Connections')}- />- <DataTable- emptyStateTextTitle={t('No global connections found')}- emptyStateTextDescription={t(- 'Create a global connection that can be shared to multiple projects',- )}- emptyStateIcon={<Globe className="size-14" />}- columns={columns}- page={globalConnections}- isLoading={isLoadingGlobalConnections}- isError={isGlobalConnectionsError}- errorStateEntity={t('connections')}- onRetry={refetchGlobalConnections}- filters={filters}- selectColumn={true}- onSelectedRowsChange={setSelectedRows}- bulkActions={bulkActions}- toolbarButtons={toolbarButtons}- />- </LockedFeatureGuard>+ emptyStateIcon={<Globe className="size-14" />}+ columns={columns}+ page={isSample ? sampleData.globalConnectionsPage() : globalConnections}+ isLoading={isSample ? false : isLoadingGlobalConnections}+ isError={isGlobalConnectionsError}+ errorStateEntity={t('connections')}+ onRetry={refetchGlobalConnections}+ filters={filters}+ selectColumn={true}+ onSelectedRowsChange={setSelectedRows}+ bulkActions={bulkActions}+ toolbarButtons={toolbarButtons}+ /></div>);};diff --git a/packages/web/src/app/routes/platform/setup/templates/index.tsx b/packages/web/src/app/routes/platform/setup/templates/index.tsxindex 4cb45d79d53..df4971797b8 100644--- a/packages/web/src/app/routes/platform/setup/templates/index.tsx+++ b/packages/web/src/app/routes/platform/setup/templates/index.tsx@@ -8,7 +8,6 @@ import { useSearchParams } from 'react-router-dom';import { toast } from 'sonner';import { DashboardPageHeader } from '@/app/components/dashboard-page-header';-import { LockedFeatureGuard } from '@/app/components/locked-feature-guard';import { AnimatedIconButton } from '@/components/custom/animated-icon-button';import {DataTable,@@ -30,13 +29,15 @@ import { PieceIconList } from '@/features/pieces';import { templatesApi, templatesMutations } from '@/features/templates';import { platformHooks } from '@/hooks/platform-hooks';+import { sampleData } from '../../sample-data';+import { CreateTemplateDialog } from './create-template-dialog';import { UpdateTemplateDialog } from './update-template-dialog';const PlatformTemplatesPage = () => {- const { platform } = platformHooks.useCurrentPlatform();-const [searchParams] = useSearchParams();+ const { platform } = platformHooks.useCurrentPlatform();+ const isSample = !platform.plan.manageTemplatesEnabled;const { data, isLoading, isError, refetch } = useQuery({queryKey: ['templates', searchParams.toString()],staleTime: 0,@@ -204,65 +205,54 @@ const PlatformTemplatesPage = () => {[refetch],);- const isEnabled = platform.plan.manageTemplatesEnabled;return (- <LockedFeatureGuard- featureKey="TEMPLATES"- locked={!isEnabled}- lockTitle={t('Unlock Templates')}- lockDescription={t(- 'Convert the most common automations into reusable templates 1 click away from your users',- )}- lockVideoUrl="https://cdn.activepieces.com/videos/showcase/templates.mp4"- >- <div className="flex flex-col w-full">- <DashboardPageHeader- description={t(- 'Convert the most common automations into reusable templates',- )}- title={t('Templates')}- />- <DataTable- emptyStateTextTitle={t('No templates found')}- emptyStateTextDescription={t(- 'Create a template for your user to inspire them',- )}- emptyStateIcon={<FileText className="size-14" />}- columns={columnsWithCheckbox}- page={data}- hidePagination={true}- isLoading={isLoading}- isError={isError}- errorStateEntity={t('templates')}- onRetry={refetch}- bulkActions={bulkActions}- toolbarButtons={toolbarButtons}- actions={[- (row) => {- return (- <div className="flex items-end justify-end">- <Tooltip>- <TooltipTrigger>- <UpdateTemplateDialog- onDone={() => refetch()}- template={row}- >- <Button variant="ghost" className="size-8 p-0">- <Pencil className="size-4" />- </Button>- </UpdateTemplateDialog>- </TooltipTrigger>- <TooltipContent side="bottom">- {t('Edit template')}- </TooltipContent>- </Tooltip>- </div>- );- },- ]}- />- </div>- </LockedFeatureGuard>+ <div className="flex flex-col w-full">+ <DashboardPageHeader+ description={t(+ 'Convert the most common automations into reusable templates',+ )}+ title={t('Templates')}+ />+ <DataTable+ emptyStateTextTitle={t('No templates found')}+ emptyStateTextDescription={t(+ 'Create a template for your user to inspire them',+ )}+ emptyStateIcon={<FileText className="size-14" />}+ columns={columnsWithCheckbox}+ page={isSample ? sampleData.templatesPage() : data}+ hidePagination={true}+ isLoading={isLoading}+ isError={isError}+ errorStateEntity={t('templates')}+ onRetry={refetch}+ bulkActions={bulkActions}+ toolbarButtons={toolbarButtons}+ actions={[+ (row) => {+ return (+ <div className="flex items-end justify-end">+ <Tooltip>+ <TooltipTrigger>+ <UpdateTemplateDialog+ onDone={() => refetch()}+ template={row}+ >+ <Button variant="ghost" className="size-8 p-0">+ <Pencil className="size-4" />+ </Button>+ </UpdateTemplateDialog>+ </TooltipTrigger>+ <TooltipContent side="bottom">+ {t('Edit template')}+ </TooltipContent>+ </Tooltip>+ </div>+ );+ },+ ]}+ />+ </div>);};diff --git a/packages/web/test/app/billing/feature-gating.test.tsx b/packages/web/test/app/billing/feature-gating.test.tsxindex 2253645177c..0481637c8b8 100644--- a/packages/web/test/app/billing/feature-gating.test.tsx+++ b/packages/web/test/app/billing/feature-gating.test.tsx@@ -94,6 +94,7 @@ vi.mock('@/components/ui/sidebar-shadcn', () => ({),}));+import { FeatureSample } from '@/app/components/feature-sample';import { FeatureTeaser } from '@/app/components/feature-teaser';import { CreateProjectButton } from '@/features/projects/components/create-project-button';@@ -242,3 +243,25 @@ describe('feature teaser', () => {);});});++describe('feature sample', () => {+ it('offers contact sales on community', () => {+ edition = 'ce';+ render(+ <FeatureSample locked title="Unlock Audit Logs" featureKey="AUDIT_LOGS">+ <div />+ </FeatureSample>,+ );+ expect(screen.getByRole('button', { name: /contact sales/i })).toBeDefined();+ });++ it('shows no sales form for a surface with no feature key', () => {+ edition = 'ce';+ render(+ <FeatureSample locked title="Unlock Audit Logs">+ <div />+ </FeatureSample>,+ );+ expect(screen.queryByRole('button', { name: /contact sales/i })).toBeNull();+ });+});