@haiiro/docuflow 0.0.15 → 0.0.17
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 +8 -2
- package/bin/install.mjs +9 -4
- package/manifest.json +34 -19
- package/package.json +1 -1
- package/public/app/docflow-app.js +5 -5
- package/src/front-components/docflow-documents.front-component.mjs +1 -1
- package/src/front-components/docflow-processes.front-component.mjs +35 -35
- package/src/front-components/docflow-processes.front-component.tsx +187 -85
- package/src/front-components/docflow-tasks.front-component.mjs +32 -32
- package/src/front-components/docflow-tasks.front-component.tsx +19 -2
- package/src/front-components/launch-process.front-component.mjs +19 -19
- package/src/front-components/launch-process.front-component.tsx +36 -60
- package/src/front-components/process-steps.front-component.mjs +17 -17
- package/src/front-components/task-form.front-component.mjs +10 -10
- package/src/logic-functions/bitrix-app.logic-function.mjs +1 -1
- package/src/logic-functions/complete-task.logic-function.mjs +39 -8
- package/src/logic-functions/docflow-app.logic-function.mjs +1 -1
- package/src/logic-functions/hand-out-form-step.logic-function.mjs +71278 -11217
- package/src/logic-functions/hand-out-form-step.logic-function.ts +1 -1
- package/src/logic-functions/launch-process.logic-function.mjs +269 -33
- package/src/logic-functions/launch-process.logic-function.ts +42 -37
- package/src/logic-functions/on-task-updated.logic-function.mjs +39 -8
- package/src/logic-functions/on-workflow-run-updated.logic-function.mjs +35 -9
- package/src/logic-functions/on-workflow-run-updated.logic-function.ts +6 -3
- package/src/logic-functions/process-catalog.logic-function.mjs +119726 -0
- package/src/logic-functions/process-catalog.logic-function.ts +84 -0
- package/src/logic-functions/publish-process.logic-function.mjs +218 -16
- package/src/logic-functions/publish-process.logic-function.ts +13 -5
- package/src/logic-functions/save-launch-fields.logic-function.mjs +5 -2
- package/src/logic-functions/save-step-settings.logic-function.mjs +5 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, useState } from 'react';
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { defineFrontComponent } from 'twenty-sdk/define';
|
|
3
3
|
import { AppPath, enqueueSnackbar, openSidePanelPage } from 'twenty-sdk/front-component';
|
|
4
4
|
import {
|
|
@@ -273,6 +273,7 @@ const DocflowTasks = () => {
|
|
|
273
273
|
const [filters, setFilters] = useState<TaskFilters>(DEFAULT_FILTERS);
|
|
274
274
|
const [sort, setSort] = useState<TableSort>(DEFAULT_SORT);
|
|
275
275
|
const [panel, setPanel] = useState<Panel>({ kind: 'closed' });
|
|
276
|
+
const [knownTitles, setKnownTitles] = useState<Record<string, string>>({});
|
|
276
277
|
const [pages, setPages] = useState(1);
|
|
277
278
|
const [hiddenColumns, setHiddenColumns] = useHiddenColumns(['createdAt']);
|
|
278
279
|
const [bulkDialog, setBulkDialog] = useState<BulkDialog>();
|
|
@@ -431,8 +432,24 @@ const DocflowTasks = () => {
|
|
|
431
432
|
panel.kind === 'task'
|
|
432
433
|
? (tasks.find(({ id }) => id === panel.taskId) ?? urgentTasks.find(({ id }) => id === panel.taskId))
|
|
433
434
|
: undefined;
|
|
435
|
+
// A completed task leaves the "Открытые" list while its panel stays open:
|
|
436
|
+
// the panel keeps the title it was opened with.
|
|
437
|
+
const openTaskTitle = openTask?.title?.trim() ?? '';
|
|
438
|
+
|
|
439
|
+
useEffect(() => {
|
|
440
|
+
if (openTask !== undefined && openTaskTitle.length > 0) {
|
|
441
|
+
setKnownTitles((current) =>
|
|
442
|
+
current[openTask.id] === openTaskTitle ? current : { ...current, [openTask.id]: openTaskTitle },
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
}, [openTask?.id, openTaskTitle]);
|
|
446
|
+
|
|
434
447
|
const panelTitle =
|
|
435
|
-
panel.kind === 'create'
|
|
448
|
+
panel.kind === 'create'
|
|
449
|
+
? 'Новое задание'
|
|
450
|
+
: panel.kind === 'task'
|
|
451
|
+
? openTaskTitle || knownTitles[panel.taskId] || 'Без названия'
|
|
452
|
+
: undefined;
|
|
436
453
|
|
|
437
454
|
return (
|
|
438
455
|
<DocflowRoot>
|