@processfocus/runtime-local 0.1.0-next.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/LICENSE.md +28 -0
- package/README.md +290 -0
- package/dist/authentication-server.mjs +188 -0
- package/dist/chunk-2sb4v2sx.js +70 -0
- package/dist/chunk-9weqs8n8.js +56031 -0
- package/dist/chunk-mvkr77wp.js +54113 -0
- package/dist/chunk-tkn4cnc8.js +453 -0
- package/dist/chunk-vpsm84e8.js +85 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/app-icons/[...path]/route.ts +63 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/health/page.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/public-form-branding/[...path]/route.ts +95 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/actions.ts +248 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/delegations-client.tsx +751 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/page.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client-index.tsx +375 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/client.tsx +73 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/page.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/process-state/page.tsx +22 -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 +11 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/process-state/page.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/abandon-execution-dialog.tsx +137 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/execution-card-menu.tsx +233 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/layout.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/page.tsx +1549 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-dialog.tsx +91 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-modal-client.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-page-client.tsx +31 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-route-fallback.tsx +18 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/restart-execution-feedback.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/layout.tsx +129 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/client.tsx +215 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/page.tsx +23 -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 +678 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/loading.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/page.tsx +228 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-create-form.tsx +147 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-item-edit-form.tsx +246 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/metric-control-url-state.ts +71 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-deleted-callback.ts +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-item-detail.ts +315 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/client.tsx +259 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/page.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/layout.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-detail-title.ts +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-refresh.ts +26 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/utils.ts +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/loading.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/org-chart-client.tsx +74 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/page.tsx +120 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/page.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/actions.ts +188 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/page.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/passkeys-client.tsx +320 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/client.tsx +152 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/page.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/client.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-form-actions.tsx +105 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-submit-button.tsx +81 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/start-process-form.tsx +282 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/layout.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/lib/mobile-process-catalog.ts +28 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/lib/start-process-actions.ts +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/loading.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/page.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/processes-client.tsx +504 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/client.tsx +153 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/page.tsx +39 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/loading.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/page.tsx +131 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/process-documentation.tsx +209 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/use-workflow-auto-refresh.ts +120 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-flow.tsx +319 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-form-preview-sheet.tsx +98 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/loading.tsx +1 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/page.tsx +100 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/access-handbook.tsx +110 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/authorization-loading.tsx +25 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/authorization-tabs.tsx +47 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-authorize.ts +261 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-helpers.ts +17 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-source.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-types.ts +79 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/evaluate-cedar.ts +43 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/explorer.tsx +526 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/layout.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-cedar.ts +174 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-handbook.ts +390 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/org-data.ts +70 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/[invitationId]/page.tsx +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-client.tsx +594 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-skeleton.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/new/page.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations-table.tsx +186 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/page.tsx +69 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/providers-table.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/roles-table.tsx +62 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/settings-client.tsx +244 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/client.tsx +329 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/page.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/tokens/page.tsx +39 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users-table.tsx +82 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/error.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/not-found.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/page.tsx +84 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/stats-data-fetcher.tsx +93 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/client.tsx +143 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/page.tsx +50 -0
- 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 +131 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/page.tsx +50 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/complete-todo-form.tsx +172 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/public-completion-correction-form.tsx +233 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/todo-form-actions.tsx +26 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/correct/[...stepPath]/page.tsx +58 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/layout.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/lib/mobile-todo-list.ts +154 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/page.tsx +1317 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/callback/route.ts +259 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/delegation/route.ts +127 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/login/route.ts +49 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/logout/route.ts +33 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/auth-options/route.ts +79 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/auth-verify/route.ts +142 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/register/route.ts +103 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/register-verify/route.ts +136 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/registration-session/route.ts +129 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/start/route.ts +153 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/refresh/route.ts +122 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/switch-role/route.ts +177 -0
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-completed/route.ts +22 -0
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-events/route.ts +38 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/lookup/route.ts +266 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/submit/route.ts +118 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/test-host/route.ts +125 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/calendar-slots/route.ts +44 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/complete/route.ts +56 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/lookup/route.ts +61 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/request-fresh-link/route.ts +41 -0
- package/dist/dashboard-source/apps/frontend/app/api/revalidate/route.ts +61 -0
- package/dist/dashboard-source/apps/frontend/app/app-shell.tsx +100 -0
- package/dist/dashboard-source/apps/frontend/app/cli-auth/route.ts +261 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/embed-client.tsx +393 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/loading.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/page.tsx +51 -0
- package/dist/dashboard-source/apps/frontend/app/embed/embedded.css +48 -0
- package/dist/dashboard-source/apps/frontend/app/embed/layout.tsx +15 -0
- package/dist/dashboard-source/apps/frontend/app/global.css +13 -0
- package/dist/dashboard-source/apps/frontend/app/layout.tsx +102 -0
- package/dist/dashboard-source/apps/frontend/app/login/layout.tsx +9 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-button.tsx +35 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-form-content.tsx +117 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-form.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/app/login/page.tsx +52 -0
- package/dist/dashboard-source/apps/frontend/app/login/passkey-button.tsx +226 -0
- package/dist/dashboard-source/apps/frontend/app/login/secret-login-form.tsx +91 -0
- package/dist/dashboard-source/apps/frontend/app/manifest.ts +7 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/error.tsx +63 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/layout.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/page.tsx +129 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-card.tsx +42 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-context.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-html.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-client.tsx +553 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-state-content.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/app/public.css +33 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/layout.tsx +49 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/page.tsx +36 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/register-passkey-client.tsx +292 -0
- package/dist/dashboard-source/apps/frontend/app/theme.css +117 -0
- package/dist/dashboard-source/apps/frontend/components/DashboardSection.tsx +693 -0
- package/dist/dashboard-source/apps/frontend/components/Header.tsx +481 -0
- package/dist/dashboard-source/apps/frontend/components/OrgUnitNode.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/components/app-sidebar.tsx +245 -0
- package/dist/dashboard-source/apps/frontend/components/auth-provider.tsx +158 -0
- package/dist/dashboard-source/apps/frontend/components/collections/collection-table-card.tsx +218 -0
- package/dist/dashboard-source/apps/frontend/components/collections/collection-table-header-row.tsx +97 -0
- package/dist/dashboard-source/apps/frontend/components/config-provider.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/copy-button.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/components/dashboard-activity.tsx +35 -0
- package/dist/dashboard-source/apps/frontend/components/dashboard-skeleton.tsx +17 -0
- package/dist/dashboard-source/apps/frontend/components/delegation-expiry.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/components/feature-permissions-provider.tsx +28 -0
- package/dist/dashboard-source/apps/frontend/components/form-dialog-content.tsx +66 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-host.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-identify.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-provider.tsx +55 -0
- package/dist/dashboard-source/apps/frontend/components/journey-timeline.tsx +378 -0
- package/dist/dashboard-source/apps/frontend/components/mobile-home-switchboard.tsx +98 -0
- package/dist/dashboard-source/apps/frontend/components/mocks-provider.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/notification-bell.tsx +137 -0
- package/dist/dashboard-source/apps/frontend/components/org-settings-provider.tsx +26 -0
- package/dist/dashboard-source/apps/frontend/components/process-workflow-link.tsx +36 -0
- package/dist/dashboard-source/apps/frontend/components/session-reissue.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/components/sidebar-lists.tsx +89 -0
- package/dist/dashboard-source/apps/frontend/components/sidebar-stats-views.tsx +65 -0
- package/dist/dashboard-source/apps/frontend/components/theme-provider.tsx +132 -0
- package/dist/dashboard-source/apps/frontend/components/todo-count-badge.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/components/token-refresh-scheduler.tsx +304 -0
- package/dist/dashboard-source/apps/frontend/components/ui/checkbox.tsx +31 -0
- package/dist/dashboard-source/apps/frontend/components/ui/dialog.tsx +142 -0
- package/dist/dashboard-source/apps/frontend/components/ui/dropdown-menu.tsx +256 -0
- package/dist/dashboard-source/apps/frontend/components/ui/input.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/components/ui/pagination.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/components/ui/sheet.tsx +138 -0
- package/dist/dashboard-source/apps/frontend/components/ui/sidebar.tsx +741 -0
- package/dist/dashboard-source/apps/frontend/components/ui/skeleton.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/components/ui/tab-pill.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/components/ui/table.tsx +115 -0
- package/dist/dashboard-source/apps/frontend/components/ui/tooltip.tsx +60 -0
- package/dist/dashboard-source/apps/frontend/components/without-waiting-badge.tsx +24 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/step-node.tsx +116 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/swimlane-node.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/workflow-edge.tsx +172 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-process-save.ts +189 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-state.ts +79 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-form-metadata.ts +74 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-mobile.ts +27 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-notification-preference.ts +246 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-processes-query.ts +56 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-weekly-execution-stats.ts +101 -0
- package/dist/dashboard-source/apps/frontend/index.d.ts +12 -0
- package/dist/dashboard-source/apps/frontend/instrumentation.node.ts +25 -0
- package/dist/dashboard-source/apps/frontend/instrumentation.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/app-icons-metadata.ts +66 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/adapter.ts +128 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/client.ts +355 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/config.ts +18 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/reconnect-registry.ts +34 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/act-on-behalf-menu.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/callback-error.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/client-session.ts +32 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/client.ts +46 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/config.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/delegations.ts +62 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/issuer.ts +164 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/jwt.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/logout.ts +35 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys-menu.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys.ts +117 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/providers.ts +52 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/realtime-session-token.ts +62 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/reauthentication-state.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/redirect.ts +105 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/secret-login-presentation.ts +33 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session-cache-scope.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session-role.ts +6 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session.ts +277 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/ssr-session.ts +76 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/verify-passkey.ts +95 -0
- package/dist/dashboard-source/apps/frontend/lib/authorization-tabs.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/cedar-highlight.ts +116 -0
- package/dist/dashboard-source/apps/frontend/lib/client-plugin-error-reporting.ts +28 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-factory.tsx +1119 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-scope.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/database-error-ui.tsx +61 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution-collection-provider.tsx +32 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution.ts +161 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/execution-collection-provider.tsx +42 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/execution.ts +215 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/graphql-stream.ts +123 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process-collection-provider.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process.ts +123 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-factory.ts +394 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-registry.ts +196 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-database-name.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-lifecycle.ts +368 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-provider.tsx +577 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/todo-collection-provider.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/todo.ts +133 -0
- package/dist/dashboard-source/apps/frontend/lib/current-provider-user.ts +30 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/frontend-port-file.ts +41 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-events.ts +21 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-query-invalidation.tsx +62 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-refresh.ts +40 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/error-boundary.tsx +84 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/index.ts +31 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/params.ts +57 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/run-effect.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/runtime.ts +168 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/access-token.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/authorization.ts +206 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/form-validation.ts +36 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/graphql.ts +94 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/index.ts +21 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest-store.ts +20 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest.ts +152 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-request-origin.ts +39 -0
- package/dist/dashboard-source/apps/frontend/lib/errors/get-display-error-message.ts +22 -0
- package/dist/dashboard-source/apps/frontend/lib/execution-menu-actions-registry.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/feature-permissions.ts +13 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-boot-health.tsx +161 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-client-plugin-registry.ts +45 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest-store.ts +214 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest.ts +74 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-plugin-loaders.ts +191 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/fragment-masking.ts +87 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/gql.ts +292 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/graphql.ts +443 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/index.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-consumer.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-error-reporting.ts +268 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-provider.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dashboard-activity.ts +7 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dependent-lookup-query.ts +78 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/endpoint.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/execution-queries.ts +70 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/file-upload-provider.tsx +82 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/graphql-identifiers.ts +10 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/list-queries.ts +327 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/lookup-provider.tsx +81 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-operations.ts +63 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-queries.ts +67 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/provider-user-queries.ts +65 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/queries.ts +80 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/server-client.ts +15 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/settings-queries.ts +634 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/stats-views-server.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/stats-views.ts +33 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/user-queries.ts +138 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-operations.ts +54 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-queries.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/mobile-home-view-model.ts +74 -0
- package/dist/dashboard-source/apps/frontend/lib/mobile-shell-policy.ts +124 -0
- package/dist/dashboard-source/apps/frontend/lib/mock-data.ts +364 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/notification-preference.ts +251 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notification-observer.ts +178 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notifications-runtime.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/use-todo-notifications.tsx +103 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-data.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-depth-config.ts +71 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-layout.ts +149 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-types.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/org-identity.ts +57 -0
- package/dist/dashboard-source/apps/frontend/lib/organisation-plugin-loaders.ts +13 -0
- package/dist/dashboard-source/apps/frontend/lib/organisation-plugin-preparation.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/plugins-client.tsx +99 -0
- package/dist/dashboard-source/apps/frontend/lib/plugins.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-form-runtime.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-graphql-errors.ts +45 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-model.ts +200 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-server.ts +209 -0
- package/dist/dashboard-source/apps/frontend/lib/query-client.ts +41 -0
- package/dist/dashboard-source/apps/frontend/lib/restart-execution-action.ts +76 -0
- package/dist/dashboard-source/apps/frontend/lib/runtime-config.ts +23 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/constants.ts +5 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/otlp-config.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/register-otel.ts +308 -0
- package/dist/dashboard-source/apps/frontend/lib/theme.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/todo-types.ts +64 -0
- package/dist/dashboard-source/apps/frontend/lib/todo-utils.ts +144 -0
- package/dist/dashboard-source/apps/frontend/lib/types/org-identity.ts +7 -0
- package/dist/dashboard-source/apps/frontend/lib/utils.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/constants.ts +118 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/edge-routing.ts +195 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/form-preview.ts +8 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/layout.ts +878 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/types.ts +63 -0
- package/dist/dashboard-source/apps/frontend/next.config.ts +238 -0
- package/dist/dashboard-source/apps/frontend/package.json +71 -0
- package/dist/dashboard-source/apps/frontend/postcss.config.mjs +5 -0
- package/dist/dashboard-source/apps/frontend/proxy.ts +293 -0
- package/dist/dashboard-source/apps/frontend/public/.gitkeep +0 -0
- package/dist/dashboard-source/apps/frontend/public/favicon.ico +0 -0
- package/dist/dashboard-source/apps/frontend/public/processfocus-embed.js +553 -0
- package/dist/dashboard-source/apps/frontend/tsconfig.json +35 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/index.ts +7 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/auth-local-cedar.ts +1397 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/cedar-reload-notifier.ts +18 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/config-base.ts +346 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/policy-watcher.ts +172 -0
- package/dist/dashboard-source/modules/auth-policy/src/index.ts +4 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/auth-policy.ts +263 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/current-principal.ts +34 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/errors.ts +47 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/types.ts +595 -0
- package/dist/dashboard-source/modules/auth-session/src/index.ts +22 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/issuer-url.ts +192 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/realtime-recipient.ts +76 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/session-cache-scope.ts +24 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/subjects.ts +54 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/url.ts +2 -0
- package/dist/dashboard-source/modules/aws-common/src/index.ts +3 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/acm.ts +50 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/otlp-config.ts +66 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/runtime-ssm.ts +28 -0
- package/dist/dashboard-source/modules/effect-json-logger/src/index.ts +1 -0
- package/dist/dashboard-source/modules/effect-json-logger/src/lib/effect-json-logger.ts +65 -0
- package/dist/dashboard-source/modules/form/src/hooks/use-local-storage.ts +78 -0
- package/dist/dashboard-source/modules/form/src/index.ts +20 -0
- package/dist/dashboard-source/modules/form/src/lib/ajv-standard-schema.ts +152 -0
- package/dist/dashboard-source/modules/form/src/lib/client-components-to-form.tsx +1421 -0
- package/dist/dashboard-source/modules/form/src/lib/friendly-validation-message.ts +85 -0
- package/dist/dashboard-source/modules/form/src/lib/lookup-context.tsx +58 -0
- package/dist/dashboard-source/modules/form/src/lib/plugin-registry.ts +34 -0
- package/dist/dashboard-source/modules/form/src/lib/walker.tsx +1554 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/client-form-definition.ts +440 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/plugin-registry.ts +13 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/types.ts +336 -0
- package/dist/dashboard-source/modules/form-rule/src/index.ts +21 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/evaluator.ts +531 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/paths.ts +102 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/types.ts +121 -0
- package/dist/dashboard-source/modules/form-schema/src/index.ts +8 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/annotation-helpers.ts +44 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/deferred-value.ts +21 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/email.ts +50 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/field-count.ts +82 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-annotations.ts +58 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-schema.ts +975 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/phone.ts +60 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/property-signature.ts +45 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/endpoint.ts +137 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/index.ts +11 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/port-files.ts +219 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/index.ts +2 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/browser-plugin-artifact.ts +201 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/frontend-manifest.ts +408 -0
- package/dist/dashboard-source/modules/frontend-plugin-host/src/index.ts +29 -0
- package/dist/dashboard-source/modules/frontend-plugin-host/src/lib/frontend-plugin-host.ts +288 -0
- package/dist/dashboard-source/modules/openauth/src/client.ts +1045 -0
- package/dist/dashboard-source/modules/openauth/src/error.ts +140 -0
- package/dist/dashboard-source/modules/openauth/src/pkce.ts +40 -0
- package/dist/dashboard-source/modules/openauth/src/random.ts +24 -0
- package/dist/dashboard-source/modules/openauth/src/subject.ts +132 -0
- package/dist/dashboard-source/modules/openauth/src/util.ts +13 -0
- package/dist/dashboard-source/modules/request-time/src/index.ts +1 -0
- package/dist/dashboard-source/modules/request-time/src/lib/request-time.ts +30 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/draft-process-execution-schema.json +45 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/execution-schema.json +217 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/process-schema.json +77 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/todo-schema.json +94 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/index.ts +2 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/rxdb-collections.ts +181 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/to-rxdb-schema.ts +166 -0
- package/dist/dashboard-source/modules/shadcn-components/src/index.ts +60 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/boolean-field.tsx +73 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/calendar-slot-field.tsx +808 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-field.tsx +127 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/field-set.tsx +14 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/file-field.tsx +321 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/file-upload-context.tsx +45 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/form-context.tsx +19 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/lookup-field.tsx +394 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/radio-field.tsx +96 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/select-field.tsx +106 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/text-field.tsx +245 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/button.tsx +63 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/checkbox.tsx +31 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/command.tsx +101 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/field.tsx +275 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/input.tsx +29 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/label.tsx +23 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/popover.tsx +31 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/separator.tsx +27 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/textarea.tsx +19 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/utils/utils.ts +4 -0
- package/dist/dashboard-source.json +70 -0
- package/dist/graphql-server.mjs +1319 -0
- package/dist/job-worker.mjs +989 -0
- package/dist/main.mjs +495 -0
- package/dist/prepare-dashboard.mjs +35 -0
- package/dist/resources/cedar/policies.cedar +315 -0
- package/dist/resources/cedar/schema.cedarschema +276 -0
- package/dist/resources/graphql-schema/rxdb.graphql +401 -0
- package/dist/resources/graphql-schema/system.graphql +1200 -0
- package/package.json +98 -0
|
@@ -0,0 +1,1549 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import type { Collection } from "@tanstack/db"
|
|
4
|
+
import { useLiveQuery } from "@tanstack/react-db"
|
|
5
|
+
import { ChevronLeft } from "lucide-react"
|
|
6
|
+
import Image from "next/image"
|
|
7
|
+
import Link from "next/link"
|
|
8
|
+
import { useRouter, useSearchParams } from "next/navigation"
|
|
9
|
+
import { Suspense, use, useMemo, useRef, useState } from "react"
|
|
10
|
+
import { ExecutionCardMenu } from "./execution-card-menu.tsx"
|
|
11
|
+
import { useMocks } from "@/components/mocks-provider"
|
|
12
|
+
import { ProcessWorkflowLink } from "@/components/process-workflow-link"
|
|
13
|
+
import { TabPill } from "@/components/ui/tab-pill"
|
|
14
|
+
import { WithoutWaitingBadge } from "@/components/without-waiting-badge"
|
|
15
|
+
import { useIsMobile } from "@/hooks/use-mobile"
|
|
16
|
+
import {
|
|
17
|
+
type ExecutionDocType,
|
|
18
|
+
useExecutionCollection,
|
|
19
|
+
} from "@/lib/collections/execution-collection-provider"
|
|
20
|
+
import { type Execution, executions as mockExecutions } from "@/lib/mock-data"
|
|
21
|
+
import { cn } from "@/lib/utils"
|
|
22
|
+
|
|
23
|
+
type ExecutionStatus = "Running" | "Completed" | "Failed" | "Abandoned"
|
|
24
|
+
type ExecutionTabKey = "in-progress" | "completed" | "failed" | "all"
|
|
25
|
+
type MockExecutionView = "timeline" | "kanban"
|
|
26
|
+
type MockExecutionTabKey = "in-progress" | "completed" | "failed" | "all"
|
|
27
|
+
|
|
28
|
+
const executionStatusTheme: Record<ExecutionStatus, string> = {
|
|
29
|
+
Running:
|
|
30
|
+
"bg-sky-100 text-sky-700 border border-sky-200 dark:bg-sky-500/10 dark:text-sky-300 dark:border-sky-500/30",
|
|
31
|
+
Completed:
|
|
32
|
+
"bg-emerald-100 text-emerald-700 border border-emerald-200 dark:bg-emerald-500/10 dark:text-emerald-300 dark:border-emerald-500/30",
|
|
33
|
+
Failed:
|
|
34
|
+
"bg-rose-100 text-rose-700 border border-rose-200 dark:bg-rose-500/10 dark:text-rose-300 dark:border-rose-500/30",
|
|
35
|
+
Abandoned:
|
|
36
|
+
"bg-slate-100 text-slate-600 border border-slate-200 dark:bg-slate-500/10 dark:text-slate-400 dark:border-slate-500/30",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const mockExecutionStatusTheme = {
|
|
40
|
+
Running:
|
|
41
|
+
"bg-sky-100 text-sky-700 border border-sky-200 dark:bg-sky-500/10 dark:text-sky-300 dark:border-sky-500/30",
|
|
42
|
+
Paused:
|
|
43
|
+
"bg-amber-100 text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-300 dark:border-amber-500/30",
|
|
44
|
+
Completed:
|
|
45
|
+
"bg-emerald-100 text-emerald-700 border border-emerald-200 dark:bg-emerald-500/10 dark:text-emerald-300 dark:border-emerald-500/30",
|
|
46
|
+
Failed:
|
|
47
|
+
"bg-rose-100 text-rose-700 border border-rose-200 dark:bg-rose-500/10 dark:text-rose-300 dark:border-rose-500/30",
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const mockExecutionTabFilters: Record<
|
|
51
|
+
MockExecutionTabKey,
|
|
52
|
+
Execution["status"][]
|
|
53
|
+
> = {
|
|
54
|
+
"in-progress": ["Running", "Paused"],
|
|
55
|
+
completed: ["Completed"],
|
|
56
|
+
failed: ["Failed"],
|
|
57
|
+
all: ["Running", "Paused", "Completed", "Failed"],
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const executionTabKeys = [
|
|
61
|
+
"in-progress",
|
|
62
|
+
"completed",
|
|
63
|
+
"failed",
|
|
64
|
+
"all",
|
|
65
|
+
] as const satisfies readonly ExecutionTabKey[]
|
|
66
|
+
|
|
67
|
+
function parseExecutionTabKey(value: string | null): ExecutionTabKey | null {
|
|
68
|
+
return executionTabKeys.find((key) => key === value) ?? null
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Format timestamp to relative time string
|
|
73
|
+
* Accepts either epoch ms (number) or ISO date string
|
|
74
|
+
*/
|
|
75
|
+
function formatRelativeTime(timestamp: number | string): string {
|
|
76
|
+
const time =
|
|
77
|
+
typeof timestamp === "string" ? new Date(timestamp).getTime() : timestamp
|
|
78
|
+
|
|
79
|
+
if (!Number.isFinite(time) || time <= 0) {
|
|
80
|
+
return "Unknown"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const now = Date.now()
|
|
84
|
+
const diff = now - time
|
|
85
|
+
|
|
86
|
+
if (diff < 0) {
|
|
87
|
+
return "Just now"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const seconds = Math.floor(diff / 1000)
|
|
91
|
+
const minutes = Math.floor(seconds / 60)
|
|
92
|
+
const hours = Math.floor(minutes / 60)
|
|
93
|
+
const days = Math.floor(hours / 24)
|
|
94
|
+
|
|
95
|
+
if (days > 0) return `${days} day${days > 1 ? "s" : ""} ago`
|
|
96
|
+
if (hours > 0) return `${hours} hour${hours > 1 ? "s" : ""} ago`
|
|
97
|
+
if (minutes > 0) return `${minutes} minute${minutes > 1 ? "s" : ""} ago`
|
|
98
|
+
return "Just now"
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function ExecutionsSkeleton() {
|
|
102
|
+
return (
|
|
103
|
+
<div className="flex-1 overflow-y-auto">
|
|
104
|
+
<section className="space-y-6">
|
|
105
|
+
<div className="rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900/60">
|
|
106
|
+
<div className="flex items-center justify-center py-12">
|
|
107
|
+
<div className="text-center">
|
|
108
|
+
<output
|
|
109
|
+
className="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-blue-600 border-r-transparent motion-reduce:animate-[spin_1.5s_linear_infinite]"
|
|
110
|
+
aria-label="Loading executions"
|
|
111
|
+
/>
|
|
112
|
+
<p className="mt-4 text-sm text-slate-500 dark:text-slate-400">
|
|
113
|
+
Loading executions...
|
|
114
|
+
</p>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</section>
|
|
119
|
+
</div>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// =============================================================================
|
|
124
|
+
// LIVE IMPLEMENTATION (using RxDB data)
|
|
125
|
+
// =============================================================================
|
|
126
|
+
|
|
127
|
+
function ExecutionsPageInner({
|
|
128
|
+
collectionPromise,
|
|
129
|
+
initialSelectedExecutionId = null,
|
|
130
|
+
onMobileBack,
|
|
131
|
+
}: {
|
|
132
|
+
collectionPromise: Promise<Collection<ExecutionDocType, string>>
|
|
133
|
+
initialSelectedExecutionId?: string | null
|
|
134
|
+
onMobileBack?: () => void
|
|
135
|
+
}) {
|
|
136
|
+
"use memo"
|
|
137
|
+
|
|
138
|
+
const executionCollection = use(collectionPromise)
|
|
139
|
+
const router = useRouter()
|
|
140
|
+
const searchParams = useSearchParams()
|
|
141
|
+
const isMobile = useIsMobile()
|
|
142
|
+
const defaultTab = initialSelectedExecutionId ? "all" : "in-progress"
|
|
143
|
+
const tab = parseExecutionTabKey(searchParams.get("filter")) ?? defaultTab
|
|
144
|
+
const currentQueryString = searchParams.toString()
|
|
145
|
+
const currentQuerySuffix = currentQueryString ? `?${currentQueryString}` : ""
|
|
146
|
+
const [selectedExecutionId, setSelectedExecutionId] = useState<string | null>(
|
|
147
|
+
null,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
// Live query for all executions, ordered by most recent first
|
|
151
|
+
const executionsQuery = useLiveQuery((q) =>
|
|
152
|
+
q
|
|
153
|
+
.from({ execution: executionCollection })
|
|
154
|
+
.select(({ execution }) => ({
|
|
155
|
+
id: execution.id,
|
|
156
|
+
updatedAt: execution.updatedAt,
|
|
157
|
+
processStateId: execution.processStateId,
|
|
158
|
+
processName: execution.processName,
|
|
159
|
+
withoutWaiting: execution.withoutWaiting ?? false,
|
|
160
|
+
processPath: execution.processPath,
|
|
161
|
+
canAbandonExecution: execution.canAbandonExecution ?? false,
|
|
162
|
+
canRestartExecution: execution.canRestartExecution ?? false,
|
|
163
|
+
status: execution.status,
|
|
164
|
+
failureReason: execution.failureReason,
|
|
165
|
+
abandonedReason: execution.abandonedReason,
|
|
166
|
+
startedAt: execution.startedAt,
|
|
167
|
+
finishedAt: execution.finishedAt,
|
|
168
|
+
completedSteps: execution.completedSteps,
|
|
169
|
+
totalSteps: execution.totalSteps,
|
|
170
|
+
durationMs: execution.durationMs,
|
|
171
|
+
estimatedCompletionAt: execution.estimatedCompletionAt,
|
|
172
|
+
slaTargetAt: execution.slaTargetAt,
|
|
173
|
+
steps: execution.steps,
|
|
174
|
+
}))
|
|
175
|
+
.orderBy(({ execution }) => execution.startedAt, "desc"),
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
const executions = executionsQuery.data ?? []
|
|
179
|
+
|
|
180
|
+
const routeSelectedExecution = initialSelectedExecutionId
|
|
181
|
+
? executions.find(
|
|
182
|
+
(execution) => execution.id === initialSelectedExecutionId,
|
|
183
|
+
)
|
|
184
|
+
: null
|
|
185
|
+
|
|
186
|
+
// Count by status
|
|
187
|
+
const runningCount = executions.filter((e) => e.status === "Running").length
|
|
188
|
+
const completedCount = executions.filter(
|
|
189
|
+
(e) => e.status === "Completed",
|
|
190
|
+
).length
|
|
191
|
+
const failedCount = executions.filter(
|
|
192
|
+
(e) => e.status === "Failed" || e.status === "Abandoned",
|
|
193
|
+
).length
|
|
194
|
+
|
|
195
|
+
// Filter based on tab
|
|
196
|
+
const filtered = (() => {
|
|
197
|
+
switch (tab) {
|
|
198
|
+
case "in-progress":
|
|
199
|
+
return executions.filter((e) => e.status === "Running")
|
|
200
|
+
case "completed":
|
|
201
|
+
return executions.filter((e) => e.status === "Completed")
|
|
202
|
+
case "failed":
|
|
203
|
+
return executions.filter(
|
|
204
|
+
(e) => e.status === "Failed" || e.status === "Abandoned",
|
|
205
|
+
)
|
|
206
|
+
default:
|
|
207
|
+
return executions
|
|
208
|
+
}
|
|
209
|
+
})()
|
|
210
|
+
|
|
211
|
+
// Selected execution
|
|
212
|
+
const selectedExecution = (() => {
|
|
213
|
+
if (filtered.length === 0) return null
|
|
214
|
+
|
|
215
|
+
if (selectedExecutionId) {
|
|
216
|
+
const found = filtered.find((e) => e.id === selectedExecutionId)
|
|
217
|
+
if (found) return found
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (initialSelectedExecutionId) {
|
|
221
|
+
if (!routeSelectedExecution) return null
|
|
222
|
+
|
|
223
|
+
const routeSelection = filtered.find(
|
|
224
|
+
(execution) => execution.id === initialSelectedExecutionId,
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
if (routeSelection) return routeSelection
|
|
228
|
+
return isMobile ? routeSelectedExecution : (filtered[0] ?? null)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return filtered[0] ?? null
|
|
232
|
+
})()
|
|
233
|
+
|
|
234
|
+
const handleSelectExecution = (executionId: string) => {
|
|
235
|
+
setSelectedExecutionId(executionId)
|
|
236
|
+
|
|
237
|
+
const executionPath = `/executions/${encodeURIComponent(executionId)}${currentQuerySuffix}`
|
|
238
|
+
|
|
239
|
+
if (isMobile) {
|
|
240
|
+
router.push(executionPath, { scroll: false })
|
|
241
|
+
return
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
router.replace(executionPath, { scroll: false })
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const handleSelectTab = (nextTab: ExecutionTabKey) => {
|
|
248
|
+
const nextSearchParams = new URLSearchParams(searchParams)
|
|
249
|
+
|
|
250
|
+
if (nextTab === defaultTab) {
|
|
251
|
+
nextSearchParams.delete("filter")
|
|
252
|
+
} else {
|
|
253
|
+
nextSearchParams.set("filter", nextTab)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const nextQueryString = nextSearchParams.toString()
|
|
257
|
+
router.replace(
|
|
258
|
+
nextQueryString ? `/executions?${nextQueryString}` : "/executions",
|
|
259
|
+
{ scroll: false },
|
|
260
|
+
)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const handleCloseMobileDetail = () => {
|
|
264
|
+
if (onMobileBack) {
|
|
265
|
+
onMobileBack()
|
|
266
|
+
return
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
router.push(`/executions${currentQuerySuffix}`, { scroll: false })
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const isMobileDetailRoute = isMobile && initialSelectedExecutionId !== null
|
|
273
|
+
const isRouteExecutionMissing =
|
|
274
|
+
initialSelectedExecutionId !== null && routeSelectedExecution === null
|
|
275
|
+
|
|
276
|
+
if (!executionsQuery.isReady) {
|
|
277
|
+
return <ExecutionsSkeleton />
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return (
|
|
281
|
+
<section className="space-y-6">
|
|
282
|
+
{!isMobileDetailRoute && (
|
|
283
|
+
<div className="flex flex-wrap items-center justify-between gap-4 rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900/60">
|
|
284
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
285
|
+
<TabPill
|
|
286
|
+
label="In Progress"
|
|
287
|
+
count={runningCount}
|
|
288
|
+
active={tab === "in-progress"}
|
|
289
|
+
onClick={() => handleSelectTab("in-progress")}
|
|
290
|
+
/>
|
|
291
|
+
<TabPill
|
|
292
|
+
label="Completed"
|
|
293
|
+
count={completedCount}
|
|
294
|
+
active={tab === "completed"}
|
|
295
|
+
onClick={() => handleSelectTab("completed")}
|
|
296
|
+
/>
|
|
297
|
+
<TabPill
|
|
298
|
+
label="Failed"
|
|
299
|
+
count={failedCount}
|
|
300
|
+
active={tab === "failed"}
|
|
301
|
+
onClick={() => handleSelectTab("failed")}
|
|
302
|
+
/>
|
|
303
|
+
<TabPill
|
|
304
|
+
label="All"
|
|
305
|
+
count={executions.length}
|
|
306
|
+
active={tab === "all"}
|
|
307
|
+
onClick={() => handleSelectTab("all")}
|
|
308
|
+
/>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
)}
|
|
312
|
+
|
|
313
|
+
{isMobileDetailRoute ? (
|
|
314
|
+
selectedExecution ? (
|
|
315
|
+
<MobileExecutionDetail
|
|
316
|
+
execution={selectedExecution}
|
|
317
|
+
onBack={handleCloseMobileDetail}
|
|
318
|
+
/>
|
|
319
|
+
) : (
|
|
320
|
+
<EmptyState
|
|
321
|
+
title="Execution not found"
|
|
322
|
+
description="This execution is no longer available or you no longer have access to it."
|
|
323
|
+
/>
|
|
324
|
+
)
|
|
325
|
+
) : filtered.length === 0 ? (
|
|
326
|
+
<EmptyState
|
|
327
|
+
title="No executions in this view"
|
|
328
|
+
description="Adjust filters or start a process from the catalog to see live executions."
|
|
329
|
+
/>
|
|
330
|
+
) : isMobile ? (
|
|
331
|
+
<div className="space-y-3">
|
|
332
|
+
{filtered.map((exec) => (
|
|
333
|
+
<ExecutionListCard
|
|
334
|
+
key={exec.id}
|
|
335
|
+
execution={exec}
|
|
336
|
+
isSelected={false}
|
|
337
|
+
onSelect={() => handleSelectExecution(exec.id)}
|
|
338
|
+
/>
|
|
339
|
+
))}
|
|
340
|
+
</div>
|
|
341
|
+
) : (
|
|
342
|
+
<div className="mt-4 grid gap-6 lg:grid-cols-[380px_1fr]">
|
|
343
|
+
<div className="space-y-3">
|
|
344
|
+
{filtered.map((exec) => (
|
|
345
|
+
<ExecutionListCard
|
|
346
|
+
key={exec.id}
|
|
347
|
+
execution={exec}
|
|
348
|
+
isSelected={exec.id === selectedExecution?.id}
|
|
349
|
+
onSelect={() => handleSelectExecution(exec.id)}
|
|
350
|
+
/>
|
|
351
|
+
))}
|
|
352
|
+
</div>
|
|
353
|
+
{selectedExecution ? (
|
|
354
|
+
<LiveExecutionDetail execution={selectedExecution} />
|
|
355
|
+
) : isRouteExecutionMissing ? (
|
|
356
|
+
<EmptyState
|
|
357
|
+
title="Execution not found"
|
|
358
|
+
description="This execution is no longer available or you no longer have access to it."
|
|
359
|
+
/>
|
|
360
|
+
) : null}
|
|
361
|
+
</div>
|
|
362
|
+
)}
|
|
363
|
+
</section>
|
|
364
|
+
)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function ExecutionListCard({
|
|
368
|
+
execution,
|
|
369
|
+
isSelected,
|
|
370
|
+
onSelect,
|
|
371
|
+
}: {
|
|
372
|
+
execution: ExecutionData
|
|
373
|
+
isSelected: boolean
|
|
374
|
+
onSelect: () => void
|
|
375
|
+
}) {
|
|
376
|
+
"use memo"
|
|
377
|
+
|
|
378
|
+
const waitingStep = execution.steps.find(
|
|
379
|
+
(step) =>
|
|
380
|
+
step.status === "Correction Required" || step.status === "Waiting",
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
return (
|
|
384
|
+
// biome-ignore lint/a11y/useSemanticElements: div needed to allow nested button in ExecutionCardMenu
|
|
385
|
+
<div
|
|
386
|
+
role="button"
|
|
387
|
+
tabIndex={0}
|
|
388
|
+
onClick={onSelect}
|
|
389
|
+
onKeyDown={(event) => {
|
|
390
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
391
|
+
event.preventDefault()
|
|
392
|
+
onSelect()
|
|
393
|
+
}
|
|
394
|
+
}}
|
|
395
|
+
className={cn(
|
|
396
|
+
"flex w-full cursor-pointer flex-col gap-3 rounded-2xl border bg-white p-4 text-left shadow-sm transition hover:-translate-y-0.5 hover:shadow-md dark:border-slate-800 dark:bg-slate-900/70",
|
|
397
|
+
isSelected
|
|
398
|
+
? "border-blue-500 dark:border-blue-400 dark:bg-blue-500/10"
|
|
399
|
+
: "border-slate-200",
|
|
400
|
+
)}
|
|
401
|
+
>
|
|
402
|
+
<div className="flex items-center justify-between">
|
|
403
|
+
<h4 className="text-lg font-semibold text-slate-900 dark:text-slate-100">
|
|
404
|
+
{execution.processName}
|
|
405
|
+
{execution.withoutWaiting && <WithoutWaitingBadge />}
|
|
406
|
+
</h4>
|
|
407
|
+
<div className="flex items-center gap-2">
|
|
408
|
+
<ExecutionCardMenu
|
|
409
|
+
executionId={execution.id}
|
|
410
|
+
status={execution.status}
|
|
411
|
+
processPath={execution.processPath}
|
|
412
|
+
canAbandonExecution={execution.canAbandonExecution}
|
|
413
|
+
canRestartExecution={execution.canRestartExecution}
|
|
414
|
+
/>
|
|
415
|
+
<span
|
|
416
|
+
className={cn(
|
|
417
|
+
"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-semibold",
|
|
418
|
+
executionStatusTheme[execution.status as ExecutionStatus] ||
|
|
419
|
+
executionStatusTheme.Running,
|
|
420
|
+
)}
|
|
421
|
+
>
|
|
422
|
+
{execution.status}
|
|
423
|
+
</span>
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
427
|
+
{execution.status === "Completed"
|
|
428
|
+
? "Finished"
|
|
429
|
+
: `Step ${execution.completedSteps} of ${execution.totalSteps}`}
|
|
430
|
+
</p>
|
|
431
|
+
<div className="flex items-center justify-between text-xs text-slate-500 dark:text-slate-400">
|
|
432
|
+
<span>Started {formatRelativeTime(execution.startedAt)}</span>
|
|
433
|
+
<span>
|
|
434
|
+
{execution.status === "Completed" && execution.finishedAt
|
|
435
|
+
? `Completed ${formatRelativeTime(execution.finishedAt)}`
|
|
436
|
+
: `Last activity ${formatRelativeTime(execution.updatedAt)}`}
|
|
437
|
+
</span>
|
|
438
|
+
</div>
|
|
439
|
+
{waitingStep && (
|
|
440
|
+
<div className="flex items-center gap-2">
|
|
441
|
+
<span
|
|
442
|
+
className={cn(
|
|
443
|
+
"rounded-full px-2 py-0.5 text-xs font-semibold",
|
|
444
|
+
waitingStep.status === "Correction Required"
|
|
445
|
+
? "bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-200"
|
|
446
|
+
: "bg-slate-200 text-slate-600 dark:bg-slate-800 dark:text-slate-300",
|
|
447
|
+
)}
|
|
448
|
+
>
|
|
449
|
+
{waitingStep.status === "Correction Required"
|
|
450
|
+
? `Correction required: ${waitingStep.name}`
|
|
451
|
+
: waitingStep.name}
|
|
452
|
+
</span>
|
|
453
|
+
</div>
|
|
454
|
+
)}
|
|
455
|
+
<StepParticipants steps={execution.steps} />
|
|
456
|
+
</div>
|
|
457
|
+
)
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
interface ExecutionStep {
|
|
461
|
+
readonly id: string
|
|
462
|
+
readonly name: string
|
|
463
|
+
readonly path: string
|
|
464
|
+
readonly status:
|
|
465
|
+
| "Completed"
|
|
466
|
+
| "Waiting"
|
|
467
|
+
| "Potential"
|
|
468
|
+
| "Failed"
|
|
469
|
+
| "Correction Required"
|
|
470
|
+
readonly failureReason?: string | undefined
|
|
471
|
+
readonly role?:
|
|
472
|
+
| {
|
|
473
|
+
readonly id: string
|
|
474
|
+
readonly name: string
|
|
475
|
+
}
|
|
476
|
+
| undefined
|
|
477
|
+
readonly submittedViaEmbeddedForm?: boolean | undefined
|
|
478
|
+
readonly externalSubmitterEmail?: string | undefined
|
|
479
|
+
readonly assignedProviderUserEmail?: string | undefined
|
|
480
|
+
readonly providerUser?:
|
|
481
|
+
| {
|
|
482
|
+
readonly id: string
|
|
483
|
+
readonly firstName: string
|
|
484
|
+
readonly lastName: string
|
|
485
|
+
readonly picture: string
|
|
486
|
+
readonly orgUnit: string
|
|
487
|
+
}
|
|
488
|
+
| undefined
|
|
489
|
+
readonly startedAt?: string | undefined // ISO date string
|
|
490
|
+
readonly completedAt?: string | undefined // ISO date string
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
interface ExecutionData {
|
|
494
|
+
withoutWaiting: boolean
|
|
495
|
+
id: string
|
|
496
|
+
updatedAt: number
|
|
497
|
+
processStateId: string
|
|
498
|
+
processName: string
|
|
499
|
+
processPath: string
|
|
500
|
+
canAbandonExecution: boolean
|
|
501
|
+
canRestartExecution: boolean
|
|
502
|
+
status: "Running" | "Completed" | "Failed" | "Abandoned"
|
|
503
|
+
failureReason?: string | undefined
|
|
504
|
+
abandonedReason?: string | undefined
|
|
505
|
+
startedAt: string // ISO date string
|
|
506
|
+
finishedAt: string | undefined // ISO date string
|
|
507
|
+
completedSteps: number
|
|
508
|
+
totalSteps: number
|
|
509
|
+
durationMs: number | undefined
|
|
510
|
+
estimatedCompletionAt: string | undefined // ISO date string
|
|
511
|
+
slaTargetAt: string | undefined // ISO date string
|
|
512
|
+
steps: readonly ExecutionStep[]
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const SWIPE_CLOSE_MIN_PX = 72
|
|
516
|
+
const SWIPE_CLOSE_HORIZONTAL_RATIO = 1.25
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Format ISO date string to readable date/time
|
|
520
|
+
*/
|
|
521
|
+
function formatDateTime(isoString: string | undefined): string {
|
|
522
|
+
if (!isoString) return "N/A"
|
|
523
|
+
const date = new Date(isoString)
|
|
524
|
+
return date.toLocaleString(undefined, {
|
|
525
|
+
month: "short",
|
|
526
|
+
day: "numeric",
|
|
527
|
+
hour: "2-digit",
|
|
528
|
+
minute: "2-digit",
|
|
529
|
+
})
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Extract unique participants from execution steps
|
|
534
|
+
*/
|
|
535
|
+
function getParticipants(steps: readonly ExecutionStep[]) {
|
|
536
|
+
const completedWithProviderUser = steps.filter(
|
|
537
|
+
(
|
|
538
|
+
s,
|
|
539
|
+
): s is typeof s & {
|
|
540
|
+
providerUser: NonNullable<typeof s.providerUser>
|
|
541
|
+
} => s.status === "Completed" && s.providerUser != null,
|
|
542
|
+
)
|
|
543
|
+
const waitingWithRole = steps.filter(
|
|
544
|
+
(s): s is typeof s & { role: NonNullable<typeof s.role> } =>
|
|
545
|
+
(s.status === "Waiting" || s.status === "Correction Required") &&
|
|
546
|
+
s.role != null,
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
// Dedupe provider users by id
|
|
550
|
+
const seenProviderUsers = new Set<string>()
|
|
551
|
+
const uniqueProviderUsers = completedWithProviderUser.filter((step) => {
|
|
552
|
+
const key = step.providerUser.id
|
|
553
|
+
if (seenProviderUsers.has(key)) return false
|
|
554
|
+
seenProviderUsers.add(key)
|
|
555
|
+
return true
|
|
556
|
+
})
|
|
557
|
+
|
|
558
|
+
return { providerUsers: uniqueProviderUsers, waitingRoles: waitingWithRole }
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function LiveExecutionDetail({ execution }: { execution: ExecutionData }) {
|
|
562
|
+
"use memo"
|
|
563
|
+
|
|
564
|
+
// Find current waiting step for display
|
|
565
|
+
const currentWaitingStep = execution.steps.find(
|
|
566
|
+
(s) => s.status === "Waiting" || s.status === "Correction Required",
|
|
567
|
+
)
|
|
568
|
+
const failedStep = execution.steps.find((s) => s.status === "Failed")
|
|
569
|
+
const { providerUsers, waitingRoles } = getParticipants(execution.steps)
|
|
570
|
+
|
|
571
|
+
return (
|
|
572
|
+
<div className="flex flex-col gap-4 rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900/70">
|
|
573
|
+
<div className="flex flex-wrap items-start justify-between gap-3">
|
|
574
|
+
<div>
|
|
575
|
+
<h3 className="text-2xl font-semibold text-slate-900 dark:text-slate-100">
|
|
576
|
+
{execution.processName}
|
|
577
|
+
{execution.withoutWaiting && <WithoutWaitingBadge />}
|
|
578
|
+
</h3>
|
|
579
|
+
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
580
|
+
Started {formatRelativeTime(execution.startedAt)}.
|
|
581
|
+
{currentWaitingStep?.status === "Correction Required"
|
|
582
|
+
? ` Correction required on ${currentWaitingStep.name}.`
|
|
583
|
+
: currentWaitingStep?.providerUser
|
|
584
|
+
? ` Current assignee: ${currentWaitingStep.providerUser.firstName} ${currentWaitingStep.providerUser.lastName}`
|
|
585
|
+
: ""}
|
|
586
|
+
</p>
|
|
587
|
+
</div>
|
|
588
|
+
<div className="flex items-center gap-2">
|
|
589
|
+
<span
|
|
590
|
+
className={cn(
|
|
591
|
+
"inline-flex items-center rounded-full px-3 py-1 text-sm font-semibold",
|
|
592
|
+
executionStatusTheme[execution.status as ExecutionStatus] ||
|
|
593
|
+
executionStatusTheme.Running,
|
|
594
|
+
)}
|
|
595
|
+
>
|
|
596
|
+
{execution.status}
|
|
597
|
+
</span>
|
|
598
|
+
<ProcessWorkflowLink
|
|
599
|
+
processName={execution.processName}
|
|
600
|
+
processPath={execution.processPath}
|
|
601
|
+
/>
|
|
602
|
+
</div>
|
|
603
|
+
</div>
|
|
604
|
+
|
|
605
|
+
{/* Progress */}
|
|
606
|
+
{execution.status === "Failed" &&
|
|
607
|
+
(execution.failureReason || failedStep) && (
|
|
608
|
+
<div className="rounded-2xl border border-rose-200 bg-rose-50 p-4 text-rose-800 dark:border-rose-900/40 dark:bg-rose-950/20 dark:text-rose-200">
|
|
609
|
+
<h4 className="text-sm font-semibold tracking-wide uppercase">
|
|
610
|
+
Failure
|
|
611
|
+
</h4>
|
|
612
|
+
<p className="mt-2 text-sm leading-relaxed">
|
|
613
|
+
{execution.failureReason ??
|
|
614
|
+
failedStep?.failureReason ??
|
|
615
|
+
"A system step failed."}
|
|
616
|
+
</p>
|
|
617
|
+
</div>
|
|
618
|
+
)}
|
|
619
|
+
|
|
620
|
+
{execution.status === "Abandoned" && (
|
|
621
|
+
<div className="rounded-2xl border border-slate-300 bg-slate-100 p-4 text-slate-700 dark:border-slate-600 dark:bg-slate-800/40 dark:text-slate-300">
|
|
622
|
+
<h4 className="text-sm font-semibold tracking-wide uppercase">
|
|
623
|
+
Abandoned
|
|
624
|
+
</h4>
|
|
625
|
+
<p className="mt-2 text-sm leading-relaxed">
|
|
626
|
+
{execution.abandonedReason || "This execution was abandoned."}
|
|
627
|
+
</p>
|
|
628
|
+
</div>
|
|
629
|
+
)}
|
|
630
|
+
|
|
631
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-900/60">
|
|
632
|
+
<h4 className="text-sm font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400">
|
|
633
|
+
Progress
|
|
634
|
+
</h4>
|
|
635
|
+
<div className="mt-4 space-y-3">
|
|
636
|
+
<div className="flex items-center justify-between text-sm">
|
|
637
|
+
<span className="text-slate-600 dark:text-slate-300">
|
|
638
|
+
Steps completed
|
|
639
|
+
</span>
|
|
640
|
+
<span className="font-semibold text-slate-900 dark:text-slate-100">
|
|
641
|
+
{execution.completedSteps} / {execution.totalSteps}
|
|
642
|
+
</span>
|
|
643
|
+
</div>
|
|
644
|
+
<div className="h-2 w-full rounded-full bg-slate-200 dark:bg-slate-700">
|
|
645
|
+
<div
|
|
646
|
+
className="h-2 rounded-full bg-blue-500"
|
|
647
|
+
style={{
|
|
648
|
+
width: `${execution.totalSteps > 0 ? (execution.completedSteps / execution.totalSteps) * 100 : 0}%`,
|
|
649
|
+
}}
|
|
650
|
+
/>
|
|
651
|
+
</div>
|
|
652
|
+
</div>
|
|
653
|
+
</div>
|
|
654
|
+
|
|
655
|
+
{/* Timeline */}
|
|
656
|
+
{execution.steps.length > 0 && (
|
|
657
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-900/60">
|
|
658
|
+
<h4 className="text-sm font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400">
|
|
659
|
+
Timeline
|
|
660
|
+
</h4>
|
|
661
|
+
<ul className="mt-4 space-y-4">
|
|
662
|
+
{execution.steps.map((step) => {
|
|
663
|
+
const isEmbeddedSubmission =
|
|
664
|
+
step.submittedViaEmbeddedForm === true
|
|
665
|
+
const hasExternalSubmitterEmail =
|
|
666
|
+
step.externalSubmitterEmail != null &&
|
|
667
|
+
step.externalSubmitterEmail.length > 0
|
|
668
|
+
const showExternalSubmissionInfo =
|
|
669
|
+
step.status !== "Correction Required" &&
|
|
670
|
+
(isEmbeddedSubmission || hasExternalSubmitterEmail)
|
|
671
|
+
|
|
672
|
+
return (
|
|
673
|
+
<li key={step.id} className="relative pl-8">
|
|
674
|
+
<span
|
|
675
|
+
className={cn(
|
|
676
|
+
"absolute left-0 top-1.5 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold",
|
|
677
|
+
step.status === "Completed"
|
|
678
|
+
? "border-emerald-500 bg-emerald-500 text-white"
|
|
679
|
+
: step.status === "Failed"
|
|
680
|
+
? "border-rose-500 bg-rose-500 text-white"
|
|
681
|
+
: step.status === "Correction Required"
|
|
682
|
+
? "border-amber-500 bg-amber-500 text-white"
|
|
683
|
+
: step.status === "Waiting"
|
|
684
|
+
? "border-blue-500 bg-blue-500 text-white"
|
|
685
|
+
: "border-slate-300 bg-white text-slate-400 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-500",
|
|
686
|
+
)}
|
|
687
|
+
>
|
|
688
|
+
{step.status === "Completed"
|
|
689
|
+
? "\u2713"
|
|
690
|
+
: step.status === "Failed"
|
|
691
|
+
? "!"
|
|
692
|
+
: step.status === "Correction Required"
|
|
693
|
+
? "?"
|
|
694
|
+
: step.status === "Waiting"
|
|
695
|
+
? "\u2022"
|
|
696
|
+
: ""}
|
|
697
|
+
</span>
|
|
698
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
699
|
+
<p className="text-sm font-semibold text-slate-900 dark:text-slate-100">
|
|
700
|
+
{step.name}
|
|
701
|
+
</p>
|
|
702
|
+
{/* External submissions can have internal roles but external submitters. */}
|
|
703
|
+
{showExternalSubmissionInfo ? (
|
|
704
|
+
<span className="rounded-full bg-cyan-500/10 px-2 py-0.5 text-[11px] font-semibold text-cyan-700 dark:text-cyan-300">
|
|
705
|
+
External Participant
|
|
706
|
+
</span>
|
|
707
|
+
) : step.assignedProviderUserEmail ? (
|
|
708
|
+
<span className="rounded-full bg-blue-500/10 px-2 py-0.5 text-[11px] font-semibold text-blue-700 dark:text-blue-300">
|
|
709
|
+
{step.assignedProviderUserEmail}
|
|
710
|
+
</span>
|
|
711
|
+
) : step.role ? (
|
|
712
|
+
<span className="rounded-full bg-slate-200 px-2 py-0.5 text-[11px] font-semibold text-slate-600 dark:bg-slate-800/60 dark:text-slate-300">
|
|
713
|
+
{step.role.name}
|
|
714
|
+
</span>
|
|
715
|
+
) : null}
|
|
716
|
+
</div>
|
|
717
|
+
{showExternalSubmissionInfo && hasExternalSubmitterEmail ? (
|
|
718
|
+
<p className="mt-1 text-[11px] text-slate-500 dark:text-slate-400">
|
|
719
|
+
{step.status === "Waiting"
|
|
720
|
+
? "Waiting for"
|
|
721
|
+
: isEmbeddedSubmission
|
|
722
|
+
? "Submitted via embedded form by"
|
|
723
|
+
: "Submitted by"}{" "}
|
|
724
|
+
{step.externalSubmitterEmail}
|
|
725
|
+
</p>
|
|
726
|
+
) : isEmbeddedSubmission &&
|
|
727
|
+
step.status !== "Waiting" &&
|
|
728
|
+
step.status !== "Correction Required" ? (
|
|
729
|
+
<p className="mt-1 text-[11px] text-slate-500 dark:text-slate-400">
|
|
730
|
+
Submitted via embedded form (no email recorded)
|
|
731
|
+
</p>
|
|
732
|
+
) : !showExternalSubmissionInfo && step.providerUser ? (
|
|
733
|
+
<p className="mt-1 text-[11px] text-slate-500 dark:text-slate-400">
|
|
734
|
+
{step.status === "Completed"
|
|
735
|
+
? "Completed by"
|
|
736
|
+
: step.status === "Failed"
|
|
737
|
+
? "Failed at"
|
|
738
|
+
: step.status === "Correction Required"
|
|
739
|
+
? "Correction assigned to"
|
|
740
|
+
: "Assigned to"}{" "}
|
|
741
|
+
{step.providerUser.firstName} {step.providerUser.lastName}
|
|
742
|
+
</p>
|
|
743
|
+
) : step.status === "Correction Required" && step.role ? (
|
|
744
|
+
<p className="mt-1 text-[11px] text-slate-500 dark:text-slate-400">
|
|
745
|
+
Correction assigned to {step.role.name}
|
|
746
|
+
</p>
|
|
747
|
+
) : null}
|
|
748
|
+
{step.status === "Failed" && step.failureReason && (
|
|
749
|
+
<p className="mt-1 text-xs text-rose-700 dark:text-rose-300">
|
|
750
|
+
{step.failureReason}
|
|
751
|
+
</p>
|
|
752
|
+
)}
|
|
753
|
+
{step.status === "Correction Required" &&
|
|
754
|
+
step.failureReason && (
|
|
755
|
+
<p className="mt-1 text-xs text-amber-700 dark:text-amber-300">
|
|
756
|
+
{step.failureReason}
|
|
757
|
+
</p>
|
|
758
|
+
)}
|
|
759
|
+
<div className="mt-1 flex flex-wrap items-center gap-3 text-xs text-slate-500 dark:text-slate-400">
|
|
760
|
+
{step.startedAt && (
|
|
761
|
+
<span>Started {formatRelativeTime(step.startedAt)}</span>
|
|
762
|
+
)}
|
|
763
|
+
{step.completedAt && (
|
|
764
|
+
<span>
|
|
765
|
+
{step.status === "Failed"
|
|
766
|
+
? `Failed ${formatRelativeTime(step.completedAt)}`
|
|
767
|
+
: `Completed ${formatRelativeTime(step.completedAt)}`}
|
|
768
|
+
</span>
|
|
769
|
+
)}
|
|
770
|
+
</div>
|
|
771
|
+
</li>
|
|
772
|
+
)
|
|
773
|
+
})}
|
|
774
|
+
</ul>
|
|
775
|
+
</div>
|
|
776
|
+
)}
|
|
777
|
+
|
|
778
|
+
{/* Participants and State Snapshot cards */}
|
|
779
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
780
|
+
{/* Participants */}
|
|
781
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-900/60">
|
|
782
|
+
<h4 className="text-sm font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400">
|
|
783
|
+
Participants
|
|
784
|
+
</h4>
|
|
785
|
+
<div className="mt-3 space-y-2">
|
|
786
|
+
{providerUsers.map((step) => (
|
|
787
|
+
<div
|
|
788
|
+
key={step.id}
|
|
789
|
+
className="flex items-center justify-between rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-600 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
|
|
790
|
+
>
|
|
791
|
+
<span>
|
|
792
|
+
{step.providerUser.firstName} {step.providerUser.lastName}
|
|
793
|
+
</span>
|
|
794
|
+
<span className="text-xs text-slate-500 dark:text-slate-400">
|
|
795
|
+
{step.providerUser.orgUnit}
|
|
796
|
+
</span>
|
|
797
|
+
</div>
|
|
798
|
+
))}
|
|
799
|
+
{waitingRoles.map((step) => (
|
|
800
|
+
<div
|
|
801
|
+
key={step.id}
|
|
802
|
+
className="flex items-center justify-between rounded-xl border border-dashed border-slate-300 bg-white px-3 py-2 text-sm text-slate-500 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-400"
|
|
803
|
+
>
|
|
804
|
+
<span className="italic">
|
|
805
|
+
Waiting for{" "}
|
|
806
|
+
{step.externalSubmitterEmail ??
|
|
807
|
+
step.assignedProviderUserEmail ??
|
|
808
|
+
step.role.name}
|
|
809
|
+
</span>
|
|
810
|
+
</div>
|
|
811
|
+
))}
|
|
812
|
+
{providerUsers.length === 0 && waitingRoles.length === 0 && (
|
|
813
|
+
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
814
|
+
No participants yet
|
|
815
|
+
</p>
|
|
816
|
+
)}
|
|
817
|
+
</div>
|
|
818
|
+
</div>
|
|
819
|
+
|
|
820
|
+
{/* State Snapshot */}
|
|
821
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-900/60">
|
|
822
|
+
<h4 className="text-sm font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400">
|
|
823
|
+
State snapshot
|
|
824
|
+
</h4>
|
|
825
|
+
<dl className="mt-3 grid grid-cols-2 gap-3 text-sm text-slate-600 dark:text-slate-300">
|
|
826
|
+
<div>
|
|
827
|
+
<dt className="text-xs tracking-wide text-slate-400 uppercase dark:text-slate-500">
|
|
828
|
+
{execution.status === "Abandoned"
|
|
829
|
+
? "Abandoned"
|
|
830
|
+
: execution.finishedAt
|
|
831
|
+
? "Completed"
|
|
832
|
+
: "Estimated completion"}
|
|
833
|
+
</dt>
|
|
834
|
+
<dd>
|
|
835
|
+
{execution.finishedAt
|
|
836
|
+
? formatDateTime(execution.finishedAt)
|
|
837
|
+
: execution.estimatedCompletionAt
|
|
838
|
+
? formatDateTime(execution.estimatedCompletionAt)
|
|
839
|
+
: "N/A"}
|
|
840
|
+
</dd>
|
|
841
|
+
</div>
|
|
842
|
+
<div>
|
|
843
|
+
<dt className="text-xs tracking-wide text-slate-400 uppercase dark:text-slate-500">
|
|
844
|
+
SLA target
|
|
845
|
+
</dt>
|
|
846
|
+
<dd>
|
|
847
|
+
{execution.slaTargetAt
|
|
848
|
+
? formatDateTime(execution.slaTargetAt)
|
|
849
|
+
: "Not set"}
|
|
850
|
+
</dd>
|
|
851
|
+
</div>
|
|
852
|
+
</dl>
|
|
853
|
+
</div>
|
|
854
|
+
</div>
|
|
855
|
+
</div>
|
|
856
|
+
)
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
function MobileExecutionDetail({
|
|
860
|
+
execution,
|
|
861
|
+
onBack,
|
|
862
|
+
}: {
|
|
863
|
+
execution: ExecutionData
|
|
864
|
+
onBack: () => void
|
|
865
|
+
}) {
|
|
866
|
+
"use memo"
|
|
867
|
+
|
|
868
|
+
const touchStartX = useRef<number | null>(null)
|
|
869
|
+
const touchStartY = useRef<number | null>(null)
|
|
870
|
+
const touchCurrentX = useRef<number | null>(null)
|
|
871
|
+
const touchCurrentY = useRef<number | null>(null)
|
|
872
|
+
|
|
873
|
+
const resetSwipe = () => {
|
|
874
|
+
touchStartX.current = null
|
|
875
|
+
touchStartY.current = null
|
|
876
|
+
touchCurrentX.current = null
|
|
877
|
+
touchCurrentY.current = null
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
return (
|
|
881
|
+
<div
|
|
882
|
+
className="space-y-4"
|
|
883
|
+
onTouchStart={(event) => {
|
|
884
|
+
const touch = event.touches[0]
|
|
885
|
+
if (!touch) return
|
|
886
|
+
|
|
887
|
+
touchStartX.current = touch.clientX
|
|
888
|
+
touchStartY.current = touch.clientY
|
|
889
|
+
touchCurrentX.current = touch.clientX
|
|
890
|
+
touchCurrentY.current = touch.clientY
|
|
891
|
+
}}
|
|
892
|
+
onTouchMove={(event) => {
|
|
893
|
+
const touch = event.touches[0]
|
|
894
|
+
if (!touch) return
|
|
895
|
+
|
|
896
|
+
touchCurrentX.current = touch.clientX
|
|
897
|
+
touchCurrentY.current = touch.clientY
|
|
898
|
+
}}
|
|
899
|
+
onTouchEnd={() => {
|
|
900
|
+
if (
|
|
901
|
+
touchStartX.current === null ||
|
|
902
|
+
touchStartY.current === null ||
|
|
903
|
+
touchCurrentX.current === null ||
|
|
904
|
+
touchCurrentY.current === null
|
|
905
|
+
) {
|
|
906
|
+
resetSwipe()
|
|
907
|
+
return
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
const deltaX = touchCurrentX.current - touchStartX.current
|
|
911
|
+
const deltaY = Math.abs(touchCurrentY.current - touchStartY.current)
|
|
912
|
+
|
|
913
|
+
resetSwipe()
|
|
914
|
+
|
|
915
|
+
if (
|
|
916
|
+
deltaX > SWIPE_CLOSE_MIN_PX &&
|
|
917
|
+
deltaX > deltaY * SWIPE_CLOSE_HORIZONTAL_RATIO
|
|
918
|
+
) {
|
|
919
|
+
onBack()
|
|
920
|
+
}
|
|
921
|
+
}}
|
|
922
|
+
onTouchCancel={resetSwipe}
|
|
923
|
+
>
|
|
924
|
+
<div className="flex items-center gap-3 rounded-2xl border border-slate-200 bg-white px-3 py-2.5 shadow-sm dark:border-slate-800 dark:bg-slate-900/70">
|
|
925
|
+
<button
|
|
926
|
+
type="button"
|
|
927
|
+
onClick={onBack}
|
|
928
|
+
className="inline-flex items-center gap-1 rounded-full px-2 py-1 text-sm font-medium text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-slate-800 dark:hover:text-slate-50"
|
|
929
|
+
>
|
|
930
|
+
<ChevronLeft className="h-4 w-4" />
|
|
931
|
+
Back
|
|
932
|
+
</button>
|
|
933
|
+
<div className="min-w-0">
|
|
934
|
+
<p className="text-[11px] font-semibold tracking-[0.18em] text-slate-400 uppercase dark:text-slate-500">
|
|
935
|
+
Execution detail
|
|
936
|
+
</p>
|
|
937
|
+
<p className="truncate text-sm font-semibold text-slate-900 dark:text-slate-100">
|
|
938
|
+
{execution.processName}
|
|
939
|
+
{execution.withoutWaiting && <WithoutWaitingBadge />}
|
|
940
|
+
</p>
|
|
941
|
+
</div>
|
|
942
|
+
</div>
|
|
943
|
+
|
|
944
|
+
<div className="animate-in slide-in-from-right-4 duration-200">
|
|
945
|
+
<LiveExecutionDetail execution={execution} />
|
|
946
|
+
</div>
|
|
947
|
+
</div>
|
|
948
|
+
)
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// =============================================================================
|
|
952
|
+
// MOCK IMPLEMENTATION (for reference)
|
|
953
|
+
// =============================================================================
|
|
954
|
+
|
|
955
|
+
function MockExecutionsSection() {
|
|
956
|
+
const [tab, setTab] = useState<MockExecutionTabKey>("in-progress")
|
|
957
|
+
const [view, setView] = useState<MockExecutionView>("timeline")
|
|
958
|
+
const [selectedExecutionId, setSelectedExecutionId] = useState<string | null>(
|
|
959
|
+
mockExecutions[0]?.id ?? null,
|
|
960
|
+
)
|
|
961
|
+
|
|
962
|
+
const filtered = useMemo(() => {
|
|
963
|
+
const statuses = mockExecutionTabFilters[tab]
|
|
964
|
+
return mockExecutions.filter((exec) => statuses.includes(exec.status))
|
|
965
|
+
}, [tab])
|
|
966
|
+
|
|
967
|
+
const selectedExecution = useMemo(() => {
|
|
968
|
+
if (filtered.length === 0) return null
|
|
969
|
+
const selected = filtered.find((exec) => exec.id === selectedExecutionId)
|
|
970
|
+
return selected ?? filtered[0] ?? null
|
|
971
|
+
}, [filtered, selectedExecutionId])
|
|
972
|
+
|
|
973
|
+
return (
|
|
974
|
+
<section className="space-y-6">
|
|
975
|
+
<div className="rounded-2xl border-2 border-amber-500 bg-amber-50 p-2 dark:border-amber-400 dark:bg-amber-900/20">
|
|
976
|
+
<h2 className="mb-4 text-lg font-bold text-amber-700 dark:text-amber-300">
|
|
977
|
+
MOCK DATA (for reference)
|
|
978
|
+
</h2>
|
|
979
|
+
<div className="flex flex-wrap items-center justify-between gap-4 rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900/60">
|
|
980
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
981
|
+
<TabPill
|
|
982
|
+
label="In Progress"
|
|
983
|
+
count={
|
|
984
|
+
mockExecutions.filter(
|
|
985
|
+
(exec) =>
|
|
986
|
+
exec.status === "Running" || exec.status === "Paused",
|
|
987
|
+
).length
|
|
988
|
+
}
|
|
989
|
+
active={tab === "in-progress"}
|
|
990
|
+
onClick={() => setTab("in-progress")}
|
|
991
|
+
/>
|
|
992
|
+
<TabPill
|
|
993
|
+
label="Completed"
|
|
994
|
+
count={
|
|
995
|
+
mockExecutions.filter((exec) => exec.status === "Completed")
|
|
996
|
+
.length
|
|
997
|
+
}
|
|
998
|
+
active={tab === "completed"}
|
|
999
|
+
onClick={() => setTab("completed")}
|
|
1000
|
+
/>
|
|
1001
|
+
<TabPill
|
|
1002
|
+
label="Failed / Cancelled"
|
|
1003
|
+
count={
|
|
1004
|
+
mockExecutions.filter((exec) => exec.status === "Failed").length
|
|
1005
|
+
}
|
|
1006
|
+
active={tab === "failed"}
|
|
1007
|
+
onClick={() => setTab("failed")}
|
|
1008
|
+
/>
|
|
1009
|
+
<TabPill
|
|
1010
|
+
label="All"
|
|
1011
|
+
count={mockExecutions.length}
|
|
1012
|
+
active={tab === "all"}
|
|
1013
|
+
onClick={() => setTab("all")}
|
|
1014
|
+
/>
|
|
1015
|
+
</div>
|
|
1016
|
+
<div className="flex items-center gap-2">
|
|
1017
|
+
<button
|
|
1018
|
+
type="button"
|
|
1019
|
+
onClick={() => setView("timeline")}
|
|
1020
|
+
className={cn(
|
|
1021
|
+
"rounded-full border px-3 py-1.5 text-sm font-medium",
|
|
1022
|
+
view === "timeline"
|
|
1023
|
+
? "border-blue-500 text-blue-600 dark:text-blue-300"
|
|
1024
|
+
: "border-slate-200 text-slate-500 hover:border-slate-300 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:border-slate-600 dark:hover:text-slate-200",
|
|
1025
|
+
)}
|
|
1026
|
+
>
|
|
1027
|
+
Timeline
|
|
1028
|
+
</button>
|
|
1029
|
+
<button
|
|
1030
|
+
type="button"
|
|
1031
|
+
onClick={() => setView("kanban")}
|
|
1032
|
+
className={cn(
|
|
1033
|
+
"rounded-full border px-3 py-1.5 text-sm font-medium",
|
|
1034
|
+
view === "kanban"
|
|
1035
|
+
? "border-blue-500 text-blue-600 dark:text-blue-300"
|
|
1036
|
+
: "border-slate-200 text-slate-500 hover:border-slate-300 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:border-slate-600 dark:hover:text-slate-200",
|
|
1037
|
+
)}
|
|
1038
|
+
>
|
|
1039
|
+
Kanban
|
|
1040
|
+
</button>
|
|
1041
|
+
<button
|
|
1042
|
+
type="button"
|
|
1043
|
+
className="rounded-full border border-slate-200 px-3 py-1.5 text-sm text-slate-500 hover:border-slate-300 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:border-slate-600 dark:hover:text-slate-200"
|
|
1044
|
+
>
|
|
1045
|
+
Export CSV
|
|
1046
|
+
</button>
|
|
1047
|
+
</div>
|
|
1048
|
+
</div>
|
|
1049
|
+
|
|
1050
|
+
{filtered.length === 0 ? (
|
|
1051
|
+
<EmptyState
|
|
1052
|
+
title="No executions in this view"
|
|
1053
|
+
description="Adjust filters or start a process from the catalog to see live executions."
|
|
1054
|
+
/>
|
|
1055
|
+
) : view === "kanban" ? (
|
|
1056
|
+
<div className="mt-4">
|
|
1057
|
+
<MockExecutionKanban executions={filtered} />
|
|
1058
|
+
</div>
|
|
1059
|
+
) : (
|
|
1060
|
+
<div className="mt-4 grid gap-6 lg:grid-cols-[380px_1fr]">
|
|
1061
|
+
<div className="space-y-3">
|
|
1062
|
+
{filtered.map((exec) => (
|
|
1063
|
+
<button
|
|
1064
|
+
key={exec.id}
|
|
1065
|
+
type="button"
|
|
1066
|
+
onClick={() => setSelectedExecutionId(exec.id)}
|
|
1067
|
+
className={cn(
|
|
1068
|
+
"flex w-full flex-col gap-3 rounded-2xl border bg-white p-4 text-left shadow-sm transition hover:-translate-y-0.5 hover:shadow-md dark:border-slate-800 dark:bg-slate-900/70",
|
|
1069
|
+
exec.id === selectedExecution?.id
|
|
1070
|
+
? "border-blue-500 dark:border-blue-400 dark:bg-blue-500/10"
|
|
1071
|
+
: "border-slate-200",
|
|
1072
|
+
)}
|
|
1073
|
+
>
|
|
1074
|
+
<div className="flex items-center justify-between">
|
|
1075
|
+
<h4 className="text-lg font-semibold text-slate-900 dark:text-slate-100">
|
|
1076
|
+
{exec.processName} {exec.executionId}
|
|
1077
|
+
</h4>
|
|
1078
|
+
<span
|
|
1079
|
+
className={cn(
|
|
1080
|
+
"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-semibold",
|
|
1081
|
+
mockExecutionStatusTheme[exec.status],
|
|
1082
|
+
)}
|
|
1083
|
+
>
|
|
1084
|
+
{exec.status}
|
|
1085
|
+
</span>
|
|
1086
|
+
</div>
|
|
1087
|
+
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
1088
|
+
{exec.progress}
|
|
1089
|
+
</p>
|
|
1090
|
+
<div className="flex items-center justify-between text-xs text-slate-500 dark:text-slate-400">
|
|
1091
|
+
<span>Started {exec.startDate}</span>
|
|
1092
|
+
<span>Last activity {exec.lastActivity}</span>
|
|
1093
|
+
</div>
|
|
1094
|
+
<div className="flex items-center gap-2">
|
|
1095
|
+
{exec.participants.map((participant) => (
|
|
1096
|
+
<MockAvatar
|
|
1097
|
+
key={participant.id}
|
|
1098
|
+
name={participant.name}
|
|
1099
|
+
title={participant.role}
|
|
1100
|
+
/>
|
|
1101
|
+
))}
|
|
1102
|
+
</div>
|
|
1103
|
+
</button>
|
|
1104
|
+
))}
|
|
1105
|
+
</div>
|
|
1106
|
+
{selectedExecution && (
|
|
1107
|
+
<MockExecutionDetail execution={selectedExecution} />
|
|
1108
|
+
)}
|
|
1109
|
+
</div>
|
|
1110
|
+
)}
|
|
1111
|
+
</div>
|
|
1112
|
+
</section>
|
|
1113
|
+
)
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
function StepParticipants({ steps }: { steps: readonly ExecutionStep[] }) {
|
|
1117
|
+
"use memo"
|
|
1118
|
+
|
|
1119
|
+
const firstParticipant = steps.find(
|
|
1120
|
+
(step) =>
|
|
1121
|
+
isExternalParticipantStep(step) ||
|
|
1122
|
+
(step.status === "Completed" && step.providerUser != null) ||
|
|
1123
|
+
((step.status === "Waiting" || step.status === "Correction Required") &&
|
|
1124
|
+
step.role != null),
|
|
1125
|
+
)
|
|
1126
|
+
|
|
1127
|
+
if (!firstParticipant) {
|
|
1128
|
+
return null
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
const isExternalParticipant = isExternalParticipantStep(firstParticipant)
|
|
1132
|
+
|
|
1133
|
+
return (
|
|
1134
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
1135
|
+
{isExternalParticipant ? (
|
|
1136
|
+
<ExternalParticipantChip
|
|
1137
|
+
email={firstParticipant.externalSubmitterEmail}
|
|
1138
|
+
/>
|
|
1139
|
+
) : firstParticipant.providerUser ? (
|
|
1140
|
+
<CompletedProviderUserChip
|
|
1141
|
+
firstName={firstParticipant.providerUser.firstName}
|
|
1142
|
+
lastName={firstParticipant.providerUser.lastName}
|
|
1143
|
+
orgUnit={firstParticipant.providerUser.orgUnit}
|
|
1144
|
+
picture={firstParticipant.providerUser.picture}
|
|
1145
|
+
/>
|
|
1146
|
+
) : firstParticipant.role ? (
|
|
1147
|
+
<PendingRoleChip roleName={firstParticipant.role.name} />
|
|
1148
|
+
) : null}
|
|
1149
|
+
</div>
|
|
1150
|
+
)
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
function isExternalParticipantStep(step: ExecutionStep) {
|
|
1154
|
+
if (step.status === "Correction Required") return false
|
|
1155
|
+
|
|
1156
|
+
return (
|
|
1157
|
+
step.submittedViaEmbeddedForm === true ||
|
|
1158
|
+
(step.externalSubmitterEmail != null &&
|
|
1159
|
+
step.externalSubmitterEmail.length > 0)
|
|
1160
|
+
)
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
function ExternalParticipantChip({ email }: { email: string | undefined }) {
|
|
1164
|
+
"use memo"
|
|
1165
|
+
|
|
1166
|
+
return (
|
|
1167
|
+
<div className="flex items-center gap-2 rounded-full border border-cyan-400/50 bg-cyan-400/10 py-1 pl-2 pr-3 text-xs text-cyan-700 dark:border-cyan-400/30 dark:bg-cyan-400/10 dark:text-cyan-200">
|
|
1168
|
+
<span className="flex h-7 w-7 items-center justify-center rounded-full bg-cyan-500 text-[10px] font-bold tracking-wide text-slate-950">
|
|
1169
|
+
EXT
|
|
1170
|
+
</span>
|
|
1171
|
+
<div>
|
|
1172
|
+
<p className="font-semibold">External Participant</p>
|
|
1173
|
+
<p className="text-[11px] text-cyan-800/80 dark:text-cyan-200/80">
|
|
1174
|
+
{email ?? "Embedded form"}
|
|
1175
|
+
</p>
|
|
1176
|
+
</div>
|
|
1177
|
+
</div>
|
|
1178
|
+
)
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
function CompletedProviderUserChip({
|
|
1182
|
+
firstName,
|
|
1183
|
+
lastName,
|
|
1184
|
+
orgUnit,
|
|
1185
|
+
picture,
|
|
1186
|
+
}: {
|
|
1187
|
+
firstName: string
|
|
1188
|
+
lastName: string
|
|
1189
|
+
orgUnit: string
|
|
1190
|
+
picture?: string
|
|
1191
|
+
}) {
|
|
1192
|
+
"use memo"
|
|
1193
|
+
|
|
1194
|
+
const initials = `${firstName.charAt(0)}${lastName.charAt(0)}`.toUpperCase()
|
|
1195
|
+
return (
|
|
1196
|
+
<div className="flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 py-1 pl-2 pr-3 text-xs dark:border-slate-700 dark:bg-slate-800/60">
|
|
1197
|
+
{picture ? (
|
|
1198
|
+
<Image
|
|
1199
|
+
src={picture}
|
|
1200
|
+
alt={`${firstName} ${lastName}`}
|
|
1201
|
+
width={28}
|
|
1202
|
+
height={28}
|
|
1203
|
+
className="h-7 w-7 rounded-full"
|
|
1204
|
+
/>
|
|
1205
|
+
) : (
|
|
1206
|
+
<span className="flex h-7 w-7 items-center justify-center rounded-full bg-emerald-600 text-[11px] font-semibold text-white">
|
|
1207
|
+
{initials}
|
|
1208
|
+
</span>
|
|
1209
|
+
)}
|
|
1210
|
+
<div>
|
|
1211
|
+
<p className="font-semibold text-slate-700 dark:text-slate-200">
|
|
1212
|
+
{firstName}
|
|
1213
|
+
<br />
|
|
1214
|
+
{lastName}
|
|
1215
|
+
</p>
|
|
1216
|
+
<p className="text-[11px] text-slate-500 dark:text-slate-400">
|
|
1217
|
+
{orgUnit}
|
|
1218
|
+
</p>
|
|
1219
|
+
</div>
|
|
1220
|
+
</div>
|
|
1221
|
+
)
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
function PendingRoleChip({ roleName }: { roleName: string }) {
|
|
1225
|
+
"use memo"
|
|
1226
|
+
|
|
1227
|
+
return (
|
|
1228
|
+
<div className="flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 py-1 pl-2 pr-3 text-xs dark:border-slate-700 dark:bg-slate-800/60">
|
|
1229
|
+
<span className="flex h-7 w-7 items-center justify-center rounded-full border-2 border-blue-500 text-[11px] font-semibold text-blue-500">
|
|
1230
|
+
?
|
|
1231
|
+
</span>
|
|
1232
|
+
<div>
|
|
1233
|
+
<p className="font-semibold text-slate-700 dark:text-slate-200">
|
|
1234
|
+
{roleName}
|
|
1235
|
+
</p>
|
|
1236
|
+
</div>
|
|
1237
|
+
</div>
|
|
1238
|
+
)
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
function MockAvatar({ name, title }: { name: string; title: string }) {
|
|
1242
|
+
const initials = name
|
|
1243
|
+
.split(" ")
|
|
1244
|
+
.map((part) => part[0])
|
|
1245
|
+
.join("")
|
|
1246
|
+
.slice(0, 2)
|
|
1247
|
+
.toUpperCase()
|
|
1248
|
+
return (
|
|
1249
|
+
<div className="flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-2 py-1 text-xs dark:border-slate-700 dark:bg-slate-800/60">
|
|
1250
|
+
<span className="flex h-7 w-7 items-center justify-center rounded-full bg-blue-600 text-[11px] font-semibold text-white">
|
|
1251
|
+
{initials}
|
|
1252
|
+
</span>
|
|
1253
|
+
<div>
|
|
1254
|
+
<p className="font-semibold text-slate-700 dark:text-slate-200">
|
|
1255
|
+
{name}
|
|
1256
|
+
</p>
|
|
1257
|
+
<p className="text-[11px] text-slate-500 dark:text-slate-400">
|
|
1258
|
+
{title}
|
|
1259
|
+
</p>
|
|
1260
|
+
</div>
|
|
1261
|
+
</div>
|
|
1262
|
+
)
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
function MockExecutionDetail({ execution }: { execution: Execution }) {
|
|
1266
|
+
return (
|
|
1267
|
+
<div className="flex flex-col gap-4 rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900/70">
|
|
1268
|
+
<div className="flex flex-wrap items-start justify-between gap-3">
|
|
1269
|
+
<div>
|
|
1270
|
+
<h3 className="text-2xl font-semibold text-slate-900 dark:text-slate-100">
|
|
1271
|
+
{execution.processName} {execution.executionId}
|
|
1272
|
+
</h3>
|
|
1273
|
+
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
1274
|
+
Started {execution.startDate}. Current assignee{" "}
|
|
1275
|
+
{execution.currentRole ? `${execution.currentRole}` : "N/A"}.
|
|
1276
|
+
</p>
|
|
1277
|
+
</div>
|
|
1278
|
+
<div className="flex items-center gap-2">
|
|
1279
|
+
<span
|
|
1280
|
+
className={cn(
|
|
1281
|
+
"inline-flex items-center rounded-full px-3 py-1 text-sm font-semibold",
|
|
1282
|
+
mockExecutionStatusTheme[execution.status],
|
|
1283
|
+
)}
|
|
1284
|
+
>
|
|
1285
|
+
{execution.status}
|
|
1286
|
+
</span>
|
|
1287
|
+
<button
|
|
1288
|
+
type="button"
|
|
1289
|
+
className="rounded-full border border-slate-200 px-3 py-1.5 text-sm text-slate-500 hover:border-slate-300 hover:text-slate-700 dark:border-slate-700 dark:text-slate-300 dark:hover:border-slate-600 dark:hover:text-slate-200"
|
|
1290
|
+
>
|
|
1291
|
+
Share
|
|
1292
|
+
</button>
|
|
1293
|
+
<button
|
|
1294
|
+
type="button"
|
|
1295
|
+
className="rounded-full bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-blue-500"
|
|
1296
|
+
>
|
|
1297
|
+
View audit log
|
|
1298
|
+
</button>
|
|
1299
|
+
</div>
|
|
1300
|
+
</div>
|
|
1301
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-900/60">
|
|
1302
|
+
<h4 className="text-sm font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400">
|
|
1303
|
+
Timeline
|
|
1304
|
+
</h4>
|
|
1305
|
+
<ul className="mt-4 space-y-4">
|
|
1306
|
+
{execution.steps.map((step) => (
|
|
1307
|
+
<li key={step.id} className="relative pl-8">
|
|
1308
|
+
<span
|
|
1309
|
+
className={cn(
|
|
1310
|
+
"absolute left-0 top-1.5 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold",
|
|
1311
|
+
step.status === "Complete"
|
|
1312
|
+
? "border-emerald-500 bg-emerald-500 text-white"
|
|
1313
|
+
: step.status === "Current"
|
|
1314
|
+
? "border-blue-500 bg-blue-500 text-white"
|
|
1315
|
+
: step.status === "Upcoming"
|
|
1316
|
+
? "border-slate-300 bg-white text-slate-400 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-500"
|
|
1317
|
+
: "border-slate-300 bg-slate-100 text-slate-400",
|
|
1318
|
+
)}
|
|
1319
|
+
>
|
|
1320
|
+
{step.status === "Complete"
|
|
1321
|
+
? "✓"
|
|
1322
|
+
: step.status === "Current"
|
|
1323
|
+
? "•"
|
|
1324
|
+
: ""}
|
|
1325
|
+
</span>
|
|
1326
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
1327
|
+
<p className="text-sm font-semibold text-slate-900 dark:text-slate-100">
|
|
1328
|
+
{step.name}
|
|
1329
|
+
</p>
|
|
1330
|
+
<span className="rounded-full bg-slate-200 px-2 py-0.5 text-[11px] font-semibold text-slate-600 dark:bg-slate-800/60 dark:text-slate-300">
|
|
1331
|
+
{step.role}
|
|
1332
|
+
</span>
|
|
1333
|
+
{step.assignee && (
|
|
1334
|
+
<span className="text-[11px] text-slate-500 dark:text-slate-400">
|
|
1335
|
+
Assigned to {step.assignee}
|
|
1336
|
+
</span>
|
|
1337
|
+
)}
|
|
1338
|
+
</div>
|
|
1339
|
+
<div className="mt-1 flex flex-wrap items-center gap-3 text-xs text-slate-500 dark:text-slate-400">
|
|
1340
|
+
{step.startedAt && <span>Started {step.startedAt}</span>}
|
|
1341
|
+
{step.completedAt && <span>Completed {step.completedAt}</span>}
|
|
1342
|
+
{step.notes && (
|
|
1343
|
+
<span className="rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-amber-600 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200">
|
|
1344
|
+
{step.notes}
|
|
1345
|
+
</span>
|
|
1346
|
+
)}
|
|
1347
|
+
</div>
|
|
1348
|
+
</li>
|
|
1349
|
+
))}
|
|
1350
|
+
</ul>
|
|
1351
|
+
</div>
|
|
1352
|
+
{execution.failureReason && (
|
|
1353
|
+
<div className="rounded-2xl border border-rose-200 bg-rose-50 p-4 text-sm text-rose-700 dark:border-rose-500/40 dark:bg-rose-900/20 dark:text-rose-200">
|
|
1354
|
+
<p className="font-semibold">Failure reason</p>
|
|
1355
|
+
<p>{execution.failureReason}</p>
|
|
1356
|
+
</div>
|
|
1357
|
+
)}
|
|
1358
|
+
{execution.abandonedReason && (
|
|
1359
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 text-sm text-slate-700 dark:border-slate-700 dark:bg-slate-900/60 dark:text-slate-200">
|
|
1360
|
+
<p className="font-semibold">Abandoned reason</p>
|
|
1361
|
+
<p>{execution.abandonedReason}</p>
|
|
1362
|
+
</div>
|
|
1363
|
+
)}
|
|
1364
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
1365
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-900/60">
|
|
1366
|
+
<h4 className="text-sm font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400">
|
|
1367
|
+
Participants
|
|
1368
|
+
</h4>
|
|
1369
|
+
<div className="mt-3 space-y-2">
|
|
1370
|
+
{execution.participants.map((participant) => (
|
|
1371
|
+
<div
|
|
1372
|
+
key={participant.id}
|
|
1373
|
+
className="flex items-center justify-between rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-600 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
|
|
1374
|
+
>
|
|
1375
|
+
<span>{participant.name}</span>
|
|
1376
|
+
<span className="text-xs text-slate-500 dark:text-slate-400">
|
|
1377
|
+
{participant.role}
|
|
1378
|
+
</span>
|
|
1379
|
+
</div>
|
|
1380
|
+
))}
|
|
1381
|
+
</div>
|
|
1382
|
+
</div>
|
|
1383
|
+
<div className="rounded-2xl border border-slate-200 bg-slate-50 p-4 dark:border-slate-700 dark:bg-slate-900/60">
|
|
1384
|
+
<h4 className="text-sm font-semibold tracking-wide text-slate-500 uppercase dark:text-slate-400">
|
|
1385
|
+
State snapshot
|
|
1386
|
+
</h4>
|
|
1387
|
+
<dl className="mt-3 grid grid-cols-2 gap-3 text-sm text-slate-600 dark:text-slate-300">
|
|
1388
|
+
<div>
|
|
1389
|
+
<dt className="text-xs tracking-wide text-slate-400 uppercase dark:text-slate-500">
|
|
1390
|
+
Estimated completion
|
|
1391
|
+
</dt>
|
|
1392
|
+
<dd>In 2 days</dd>
|
|
1393
|
+
</div>
|
|
1394
|
+
<div>
|
|
1395
|
+
<dt className="text-xs tracking-wide text-slate-400 uppercase dark:text-slate-500">
|
|
1396
|
+
SLA target
|
|
1397
|
+
</dt>
|
|
1398
|
+
<dd>Oct 16, 18:00</dd>
|
|
1399
|
+
</div>
|
|
1400
|
+
<div>
|
|
1401
|
+
<dt className="text-xs tracking-wide text-slate-400 uppercase dark:text-slate-500">
|
|
1402
|
+
Current form
|
|
1403
|
+
</dt>
|
|
1404
|
+
<dd>IT account setup</dd>
|
|
1405
|
+
</div>
|
|
1406
|
+
<div>
|
|
1407
|
+
<dt className="text-xs tracking-wide text-slate-400 uppercase dark:text-slate-500">
|
|
1408
|
+
Pending approvals
|
|
1409
|
+
</dt>
|
|
1410
|
+
<dd>1 manager</dd>
|
|
1411
|
+
</div>
|
|
1412
|
+
</dl>
|
|
1413
|
+
</div>
|
|
1414
|
+
</div>
|
|
1415
|
+
</div>
|
|
1416
|
+
)
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
function MockExecutionKanban({ executions }: { executions: Execution[] }) {
|
|
1420
|
+
const columns: { title: string; statuses: Execution["status"][] }[] = [
|
|
1421
|
+
{ title: "Running", statuses: ["Running", "Paused"] },
|
|
1422
|
+
{ title: "Completed", statuses: ["Completed"] },
|
|
1423
|
+
{ title: "Failed", statuses: ["Failed"] },
|
|
1424
|
+
]
|
|
1425
|
+
|
|
1426
|
+
return (
|
|
1427
|
+
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
|
|
1428
|
+
{columns.map((column) => (
|
|
1429
|
+
<div
|
|
1430
|
+
key={column.title}
|
|
1431
|
+
className="rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900/70"
|
|
1432
|
+
>
|
|
1433
|
+
<div className="flex items-center justify-between">
|
|
1434
|
+
<h4 className="text-lg font-semibold text-slate-900 dark:text-slate-100">
|
|
1435
|
+
{column.title}
|
|
1436
|
+
</h4>
|
|
1437
|
+
<span className="rounded-full bg-slate-200 px-2 py-0.5 text-xs font-semibold text-slate-600 dark:bg-slate-800 dark:text-slate-300">
|
|
1438
|
+
{
|
|
1439
|
+
executions.filter((exec) =>
|
|
1440
|
+
column.statuses.includes(exec.status),
|
|
1441
|
+
).length
|
|
1442
|
+
}
|
|
1443
|
+
</span>
|
|
1444
|
+
</div>
|
|
1445
|
+
<div className="mt-3 space-y-3">
|
|
1446
|
+
{executions
|
|
1447
|
+
.filter((exec) => column.statuses.includes(exec.status))
|
|
1448
|
+
.map((exec) => (
|
|
1449
|
+
<div
|
|
1450
|
+
key={exec.id}
|
|
1451
|
+
className="rounded-2xl border border-slate-200 bg-slate-50/60 p-3 text-sm text-slate-600 shadow-sm dark:border-slate-700 dark:bg-slate-900/60 dark:text-slate-300"
|
|
1452
|
+
>
|
|
1453
|
+
<div className="flex items-center justify-between">
|
|
1454
|
+
<p className="font-semibold text-slate-900 dark:text-slate-100">
|
|
1455
|
+
{exec.processName} {exec.executionId}
|
|
1456
|
+
</p>
|
|
1457
|
+
<span
|
|
1458
|
+
className={cn(
|
|
1459
|
+
"inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-semibold",
|
|
1460
|
+
mockExecutionStatusTheme[exec.status],
|
|
1461
|
+
)}
|
|
1462
|
+
>
|
|
1463
|
+
{exec.status}
|
|
1464
|
+
</span>
|
|
1465
|
+
</div>
|
|
1466
|
+
<p className="text-xs text-slate-500 dark:text-slate-400">
|
|
1467
|
+
{exec.progress}
|
|
1468
|
+
</p>
|
|
1469
|
+
<div className="mt-2 flex items-center justify-between text-[11px] text-slate-500 dark:text-slate-400">
|
|
1470
|
+
<span>{exec.startDate}</span>
|
|
1471
|
+
<span>{exec.lastActivity}</span>
|
|
1472
|
+
</div>
|
|
1473
|
+
</div>
|
|
1474
|
+
))}
|
|
1475
|
+
{executions.filter((exec) => column.statuses.includes(exec.status))
|
|
1476
|
+
.length === 0 && (
|
|
1477
|
+
<div className="rounded-xl border border-dashed border-slate-300 p-4 text-center text-sm text-slate-500 dark:border-slate-700 dark:text-slate-400">
|
|
1478
|
+
No executions here yet
|
|
1479
|
+
</div>
|
|
1480
|
+
)}
|
|
1481
|
+
</div>
|
|
1482
|
+
</div>
|
|
1483
|
+
))}
|
|
1484
|
+
</div>
|
|
1485
|
+
)
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
// =============================================================================
|
|
1489
|
+
// SHARED COMPONENTS
|
|
1490
|
+
// =============================================================================
|
|
1491
|
+
|
|
1492
|
+
export function ExecutionsPageContent({
|
|
1493
|
+
initialSelectedExecutionId = null,
|
|
1494
|
+
onMobileBack,
|
|
1495
|
+
}: {
|
|
1496
|
+
initialSelectedExecutionId?: string | null
|
|
1497
|
+
onMobileBack?: () => void
|
|
1498
|
+
}) {
|
|
1499
|
+
"use memo"
|
|
1500
|
+
|
|
1501
|
+
const { collectionPromise } = useExecutionCollection()
|
|
1502
|
+
const { showMocks } = useMocks()
|
|
1503
|
+
const isMobile = useIsMobile()
|
|
1504
|
+
const showMocksSection = !isMobile || initialSelectedExecutionId === null
|
|
1505
|
+
|
|
1506
|
+
return (
|
|
1507
|
+
<div className="flex-1 space-y-8 overflow-y-auto">
|
|
1508
|
+
<Suspense fallback={<ExecutionsSkeleton />}>
|
|
1509
|
+
<ExecutionsPageInner
|
|
1510
|
+
collectionPromise={collectionPromise}
|
|
1511
|
+
initialSelectedExecutionId={initialSelectedExecutionId}
|
|
1512
|
+
{...(onMobileBack ? { onMobileBack } : {})}
|
|
1513
|
+
/>
|
|
1514
|
+
</Suspense>
|
|
1515
|
+
{showMocks && showMocksSection && <MockExecutionsSection />}
|
|
1516
|
+
</div>
|
|
1517
|
+
)
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
export default function ExecutionsPage() {
|
|
1521
|
+
return <ExecutionsPageContent />
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
function EmptyState({
|
|
1525
|
+
title,
|
|
1526
|
+
description,
|
|
1527
|
+
}: {
|
|
1528
|
+
title: string
|
|
1529
|
+
description: string
|
|
1530
|
+
}) {
|
|
1531
|
+
"use memo"
|
|
1532
|
+
|
|
1533
|
+
return (
|
|
1534
|
+
<div className="col-span-full flex flex-col items-center justify-center rounded-3xl border border-dashed border-slate-300 bg-white/60 p-12 text-center dark:border-slate-700 dark:bg-slate-900/40">
|
|
1535
|
+
<h3 className="text-lg font-semibold text-slate-900 dark:text-slate-100">
|
|
1536
|
+
{title}
|
|
1537
|
+
</h3>
|
|
1538
|
+
<p className="mt-2 max-w-md text-sm text-slate-500 dark:text-slate-400">
|
|
1539
|
+
{description}
|
|
1540
|
+
</p>
|
|
1541
|
+
<Link
|
|
1542
|
+
href="/processes"
|
|
1543
|
+
className="mt-5 rounded-full bg-blue-600 px-5 py-2 text-sm font-semibold text-white shadow hover:bg-blue-500"
|
|
1544
|
+
>
|
|
1545
|
+
Browse processes
|
|
1546
|
+
</Link>
|
|
1547
|
+
</div>
|
|
1548
|
+
)
|
|
1549
|
+
}
|