@haiiro/docuflow 0.0.12 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -9
- package/bin/install.mjs +69 -3
- package/manifest.json +114 -18
- package/package.json +6 -3
- package/public/app/docflow-app.css +2 -0
- package/public/app/docflow-app.js +95 -0
- package/src/front-components/docflow-documents.front-component.mjs +41 -41
- package/src/front-components/docflow-documents.front-component.tsx +49 -32
- package/src/front-components/docflow-processes.front-component.mjs +34 -34
- package/src/front-components/docflow-processes.front-component.tsx +24 -11
- package/src/front-components/docflow-tasks.front-component.mjs +40 -39
- package/src/front-components/docflow-tasks.front-component.tsx +19 -14
- package/src/front-components/launch-process.front-component.mjs +75 -0
- package/src/front-components/launch-process.front-component.tsx +270 -0
- package/src/front-components/process-steps.front-component.mjs +26 -26
- package/src/front-components/process-steps.front-component.tsx +56 -10
- package/src/front-components/task-form.front-component.mjs +45 -44
- package/src/front-components/task-form.front-component.tsx +12 -1
- package/src/logic-functions/bitrix-app.logic-function.mjs +186 -88
- package/src/logic-functions/bitrix-app.logic-function.ts +24 -61
- package/src/logic-functions/bitrix-event.logic-function.mjs +22 -1
- package/src/logic-functions/bitrix-event.logic-function.ts +2 -2
- package/src/logic-functions/bitrix-install.logic-function.mjs +26 -12
- package/src/logic-functions/bitrix-install.logic-function.ts +2 -5
- package/src/logic-functions/complete-task.logic-function.mjs +22 -1
- package/src/logic-functions/complete-task.logic-function.ts +2 -2
- package/src/logic-functions/docflow-app-session.logic-function.mjs +60064 -0
- package/src/logic-functions/docflow-app-session.logic-function.ts +54 -0
- package/src/logic-functions/docflow-app.logic-function.mjs +60149 -0
- package/src/logic-functions/docflow-app.logic-function.ts +38 -0
- package/src/logic-functions/launch-process.logic-function.mjs +134 -40
- package/src/logic-functions/launch-process.logic-function.ts +85 -24
- package/src/logic-functions/publish-process.logic-function.mjs +32 -11
- package/src/logic-functions/publish-process.logic-function.ts +8 -4
- package/src/logic-functions/save-launch-fields.logic-function.mjs +194 -17
- package/src/logic-functions/save-launch-fields.logic-function.ts +26 -8
- package/src/logic-functions/save-step-settings.logic-function.mjs +24 -2
- package/src/logic-functions/save-step-settings.logic-function.ts +2 -2
- package/src/logic-functions/save-task-form.logic-function.mjs +22 -1
- package/src/logic-functions/save-task-form.logic-function.ts +2 -2
|
@@ -25,10 +25,10 @@ import { useAsync, useDebouncedValue } from 'src/front/hooks/use-async';
|
|
|
25
25
|
import { useBulkAction } from 'src/front/hooks/use-bulk-action';
|
|
26
26
|
import { useWorkspaceMembers } from 'src/front/hooks/use-workspace-members';
|
|
27
27
|
import { type DocflowWorkflowRun, type WorkspaceMember } from 'src/front/types';
|
|
28
|
+
import { ListSkeleton, TableSkeleton } from 'src/front/ui/skeleton';
|
|
28
29
|
import {
|
|
29
30
|
DataTable,
|
|
30
31
|
DocflowRoot,
|
|
31
|
-
formatTotal,
|
|
32
32
|
ListToolbar,
|
|
33
33
|
Message,
|
|
34
34
|
SectionTitle,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
useRowSelection,
|
|
41
41
|
} from 'src/front/ui/components';
|
|
42
42
|
import { FormFieldInputs } from 'src/front/ui/form-field-inputs';
|
|
43
|
-
import { Button, type MenuAction, MenuButton, PromptDialog,
|
|
43
|
+
import { Button, type MenuAction, MenuButton, PromptDialog, QuickViews, StatusChip } from 'src/front/ui/kit';
|
|
44
44
|
import { Timeline } from 'src/front/ui/timeline';
|
|
45
45
|
import { restAnd, restEq, restIlike, restIn } from 'src/shared/api/rest-filter.util';
|
|
46
46
|
import { DOCFLOW_SECTION } from 'src/shared/docflow.constants';
|
|
@@ -51,7 +51,9 @@ import {
|
|
|
51
51
|
buildLaunchParameters,
|
|
52
52
|
isLaunchableTrigger,
|
|
53
53
|
isLaunchParametersStep,
|
|
54
|
+
isLaunchTrigger,
|
|
54
55
|
parseLaunchFields,
|
|
56
|
+
parseLaunchObject,
|
|
55
57
|
} from 'src/shared/workflow/launch-step.util';
|
|
56
58
|
import { orderRunSteps } from 'src/shared/workflow/run-timeline.util';
|
|
57
59
|
import { type WorkflowStep, type WorkflowTrigger } from 'src/shared/workflow/workflow-run.type';
|
|
@@ -69,7 +71,13 @@ type Panel = { kind: 'closed' } | { kind: 'process'; workflowId: string };
|
|
|
69
71
|
type ProcessView = 'all' | 'active' | 'draft';
|
|
70
72
|
type ParametersFilter = 'any' | 'with' | 'without';
|
|
71
73
|
|
|
72
|
-
type WorkflowRecord = {
|
|
74
|
+
type WorkflowRecord = {
|
|
75
|
+
id: string;
|
|
76
|
+
name?: string | null;
|
|
77
|
+
smbLaunchFields?: unknown;
|
|
78
|
+
smbLaunchObject?: string | null;
|
|
79
|
+
updatedAt?: string | null;
|
|
80
|
+
};
|
|
73
81
|
type WorkflowVersionRecord = {
|
|
74
82
|
id: string;
|
|
75
83
|
workflowId: string;
|
|
@@ -90,6 +98,9 @@ type DocflowProcess = {
|
|
|
90
98
|
// A draft edited after the last publishing
|
|
91
99
|
hasUnpublishedChanges: boolean;
|
|
92
100
|
launchFields: FormField[];
|
|
101
|
+
// The object whose records the published version is launched on: such a
|
|
102
|
+
// process starts from a record, with "Запустить процесс"
|
|
103
|
+
launchObject: string | undefined;
|
|
93
104
|
// The steps in the order a run goes through them
|
|
94
105
|
stages: WorkflowStep[];
|
|
95
106
|
updatedAt?: string | null;
|
|
@@ -158,6 +169,7 @@ const loadProcesses = async (searchQuery: string): Promise<DocflowProcess[]> =>
|
|
|
158
169
|
isActive: active !== undefined,
|
|
159
170
|
hasUnpublishedChanges: active !== undefined && draft !== undefined,
|
|
160
171
|
launchFields: parseLaunchFields(workflow.smbLaunchFields),
|
|
172
|
+
launchObject: isLaunchTrigger(active?.trigger) ? parseLaunchObject(workflow.smbLaunchObject) : undefined,
|
|
161
173
|
stages: stagesOf(active ?? draft ?? deactivated),
|
|
162
174
|
updatedAt: workflow.updatedAt,
|
|
163
175
|
};
|
|
@@ -231,7 +243,7 @@ const RecentRuns = ({ workflowId }: { workflowId: string }) => {
|
|
|
231
243
|
);
|
|
232
244
|
|
|
233
245
|
if (loading && runs === undefined) {
|
|
234
|
-
return <
|
|
246
|
+
return <ListSkeleton rows={3} />;
|
|
235
247
|
}
|
|
236
248
|
|
|
237
249
|
if ((runs ?? []).length === 0) {
|
|
@@ -412,7 +424,11 @@ const ProcessPanel = ({
|
|
|
412
424
|
</Button>
|
|
413
425
|
</div>
|
|
414
426
|
</div>
|
|
415
|
-
{process.isPublished ? (
|
|
427
|
+
{process.isPublished && process.launchObject !== undefined ? (
|
|
428
|
+
<Message tone="hint">
|
|
429
|
+
Процесс запускается на записи: откройте или выберите запись и нажмите «Запустить процесс» в её меню.
|
|
430
|
+
</Message>
|
|
431
|
+
) : process.isPublished ? (
|
|
416
432
|
<section style={{ display: 'flex', flexDirection: 'column', gap: theme.spacing[3] }}>
|
|
417
433
|
<SectionTitle>Запуск</SectionTitle>
|
|
418
434
|
{process.launchFields.length > 0 ? (
|
|
@@ -664,7 +680,7 @@ const DocflowProcesses = () => {
|
|
|
664
680
|
],
|
|
665
681
|
}}
|
|
666
682
|
views={
|
|
667
|
-
<
|
|
683
|
+
<QuickViews
|
|
668
684
|
value={view}
|
|
669
685
|
onChange={(next) => {
|
|
670
686
|
setView(next);
|
|
@@ -676,10 +692,6 @@ const DocflowProcesses = () => {
|
|
|
676
692
|
}))}
|
|
677
693
|
/>
|
|
678
694
|
}
|
|
679
|
-
total={loaded === undefined ? undefined : formatTotal(processes.length, undefined, PROCESS_NOUN)}
|
|
680
|
-
columns={{ columns: COLUMNS, hiddenKeys: hiddenColumns, onChange: setHiddenColumns }}
|
|
681
|
-
onRefresh={() => void reloadAll()}
|
|
682
|
-
isRefreshing={loading}
|
|
683
695
|
onCreate={() => void handleCreate()}
|
|
684
696
|
isCreating={isCreating}
|
|
685
697
|
/>
|
|
@@ -688,7 +700,7 @@ const DocflowProcesses = () => {
|
|
|
688
700
|
<Message tone="danger">{getErrorMessage(error, 'Не удалось загрузить процессы')}</Message>
|
|
689
701
|
</div>
|
|
690
702
|
)}
|
|
691
|
-
{loading && loaded === undefined && <
|
|
703
|
+
{loading && loaded === undefined && <TableSkeleton />}
|
|
692
704
|
{!loading && error === undefined && processes.length === 0 && (
|
|
693
705
|
<Message>Процессов нет. «Создать» добавит процесс в раздел «Документооборот».</Message>
|
|
694
706
|
)}
|
|
@@ -696,6 +708,7 @@ const DocflowProcesses = () => {
|
|
|
696
708
|
<DataTable
|
|
697
709
|
columns={COLUMNS}
|
|
698
710
|
hiddenColumnKeys={hiddenColumns}
|
|
711
|
+
onHiddenColumnsChange={setHiddenColumns}
|
|
699
712
|
sort={sort}
|
|
700
713
|
onSortChange={setSort}
|
|
701
714
|
selectedRowId={selectedWorkflowId}
|