@rytass/bpm-core-react 0.17.0 → 0.17.1
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/CHANGELOG.md +13 -0
- package/dist/chunks/admin-pickers-BRHk3qKq.cjs +2 -0
- package/dist/chunks/admin-pickers-BRHk3qKq.cjs.map +1 -0
- package/dist/chunks/{admin-pickers-DxhzECkD.js → admin-pickers-Djq3h-UR.js} +41 -39
- package/dist/chunks/admin-pickers-Djq3h-UR.js.map +1 -0
- package/dist/chunks/{categories-DjENouRm.cjs → categories-AxxhqjLZ.cjs} +2 -2
- package/dist/chunks/{categories-DjENouRm.cjs.map → categories-AxxhqjLZ.cjs.map} +1 -1
- package/dist/chunks/{categories-1gKxeEqw.js → categories-riC33J_j.js} +2 -2
- package/dist/chunks/{categories-1gKxeEqw.js.map → categories-riC33J_j.js.map} +1 -1
- package/dist/chunks/{compose-DZ7RKvUp.cjs → compose-B7TtrpQJ.cjs} +2 -2
- package/dist/chunks/{compose-DZ7RKvUp.cjs.map → compose-B7TtrpQJ.cjs.map} +1 -1
- package/dist/chunks/{compose-Crklayzy.js → compose-_pREPtfN.js} +2 -2
- package/dist/chunks/{compose-Crklayzy.js.map → compose-_pREPtfN.js.map} +1 -1
- package/dist/chunks/{designer-D9eFma1W.js → designer-BiywgNXs.js} +2 -2
- package/dist/chunks/{designer-D9eFma1W.js.map → designer-BiywgNXs.js.map} +1 -1
- package/dist/chunks/{designer-sJGTGYOf.cjs → designer-ttAqv859.cjs} +2 -2
- package/dist/chunks/{designer-sJGTGYOf.cjs.map → designer-ttAqv859.cjs.map} +1 -1
- package/dist/chunks/{orgs-Dr0FFoZo.cjs → orgs-C8usknWb.cjs} +2 -2
- package/dist/chunks/{orgs-Dr0FFoZo.cjs.map → orgs-C8usknWb.cjs.map} +1 -1
- package/dist/chunks/{orgs-CY0i1fie.js → orgs-Lg7tXv2u.js} +2 -2
- package/dist/chunks/{orgs-CY0i1fie.js.map → orgs-Lg7tXv2u.js.map} +1 -1
- package/dist/chunks/{users-BCyePbwB.js → users-DRbuDYF1.js} +2 -2
- package/dist/chunks/{users-BCyePbwB.js.map → users-DRbuDYF1.js.map} +1 -1
- package/dist/chunks/{users-DVBJluFR.cjs → users-DVQicZIo.cjs} +2 -2
- package/dist/chunks/{users-DVBJluFR.cjs.map → users-DVQicZIo.cjs.map} +1 -1
- package/dist/components/admin-pickers.d.cts +65 -0
- package/dist/components/approval-instance-list-page.d.cts +17 -0
- package/dist/components/bpm-form-field.d.cts +10 -0
- package/dist/components/bpm-notification-bell-button.d.cts +22 -0
- package/dist/components/dashboard-page.d.cts +7 -0
- package/dist/components/notification-drawer.d.cts +11 -0
- package/dist/components/org-unit-tree-draft-editor.d.cts +24 -0
- package/dist/components/org-unit-tree-draft-editor.d.ts +1 -1
- package/dist/components/pdf-preview.d.cts +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -15
- package/dist/index.js +1 -1
- package/dist/lib/auth-provider.d.cts +37 -0
- package/dist/lib/format-date-time.d.cts +5 -0
- package/dist/lib/format-member-label.d.cts +12 -0
- package/dist/lib/member-profile-resolution.d.cts +48 -0
- package/dist/lib/notification-drawer-provider.d.cts +27 -0
- package/dist/lib/notification-unread-provider.d.cts +25 -0
- package/dist/lib/org-tree-draft.d.cts +27 -0
- package/dist/lib/providers.d.cts +31 -0
- package/dist/lib/router-adapter.d.cts +47 -0
- package/dist/lib/routes-config.d.cts +117 -0
- package/dist/lib/task-node-label.d.cts +10 -0
- package/dist/lib/use-bpm-logout.d.cts +12 -0
- package/dist/lib/use-bpm-member.d.cts +17 -0
- package/dist/next/BPMNextProviders.d.cts +51 -0
- package/dist/next/index.d.cts +2 -0
- package/dist/next/index.d.ts +2 -2
- package/dist/next/workflow-chat-route.d.cts +17 -0
- package/dist/pages/admin/delegations/index.d.cts +4 -0
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.d.cts +4 -0
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.d.cts +4 -0
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/admin/webhook-endpoints/index.d.cts +4 -0
- package/dist/pages/cc/index.d.cts +16 -0
- package/dist/pages/dashboard/index.d.cts +16 -0
- package/dist/pages/delegations/index.d.cts +4 -0
- package/dist/pages/inbox/index.d.cts +16 -0
- package/dist/pages/instances/detail/index.d.cts +23 -0
- package/dist/pages/instances/new/index.d.cts +20 -0
- package/dist/pages/login/index.d.cts +21 -0
- package/dist/pages/root/index.d.cts +18 -0
- package/dist/pages/search/index.d.cts +16 -0
- package/dist/pages/sent/index.d.cts +16 -0
- package/dist/pages/settings/notifications/index.d.cts +4 -0
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.d.cts +4 -0
- package/dist/pages/templates/categories/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.d.cts +25 -0
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.d.cts +8 -0
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/pages/templates/index.d.cts +4 -0
- package/dist/pages/templates/versions/index.d.cts +8 -0
- package/dist/views/admin/delegations/AdminDelegationsView.d.cts +2 -0
- package/dist/views/admin/delegations/index.d.cts +1 -0
- package/dist/views/admin/delegations/index.d.ts +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.d.cts +4 -0
- package/dist/views/admin/index.d.ts +4 -4
- package/dist/views/admin/index.js +2 -2
- package/dist/views/admin/orgs/AdminOrgsView.d.cts +2 -0
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.d.cts +1 -0
- package/dist/views/admin/orgs/index.d.ts +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/AdminUsersView.d.cts +2 -0
- package/dist/views/admin/users/MemberTaskReassignModal.d.cts +13 -0
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.d.cts +1 -0
- package/dist/views/admin/users/index.d.ts +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/admin/webhook-endpoints/AdminWebhookEndpointsView.d.cts +8 -0
- package/dist/views/admin/webhook-endpoints/index.d.cts +1 -0
- package/dist/views/admin/webhook-endpoints/index.d.ts +1 -1
- package/dist/views/cc/CcView.d.cts +7 -0
- package/dist/views/cc/index.d.cts +1 -0
- package/dist/views/cc/index.d.ts +1 -1
- package/dist/views/dashboard/DashboardView.d.cts +7 -0
- package/dist/views/dashboard/index.d.cts +1 -0
- package/dist/views/dashboard/index.d.ts +1 -1
- package/dist/views/delegations/DelegationsView.d.cts +2 -0
- package/dist/views/delegations/index.d.cts +1 -0
- package/dist/views/delegations/index.d.ts +1 -1
- package/dist/views/forms/builder/FormBuilderView.d.cts +18 -0
- package/dist/views/forms/builder/index.d.cts +1 -0
- package/dist/views/forms/builder/index.d.ts +1 -1
- package/dist/views/forms/builder/json-code-editor.d.cts +11 -0
- package/dist/views/forms/renderer/FormRendererView.d.cts +24 -0
- package/dist/views/forms/renderer/FormRendererView.d.ts +1 -1
- package/dist/views/forms/renderer/form-data-source-field.d.cts +65 -0
- package/dist/views/forms/renderer/form-field-link.d.cts +16 -0
- package/dist/views/forms/renderer/index.d.cts +2 -0
- package/dist/views/forms/renderer/index.d.ts +2 -2
- package/dist/views/forms/renderer/member-field-options.d.cts +39 -0
- package/dist/views/forms/renderer/member-field.d.cts +21 -0
- package/dist/views/inbox/InboxView.d.cts +7 -0
- package/dist/views/inbox/index.d.cts +1 -0
- package/dist/views/inbox/index.d.ts +1 -1
- package/dist/views/instances/detail/InstanceDetailView.d.cts +27 -0
- package/dist/views/instances/detail/index.d.cts +7 -0
- package/dist/views/instances/detail/index.d.ts +7 -7
- package/dist/views/instances/detail/sections/InstanceAttachmentsSection.d.cts +15 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +36 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +1 -1
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +29 -0
- package/dist/views/instances/detail/sections/InstanceSignaturesSection.d.cts +14 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +55 -0
- package/dist/views/instances/detail/sections/InstanceWebhookDeliveriesSection.d.cts +20 -0
- package/dist/views/instances/detail/sections/container-helpers.d.cts +10 -0
- package/dist/views/instances/detail/sections/container-helpers.d.ts +1 -1
- package/dist/views/instances/detail/sections/shared.d.cts +141 -0
- package/dist/views/instances/detail/submitted-by.d.cts +23 -0
- package/dist/views/instances/index.d.cts +1 -0
- package/dist/views/instances/index.d.ts +1 -1
- package/dist/views/instances/new/InstanceNewView.d.cts +15 -0
- package/dist/views/instances/new/index.d.cts +1 -0
- package/dist/views/instances/new/index.d.ts +1 -1
- package/dist/views/login/LoginView.d.cts +47 -0
- package/dist/views/login/index.d.cts +1 -0
- package/dist/views/login/index.d.ts +1 -1
- package/dist/views/root/RootView.d.cts +10 -0
- package/dist/views/root/index.d.cts +1 -0
- package/dist/views/root/index.d.ts +1 -1
- package/dist/views/search/SearchView.d.cts +7 -0
- package/dist/views/search/index.d.cts +1 -0
- package/dist/views/search/index.d.ts +1 -1
- package/dist/views/sent/SentView.d.cts +7 -0
- package/dist/views/sent/index.d.cts +1 -0
- package/dist/views/sent/index.d.ts +1 -1
- package/dist/views/settings/index.d.cts +1 -0
- package/dist/views/settings/index.d.ts +1 -1
- package/dist/views/settings/notifications/SettingsNotificationsView.d.cts +2 -0
- package/dist/views/settings/notifications/index.d.cts +1 -0
- package/dist/views/settings/notifications/index.d.ts +1 -1
- package/dist/views/templates/TemplatesView.d.cts +7 -0
- package/dist/views/templates/categories/TemplateCategoriesView.d.cts +2 -0
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.d.cts +1 -0
- package/dist/views/templates/categories/index.d.ts +1 -1
- package/dist/views/templates/categories/index.js +1 -1
- package/dist/views/templates/compose/TemplateComposeWizardView.d.cts +21 -0
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.d.cts +2 -0
- package/dist/views/templates/compose/index.d.ts +2 -2
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/compose/steps/ComposeFormStep.d.cts +15 -0
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +12 -0
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +22 -0
- package/dist/views/templates/compose/use-template-compose-wizard.d.cts +46 -0
- package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.cts +20 -0
- package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.ts +1 -1
- package/dist/views/templates/designer/TemplateDesignerView.d.cts +65 -0
- package/dist/views/templates/designer/chrome-workflow-chat.d.cts +12 -0
- package/dist/views/templates/designer/chrome-workflow-chat.d.ts +1 -1
- package/dist/views/templates/designer/decision-policy-options.d.cts +8 -0
- package/dist/views/templates/designer/designer-version-labels.d.cts +12 -0
- package/dist/views/templates/designer/dry-run-assignee-label.d.cts +28 -0
- package/dist/views/templates/designer/dry-run-sample-data.d.cts +9 -0
- package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +35 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.d.cts +1 -0
- package/dist/views/templates/designer/index.d.ts +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/notify-webhook-designer.d.cts +74 -0
- package/dist/views/templates/designer/position-level-options.d.cts +17 -0
- package/dist/views/templates/designer/use-workflow-chat.d.cts +21 -0
- package/dist/views/templates/designer/use-workflow-chat.d.ts +1 -1
- package/dist/views/templates/designer/use-workflow-designer-controller.d.cts +41 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.cts +16 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.ts +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.d.cts +3 -0
- package/dist/views/templates/index.d.ts +3 -3
- package/dist/views/templates/index.js +1 -1
- package/dist/views/templates/versions/TemplateVersionsView.d.cts +5 -0
- package/dist/views/templates/versions/index.d.cts +1 -0
- package/dist/views/templates/versions/index.d.ts +1 -1
- package/dist/views/workflow/index.d.cts +4 -0
- package/dist/views/workflow/index.d.ts +4 -4
- package/package.json +387 -147
- package/dist/chunks/admin-pickers-DxhzECkD.js.map +0 -1
- package/dist/chunks/admin-pickers-qe3j--gX.cjs +0 -2
- package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './FormRendererView';
|
|
2
|
-
export * from './form-data-source-field';
|
|
1
|
+
export * from './FormRendererView.js';
|
|
2
|
+
export * from './form-data-source-field.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FormFieldValue } from '@rytass/bpm-core-shared/form';
|
|
2
|
+
/**
|
|
3
|
+
* One pickable member, shaped for Mezzanine `AutoComplete` (`id` + `name`).
|
|
4
|
+
* `unresolved` marks the placeholder written when a stored id has no profile,
|
|
5
|
+
* so a real profile arriving later replaces it instead of the placeholder
|
|
6
|
+
* sticking (the designer does the same for its approver list).
|
|
7
|
+
*/
|
|
8
|
+
export type MemberFieldOption = Readonly<{
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
unresolved?: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const UNKNOWN_MEMBER_NAME = "\u672A\u77E5\u6703\u54E1";
|
|
14
|
+
export declare function readMemberFieldOption(member: {
|
|
15
|
+
readonly email: string;
|
|
16
|
+
readonly memberId: string;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
}): MemberFieldOption;
|
|
19
|
+
export declare function readUnresolvedMemberFieldOption(memberId: string): MemberFieldOption;
|
|
20
|
+
/**
|
|
21
|
+
* Adds `nextOptions` to `currentOptions`. A resolved option replaces an
|
|
22
|
+
* unresolved placeholder with the same id; otherwise the first one seen wins.
|
|
23
|
+
* Returns `currentOptions` itself when nothing changed, so state setters can
|
|
24
|
+
* bail out of a re-render.
|
|
25
|
+
*/
|
|
26
|
+
export declare function mergeMemberFieldOptions(currentOptions: readonly MemberFieldOption[], nextOptions: readonly MemberFieldOption[]): readonly MemberFieldOption[];
|
|
27
|
+
/** Ids in the stored value that no known option covers yet. */
|
|
28
|
+
export declare function readUnresolvedMemberIds(value: FormFieldValue | undefined, knownOptions: readonly MemberFieldOption[]): readonly string[];
|
|
29
|
+
/**
|
|
30
|
+
* The stored value as options, in stored order. An id with no known profile
|
|
31
|
+
* still shows up (as 「未知會員」) so the filler can see and remove it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readSelectedMemberFieldOptions(value: FormFieldValue | undefined, knownOptions: readonly MemberFieldOption[]): readonly MemberFieldOption[];
|
|
34
|
+
/**
|
|
35
|
+
* What a picker change writes back. Nothing picked is `undefined`, the same as
|
|
36
|
+
* every other optional field, so the renderer's own initial value (`[]` for a
|
|
37
|
+
* multiple member field) is restored by `buildFormRendererValues`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function readMemberFieldValue(selected: readonly MemberFieldOption[], multiple: boolean): FormFieldValue | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormFieldValue } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
export interface MemberFieldControlProps {
|
|
4
|
+
readonly multiple: boolean;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly onChange: (value: FormFieldValue | undefined) => void;
|
|
7
|
+
readonly placeholder?: string;
|
|
8
|
+
readonly readonly: boolean;
|
|
9
|
+
readonly size?: 'main' | 'sub';
|
|
10
|
+
readonly value: FormFieldValue | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 人員選擇 picker. Searching and name lookup reuse the directory queries the
|
|
14
|
+
* admin member picker and the workflow designer already call
|
|
15
|
+
* (`searchMembers` / `resolveMembers`); nothing new is added server side.
|
|
16
|
+
*
|
|
17
|
+
* Stored values are member ids. The names shown here are resolved on mount and
|
|
18
|
+
* whenever a stored id has no profile yet, so a read-only view of a submitted
|
|
19
|
+
* form (instance detail) shows names, not ids.
|
|
20
|
+
*/
|
|
21
|
+
export declare function MemberFieldControl({ multiple, name, onChange, placeholder, readonly, size, value, }: MemberFieldControlProps): ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic view for the BPM "我的待簽" inbox. Mechanical port of
|
|
4
|
+
* `apps/client/src/app/inbox/page.tsx` — renders pending tasks, tracking,
|
|
5
|
+
* and history tabs.
|
|
6
|
+
*/
|
|
7
|
+
export declare function InboxView(): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InboxView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './InboxView';
|
|
1
|
+
export * from './InboxView.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface InstanceDetailViewProps {
|
|
3
|
+
/** Approval instance id (Next.js `params.id` resolved by the page shim). */
|
|
4
|
+
readonly instanceId: string;
|
|
5
|
+
/** Show the form snapshot section (default: true). */
|
|
6
|
+
readonly showForm?: boolean;
|
|
7
|
+
/** Show the attachments section (default: true). */
|
|
8
|
+
readonly showAttachments?: boolean;
|
|
9
|
+
/** Show the tasks section (default: true). */
|
|
10
|
+
readonly showTasks?: boolean;
|
|
11
|
+
/** Show the signatures section (default: true). */
|
|
12
|
+
readonly showSignatures?: boolean;
|
|
13
|
+
/** Show the history section (default: true). */
|
|
14
|
+
readonly showHistory?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Show the notify-node webhook deliveries section (default: true). Only
|
|
17
|
+
* administrators ever see it, and only when the instance queued any.
|
|
18
|
+
*/
|
|
19
|
+
readonly showWebhookDeliveries?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Framework-agnostic view for the BPM approval instance detail page.
|
|
23
|
+
* Mechanical port of `apps/client/src/app/instances/[id]/page.tsx`. The
|
|
24
|
+
* `instanceId` is provided by the host page wrapper (typically resolved
|
|
25
|
+
* from `params.id` in the Next.js Server Component shim).
|
|
26
|
+
*/
|
|
27
|
+
export declare function InstanceDetailView({ instanceId, showAttachments, showForm, showHistory, showSignatures, showTasks, showWebhookDeliveries, }: InstanceDetailViewProps): ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './InstanceDetailView.cjs';
|
|
2
|
+
export * from './sections/InstanceFormSection.cjs';
|
|
3
|
+
export * from './sections/InstanceAttachmentsSection.cjs';
|
|
4
|
+
export * from './sections/InstanceTasksSection.cjs';
|
|
5
|
+
export * from './sections/InstanceSignaturesSection.cjs';
|
|
6
|
+
export * from './sections/InstanceHistorySection.cjs';
|
|
7
|
+
export * from './sections/InstanceWebhookDeliveriesSection.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './InstanceDetailView';
|
|
2
|
-
export * from './sections/InstanceFormSection';
|
|
3
|
-
export * from './sections/InstanceAttachmentsSection';
|
|
4
|
-
export * from './sections/InstanceTasksSection';
|
|
5
|
-
export * from './sections/InstanceSignaturesSection';
|
|
6
|
-
export * from './sections/InstanceHistorySection';
|
|
7
|
-
export * from './sections/InstanceWebhookDeliveriesSection';
|
|
1
|
+
export * from './InstanceDetailView.js';
|
|
2
|
+
export * from './sections/InstanceFormSection.js';
|
|
3
|
+
export * from './sections/InstanceAttachmentsSection.js';
|
|
4
|
+
export * from './sections/InstanceTasksSection.js';
|
|
5
|
+
export * from './sections/InstanceSignaturesSection.js';
|
|
6
|
+
export * from './sections/InstanceHistorySection.js';
|
|
7
|
+
export * from './sections/InstanceWebhookDeliveriesSection.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { AttachmentRecord } from '@rytass/bpm-core-client/workflow';
|
|
3
|
+
export interface InstanceAttachmentsSectionProps {
|
|
4
|
+
/** The list of attachments for this instance. */
|
|
5
|
+
readonly attachments: readonly AttachmentRecord[];
|
|
6
|
+
/** Called when the user clicks the download action for an attachment. */
|
|
7
|
+
readonly onDownload: (attachment: AttachmentRecord) => void;
|
|
8
|
+
/** Called when the user clicks the preview action for a PDF attachment. */
|
|
9
|
+
readonly onPreview: (attachment: AttachmentRecord) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders the attachments section of the approval instance detail page.
|
|
13
|
+
* Shows a table of attachments with download and (for PDFs) preview actions.
|
|
14
|
+
*/
|
|
15
|
+
export declare function InstanceAttachmentsSection({ attachments, onDownload, onPreview, }: InstanceAttachmentsSectionProps): ReactElement;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { ApprovalInstanceRecord, WorkflowFormData } from '@rytass/bpm-core-client/workflow';
|
|
4
|
+
import { FormDataSourceFieldState } from '../../../forms/renderer/form-data-source-field.cjs';
|
|
5
|
+
export interface InstanceFormSectionProps {
|
|
6
|
+
/** The loaded approval instance, or null while loading. */
|
|
7
|
+
readonly instance: ApprovalInstanceRecord | null;
|
|
8
|
+
/** Whether the instance is in a loading state. */
|
|
9
|
+
readonly loading: boolean;
|
|
10
|
+
/** Error message to display, if any. */
|
|
11
|
+
readonly error: string | null;
|
|
12
|
+
/** Whether the current user can resubmit (edit + resubmit the returned form). */
|
|
13
|
+
readonly canResubmitInstance: boolean;
|
|
14
|
+
/** Current form data for the resubmit flow. */
|
|
15
|
+
readonly resubmitFormData: WorkflowFormData;
|
|
16
|
+
/** Validation error map for the resubmit form. */
|
|
17
|
+
readonly resubmitFormErrors: Readonly<Record<string, string>>;
|
|
18
|
+
/** Whether a decision/submit action is in progress. */
|
|
19
|
+
readonly deciding: boolean;
|
|
20
|
+
/** Called when the form data changes in the resubmit flow. */
|
|
21
|
+
readonly onResubmitFormChange: (values: WorkflowFormData) => void;
|
|
22
|
+
/** Called when a dynamic option field changes validation state. */
|
|
23
|
+
readonly onDataSourceStateChange: (fieldKey: string, state: Pick<FormDataSourceFieldState, 'hasValue' | 'invalidValues' | 'status'>) => void;
|
|
24
|
+
/** Called when the user clicks "重新送出". */
|
|
25
|
+
readonly onResubmitInstance: () => void;
|
|
26
|
+
/** Called when an attachment upload is requested via the form field. */
|
|
27
|
+
readonly onUploadAttachment: (field: FormFieldDefinition, file: File) => Promise<{
|
|
28
|
+
readonly id: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Renders the form snapshot section of the approval instance detail page.
|
|
33
|
+
* Displays the form in read-only mode normally, or editable mode when the
|
|
34
|
+
* instance has been returned and the current member can resubmit it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function InstanceFormSection({ canResubmitInstance, deciding, error, instance, loading, onDataSourceStateChange, onResubmitFormChange, onResubmitInstance, onUploadAttachment, resubmitFormData, resubmitFormErrors, }: InstanceFormSectionProps): ReactElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { ApprovalInstanceRecord, WorkflowFormData } from '@rytass/bpm-core-client/workflow';
|
|
4
|
-
import { FormDataSourceFieldState } from '../../../forms/renderer/form-data-source-field';
|
|
4
|
+
import { FormDataSourceFieldState } from '../../../forms/renderer/form-data-source-field.js';
|
|
5
5
|
export interface InstanceFormSectionProps {
|
|
6
6
|
/** The loaded approval instance, or null while loading. */
|
|
7
7
|
readonly instance: ApprovalInstanceRecord | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ActivityLogRecord, ApprovalInstanceRecord, MemberProfileRecord, SignatureRecord, SignatureVerificationRecord, TaskDecisionRecord, TaskRecord, WorkflowTokenRecord } from '@rytass/bpm-core-client/workflow';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface InstanceHistorySectionProps {
|
|
5
|
+
/** Activity log records for this instance. */
|
|
6
|
+
readonly activityLogs: readonly ActivityLogRecord[];
|
|
7
|
+
/** All tasks for this instance (used to compute pending/future steps). */
|
|
8
|
+
readonly tasks: readonly TaskRecord[];
|
|
9
|
+
/** All workflow tokens for this instance. */
|
|
10
|
+
readonly workflowTokens: readonly WorkflowTokenRecord[];
|
|
11
|
+
/** The workflow definition snapshot, or null if not yet loaded. */
|
|
12
|
+
readonly workflowSnapshot: WorkflowDefinition | null;
|
|
13
|
+
/** The current state of the instance. */
|
|
14
|
+
readonly instanceState: ApprovalInstanceRecord['state'];
|
|
15
|
+
/** Member profiles indexed by memberId. */
|
|
16
|
+
readonly memberProfilesById: ReadonlyMap<string, MemberProfileRecord>;
|
|
17
|
+
/** Task decisions indexed by taskId (latest per task). */
|
|
18
|
+
readonly taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>;
|
|
19
|
+
/** Signatures indexed by id. */
|
|
20
|
+
readonly signaturesById: ReadonlyMap<string, SignatureRecord>;
|
|
21
|
+
/** Signature chain verification result, or null. */
|
|
22
|
+
readonly signatureVerification: SignatureVerificationRecord | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders the activity history section of the approval instance detail page.
|
|
26
|
+
* Computes the step records from the provided data and renders them as a
|
|
27
|
+
* vertical dot stepper.
|
|
28
|
+
*/
|
|
29
|
+
export declare function InstanceHistorySection({ activityLogs, instanceState, memberProfilesById, signatureVerification, signaturesById, taskDecisionsByTaskId, tasks, workflowSnapshot, workflowTokens, }: InstanceHistorySectionProps): ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SignatureRecord, SignatureVerificationRecord } from '@rytass/bpm-core-client/workflow';
|
|
3
|
+
export interface InstanceSignaturesSectionProps {
|
|
4
|
+
/** The list of signatures for this instance. */
|
|
5
|
+
readonly signatures: readonly SignatureRecord[];
|
|
6
|
+
/** The signature chain verification result, or null if not yet loaded. */
|
|
7
|
+
readonly signatureVerification: SignatureVerificationRecord | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders the signatures section of the approval instance detail page.
|
|
11
|
+
* Shows the signature chain verification status and a table of individual
|
|
12
|
+
* signature records.
|
|
13
|
+
*/
|
|
14
|
+
export declare function InstanceSignaturesSection({ signatureVerification, signatures, }: InstanceSignaturesSectionProps): ReactElement;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AdhocDirectiveRecord, ApprovalInstanceRecord, MemberProfileRecord, TaskRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Imperative handle exposed by InstanceTasksSection via ref.
|
|
4
|
+
* The container uses these to wire PageHeader action buttons to the
|
|
5
|
+
* section's internal modal state without lifting state up.
|
|
6
|
+
*/
|
|
7
|
+
export type AdhocActionMode = 'COMPLETION_NOTIFY' | 'COUNTERSIGN' | 'PRE_APPROVAL' | 'STAGE_NOTIFY';
|
|
8
|
+
export interface InstanceTasksSectionHandle {
|
|
9
|
+
/** Whether a task action (decision) is currently in flight. */
|
|
10
|
+
readonly deciding: boolean;
|
|
11
|
+
/** Whether the current user has an actionable pending task. */
|
|
12
|
+
readonly hasCurrentTask: boolean;
|
|
13
|
+
/** Whether the current task's node allows a return action. */
|
|
14
|
+
readonly canReturnCurrentTask: boolean;
|
|
15
|
+
/** Whether the current task's node allows a reject action. */
|
|
16
|
+
readonly canRejectCurrentTask: boolean;
|
|
17
|
+
/** Whether the current task's node allows a transfer action. */
|
|
18
|
+
readonly canTransferCurrentTask: boolean;
|
|
19
|
+
/** Whether the current task's node allows ad-hoc countersign/pre-approval. */
|
|
20
|
+
readonly canAddSignerCurrentTask: boolean;
|
|
21
|
+
/** Opens the reject-reason modal. */
|
|
22
|
+
openRejectModal(): void;
|
|
23
|
+
/** Opens the return modal. */
|
|
24
|
+
openReturnModal(): void;
|
|
25
|
+
/** Opens the transfer modal. */
|
|
26
|
+
openTransferModal(): void;
|
|
27
|
+
/** Opens the ad-hoc action modal in the given mode. */
|
|
28
|
+
openAdhocModal(mode: AdhocActionMode): void;
|
|
29
|
+
/** Opens the approve-comment modal. */
|
|
30
|
+
handleApprove(): void;
|
|
31
|
+
}
|
|
32
|
+
export interface InstanceTasksSectionProps {
|
|
33
|
+
/** All tasks for this instance. */
|
|
34
|
+
readonly tasks: readonly TaskRecord[];
|
|
35
|
+
/** Ad-hoc directives recorded on this instance. */
|
|
36
|
+
readonly adhocDirectives: readonly AdhocDirectiveRecord[];
|
|
37
|
+
/** The loaded approval instance (used to read workflowSnapshot node labels). */
|
|
38
|
+
readonly instance: ApprovalInstanceRecord | null;
|
|
39
|
+
/** Member profiles indexed by memberId, for displaying assignee labels. */
|
|
40
|
+
readonly memberProfilesById: ReadonlyMap<string, MemberProfileRecord>;
|
|
41
|
+
/** The currently authenticated member's id. */
|
|
42
|
+
readonly currentMemberId: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Called after any task decision action (approve / reject / return /
|
|
45
|
+
* transfer) completes successfully. The container should refresh data.
|
|
46
|
+
*/
|
|
47
|
+
readonly onChanged: () => void | Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Renders the tasks section of the approval instance detail page.
|
|
51
|
+
* Contains the task table plus all decision action modals
|
|
52
|
+
* (reject, return, transfer). Approve is also handled here via the
|
|
53
|
+
* imperative handle exposed through the forwarded ref.
|
|
54
|
+
*/
|
|
55
|
+
export declare const InstanceTasksSection: import('react').ForwardRefExoticComponent<InstanceTasksSectionProps & import('react').RefAttributes<InstanceTasksSectionHandle>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { WorkflowWebhookDeliveryRecord } from '@rytass/bpm-core-client/workflow';
|
|
3
|
+
export interface InstanceWebhookDeliveriesSectionProps {
|
|
4
|
+
/** The instance's notify-node webhook deliveries, oldest first. */
|
|
5
|
+
readonly deliveries: readonly WorkflowWebhookDeliveryRecord[];
|
|
6
|
+
/** Resolves a node id to the label shown to the reader. */
|
|
7
|
+
readonly readNodeLabel: (nodeId: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Re-queues a `FAILED` delivery. A rejection is shown in the section, so
|
|
10
|
+
* the caller only needs to refresh what it displays on success.
|
|
11
|
+
*/
|
|
12
|
+
readonly onRetry: (delivery: WorkflowWebhookDeliveryRecord) => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Administrator-only view of the webhooks this instance's notify nodes sent
|
|
16
|
+
* (ADR 18 §3.10): where each delivery stands, how many attempts it took, the
|
|
17
|
+
* last error, and a retry for the ones that gave up. Carries no URL or
|
|
18
|
+
* payload — the server never sends them to the browser.
|
|
19
|
+
*/
|
|
20
|
+
export declare function InstanceWebhookDeliveriesSection({ deliveries, onRetry, readNodeLabel, }: InstanceWebhookDeliveriesSectionProps): ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActivityLogRecord, AdhocDirectiveRecord, ApprovalInstanceRecord, MemberProfileRecord, TaskDecisionRecord, TaskRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
+
export { canMemberActOnTask, readErrorMessage, readInstanceStateLabel, readNodeRuntimeState, } from './shared.cjs';
|
|
3
|
+
export declare function readMemberProfilesForTimeline({ activityLogs, adhocDirectives, instance, tasks, }: {
|
|
4
|
+
readonly activityLogs: readonly ActivityLogRecord[];
|
|
5
|
+
readonly adhocDirectives?: readonly AdhocDirectiveRecord[];
|
|
6
|
+
readonly instance?: Pick<ApprovalInstanceRecord, 'initiatorMemberId' | 'submittedByMemberId'>;
|
|
7
|
+
readonly tasks: readonly TaskRecord[];
|
|
8
|
+
}): Promise<readonly MemberProfileRecord[]>;
|
|
9
|
+
export declare function readTaskDecisionsForTasks(tasks: readonly TaskRecord[]): Promise<readonly TaskDecisionRecord[]>;
|
|
10
|
+
export declare function readLatestTaskDecisionsByTaskId(taskDecisions: readonly TaskDecisionRecord[]): ReadonlyMap<string, TaskDecisionRecord>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActivityLogRecord, AdhocDirectiveRecord, ApprovalInstanceRecord, MemberProfileRecord, TaskDecisionRecord, TaskRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
-
export { canMemberActOnTask, readErrorMessage, readInstanceStateLabel, readNodeRuntimeState, } from './shared';
|
|
2
|
+
export { canMemberActOnTask, readErrorMessage, readInstanceStateLabel, readNodeRuntimeState, } from './shared.js';
|
|
3
3
|
export declare function readMemberProfilesForTimeline({ activityLogs, adhocDirectives, instance, tasks, }: {
|
|
4
4
|
readonly activityLogs: readonly ActivityLogRecord[];
|
|
5
5
|
readonly adhocDirectives?: readonly AdhocDirectiveRecord[];
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ActivityLogRecord, ApprovalInstanceRecord, AttachmentRecord, MemberProfileRecord, SignatureRecord, SignatureVerificationRecord, TaskDecisionRecord, TaskRecord, WorkflowTokenRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
+
import { WorkflowDefinition, WorkflowNode } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
export type TaskRow = Readonly<Record<string, unknown> & TaskRecord & {
|
|
4
|
+
assigneeLabel: string;
|
|
5
|
+
key: string;
|
|
6
|
+
nodeLabel: string;
|
|
7
|
+
statusLabel: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type AttachmentRow = Readonly<Record<string, unknown> & {
|
|
10
|
+
attachment: AttachmentRecord;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
filename: string;
|
|
13
|
+
id: string;
|
|
14
|
+
key: string;
|
|
15
|
+
mimeType: string;
|
|
16
|
+
sizeLabel: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type SignatureRow = Readonly<Record<string, unknown> & {
|
|
19
|
+
algorithm: string;
|
|
20
|
+
hashLabel: string;
|
|
21
|
+
key: string;
|
|
22
|
+
keyVersion: number;
|
|
23
|
+
signedAtLabel: string;
|
|
24
|
+
signerMemberId: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type MemberOption = Readonly<{
|
|
27
|
+
email: string | null;
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type ActivityStepDescriptionPart = Readonly<{
|
|
32
|
+
text: string;
|
|
33
|
+
type: 'text';
|
|
34
|
+
}> | Readonly<{
|
|
35
|
+
email: string | null;
|
|
36
|
+
label: string;
|
|
37
|
+
memberId: string | null;
|
|
38
|
+
prefix: string;
|
|
39
|
+
type: 'member';
|
|
40
|
+
}>
|
|
41
|
+
/**
|
|
42
|
+
* What an approver actually wrote. Kept apart from the `text` parts so the
|
|
43
|
+
* timeline can give it its own line instead of burying it mid-sentence
|
|
44
|
+
* between the node, the actor, the timestamp and the signature hash.
|
|
45
|
+
*/
|
|
46
|
+
| Readonly<{
|
|
47
|
+
label: string;
|
|
48
|
+
text: string;
|
|
49
|
+
tone: 'danger' | 'neutral';
|
|
50
|
+
type: 'comment';
|
|
51
|
+
}>;
|
|
52
|
+
export interface ActivityStepRecord {
|
|
53
|
+
readonly descriptionParts: readonly ActivityStepDescriptionPart[];
|
|
54
|
+
readonly error: boolean;
|
|
55
|
+
readonly forcePending?: boolean;
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly title: string;
|
|
58
|
+
}
|
|
59
|
+
interface DelegationChainStep {
|
|
60
|
+
readonly from: string;
|
|
61
|
+
readonly reason: string;
|
|
62
|
+
readonly ruleId: string | null;
|
|
63
|
+
readonly to: string;
|
|
64
|
+
}
|
|
65
|
+
export declare function readDelegationChain(value: string): readonly DelegationChainStep[];
|
|
66
|
+
export declare function readStringField(record: Readonly<Record<string, unknown>>, key: string): string | null;
|
|
67
|
+
export declare function readStringArrayField(record: Readonly<Record<string, unknown>>, key: string): readonly string[];
|
|
68
|
+
export declare function readNumberField(record: Readonly<Record<string, unknown>>, key: string): number | null;
|
|
69
|
+
export declare function isPresentText(value: string | null): value is string;
|
|
70
|
+
export declare function isRecord(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
71
|
+
export declare function isPendingTask(task: TaskRecord): boolean;
|
|
72
|
+
export declare function readErrorMessage(error: unknown): string;
|
|
73
|
+
export declare function formatFileSize(sizeBytes: number): string;
|
|
74
|
+
export declare function readShortHash(hash: string): string;
|
|
75
|
+
export declare function readInstanceStateLabel(state: string): string;
|
|
76
|
+
export declare function readTaskStatusLabel(status: TaskRecord['status']): string;
|
|
77
|
+
export declare function readTaskDecisionActionLabel(action: string): string;
|
|
78
|
+
export declare function readNodeKindLabel(type: WorkflowNode['type']): string;
|
|
79
|
+
export declare function readNodeDisplayLabel(nodeId: string, workflow: WorkflowDefinition | null): string;
|
|
80
|
+
export declare function readMemberDisplayText(memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>): string;
|
|
81
|
+
export declare function readTaskAssigneeLabel(task: TaskRecord, memberProfilesById?: ReadonlyMap<string, MemberProfileRecord>): string;
|
|
82
|
+
export declare function canMemberActOnTask(task: TaskRecord, memberId: string | null): boolean;
|
|
83
|
+
export declare function readReturnTargetOptions(workflow: WorkflowDefinition, node: WorkflowNode): readonly {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly name: string;
|
|
86
|
+
}[];
|
|
87
|
+
export declare function readMemberOption(profile: MemberProfileRecord): MemberOption;
|
|
88
|
+
/**
|
|
89
|
+
* The target an ad-hoc directive is sent to, or the reason it cannot be built
|
|
90
|
+
* yet. Kept out of the component so the "which shape do we send" decision is
|
|
91
|
+
* testable on its own — it is the part that changed when the member picker
|
|
92
|
+
* went from one selection to many.
|
|
93
|
+
*/
|
|
94
|
+
export type AdhocTargetDraft = Readonly<{
|
|
95
|
+
target: Readonly<{
|
|
96
|
+
kind: 'MEMBER';
|
|
97
|
+
memberIds: readonly string[];
|
|
98
|
+
}> | Readonly<{
|
|
99
|
+
kind: 'WEBHOOK';
|
|
100
|
+
webhookUrl: string;
|
|
101
|
+
}>;
|
|
102
|
+
valid: true;
|
|
103
|
+
}> | Readonly<{
|
|
104
|
+
error: string;
|
|
105
|
+
valid: false;
|
|
106
|
+
}>;
|
|
107
|
+
export declare function readAdhocTargetDraft({ memberIds, useWebhookTarget, webhookUrl, }: {
|
|
108
|
+
readonly memberIds: readonly string[];
|
|
109
|
+
readonly useWebhookTarget: boolean;
|
|
110
|
+
readonly webhookUrl: string;
|
|
111
|
+
}): AdhocTargetDraft;
|
|
112
|
+
export declare function isPresentMemberOption(option: MemberOption | null): option is MemberOption;
|
|
113
|
+
export declare function readMemberOptionFromValue(value: unknown): MemberOption | null;
|
|
114
|
+
export declare function readUniqueMemberOption(searchText: string, options: readonly MemberOption[]): MemberOption | null;
|
|
115
|
+
export declare function readTextDescriptionPart(text: string | null): ActivityStepDescriptionPart | null;
|
|
116
|
+
export declare function readCommentDescriptionPart(label: string, text: string | null, tone?: 'danger' | 'neutral'): ActivityStepDescriptionPart | null;
|
|
117
|
+
export declare function readMemberDescriptionPart(prefix: string, memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, fallbackLabel: string): ActivityStepDescriptionPart;
|
|
118
|
+
export declare function isActivityDescriptionPart(part: ActivityStepDescriptionPart | null): part is ActivityStepDescriptionPart;
|
|
119
|
+
export declare function readCurrentActivityStep(activitySteps: readonly ActivityStepRecord[]): number;
|
|
120
|
+
export declare function isUserMeaningfulActivity(activityLog: ActivityLogRecord): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Member ids that only appear inside the payload of the sequential-signing
|
|
123
|
+
* events, so the timeline can load their profiles and show names, not ids.
|
|
124
|
+
*/
|
|
125
|
+
export declare function readSequentialActivityPayloadMemberIds(activityLog: ActivityLogRecord): readonly string[];
|
|
126
|
+
export declare function readActivityEventLabel(eventType: string, payload: Readonly<Record<string, unknown>>): string;
|
|
127
|
+
export declare function readActivityPayload(activityLog: ActivityLogRecord): Readonly<Record<string, unknown>>;
|
|
128
|
+
export declare function isActivityError(activityLog: ActivityLogRecord, payload: Readonly<Record<string, unknown>>): boolean;
|
|
129
|
+
export declare function formatActivityDateTime(value: string): string;
|
|
130
|
+
export declare function readActivityDetailParts(activityLog: ActivityLogRecord, payload: Readonly<Record<string, unknown>>, workflow: WorkflowDefinition | null, taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>, signaturesById: ReadonlyMap<string, SignatureRecord>, signatureVerification: SignatureVerificationRecord | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>): readonly ActivityStepDescriptionPart[];
|
|
131
|
+
export declare function isFutureTimelineNode(node: WorkflowNode, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: ApprovalInstanceRecord['state'], representedNodeIds: ReadonlySet<string>): boolean;
|
|
132
|
+
export declare function readFutureTimelineNodes(workflow: WorkflowDefinition, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: ApprovalInstanceRecord['state'], representedNodeIds: ReadonlySet<string>): readonly WorkflowNode[];
|
|
133
|
+
export declare function readFutureNodeStepTitle(node: WorkflowNode): string;
|
|
134
|
+
export declare function readActivityStepRecords(activityLogs: readonly ActivityLogRecord[], tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], workflow: WorkflowDefinition | null, instanceState: ApprovalInstanceRecord['state'], memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>, signaturesById: ReadonlyMap<string, SignatureRecord>, signatureVerification: SignatureVerificationRecord | null): ActivityStepRecord[];
|
|
135
|
+
type RuntimeTone = 'cancelled' | 'completed' | 'current' | 'neutral' | 'waiting';
|
|
136
|
+
export declare function readNodeRuntimeState(node: WorkflowNode, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: string): Readonly<{
|
|
137
|
+
secondaryLabel: string;
|
|
138
|
+
statusLabel: string;
|
|
139
|
+
tone: RuntimeTone;
|
|
140
|
+
}>;
|
|
141
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who filed an approval instance on someone's behalf.
|
|
3
|
+
*
|
|
4
|
+
* `submittedByMemberId` is `null` on rows written before the column existed
|
|
5
|
+
* and equals `initiatorMemberId` when the applicant submitted it themselves;
|
|
6
|
+
* only a different, non-empty value means somebody else filed it. This is the
|
|
7
|
+
* one place the detail page reads that rule.
|
|
8
|
+
*/
|
|
9
|
+
interface SubmittedByFields {
|
|
10
|
+
readonly initiatorMemberId: string | null | undefined;
|
|
11
|
+
readonly submittedByMemberId?: string | null;
|
|
12
|
+
}
|
|
13
|
+
interface NamedMember {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function readDistinctSubmitterMemberId({ initiatorMemberId, submittedByMemberId, }: SubmittedByFields): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* 「由 {submitter} 代 {initiator} 送出」, or `null` when the applicant
|
|
19
|
+
* submitted it themselves. A member whose profile did not load shows by id,
|
|
20
|
+
* like every other member on the page.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readSubmittedOnBehalfLabel(fields: SubmittedByFields, memberProfilesById: ReadonlyMap<string, NamedMember>): string | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './new/index.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './new';
|
|
1
|
+
export * from './new/index.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface InstanceNewViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Optional template id pre-selected by the host. The Server Component
|
|
5
|
+
* page should read `?templateId=` from its `searchParams` and pass the
|
|
6
|
+
* value through this prop.
|
|
7
|
+
*/
|
|
8
|
+
readonly templateId?: string | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Framework-agnostic view for the BPM "發起簽核" launch page. Mechanical port
|
|
12
|
+
* of `apps/client/src/app/instances/new/page.tsx` — picks a launchable
|
|
13
|
+
* template and submits the launch form.
|
|
14
|
+
*/
|
|
15
|
+
export declare function InstanceNewView(props?: InstanceNewViewProps): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InstanceNewView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './InstanceNewView';
|
|
1
|
+
export * from './InstanceNewView.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface LoginViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Logo image URL. Renders an inline `<img>` so the view stays framework
|
|
5
|
+
* agnostic (no `next/image` dependency). Defaults to
|
|
6
|
+
* `/rytass-logo.png` — host should serve a static asset at that path or
|
|
7
|
+
* override via this prop.
|
|
8
|
+
*/
|
|
9
|
+
readonly logoSrc?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Pre-fill the identifier input. Defaults to the seeded demo account
|
|
12
|
+
* email so the form is usable out of the box.
|
|
13
|
+
*/
|
|
14
|
+
readonly defaultIdentifier?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Pre-fill the password input. Defaults to the seeded demo password
|
|
17
|
+
* (`'demo'`). Production hosts should pass an empty string.
|
|
18
|
+
*/
|
|
19
|
+
readonly defaultPassword?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Custom redirect target after a successful login. Defaults to reading
|
|
22
|
+
* `?next=` from the host router's search params, falling back to `'/'`.
|
|
23
|
+
*/
|
|
24
|
+
readonly defaultNextPath?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Override the BPM admin brand title shown above the form. Defaults to
|
|
27
|
+
* `'BPM Admin'`.
|
|
28
|
+
*/
|
|
29
|
+
readonly brandTitle?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Override the brand subtitle shown above the form. Defaults to
|
|
32
|
+
* `'BPM API 登入'`.
|
|
33
|
+
*/
|
|
34
|
+
readonly brandSubtitle?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Login UI for the BPM admin host. Renders the brand mark, identifier /
|
|
38
|
+
* password fields, and a "test members" picker fed by
|
|
39
|
+
* `listApiTestMembers()`. Self-contained: composes Mezzanine UI primitives,
|
|
40
|
+
* reads the auth context, and uses the host router adapter to redirect on
|
|
41
|
+
* success.
|
|
42
|
+
*
|
|
43
|
+
* Wrap with `<AuthProvider>` (and indirectly `<RouterAdapterProvider>`)
|
|
44
|
+
* higher in the tree. The `pages/login` subpath ships a thin Next.js
|
|
45
|
+
* wrapper that exports `default` (Server Component) and `metadata`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function LoginView({ logoSrc, defaultIdentifier, defaultPassword, defaultNextPath, brandTitle, brandSubtitle, }?: LoginViewProps): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LoginView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './LoginView';
|
|
1
|
+
export * from './LoginView.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic placeholder for the BPM root path. Server-side redirect
|
|
4
|
+
* to `/dashboard` is the consumer's responsibility (Next.js `middleware.ts`
|
|
5
|
+
* or `app/page.tsx`). This view renders nothing so it can be safely mounted
|
|
6
|
+
* during the redirect flash.
|
|
7
|
+
*
|
|
8
|
+
* Mechanical port of `apps/client/src/app/page.tsx`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function RootView(): ReactElement | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RootView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './RootView';
|
|
1
|
+
export * from './RootView.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic view for the BPM case search page — list of all
|
|
4
|
+
* instances the current member has visibility on. Mechanical port of
|
|
5
|
+
* `apps/client/src/app/search/page.tsx`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SearchView(): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SearchView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SearchView';
|
|
1
|
+
export * from './SearchView.js';
|