@cosmicdrift/kumiko-samples 0.409.0 → 0.411.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +36 -1
- package/packages/bundled-features/src/auth-email-password/changes.json +24 -0
- package/packages/bundled-features/src/auth-email-password/handlers/login-options.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/seeding.ts +84 -6
- package/packages/bundled-features/src/auth-email-password/web/i18n.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +48 -3
- package/packages/bundled-features/src/auth-email-password/web/static-account.ts +190 -0
- package/packages/bundled-features/src/auth-email-password/web/static-client.ts +226 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +4 -1
- package/packages/bundled-features/src/contact/changes.json +6 -0
- package/packages/bundled-features/src/contact/client/contact-website-client.ts +29 -0
- package/packages/bundled-features/src/contact/client/index.ts +9 -0
- package/packages/bundled-features/src/contact/feature.ts +3 -0
- package/packages/bundled-features/src/contact/handlers/access.ts +1 -1
- package/packages/bundled-features/src/contact/handlers/challenge.query.ts +1 -1
- package/packages/bundled-features/src/contact/handlers/submit.write.ts +1 -1
- package/packages/bundled-features/src/contact/i18n.ts +4 -1
- package/packages/bundled-features/src/contact/options.ts +1 -1
- package/packages/bundled-features/src/contact/screens.ts +1 -0
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/packages/bundled-features/src/foundation-shared/demo-admin-env.ts +11 -0
- package/packages/bundled-features/src/foundation-shared/index.ts +5 -1
- package/packages/bundled-features/src/inbound-provider-imap/changes.json +6 -0
- package/packages/bundled-features/src/inbound-provider-imap/imap-client.ts +3 -1
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/packages/bundled-features/src/presence/changes.json +8 -0
- package/packages/bundled-features/src/presence/feature.ts +25 -0
- package/packages/bundled-features/src/presence/handlers/heartbeat.write.ts +52 -0
- package/packages/bundled-features/src/presence/handlers/leave.write.ts +41 -0
- package/packages/bundled-features/src/presence/handlers/list.query.ts +39 -0
- package/packages/bundled-features/src/presence/index.ts +7 -0
- package/packages/bundled-features/src/presence/options.ts +30 -0
- package/packages/bundled-features/src/presence/payloads.ts +26 -0
- package/packages/bundled-features/src/presence/room.ts +65 -0
- package/packages/bundled-features/src/presence/store.ts +185 -0
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +1 -1
- package/packages/bundled-features/src/sessions/feature.ts +6 -2
- package/packages/bundled-features/src/sessions/handlers/last-activity-probe.route.ts +19 -0
- package/packages/bundled-features/src/subscription-paddle/checkout-config.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +1 -1
- package/packages/bundled-features/src/tenant-inactivity/changes.json +12 -0
- package/packages/bundled-features/src/tenant-inactivity/check-inactive-tenants.ts +14 -6
- package/packages/bundled-features/src/tenant-inactivity/constants.ts +4 -1
- package/packages/bundled-features/src/tenant-inactivity/handlers/inactivity-state.query.ts +2 -1
- package/packages/bundled-features/src/tenant-inactivity/handlers/keep-account.write.ts +5 -1
- package/packages/bundled-features/src/tenant-inactivity/options.ts +1 -0
- package/packages/bundled-features/src/tenant-inactivity/remote-activity.ts +6 -1
- package/packages/bundled-features/src/tenant-inactivity/static-keep-account.ts +37 -0
- package/packages/bundled-features/src/tenant-lifecycle/constants.ts +2 -0
- package/packages/bundled-features/src/tenant-lifecycle/handlers/cancel-destruction.write.ts +6 -2
- package/packages/bundled-features/src/tenant-lifecycle/handlers/request-destruction.write.ts +2 -1
- package/packages/bundled-features/src/tenant-lifecycle/index.ts +1 -0
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +4 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +1 -0
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +4 -1
- package/packages/bundled-features/src/waitlist/changes.json +12 -0
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +1 -2
- package/packages/bundled-features/src/waitlist/static-submit.ts +56 -0
- package/samples/apps/styleguide/src/features/widgets/i18n.ts +143 -0
- package/samples/apps/styleguide/src/features/widgets/web/VariantsDemo.tsx +276 -0
- package/samples/apps/styleguide/src/features/widgets/web/Widgets.tsx +3 -0
- package/samples/apps/styleguide/src/features/workboard/feature.ts +1 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +26 -25
- package/samples/apps/use-all-bundled/playwright.config.ts +0 -2
- package/samples/apps/use-all-bundled/src/run-config.ts +6 -15
- package/samples/recipes/anonymous-access/README.md +2 -0
- package/samples/recipes/anonymous-access/src/feature.ts +7 -1
- package/samples/recipes/contact/README.md +10 -4
- package/samples/recipes/contact/src/feature.ts +1 -1
- package/samples/recipes/realtime-sse/README.md +1 -0
- package/samples/recipes/realtime-sse/package.json +1 -0
- package/samples/recipes/realtime-sse/src/feature.ts +9 -0
- package/samples/recipes/record-detail-layout/README.md +1 -0
- package/samples/recipes/record-detail-layout/src/feature.ts +10 -0
- package/samples/recipes/wizard-form/README.md +9 -0
- package/samples/recipes/wizard-form/src/feature.ts +13 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": "samples/apps/use-all-bundled APP_FEATURES (composeFeatures includeBundled + signup)",
|
|
3
|
-
"featureCount":
|
|
3
|
+
"featureCount": 93,
|
|
4
4
|
"features": [
|
|
5
5
|
{
|
|
6
6
|
"name": "account-security",
|
|
@@ -704,10 +704,11 @@
|
|
|
704
704
|
"delivery",
|
|
705
705
|
"user-data-rights",
|
|
706
706
|
"files",
|
|
707
|
-
"notes-history"
|
|
707
|
+
"notes-history"
|
|
708
|
+
],
|
|
709
|
+
"optionalRequires": [
|
|
708
710
|
"channel-telegram"
|
|
709
711
|
],
|
|
710
|
-
"optionalRequires": [],
|
|
711
712
|
"configReads": [],
|
|
712
713
|
"exposesApis": [],
|
|
713
714
|
"usesApis": [],
|
|
@@ -742,27 +743,6 @@
|
|
|
742
743
|
"readRoles": [
|
|
743
744
|
"SystemAdmin"
|
|
744
745
|
]
|
|
745
|
-
},
|
|
746
|
-
{
|
|
747
|
-
"key": "telegram-chat",
|
|
748
|
-
"qualifiedName": "contact:config:telegram-chat",
|
|
749
|
-
"type": "text",
|
|
750
|
-
"scope": "system",
|
|
751
|
-
"default": "",
|
|
752
|
-
"encrypted": false,
|
|
753
|
-
"computed": false,
|
|
754
|
-
"validated": false,
|
|
755
|
-
"options": null,
|
|
756
|
-
"bounds": null,
|
|
757
|
-
"pattern": {
|
|
758
|
-
"regex": "^$|^(-?[0-9]{1,20}|@[A-Za-z0-9_]{5,32})$"
|
|
759
|
-
},
|
|
760
|
-
"writeRoles": [
|
|
761
|
-
"SystemAdmin"
|
|
762
|
-
],
|
|
763
|
-
"readRoles": [
|
|
764
|
-
"SystemAdmin"
|
|
765
|
-
]
|
|
766
746
|
}
|
|
767
747
|
],
|
|
768
748
|
"secrets": [],
|
|
@@ -773,7 +753,6 @@
|
|
|
773
753
|
"contact:write:reply",
|
|
774
754
|
"contact:write:report",
|
|
775
755
|
"contact:write:send-reply-mail",
|
|
776
|
-
"contact:write:send-test",
|
|
777
756
|
"contact:write:submit"
|
|
778
757
|
],
|
|
779
758
|
"uiHints": {
|
|
@@ -2270,6 +2249,28 @@
|
|
|
2270
2249
|
"recommended": false
|
|
2271
2250
|
}
|
|
2272
2251
|
},
|
|
2252
|
+
{
|
|
2253
|
+
"name": "presence",
|
|
2254
|
+
"description": "Who else is on this record right now: a browser sends a heartbeat every 15 seconds for one row of an allow-listed entity and gets the other viewers and editors back, with a live signal to them on a change. State is ephemeral (Redis hash per tenant, entity and row, in-memory without Redis), keyed by the session tenant, expires after ttlSeconds without a heartbeat and holds user ids only; display names are looked up per response. A caller sees presence only for rows visible to them. Mount with createPresenceFeature({ entities: [\"task\"] }).",
|
|
2255
|
+
"toggleableDefault": null,
|
|
2256
|
+
"requires": [],
|
|
2257
|
+
"optionalRequires": [],
|
|
2258
|
+
"configReads": [],
|
|
2259
|
+
"exposesApis": [],
|
|
2260
|
+
"usesApis": [],
|
|
2261
|
+
"extensionsUsed": [],
|
|
2262
|
+
"configKeys": [],
|
|
2263
|
+
"secrets": [],
|
|
2264
|
+
"writeHandlers": [
|
|
2265
|
+
"presence:write:heartbeat",
|
|
2266
|
+
"presence:write:leave"
|
|
2267
|
+
],
|
|
2268
|
+
"uiHints": {
|
|
2269
|
+
"displayLabel": "Presence",
|
|
2270
|
+
"category": "communication",
|
|
2271
|
+
"recommended": false
|
|
2272
|
+
}
|
|
2273
|
+
},
|
|
2273
2274
|
{
|
|
2274
2275
|
"name": "rate-limiting",
|
|
2275
2276
|
"description": "Adds an ops-side `rate-limiting:query:status` query handler for inspecting current bucket state; the actual request throttling is wired automatically by the dispatcher when any handler declares a `rateLimit` option (e.g. `{ per: 'user', limit: 3, windowSeconds: 60 }`) or when you pass `context.rateLimit` to `buildServer`. Loading this feature is optional if you only need L3 per-handler rate limits and have no need for ops introspection.",
|
|
@@ -8,7 +8,6 @@ import { chromium } from "@playwright/test";
|
|
|
8
8
|
import { E2E_PORTS } from "../../e2e/e2e-ports";
|
|
9
9
|
|
|
10
10
|
const PORT = E2E_PORTS["framework/use-all-bundled"];
|
|
11
|
-
const FAKE_TELEGRAM_PORT = E2E_PORTS["framework/use-all-bundled-fake-telegram"];
|
|
12
11
|
const PRINT_SERVICE_PORT = E2E_PORTS["framework/use-all-bundled-puppeteer-service"];
|
|
13
12
|
// Both sides of the print service handshake; any value of 16+ characters will do for a local run.
|
|
14
13
|
const PRINT_SERVICE_TOKEN = "use-all-bundled-e2e-print-service";
|
|
@@ -19,7 +18,6 @@ const appConfig = defineAppE2eConfig({
|
|
|
19
18
|
...PLAYWRIGHT_DEMO_ENV,
|
|
20
19
|
PUPPETEER_SERVICE_URL: `http://127.0.0.1:${PRINT_SERVICE_PORT}`,
|
|
21
20
|
PUPPETEER_AUTH_TOKEN: PRINT_SERVICE_TOKEN,
|
|
22
|
-
SAMPLE_TELEGRAM_API_URL: `http://127.0.0.1:${FAKE_TELEGRAM_PORT}`,
|
|
23
21
|
},
|
|
24
22
|
});
|
|
25
23
|
|
|
@@ -35,10 +35,7 @@ import {
|
|
|
35
35
|
} from "@cosmicdrift/kumiko-bundled-features/channel-push";
|
|
36
36
|
import { createChannelSlackFeature } from "@cosmicdrift/kumiko-bundled-features/channel-slack";
|
|
37
37
|
import { createChannelTeamsFeature } from "@cosmicdrift/kumiko-bundled-features/channel-teams";
|
|
38
|
-
import {
|
|
39
|
-
createChannelTelegramFeature,
|
|
40
|
-
type TelegramChannelOptions,
|
|
41
|
-
} from "@cosmicdrift/kumiko-bundled-features/channel-telegram";
|
|
38
|
+
import { createChannelTelegramFeature } from "@cosmicdrift/kumiko-bundled-features/channel-telegram";
|
|
42
39
|
import { createComplianceProfilesFeature } from "@cosmicdrift/kumiko-bundled-features/compliance-profiles";
|
|
43
40
|
import { createComplianceProfilesOpsFeature } from "@cosmicdrift/kumiko-bundled-features/compliance-profiles-ops";
|
|
44
41
|
import {
|
|
@@ -77,6 +74,7 @@ import {
|
|
|
77
74
|
import { createNotesHistoryFeature } from "@cosmicdrift/kumiko-bundled-features/notes-history";
|
|
78
75
|
import { createNotesHistoryUserDataFeature } from "@cosmicdrift/kumiko-bundled-features/notes-history-user-data";
|
|
79
76
|
import { createPersonalAccessTokensFeature } from "@cosmicdrift/kumiko-bundled-features/personal-access-tokens";
|
|
77
|
+
import { createPresenceFeature } from "@cosmicdrift/kumiko-bundled-features/presence";
|
|
80
78
|
import { createReadinessFeature } from "@cosmicdrift/kumiko-bundled-features/readiness";
|
|
81
79
|
import { createRendererFoundationFeature } from "@cosmicdrift/kumiko-bundled-features/renderer-foundation";
|
|
82
80
|
import { createRendererPdfFeature } from "@cosmicdrift/kumiko-bundled-features/renderer-pdf";
|
|
@@ -134,18 +132,10 @@ const stubPushTransport: PushTransport = {
|
|
|
134
132
|
// no token minted here is ever trusted by a deployment.
|
|
135
133
|
const SMOKE_HMAC_SECRET = "use-all-bundled-smoke-hmac-key-0123456789";
|
|
136
134
|
|
|
137
|
-
// The e2e points the Telegram channel at a local stub so the contact forward reads "delivered" without the real Bot API.
|
|
138
|
-
function fakeTelegramApiOptions(): TelegramChannelOptions {
|
|
139
|
-
const apiBaseUrl = process.env["SAMPLE_TELEGRAM_API_URL"];
|
|
140
|
-
if (apiBaseUrl === undefined) return {};
|
|
141
|
-
return { apiBaseUrl, allowedHosts: [new URL(apiBaseUrl).hostname], requireHttps: false };
|
|
142
|
-
}
|
|
143
|
-
|
|
144
135
|
export const APP_FEATURES = [
|
|
145
136
|
localeDe(),
|
|
146
137
|
// foundations not in the auto-mounted bundled-set
|
|
147
|
-
|
|
148
|
-
createSecretsFeature({ roles: ["TenantAdmin", "SystemAdmin"] }),
|
|
138
|
+
createSecretsFeature(),
|
|
149
139
|
...composeSecurityStack(),
|
|
150
140
|
// auth-mfa: composeFeatures auto-threads mfaStatusCheckerFromFeature into
|
|
151
141
|
// the auto-mounted auth-email-password login handler when this feature is
|
|
@@ -201,7 +191,7 @@ export const APP_FEATURES = [
|
|
|
201
191
|
createChannelSlackFeature(),
|
|
202
192
|
createChannelDiscordFeature(),
|
|
203
193
|
createChannelTeamsFeature(),
|
|
204
|
-
createChannelTelegramFeature(
|
|
194
|
+
createChannelTelegramFeature(),
|
|
205
195
|
|
|
206
196
|
...composeMailStack({ transports: ["inmemory", "smtp"] }),
|
|
207
197
|
|
|
@@ -328,7 +318,6 @@ export const APP_FEATURES = [
|
|
|
328
318
|
appName: "publicstatus",
|
|
329
319
|
appVersion: "2026.10.30",
|
|
330
320
|
fields: { phone: "optional" },
|
|
331
|
-
telegram: true,
|
|
332
321
|
reportCancelTarget: "admin-shell:screen:tenant-overview",
|
|
333
322
|
// Lowest values the options allow, so the e2e submit does not wait on the challenge.
|
|
334
323
|
spamProtection: { minSubmitSeconds: 0, proofOfWorkBits: 8 },
|
|
@@ -433,6 +422,8 @@ export const APP_FEATURES = [
|
|
|
433
422
|
// notes-history: default roles are TenantAdmin/TenantMember; same
|
|
434
423
|
// SystemAdmin-operator reasoning as tags above.
|
|
435
424
|
createNotesHistoryFeature({ roles: ["TenantAdmin", "TenantMember", "SystemAdmin"] }),
|
|
425
|
+
// presence: no host entity in this sample opts in, so it only mounts the handlers.
|
|
426
|
+
createPresenceFeature(),
|
|
436
427
|
// notes-history-user-data: GDPR export/erase coverage for note-entry.
|
|
437
428
|
// Depends (optionally) on notes-history + (hard) on user-data-rights —
|
|
438
429
|
// both mounted here.
|
|
@@ -6,6 +6,8 @@ Public endpoints without a logged-in user.
|
|
|
6
6
|
|
|
7
7
|
- `access: "anonymous"` on handlers that must stay public
|
|
8
8
|
- Rate limits that still bind anonymous callers (`per: "ip+handler"`)
|
|
9
|
+
- `anySignedIn: true` next to `anonymous`, so a visitor who is signed in with a role the
|
|
10
|
+
handler does not list is not turned away from a public form
|
|
9
11
|
|
|
10
12
|
## Source
|
|
11
13
|
|
|
@@ -104,7 +104,13 @@ export const anonymousAccessFeature = defineFeature("shop", (r) => {
|
|
|
104
104
|
// anonymous root handler — the runtime personal-data gate
|
|
105
105
|
// (write-origin.ts) requires this explicit opt-in, the same way the
|
|
106
106
|
// boot validator would reject an openToAll declaration missing it.
|
|
107
|
-
|
|
107
|
+
// The browser sends the session cookie along, so a signed-in visitor arrives with its
|
|
108
|
+
// roles; anySignedIn keeps the checkout open to them whatever those roles are.
|
|
109
|
+
access: {
|
|
110
|
+
roles: [...access.anonymous, "User"],
|
|
111
|
+
personalData: "public-intake",
|
|
112
|
+
anySignedIn: true,
|
|
113
|
+
},
|
|
108
114
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
109
115
|
});
|
|
110
116
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Public contact form backend. The `contact` bundled feature stores questions, contact
|
|
4
4
|
requests and problem reports from website visitors and notifies every SystemAdmin (mail,
|
|
5
|
-
|
|
5
|
+
Telegram only when the app turns it on). The notification names only the kind, the app and a link into the inbox:
|
|
6
6
|
no name, address, phone, subject or message. Telegram is a third party where nothing can be
|
|
7
7
|
shredded or recalled, so it gets the same minimal text. Website senders get a fixed
|
|
8
8
|
acknowledgement that repeats nothing they typed; signed-in admin reports get a copy.
|
|
@@ -40,7 +40,13 @@ bun test --config=bunfig.integration.toml samples/recipes/contact
|
|
|
40
40
|
## Integration into a real app
|
|
41
41
|
|
|
42
42
|
1. Mount `createContactFeature({ appName })` plus delivery, a mail channel, `user-data-rights`,
|
|
43
|
-
`files` with a file provider
|
|
43
|
+
`files` with a file provider and `config`.
|
|
44
44
|
2. Run `kumiko schema generate` (new tables, plus the delivery `idempotency_key` column).
|
|
45
|
-
3. SystemAdmins set `contact:config:reply-to`
|
|
46
|
-
4. Embed `/contact/client.js` on the website; the form is yours.
|
|
45
|
+
3. SystemAdmins set `contact:config:reply-to` in the admin.
|
|
46
|
+
4. Embed `/contact/client.js` on the website; the form is yours. A website served by another
|
|
47
|
+
server can serve the same script from `CONTACT_CLIENT_SOURCE` and type its calls with
|
|
48
|
+
`ContactWebsiteClient`, both from `@cosmicdrift/kumiko-bundled-features/contact/client`.
|
|
49
|
+
|
|
50
|
+
Telegram is optional and off by default: notifications go by mail to SystemAdmins only. An app
|
|
51
|
+
that turns it on (`telegram: true`) also mounts `channel-telegram` and `secrets` for the bot
|
|
52
|
+
token, and SystemAdmins set `contact:config:telegram-chat`.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// Prerequisites the app wires itself:
|
|
15
15
|
// - `anonymousAccess` (defaultTenantId = SYSTEM_TENANT_ID) so the form needs no login
|
|
16
|
-
// - delivery with a mail channel (
|
|
16
|
+
// - delivery with a mail channel (channel-telegram only with `telegram: true`, off by default)
|
|
17
17
|
// - a file provider, because the entities carry file fields
|
|
18
18
|
// - `kumiko schema generate` for the new tables
|
|
19
19
|
|
|
@@ -6,6 +6,7 @@ Server-sent events — live updates without F5.
|
|
|
6
6
|
|
|
7
7
|
- Entity writes that fan out over SSE
|
|
8
8
|
- Client subscription shape for live lists
|
|
9
|
+
- Presence: `createPresenceFeature({ entities: ["message"] })` answers who else has a message open; the heartbeat is a write, the others get an SSE frame addressed to their user id (no names inside)
|
|
9
10
|
|
|
10
11
|
## Source
|
|
11
12
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createPresenceFeature } from "@cosmicdrift/kumiko-bundled-features/presence";
|
|
1
2
|
import {
|
|
2
3
|
createEntity,
|
|
3
4
|
createTextField,
|
|
@@ -25,3 +26,11 @@ export const chatFeature = defineFeature("chat", (r) => {
|
|
|
25
26
|
});
|
|
26
27
|
r.writeHandler(defineEntityDeleteHandler("message", messageEntity, adminWrite));
|
|
27
28
|
});
|
|
29
|
+
|
|
30
|
+
// Who else has a message open. The heartbeat is an ordinary write; the others learn about a
|
|
31
|
+
// change through an SSE frame addressed to them (`presence:event:changed`, no names inside),
|
|
32
|
+
// then refetch with `usePresence` / `usePresenceList` on the client.
|
|
33
|
+
export const presenceFeature = createPresenceFeature({
|
|
34
|
+
entities: ["message"],
|
|
35
|
+
roles: ["Admin", "User"],
|
|
36
|
+
});
|
|
@@ -9,6 +9,7 @@ header, a metrics band, and a tabbed layout instead of one long stacked form.
|
|
|
9
9
|
rendered from the columns of the screen's own query row
|
|
10
10
|
- `layout.mode: "tabs"` with two `relatedList` tabs (order items, payments)
|
|
11
11
|
and one `fields` tab (master data) — each `relatedList` runs its own query
|
|
12
|
+
- a header action with `showOnTabs: ["payments"]`, shown only while that tab is active
|
|
12
13
|
- boot-validator catching two common author mistakes: a `metrics` entry
|
|
13
14
|
with an empty `label`, and a `tabs` layout with fewer than two
|
|
14
15
|
sections
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
// not inside any tab's Card. `inlineActions` keeps download-invoice a visible
|
|
17
17
|
// button next to it where the page header would otherwise fold it into the menu.
|
|
18
18
|
//
|
|
19
|
+
// 6. `showOnTabs` limits the record-payment action to the payments tab.
|
|
20
|
+
//
|
|
19
21
|
// projectionDetail has no entity — it binds to an explicit query instead, so
|
|
20
22
|
// every field name below (header, metrics, fields) is a column of that
|
|
21
23
|
// query's row, not an entity field.
|
|
@@ -158,6 +160,14 @@ export function createOrderDeskFeature(): FeatureDefinition {
|
|
|
158
160
|
screen: "order-detail",
|
|
159
161
|
icon: "download",
|
|
160
162
|
},
|
|
163
|
+
{
|
|
164
|
+
kind: "navigate",
|
|
165
|
+
id: "record-payment",
|
|
166
|
+
label: "order-desk.action.recordPayment",
|
|
167
|
+
screen: "order-detail",
|
|
168
|
+
icon: "plus",
|
|
169
|
+
showOnTabs: ["payments"],
|
|
170
|
+
},
|
|
161
171
|
],
|
|
162
172
|
inlineActions: ["download-invoice"],
|
|
163
173
|
access: { roles: ["Support", "Admin"] },
|
|
@@ -24,6 +24,15 @@ the user left off.
|
|
|
24
24
|
mounted alongside this one (both enforced at boot). The actual
|
|
25
25
|
save/resume/discard wiring happens automatically inside `RenderEdit` —
|
|
26
26
|
this recipe never calls a form-draft handler from its own code.
|
|
27
|
+
- **Step rail texts** — a section's `subtitle` is the line under its step in
|
|
28
|
+
the rail (opt-in, `description` is never used there); `summaryField`
|
|
29
|
+
replaces it with the entered value once the step is done. `wizard.aside`
|
|
30
|
+
adds the "up next" card, and `finishDescription` the finish card on the
|
|
31
|
+
last step. Extension steps take the same three texts; on an `actionForm`
|
|
32
|
+
`summaryField` and `submitDisabledWhen` may name a field of its `fields`.
|
|
33
|
+
- **Footer options** — `wizard.saveAndCloseOnCreate` offers "Save and close" (also on the last step)
|
|
34
|
+
while creating; `wizard.submitDisabledWhen` disables Finish while a field
|
|
35
|
+
condition holds. It is UI-only: enforce the rule in a validation hook too.
|
|
27
36
|
|
|
28
37
|
## Feature composition
|
|
29
38
|
|
|
@@ -33,9 +33,20 @@ export const listingsFeature = defineFeature("listings", (r) => {
|
|
|
33
33
|
layout: {
|
|
34
34
|
mode: "wizard",
|
|
35
35
|
draft: true,
|
|
36
|
+
wizard: {
|
|
37
|
+
aside: { upNext: true, finishDescription: "Publishes the listing." },
|
|
38
|
+
saveAndCloseOnCreate: true,
|
|
39
|
+
// UI-only: the write handler would still accept a vehicle listing.
|
|
40
|
+
submitDisabledWhen: { field: "category", eq: "vehicles" },
|
|
41
|
+
},
|
|
36
42
|
sections: [
|
|
37
|
-
{
|
|
38
|
-
|
|
43
|
+
{
|
|
44
|
+
title: "Basics",
|
|
45
|
+
subtitle: "Title and category",
|
|
46
|
+
summaryField: "title",
|
|
47
|
+
fields: ["title", "category"],
|
|
48
|
+
},
|
|
49
|
+
{ title: "Pricing", subtitle: "Price and condition", fields: ["price", "condition"] },
|
|
39
50
|
{
|
|
40
51
|
kind: "extension",
|
|
41
52
|
title: "Review",
|