@processfocus/runtime-local 0.1.0-next.2 → 0.1.0-next.4
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/README.md +51 -253
- package/dist/authentication-server.mjs +52 -84
- package/dist/chunk-3wzp2sax.js +4806 -0
- package/dist/chunk-5kjvzbwr.js +512 -0
- package/dist/chunk-egeb4821.js +156 -0
- package/dist/chunk-q5v72erd.js +241 -0
- package/dist/{chunk-yhzbn4vx.js → chunk-wvbz0nmd.js} +19485 -34180
- package/dist/{chunk-352j1ayk.js → chunk-y8fnwbx0.js} +51781 -36259
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/actions.ts +12 -12
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/delegations-client.tsx +31 -21
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/page.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client-index.tsx +1 -12
- package/dist/dashboard-source/apps/frontend/app/(protected)/connected-apps/disconnect-form.tsx +57 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/connected-apps/page.tsx +97 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/client.tsx +1 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/process-state/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/page.tsx +3 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/process-state/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/client-layout.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/executions-client.tsx +1637 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/layout.tsx +5 -7
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/page.tsx +4 -1589
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-page-client.tsx +1 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/layout.tsx +41 -33
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/client.tsx +11 -17
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/list-page-client.tsx +169 -18
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/page.tsx +21 -14
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-create-form.tsx +36 -18
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-item-edit-form.tsx +22 -28
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-item-load-error.tsx +49 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-schema-form.tsx +28 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/metric-control-url-state.ts +7 -16
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-deleted-callback.ts +4 -6
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-item-detail.ts +45 -142
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/client.tsx +10 -20
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/layout.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-process-dialog.tsx +72 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-refresh-provider.tsx +65 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-refresh.ts +162 -16
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/utils.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/page.tsx +4 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/page.tsx +4 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/actions.ts +15 -18
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/page.tsx +12 -6
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/passkeys-client.tsx +7 -16
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/client.tsx +26 -48
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/page.tsx +4 -7
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/client-layout.tsx +28 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/client.tsx +1 -3
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/start-process-form.tsx +193 -117
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/layout.tsx +7 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/page.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/processes-client.tsx +60 -204
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/client.tsx +12 -51
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/page.tsx +27 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/page.tsx +5 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-flow.tsx +0 -5
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-form-preview-sheet.tsx +26 -19
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/page.tsx +5 -2
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-authorize.ts +85 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-types.ts +12 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/explorer.tsx +66 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/layout.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-handbook.ts +41 -13
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/[invitationId]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-client.tsx +442 -365
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/new/page.tsx +8 -2
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations-table.tsx +61 -43
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/page.tsx +6 -67
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/providers/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/roles/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/settings-client.tsx +111 -189
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/settings-page.tsx +86 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/client.tsx +141 -256
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/tokens/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users-table.tsx +6 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/page.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/client.tsx +30 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/page.tsx +3 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/client.tsx +2 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/page.tsx +3 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/complete-todo-form.tsx +47 -54
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/public-completion-correction-form.tsx +37 -54
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/todo-form-actions.tsx +1 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/correct/[...stepPath]/page.tsx +3 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/layout.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/lib/mobile-todo-list.ts +4 -25
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/page.tsx +4 -1315
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/to-dos-client.tsx +1282 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/callback/route.ts +81 -65
- package/dist/dashboard-source/apps/frontend/app/api/auth/delegation/route.ts +8 -2
- package/dist/dashboard-source/apps/frontend/app/api/auth/login/route.ts +0 -1
- package/dist/dashboard-source/apps/frontend/app/api/auth/logout/route.ts +10 -5
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/start/route.ts +1 -3
- package/dist/dashboard-source/apps/frontend/app/api/auth/refresh/route.ts +0 -1
- package/dist/dashboard-source/apps/frontend/app/api/auth/revalidate-google/route.ts +68 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/switch-role/route.ts +1 -3
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-events/route.ts +69 -1
- package/dist/dashboard-source/apps/frontend/app/api/embed/lookup/route.ts +25 -7
- package/dist/dashboard-source/apps/frontend/app/api/embed/submit/route.ts +1 -2
- package/dist/dashboard-source/apps/frontend/app/api/public/start/[address]/route.ts +49 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/lookup/route.ts +4 -3
- package/dist/dashboard-source/apps/frontend/app/api/revalidate/route.ts +15 -4
- package/dist/dashboard-source/apps/frontend/app/app-shell.tsx +14 -6
- package/dist/dashboard-source/apps/frontend/app/cli-auth/route.ts +2 -1
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/embed-client.tsx +31 -18
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/page.tsx +5 -1
- package/dist/dashboard-source/apps/frontend/app/login/page.tsx +4 -4
- package/dist/dashboard-source/apps/frontend/app/login/passkey-button.tsx +11 -6
- package/dist/dashboard-source/apps/frontend/app/login/passkey-help/page.tsx +67 -0
- package/dist/dashboard-source/apps/frontend/app/mcp/[[...endpoint]]/route.ts +44 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-client.tsx +44 -25
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/form/page.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/layout.tsx +32 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/page-client.tsx +319 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/page-content.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/page.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/public.css +1 -1
- package/dist/dashboard-source/apps/frontend/app/register/passkey/register-passkey-client.tsx +17 -0
- package/dist/dashboard-source/apps/frontend/components/DashboardSection.tsx +9 -15
- package/dist/dashboard-source/apps/frontend/components/Header.tsx +14 -8
- package/dist/dashboard-source/apps/frontend/components/anonymous-page-link.tsx +57 -0
- package/dist/dashboard-source/apps/frontend/components/anonymous-start-form.tsx +24 -0
- package/dist/dashboard-source/apps/frontend/components/app-sidebar.tsx +21 -7
- package/dist/dashboard-source/apps/frontend/components/auth-provider.tsx +12 -7
- package/dist/dashboard-source/apps/frontend/components/browser-only.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/components/config-provider.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/delegation-expiry.tsx +24 -13
- package/dist/dashboard-source/apps/frontend/components/form-dialog-content.tsx +22 -2
- package/dist/dashboard-source/apps/frontend/components/journey-timeline.tsx +52 -45
- package/dist/dashboard-source/apps/frontend/components/notification-bell.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/sidebar-lists.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/token-refresh-scheduler.tsx +38 -11
- package/dist/dashboard-source/apps/frontend/components/ui/sidebar.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/ui/tab-pill.tsx +26 -15
- package/dist/dashboard-source/apps/frontend/components/workflow/step-node.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/workflow/workflow-edge.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-form-metadata.ts +21 -10
- package/dist/dashboard-source/apps/frontend/hooks/use-process-draft.ts +173 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-weekly-execution-stats.ts +1 -3
- package/dist/dashboard-source/apps/frontend/lib/anonymous-page-form-values.ts +6 -0
- package/dist/dashboard-source/apps/frontend/lib/anonymous-page-server.ts +65 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/adapter.ts +9 -3
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/client.ts +7 -340
- package/dist/dashboard-source/apps/frontend/lib/auth/client-session.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/delegations.ts +9 -7
- package/dist/dashboard-source/apps/frontend/lib/auth/google-revalidation.ts +111 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/logout.ts +1 -1
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys.ts +28 -30
- package/dist/dashboard-source/apps/frontend/lib/auth/providers.ts +10 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/realtime-session-token.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/reauthentication-state.ts +4 -4
- package/dist/dashboard-source/apps/frontend/lib/auth/session-admission.ts +11 -7
- package/dist/dashboard-source/apps/frontend/lib/auth/session.ts +27 -10
- package/dist/dashboard-source/apps/frontend/lib/auth/ssr-session.ts +76 -9
- package/dist/dashboard-source/apps/frontend/lib/auth/verify-passkey.ts +25 -3
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-factory.tsx +115 -23
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution.ts +1 -8
- package/dist/dashboard-source/apps/frontend/lib/collections/execution.ts +6 -2
- package/dist/dashboard-source/apps/frontend/lib/collections/graphql-stream.ts +21 -1
- package/dist/dashboard-source/apps/frontend/lib/collections/process-collection-provider.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process.ts +8 -2
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-factory.ts +16 -4
- package/dist/dashboard-source/apps/frontend/lib/collections/todo.ts +1 -1
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-query-invalidation.tsx +66 -9
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-refresh.ts +10 -6
- package/dist/dashboard-source/apps/frontend/lib/effect/navigation.ts +4 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/page-runtime.ts +29 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/params.ts +18 -12
- package/dist/dashboard-source/apps/frontend/lib/effect/run-effect.ts +1 -1
- package/dist/dashboard-source/apps/frontend/lib/effect/runtime.ts +19 -23
- package/dist/dashboard-source/apps/frontend/lib/effect/services/access-token.ts +9 -12
- package/dist/dashboard-source/apps/frontend/lib/effect/services/authorization.ts +12 -12
- package/dist/dashboard-source/apps/frontend/lib/effect/services/form-validation.ts +20 -18
- package/dist/dashboard-source/apps/frontend/lib/effect/services/graphql.ts +32 -16
- package/dist/dashboard-source/apps/frontend/lib/embed-form-server.ts +35 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest.ts +10 -103
- package/dist/dashboard-source/apps/frontend/lib/forms/invitation.ts +43 -0
- package/dist/dashboard-source/apps/frontend/lib/forms/provider-user.ts +64 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-form-loaders.ts +40 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest.ts +1 -33
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/gql.ts +123 -33
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/graphql.ts +168 -30
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/index.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/anonymous-page.ts +27 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dependent-lookup-query.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/list-queries.ts +34 -29
- package/dist/dashboard-source/apps/frontend/lib/graphql/lookup-provider.tsx +82 -10
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-operations.ts +2 -5
- package/dist/dashboard-source/apps/frontend/lib/graphql/queries.ts +25 -4
- package/dist/dashboard-source/apps/frontend/lib/graphql/server-client.ts +11 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/settings-queries.ts +13 -104
- package/dist/dashboard-source/apps/frontend/lib/graphql/user-queries.ts +11 -4
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-operations.ts +1 -3
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-queries.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/list-detail-selection.ts +54 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/executions.ts +110 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/list-writes.ts +395 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/lists.ts +263 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/oauth.ts +889 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/origin.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/processes.ts +436 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/read-tool.ts +72 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/result.ts +4 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/server.ts +71 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/store.ts +107 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/todos.ts +260 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/notification-preference.ts +0 -1
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notification-observer.ts +0 -5
- package/dist/dashboard-source/apps/frontend/lib/org-chart-data.ts +0 -2
- package/dist/dashboard-source/apps/frontend/lib/org-identity.ts +6 -4
- package/dist/dashboard-source/apps/frontend/lib/organisation-form-loaders.ts +4 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-form-runtime.ts +0 -1
- package/dist/dashboard-source/apps/frontend/lib/public-todo-model.ts +39 -139
- package/dist/dashboard-source/apps/frontend/lib/public-todo-server.ts +17 -16
- package/dist/dashboard-source/apps/frontend/lib/query-client.ts +0 -1
- package/dist/dashboard-source/apps/frontend/lib/todo-utils.ts +1 -77
- package/dist/dashboard-source/apps/frontend/lib/workflow/layout.ts +3 -7
- package/dist/dashboard-source/apps/frontend/next.config.ts +33 -13
- package/dist/dashboard-source/apps/frontend/package.json +47 -47
- package/dist/dashboard-source/apps/frontend/proxy.ts +72 -14
- package/dist/dashboard-source/modules/auth-local-cedar/src/index.ts +0 -3
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/auth-local-cedar.ts +165 -233
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/cedar-reload-notifier.ts +4 -3
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/config-base.ts +111 -75
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/policy-watcher.ts +14 -18
- package/dist/dashboard-source/modules/auth-policy/src/index.ts +1 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/auth-policy.ts +19 -37
- package/dist/dashboard-source/modules/auth-policy/src/lib/current-principal.ts +33 -29
- package/dist/dashboard-source/modules/auth-policy/src/lib/policy-revision.ts +23 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/types.ts +24 -49
- package/dist/dashboard-source/modules/auth-session/src/index.ts +4 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/project-subscription.ts +13 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/realtime-recipient.ts +10 -2
- package/dist/dashboard-source/modules/auth-session/src/lib/subjects.ts +82 -8
- package/dist/dashboard-source/modules/auth-session/src/lib/workload-access.ts +48 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/workload-audit.ts +52 -0
- package/dist/dashboard-source/modules/aws-common/src/index.ts +0 -1
- package/dist/dashboard-source/modules/effect-json-logger/src/lib/effect-json-logger.ts +6 -9
- package/dist/dashboard-source/modules/form/src/hooks/use-local-storage.ts +5 -3
- package/dist/dashboard-source/modules/form/src/index.ts +1 -10
- package/dist/dashboard-source/modules/form/src/lib/effect-schema-form.tsx +1271 -0
- package/dist/dashboard-source/modules/form/src/lib/form-actions.ts +26 -0
- package/dist/dashboard-source/modules/form/src/lib/form-prefill.tsx +79 -0
- package/dist/dashboard-source/modules/form/src/lib/initial-focus.ts +31 -0
- package/dist/dashboard-source/modules/form/src/lib/lookup-context.tsx +18 -0
- package/dist/dashboard-source/modules/form/src/lib/plugin-registry.ts +4 -0
- package/dist/dashboard-source/modules/form/src/lib/plugin-scripts.ts +26 -0
- package/dist/dashboard-source/modules/form/src/lib/registered-plugin-field.tsx +57 -0
- package/dist/dashboard-source/modules/form/src/lib/schema-lookup.tsx +124 -0
- package/dist/dashboard-source/modules/form/src/lib/schema-typeahead.tsx +522 -0
- package/dist/dashboard-source/modules/form/src/lib/validation-logic.ts +172 -0
- package/dist/dashboard-source/modules/form-schema/src/index.ts +4 -1
- package/dist/dashboard-source/modules/form-schema/src/lib/annotation-helpers.ts +19 -14
- package/dist/dashboard-source/modules/form-schema/src/lib/email.ts +13 -11
- package/dist/dashboard-source/modules/form-schema/src/lib/field-count.ts +15 -13
- package/dist/dashboard-source/modules/form-schema/src/lib/form-annotations.ts +14 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-presentation.ts +33 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-schema.ts +186 -80
- package/dist/dashboard-source/modules/form-schema/src/lib/number-from-string.ts +26 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/phone.ts +8 -7
- package/dist/dashboard-source/modules/form-schema/src/lib/public-completion-correction.ts +7 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/search-lookup-items.ts +27 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/index.ts +5 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/executable-rules.ts +379 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/form-submission-schema.ts +475 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/json-schema.ts +58 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/schema-defaults.ts +158 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/submission-utils.ts +75 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/browser-plugin-artifact.ts +46 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/frontend-manifest.ts +37 -30
- package/dist/dashboard-source/modules/frontend-plugin-host/src/lib/frontend-plugin-host.ts +9 -1
- package/dist/dashboard-source/modules/openauth/src/client.ts +25 -17
- package/dist/dashboard-source/modules/openauth/src/util.ts +16 -0
- package/dist/dashboard-source/modules/{aws-common/src/lib/project-balance-admission.ts → project-accounting/src/admission.ts} +4 -8
- package/dist/dashboard-source/modules/realtime-client/src/appsync-client.ts +377 -0
- package/dist/dashboard-source/modules/realtime-client/src/index.ts +5 -0
- package/dist/dashboard-source/modules/realtime-client/src/subscription-presence.ts +163 -0
- package/dist/dashboard-source/modules/request-time/src/lib/request-time.ts +6 -24
- package/dist/dashboard-source/modules/rxdb-collections/generated/execution-schema.json +28 -21
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/rxdb-collections.ts +25 -18
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/to-rxdb-schema.ts +60 -10
- package/dist/dashboard-source/modules/shadcn-components/src/index.ts +18 -2
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-calendar.tsx +93 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-field.tsx +147 -48
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-time-display.tsx +273 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/local-date-time-input.tsx +108 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/lookup-field.tsx +237 -351
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/popover.tsx +2 -1
- package/dist/dashboard-source.json +47 -47
- package/dist/graphql-server.mjs +272 -200
- package/dist/job-worker-supervisor.mjs +262 -0
- package/dist/job-worker.mjs +234 -133
- package/dist/main.mjs +30 -6
- package/dist/prepare-dashboard.mjs +8 -8
- package/dist/resources/cedar/policies.cedar +80 -38
- package/dist/resources/cedar/schema.cedarschema +39 -21
- package/dist/resources/graphql-schema/rxdb.graphql +2 -0
- package/dist/resources/graphql-schema/system.graphql +191 -51
- package/package.json +63 -62
- package/dist/chunk-6ntmymmx.js +0 -85
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/utils.ts +0 -20
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-form-actions.tsx +0 -105
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-process-save.ts +0 -189
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-state.ts +0 -79
- package/dist/dashboard-source/apps/frontend/hooks/use-processes-query.ts +0 -56
- package/dist/dashboard-source/modules/form/src/lib/ajv-standard-schema.ts +0 -152
- package/dist/dashboard-source/modules/form/src/lib/client-components-to-form.tsx +0 -1421
- package/dist/dashboard-source/modules/form/src/lib/friendly-validation-message.ts +0 -85
- package/dist/dashboard-source/modules/form/src/lib/walker.tsx +0 -1549
- package/dist/dashboard-source/modules/form-client-representation/src/lib/client-form-definition.ts +0 -440
- package/dist/dashboard-source/modules/form-client-representation/src/lib/plugin-registry.ts +0 -13
- package/dist/dashboard-source/modules/form-client-representation/src/lib/types.ts +0 -336
- package/dist/dashboard-source/modules/form-rule/src/index.ts +0 -21
- package/dist/dashboard-source/modules/form-rule/src/lib/evaluator.ts +0 -531
- package/dist/dashboard-source/modules/form-rule/src/lib/paths.ts +0 -102
- package/dist/dashboard-source/modules/form-rule/src/lib/types.ts +0 -121
- package/dist/dashboard-source/modules/form-schema/src/lib/property-signature.ts +0 -45
|
@@ -2,175 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import type { Collection } from "@tanstack/db"
|
|
4
4
|
import { useLiveQuery } from "@tanstack/react-db"
|
|
5
|
-
import { formatDistanceToNow } from "date-fns"
|
|
6
5
|
import Link from "next/link"
|
|
7
6
|
import { Suspense, use, useMemo, useState } from "react"
|
|
7
|
+
import { deepEqual } from "rxdb/plugins/utils"
|
|
8
8
|
import {
|
|
9
9
|
type MobileProcessCatalogItem,
|
|
10
10
|
createMobileProcessCatalog,
|
|
11
11
|
} from "./lib/mobile-process-catalog.ts"
|
|
12
12
|
import { ProcessWorkflowLink } from "@/components/process-workflow-link"
|
|
13
|
-
import type { DraftProcessExecutionDocType } from "@/lib/collections/draft-process-execution"
|
|
14
|
-
import { useDraftProcessCollection } from "@/lib/collections/draft-process-execution-collection-provider"
|
|
15
13
|
import {
|
|
16
14
|
type ProcessDocType,
|
|
17
15
|
useProcessCollection,
|
|
18
16
|
} from "@/lib/collections/process-collection-provider"
|
|
19
17
|
import { cn } from "@/lib/utils"
|
|
20
18
|
|
|
21
|
-
function formatLastSaved(lastSaved: string): string {
|
|
22
|
-
try {
|
|
23
|
-
const date = new Date(lastSaved)
|
|
24
|
-
if (Number.isNaN(date.getTime())) {
|
|
25
|
-
return "Recently saved"
|
|
26
|
-
}
|
|
27
|
-
return formatDistanceToNow(date, { addSuffix: true })
|
|
28
|
-
} catch {
|
|
29
|
-
return "Recently saved"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface DraftCardData {
|
|
34
|
-
id: string
|
|
35
|
-
processId: string
|
|
36
|
-
name: string
|
|
37
|
-
startStepPath: string
|
|
38
|
-
fieldsCompleted: number
|
|
39
|
-
totalFields: number
|
|
40
|
-
lastSaved: string
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function DraftProcessExecutionCard({
|
|
44
|
-
draft,
|
|
45
|
-
onDiscard,
|
|
46
|
-
}: {
|
|
47
|
-
draft: DraftCardData
|
|
48
|
-
onDiscard: (id: string) => void
|
|
49
|
-
}) {
|
|
50
|
-
// Construct the continue URL with draftId query param
|
|
51
|
-
const continueUrl = `/processes/start/${draft.startStepPath}?draftId=${encodeURIComponent(draft.id)}`
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div className="rounded-xl border border-slate-200 bg-slate-50/40 p-3 text-sm text-slate-600 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-300">
|
|
55
|
-
<div className="flex items-center justify-between">
|
|
56
|
-
<div>
|
|
57
|
-
<p className="font-semibold text-slate-900 dark:text-slate-100">
|
|
58
|
-
{draft.name}
|
|
59
|
-
</p>
|
|
60
|
-
<p className="text-xs text-slate-500 dark:text-slate-400">
|
|
61
|
-
{draft.fieldsCompleted} of {draft.totalFields} fields complete
|
|
62
|
-
</p>
|
|
63
|
-
</div>
|
|
64
|
-
<span className="text-xs text-slate-500 dark:text-slate-400">
|
|
65
|
-
{formatLastSaved(draft.lastSaved)}
|
|
66
|
-
</span>
|
|
67
|
-
</div>
|
|
68
|
-
<div className="mt-3 flex items-center justify-between">
|
|
69
|
-
<div className="h-2 w-48 rounded-full bg-slate-200 dark:bg-slate-700">
|
|
70
|
-
<div
|
|
71
|
-
className="h-2 rounded-full bg-blue-500"
|
|
72
|
-
style={{
|
|
73
|
-
width: `${(draft.fieldsCompleted / draft.totalFields) * 100}%`,
|
|
74
|
-
}}
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
<div className="flex gap-2">
|
|
78
|
-
<Link
|
|
79
|
-
href={continueUrl}
|
|
80
|
-
prefetch={false}
|
|
81
|
-
className="cursor-pointer rounded-full border border-slate-200 px-3 py-1 text-xs font-semibold text-slate-600 transition-colors hover:border-slate-300 hover:bg-slate-50 hover:text-slate-800 dark:border-slate-700 dark:text-slate-300 dark:hover:border-slate-600 dark:hover:bg-slate-800"
|
|
82
|
-
>
|
|
83
|
-
Continue
|
|
84
|
-
</Link>
|
|
85
|
-
<button
|
|
86
|
-
type="button"
|
|
87
|
-
onClick={() => onDiscard(draft.id)}
|
|
88
|
-
className="cursor-pointer text-xs font-semibold text-rose-500 transition-colors hover:text-rose-600 dark:hover:text-rose-400"
|
|
89
|
-
>
|
|
90
|
-
Discard
|
|
91
|
-
</button>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function DraftsSkeleton() {
|
|
99
|
-
return (
|
|
100
|
-
<div className="flex items-center justify-center py-6">
|
|
101
|
-
<output
|
|
102
|
-
className="inline-block h-6 w-6 animate-spin rounded-full border-4 border-solid border-blue-600 border-r-transparent motion-reduce:animate-[spin_1.5s_linear_infinite]"
|
|
103
|
-
aria-label="Loading drafts"
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function DraftsListInner({
|
|
110
|
-
collectionPromise,
|
|
111
|
-
}: {
|
|
112
|
-
collectionPromise: Promise<Collection<DraftProcessExecutionDocType, string>>
|
|
113
|
-
}) {
|
|
114
|
-
const draftProcessExecutionCollection = use(collectionPromise)
|
|
115
|
-
|
|
116
|
-
const draftsQuery = useLiveQuery((q) =>
|
|
117
|
-
q.from({ draft: draftProcessExecutionCollection }).select(({ draft }) => ({
|
|
118
|
-
id: draft.id,
|
|
119
|
-
processId: draft.processId,
|
|
120
|
-
name: draft.name,
|
|
121
|
-
startStepPath: draft.startStepPath,
|
|
122
|
-
fieldsCompleted: draft.fieldsCompleted,
|
|
123
|
-
totalFields: draft.totalFields,
|
|
124
|
-
lastSaved: draft.lastSaved,
|
|
125
|
-
})),
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
const handleDiscard = async (draftId: string) => {
|
|
129
|
-
try {
|
|
130
|
-
draftProcessExecutionCollection.delete(draftId)
|
|
131
|
-
} catch (error) {
|
|
132
|
-
console.error("Failed to discard draft:", error)
|
|
133
|
-
alert(
|
|
134
|
-
`Failed to discard draft: ${error instanceof Error ? error.message : String(error)}`,
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (!draftsQuery.isReady) {
|
|
140
|
-
return <DraftsSkeleton />
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (draftsQuery.data.length === 0) {
|
|
144
|
-
return (
|
|
145
|
-
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
146
|
-
No drafts yet. Start a process and your progress will autosave here.
|
|
147
|
-
</p>
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<>
|
|
153
|
-
{draftsQuery.data.map((draft) => (
|
|
154
|
-
<DraftProcessExecutionCard
|
|
155
|
-
key={draft.id}
|
|
156
|
-
draft={draft}
|
|
157
|
-
onDiscard={handleDiscard}
|
|
158
|
-
/>
|
|
159
|
-
))}
|
|
160
|
-
</>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function DraftsList() {
|
|
165
|
-
const { collectionPromise } = useDraftProcessCollection()
|
|
166
|
-
|
|
167
|
-
return (
|
|
168
|
-
<Suspense fallback={<DraftsSkeleton />}>
|
|
169
|
-
<DraftsListInner collectionPromise={collectionPromise} />
|
|
170
|
-
</Suspense>
|
|
171
|
-
)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
19
|
function ProcessesSkeleton() {
|
|
175
20
|
return (
|
|
176
21
|
<div className="flex-1 overflow-y-auto">
|
|
@@ -203,28 +48,23 @@ function ProcessesPageInner({
|
|
|
203
48
|
const [query, setQuery] = useState("")
|
|
204
49
|
const [filterFavorites, setFilterFavorites] = useState(false)
|
|
205
50
|
|
|
206
|
-
// Suspend until collection is ready
|
|
207
51
|
const processesCollection = use(collectionPromise)
|
|
208
52
|
|
|
209
|
-
|
|
210
|
-
const processesQuery = useLiveQuery((q) =>
|
|
211
|
-
q.from({ process: processesCollection }).select(({ process }) => ({
|
|
212
|
-
id: process.id,
|
|
213
|
-
updatedAt: process.updatedAt,
|
|
214
|
-
name: process.name,
|
|
215
|
-
path: process.path,
|
|
216
|
-
activeInstances: process.activeInstances,
|
|
217
|
-
category: process.category,
|
|
218
|
-
duration: process.duration,
|
|
219
|
-
formFieldCount: process.formFieldCount,
|
|
220
|
-
purpose: process.purpose,
|
|
221
|
-
isFavorite: process.isFavorite,
|
|
222
|
-
orgUnit: process.orgUnit,
|
|
223
|
-
startStepPath: process.startStepPath,
|
|
224
|
-
})),
|
|
225
|
-
)
|
|
53
|
+
const { initialSync, retryInitialSync } = useProcessCollection()
|
|
226
54
|
|
|
227
|
-
const
|
|
55
|
+
const processesQuery = useLiveQuery({
|
|
56
|
+
query: (q) => q.from({ process: processesCollection }),
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// The provider confirms persistence and adapter commits. A live query can
|
|
60
|
+
// still be applying those commits; compare its full local snapshot before
|
|
61
|
+
// authorizing empty/filter-empty wording. Keep its existing rows visible.
|
|
62
|
+
const isLoadingProcesses =
|
|
63
|
+
!processesQuery.isReady ||
|
|
64
|
+
processesQuery.data.length !== processesCollection.size ||
|
|
65
|
+
!processesQuery.data.every((process) =>
|
|
66
|
+
deepEqual(process, processesCollection.get(process.id)),
|
|
67
|
+
)
|
|
228
68
|
|
|
229
69
|
const filtered = useMemo(() => {
|
|
230
70
|
const processes = processesQuery.data ?? []
|
|
@@ -259,14 +99,45 @@ function ProcessesPageInner({
|
|
|
259
99
|
[filtered],
|
|
260
100
|
)
|
|
261
101
|
|
|
262
|
-
|
|
263
|
-
|
|
102
|
+
const hasRows = (processesQuery.data?.length ?? 0) > 0
|
|
103
|
+
const emptyTitle =
|
|
104
|
+
query.trim() || filterFavorites
|
|
105
|
+
? "No matching processes"
|
|
106
|
+
: "No processes found"
|
|
107
|
+
const emptyDescription =
|
|
108
|
+
query.trim() || filterFavorites
|
|
109
|
+
? "Try a different search or turn off Favorites."
|
|
110
|
+
: "There are no processes for your organisational unit or role."
|
|
111
|
+
const syncError =
|
|
112
|
+
initialSync.status === "error" ? (
|
|
113
|
+
<div role="alert" className="rounded-2xl border border-amber-300 p-4">
|
|
114
|
+
<p>
|
|
115
|
+
Processes could not finish loading. Check your connection and retry.
|
|
116
|
+
</p>
|
|
117
|
+
<button
|
|
118
|
+
type="button"
|
|
119
|
+
onClick={retryInitialSync}
|
|
120
|
+
className="mt-2 font-semibold text-blue-600"
|
|
121
|
+
>
|
|
122
|
+
Retry loading processes
|
|
123
|
+
</button>
|
|
124
|
+
</div>
|
|
125
|
+
) : null
|
|
126
|
+
|
|
127
|
+
if (!hasRows && syncError) return syncError
|
|
128
|
+
if (!hasRows && (isLoadingProcesses || initialSync.status !== "complete")) {
|
|
264
129
|
return <ProcessesSkeleton />
|
|
265
130
|
}
|
|
266
131
|
|
|
267
132
|
return (
|
|
268
133
|
<div className="flex-1 overflow-y-auto">
|
|
269
134
|
<section className="space-y-6">
|
|
135
|
+
{syncError}
|
|
136
|
+
{initialSync.status === "loading" && (
|
|
137
|
+
<p role="status" className="text-sm text-slate-500">
|
|
138
|
+
Loading processes…
|
|
139
|
+
</p>
|
|
140
|
+
)}
|
|
270
141
|
<div className="hidden rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900/60 md:block">
|
|
271
142
|
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
|
|
272
143
|
<h2 className="text-2xl font-semibold text-slate-900 dark:text-slate-50">
|
|
@@ -298,22 +169,20 @@ function ProcessesPageInner({
|
|
|
298
169
|
</div>
|
|
299
170
|
<p className="mt-3 max-w-3xl text-sm text-slate-500 dark:text-slate-400">
|
|
300
171
|
Processes are grouped by department. Start immediately if no intake
|
|
301
|
-
form is required, or
|
|
302
|
-
schema driven validation.
|
|
172
|
+
form is required, or open the form to enter or pick up your details.
|
|
303
173
|
</p>
|
|
304
174
|
</div>
|
|
305
175
|
<div className="space-y-4 md:hidden">
|
|
306
176
|
{mobileCatalog.map((process) => (
|
|
307
177
|
<MobileProcessRow key={process.id} process={process} />
|
|
308
178
|
))}
|
|
309
|
-
{mobileCatalog.length === 0 &&
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
description=
|
|
313
|
-
|
|
314
|
-
)}
|
|
179
|
+
{mobileCatalog.length === 0 &&
|
|
180
|
+
initialSync.status === "complete" &&
|
|
181
|
+
!isLoadingProcesses && (
|
|
182
|
+
<EmptyState title={emptyTitle} description={emptyDescription} />
|
|
183
|
+
)}
|
|
315
184
|
</div>
|
|
316
|
-
<div className="hidden gap-6 lg:grid-cols-[2fr_1fr]
|
|
185
|
+
<div className="hidden gap-6 md:grid lg:grid-cols-[2fr_1fr]">
|
|
317
186
|
<div className="space-y-5">
|
|
318
187
|
{categoryEntries.map(([category, categoryProcesses]) => (
|
|
319
188
|
<div key={category} className="space-y-3">
|
|
@@ -335,26 +204,13 @@ function ProcessesPageInner({
|
|
|
335
204
|
</div>
|
|
336
205
|
</div>
|
|
337
206
|
))}
|
|
338
|
-
{categoryEntries.length === 0 &&
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
description=
|
|
342
|
-
|
|
343
|
-
)}
|
|
207
|
+
{categoryEntries.length === 0 &&
|
|
208
|
+
initialSync.status === "complete" &&
|
|
209
|
+
!isLoadingProcesses && (
|
|
210
|
+
<EmptyState title={emptyTitle} description={emptyDescription} />
|
|
211
|
+
)}
|
|
344
212
|
</div>
|
|
345
213
|
<div className="space-y-5">
|
|
346
|
-
<div className="rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900/70">
|
|
347
|
-
<h3 className="text-lg font-semibold text-slate-900 dark:text-slate-100">
|
|
348
|
-
Draft process starts
|
|
349
|
-
</h3>
|
|
350
|
-
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
351
|
-
Resume where you left off. Drafts autosave every 30 seconds and
|
|
352
|
-
can be shared for collaboration.
|
|
353
|
-
</p>
|
|
354
|
-
<div className="mt-4 space-y-3">
|
|
355
|
-
<DraftsList />
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
358
214
|
<div className="rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900/70">
|
|
359
215
|
<h3 className="text-lg font-semibold text-slate-900 dark:text-slate-100">
|
|
360
216
|
Help & resources
|
|
@@ -2,24 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import { useRouter } from "next/navigation"
|
|
4
4
|
import { Suspense } from "react"
|
|
5
|
-
import type { JsonSchemaRoot } from "../../../../../../../modules/form/src/index.ts"
|
|
6
5
|
import {
|
|
7
6
|
FormSkeleton,
|
|
8
7
|
StartProcessForm,
|
|
9
8
|
} from "../../components/start-process-form.tsx"
|
|
10
|
-
import {
|
|
9
|
+
import { useReturnToList } from "@/app/(protected)/lists/lib/list-refresh-provider"
|
|
11
10
|
import { useFormMetadata } from "@/hooks/use-form-metadata"
|
|
12
11
|
|
|
13
12
|
interface StartProcessClientProps {
|
|
14
13
|
startStepPath: string
|
|
15
|
-
draftId: string | undefined
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
function StartProcessClientInner({
|
|
19
|
-
startStepPath,
|
|
20
|
-
draftId,
|
|
21
|
-
}: StartProcessClientProps) {
|
|
16
|
+
function StartProcessClientInner({ startStepPath }: StartProcessClientProps) {
|
|
22
17
|
const router = useRouter()
|
|
18
|
+
const returnToList = useReturnToList()
|
|
23
19
|
|
|
24
20
|
// Fetch form metadata via GraphQL
|
|
25
21
|
const {
|
|
@@ -30,21 +26,13 @@ function StartProcessClientInner({
|
|
|
30
26
|
|
|
31
27
|
const defaultValues =
|
|
32
28
|
(formMetadata?.defaultValues as Record<string, unknown> | null) ?? null
|
|
33
|
-
const jsonSchema = (formMetadata?.jsonSchema as JsonSchemaRoot | null) ?? null
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
mergedDefaultValues,
|
|
38
|
-
isLoading: isDraftLoading,
|
|
39
|
-
isError: isDraftError,
|
|
40
|
-
} = useDraftState(draftId, defaultValues)
|
|
41
|
-
|
|
42
|
-
const handleClose = () => {
|
|
30
|
+
const handleClose = (result: "cancelled" | "submitted" = "cancelled") => {
|
|
31
|
+
if (returnToList(result)) return
|
|
43
32
|
router.push("/processes")
|
|
44
33
|
}
|
|
45
34
|
|
|
46
|
-
|
|
47
|
-
if (isMetadataLoading || isDraftLoading) {
|
|
35
|
+
if (isMetadataLoading) {
|
|
48
36
|
return (
|
|
49
37
|
<div className="flex-1">
|
|
50
38
|
<div className="mx-auto max-w-2xl">
|
|
@@ -78,35 +66,7 @@ function StartProcessClientInner({
|
|
|
78
66
|
</p>
|
|
79
67
|
<button
|
|
80
68
|
type="button"
|
|
81
|
-
onClick={handleClose}
|
|
82
|
-
className="rounded-full bg-rose-600 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-rose-500"
|
|
83
|
-
>
|
|
84
|
-
Go Back
|
|
85
|
-
</button>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Show error state if draft loading failed
|
|
93
|
-
if (isDraftError) {
|
|
94
|
-
return (
|
|
95
|
-
<div className="flex-1">
|
|
96
|
-
<div className="mx-auto max-w-2xl">
|
|
97
|
-
<div className="rounded-2xl border border-rose-200 bg-rose-50 p-8 shadow-sm dark:border-rose-800 dark:bg-rose-900/20">
|
|
98
|
-
<div className="mb-6">
|
|
99
|
-
<h1 className="text-3xl font-semibold text-rose-900 dark:text-rose-100">
|
|
100
|
-
Error Loading Draft
|
|
101
|
-
</h1>
|
|
102
|
-
</div>
|
|
103
|
-
<p className="mb-4 text-sm text-rose-600 dark:text-rose-400">
|
|
104
|
-
Failed to load the saved draft. Please try again or start a new
|
|
105
|
-
process.
|
|
106
|
-
</p>
|
|
107
|
-
<button
|
|
108
|
-
type="button"
|
|
109
|
-
onClick={handleClose}
|
|
69
|
+
onClick={() => handleClose()}
|
|
110
70
|
className="rounded-full bg-rose-600 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-rose-500"
|
|
111
71
|
>
|
|
112
72
|
Go Back
|
|
@@ -127,15 +87,16 @@ function StartProcessClientInner({
|
|
|
127
87
|
</h1>
|
|
128
88
|
</div>
|
|
129
89
|
<StartProcessForm
|
|
90
|
+
processId={formMetadata.processId ?? ""}
|
|
91
|
+
canSkipScheduleWaits={formMetadata.canSkipScheduleWaits ?? false}
|
|
130
92
|
startStepPath={startStepPath}
|
|
131
93
|
mutationName={formMetadata.mutationName}
|
|
132
94
|
inputTypeName={formMetadata.inputTypeName}
|
|
133
|
-
defaultValues={
|
|
134
|
-
|
|
135
|
-
|
|
95
|
+
defaultValues={defaultValues}
|
|
96
|
+
requestData={formMetadata.requestData}
|
|
97
|
+
pluginConfiguration={formMetadata.pluginConfiguration ?? {}}
|
|
136
98
|
processName={formMetadata.processName}
|
|
137
99
|
totalFields={formMetadata.totalFields}
|
|
138
|
-
draftId={draftId}
|
|
139
100
|
onClose={handleClose}
|
|
140
101
|
/>
|
|
141
102
|
</div>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { NotFound } from "@mcrovero/effect-nextjs/Navigation"
|
|
2
1
|
import { Effect } from "effect"
|
|
3
2
|
import StartProcessClient from "./client.tsx"
|
|
3
|
+
import ListPage from "@/app/(protected)/lists/[...listPath]/page"
|
|
4
|
+
import { parseListReturnDestination } from "@/app/(protected)/lists/lib/list-refresh"
|
|
5
|
+
import { NotFound } from "@/lib/effect/navigation"
|
|
4
6
|
import { BasePage } from "@/lib/effect/runtime"
|
|
5
7
|
|
|
8
|
+
export const instant = false
|
|
9
|
+
|
|
6
10
|
/**
|
|
7
11
|
* Start process page - thin server wrapper that passes URL params to client.
|
|
8
12
|
* Form metadata is fetched client-side via GraphQL.
|
|
@@ -12,10 +16,10 @@ const StartProcessPage = Effect.fn("StartProcessPage")(function* ({
|
|
|
12
16
|
searchParams,
|
|
13
17
|
}: {
|
|
14
18
|
params: Promise<{ startStepPath: string[] }>
|
|
15
|
-
searchParams: Promise<{
|
|
19
|
+
searchParams: Promise<{ returnTo?: string | string[] }>
|
|
16
20
|
}) {
|
|
17
21
|
const { startStepPath: pathSegments } = yield* Effect.promise(() => params)
|
|
18
|
-
const {
|
|
22
|
+
const { returnTo } = yield* Effect.promise(() => searchParams)
|
|
19
23
|
|
|
20
24
|
// Guard against asset-like requests accidentally hitting this catch-all route
|
|
21
25
|
// (e.g. `/processes/start/hr/installHook.js.map`).
|
|
@@ -33,7 +37,26 @@ const StartProcessPage = Effect.fn("StartProcessPage")(function* ({
|
|
|
33
37
|
// Full path for lookup: "/engineering/bug-report-fix/Report bug"
|
|
34
38
|
const startStepPath = `/${pathSegments.map(decodeURIComponent).join("/")}`
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
// Relative List destinations are validated by the same parser as close/submit.
|
|
41
|
+
// A hard navigation has no intercepted background: render the real List here.
|
|
42
|
+
// Match the client's URLSearchParams.get() behavior for repeated parameters.
|
|
43
|
+
const destination = parseListReturnDestination(
|
|
44
|
+
(Array.isArray(returnTo) ? returnTo[0] : returnTo) ?? null,
|
|
45
|
+
"http://localhost",
|
|
46
|
+
)
|
|
47
|
+
if (destination) {
|
|
48
|
+
const listUrl = new URL(destination.href, "http://localhost")
|
|
49
|
+
return (
|
|
50
|
+
<ListPage
|
|
51
|
+
params={Promise.resolve({
|
|
52
|
+
listPath: destination.listPath.slice(1).split("/"),
|
|
53
|
+
})}
|
|
54
|
+
searchParams={Promise.resolve(Object.fromEntries(listUrl.searchParams))}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return <StartProcessClient startStepPath={startStepPath} />
|
|
37
60
|
})
|
|
38
61
|
|
|
39
62
|
export default BasePage.build(StartProcessPage)
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import "@xyflow/react/dist/style.css"
|
|
2
|
-
import { NotFound } from "@mcrovero/effect-nextjs/Navigation"
|
|
3
2
|
import { Effect } from "effect"
|
|
4
3
|
import Link from "next/link"
|
|
5
4
|
import { ProcessDocumentation } from "./process-documentation.tsx"
|
|
6
5
|
import { WorkflowFlow } from "./workflow-flow.tsx"
|
|
6
|
+
import { NotFound } from "@/lib/effect/navigation"
|
|
7
7
|
import { BasePage } from "@/lib/effect/runtime"
|
|
8
8
|
import { fetchProcessWorkflowEffect } from "@/lib/graphql/workflow-operations"
|
|
9
9
|
import { getPhaseColors } from "@/lib/workflow/constants"
|
|
10
10
|
import { createInitialLayout } from "@/lib/workflow/layout"
|
|
11
11
|
|
|
12
|
+
// The authenticated shell can omit this page while checking the session.
|
|
13
|
+
export const instant = false
|
|
14
|
+
|
|
12
15
|
const WorkflowPage = Effect.fn("WorkflowPage")(function* ({
|
|
13
16
|
params,
|
|
14
17
|
}: {
|
|
@@ -27,9 +30,8 @@ const WorkflowPage = Effect.fn("WorkflowPage")(function* ({
|
|
|
27
30
|
|
|
28
31
|
// Fetch workflow data with error handling - return error state on failure
|
|
29
32
|
const data = yield* fetchProcessWorkflowEffect(processPath).pipe(
|
|
30
|
-
Effect.
|
|
33
|
+
Effect.catch((error) => {
|
|
31
34
|
console.error("Failed to fetch workflow data:", error.message)
|
|
32
|
-
// Return empty/error state for graceful degradation
|
|
33
35
|
return Effect.succeed({
|
|
34
36
|
processWorkflow: null,
|
|
35
37
|
error: error.message,
|
|
@@ -37,7 +39,6 @@ const WorkflowPage = Effect.fn("WorkflowPage")(function* ({
|
|
|
37
39
|
}),
|
|
38
40
|
)
|
|
39
41
|
|
|
40
|
-
// Handle error state
|
|
41
42
|
if (!data.processWorkflow) {
|
|
42
43
|
return (
|
|
43
44
|
<div className="space-y-6">
|
|
@@ -154,15 +154,12 @@ function WorkflowFlowInner({
|
|
|
154
154
|
|
|
155
155
|
const onNodesChange = useCallback((changes: NodeChange[]) => {
|
|
156
156
|
setLayout((currentLayout) => {
|
|
157
|
-
// Apply React Flow's changes first
|
|
158
157
|
const updatedNodes = applyNodeChanges(changes, currentLayout.nodes)
|
|
159
158
|
|
|
160
|
-
// If layout already applied, just return the updated nodes
|
|
161
159
|
if (currentLayout.measuredHeight !== null) {
|
|
162
160
|
return { ...currentLayout, nodes: updatedNodes }
|
|
163
161
|
}
|
|
164
162
|
|
|
165
|
-
// Check if we have dimension changes
|
|
166
163
|
const hasDimensionChanges = changes.some(
|
|
167
164
|
(change) => change.type === "dimensions",
|
|
168
165
|
)
|
|
@@ -170,7 +167,6 @@ function WorkflowFlowInner({
|
|
|
170
167
|
return { ...currentLayout, nodes: updatedNodes }
|
|
171
168
|
}
|
|
172
169
|
|
|
173
|
-
// Check if all step nodes now have measurements
|
|
174
170
|
const stepNodes = updatedNodes.filter((n) => n.type === "workflowStep")
|
|
175
171
|
const allMeasured =
|
|
176
172
|
stepNodes.length > 0 &&
|
|
@@ -276,7 +272,6 @@ function WorkflowFlowWithAutoRefresh({
|
|
|
276
272
|
initialWorkflowData,
|
|
277
273
|
)
|
|
278
274
|
|
|
279
|
-
// Recompute layout when workflow data changes
|
|
280
275
|
const { nodes: currentNodes, edges: currentEdges } = useMemo(
|
|
281
276
|
() => createInitialLayout(workflowData),
|
|
282
277
|
[workflowData],
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { useCallback, useEffect } from "react"
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
type FormActionsContext,
|
|
7
|
-
type JsonSchemaRoot,
|
|
8
|
-
dynamicForm,
|
|
9
|
-
} from "../../../../../../../modules/form/src/index.ts"
|
|
3
|
+
import { Suspense, use, useCallback, useEffect } from "react"
|
|
4
|
+
import type { FieldError, FormActionsContext } from "../../../../../../../modules/form/src/index.ts"
|
|
5
|
+
import { EffectSchemaForm } from "../../../../../../../modules/form/src/lib/effect-schema-form.tsx"
|
|
10
6
|
import {
|
|
11
7
|
Sheet,
|
|
12
8
|
SheetContent,
|
|
@@ -15,6 +11,7 @@ import {
|
|
|
15
11
|
SheetTitle,
|
|
16
12
|
} from "@/components/ui/sheet"
|
|
17
13
|
import { useFormMetadata } from "@/hooks/use-form-metadata"
|
|
14
|
+
import { loadBrowserFormDefinition } from "@/lib/frontend-form-loaders"
|
|
18
15
|
import type { WorkflowStepData } from "@/lib/workflow/types"
|
|
19
16
|
|
|
20
17
|
interface WorkflowFormPreviewSheetProps {
|
|
@@ -60,7 +57,6 @@ export function WorkflowFormPreviewSheet({
|
|
|
60
57
|
|
|
61
58
|
const defaultValues =
|
|
62
59
|
(formMetadata?.defaultValues as Record<string, unknown> | null) ?? null
|
|
63
|
-
const jsonSchema = (formMetadata?.jsonSchema as JsonSchemaRoot | null) ?? null
|
|
64
60
|
|
|
65
61
|
return (
|
|
66
62
|
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
@@ -80,19 +76,30 @@ export function WorkflowFormPreviewSheet({
|
|
|
80
76
|
Unable to load this form.
|
|
81
77
|
</div>
|
|
82
78
|
) : null}
|
|
83
|
-
{!isLoading && formMetadata
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
{!isLoading && formMetadata ? (
|
|
80
|
+
<Suspense fallback={<FormPreviewSkeleton />}>
|
|
81
|
+
<ExecutablePreview
|
|
82
|
+
stepPath={step.path}
|
|
83
|
+
draftId={draftId}
|
|
84
|
+
defaultValues={defaultValues ?? {}}
|
|
85
|
+
requestData={formMetadata.requestData}
|
|
86
|
+
onSubmit={handleSubmit}
|
|
87
|
+
>
|
|
88
|
+
{renderActions}
|
|
89
|
+
</ExecutablePreview>
|
|
90
|
+
</Suspense>
|
|
91
|
+
) : null}
|
|
94
92
|
</div>
|
|
95
93
|
</SheetContent>
|
|
96
94
|
</Sheet>
|
|
97
95
|
)
|
|
98
96
|
}
|
|
97
|
+
|
|
98
|
+
function ExecutablePreview(
|
|
99
|
+
props: Omit<React.ComponentProps<typeof EffectSchemaForm>, "schema"> & {
|
|
100
|
+
stepPath: string
|
|
101
|
+
},
|
|
102
|
+
) {
|
|
103
|
+
const schema = use(loadBrowserFormDefinition(props.stepPath))
|
|
104
|
+
return <EffectSchemaForm {...props} schema={schema} />
|
|
105
|
+
}
|
package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/page.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NotFound } from "@mcrovero/effect-nextjs/Navigation"
|
|
2
1
|
import { Effect } from "effect"
|
|
3
2
|
import { Suspense } from "react"
|
|
4
3
|
import type { ProviderUserSession } from "../../../../../../../modules/auth-session/src/index.ts"
|
|
@@ -10,9 +9,13 @@ import { loadAuthorizationCedar } from "../load-cedar.ts"
|
|
|
10
9
|
import { loadHandbookData } from "../load-handbook.ts"
|
|
11
10
|
import { getSessionWithToken } from "@/lib/auth/session"
|
|
12
11
|
import { parseAuthorizationTab } from "@/lib/authorization-tabs"
|
|
12
|
+
import { NotFound } from "@/lib/effect/navigation"
|
|
13
13
|
import { BasePageWithAuthorization } from "@/lib/effect/runtime"
|
|
14
14
|
import { checkFeaturePermissions } from "@/lib/effect/services"
|
|
15
15
|
|
|
16
|
+
// The authenticated shell can omit this page while checking the session.
|
|
17
|
+
export const instant = false
|
|
18
|
+
|
|
16
19
|
type AuthorizationPageProps = {
|
|
17
20
|
params: Promise<{ tab?: readonly string[] }>
|
|
18
21
|
}
|
|
@@ -29,7 +32,7 @@ const denied = (
|
|
|
29
32
|
const AuthorizationPageContent = Effect.fn("AuthorizationPageContent")(
|
|
30
33
|
function* ({ params }: AuthorizationPageProps) {
|
|
31
34
|
const sessionResult = yield* getSessionWithToken.pipe(
|
|
32
|
-
Effect.
|
|
35
|
+
Effect.catch(() => Effect.succeed(null)),
|
|
33
36
|
)
|
|
34
37
|
if (!sessionResult || !("email" in sessionResult)) {
|
|
35
38
|
return denied
|