@nocobase/plugin-workflow 2.2.0-beta.14 → 2.2.0-beta.16
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/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/119.e7dbd037d52d1286.js +10 -0
- package/dist/client/142.fb4936d78fc80007.js +10 -0
- package/dist/client/159.cc9a0f2d92cab2c1.js +10 -0
- package/dist/client/276.69fb2aea13bc7c37.js +10 -0
- package/dist/client/346.66d060d37843d3d1.js +10 -0
- package/dist/client/382.d37fba14a6b91b0b.js +10 -0
- package/dist/client/394.a37310b78419ad7a.js +10 -0
- package/dist/client/438.6c6409d821d8c353.js +10 -0
- package/dist/client/509.88792f5bd054b2af.js +10 -0
- package/dist/client/54.d81b710f7b4c1cd5.js +10 -0
- package/dist/client/618.1aa6c21d0f2840cb.js +10 -0
- package/dist/client/635.ff6085589e23d39b.js +10 -0
- package/dist/client/67.92c849b5dbe07c33.js +10 -0
- package/dist/client/719.f011fde3ad54571e.js +10 -0
- package/dist/client/728.711fd4f1ed7d4e6a.js +10 -0
- package/dist/client/739.49407722fca8d236.js +10 -0
- package/dist/client/759.13aab01e6912ed8d.js +10 -0
- package/dist/client/772.1ebaef11a0ac8688.js +10 -0
- package/dist/client/782.47792ce10fc0d5fb.js +10 -0
- package/dist/client/828.6880ab21513b1968.js +10 -0
- package/dist/client/87.083467b89aaf3e53.js +10 -0
- package/dist/client/938.26493fc09ba1ccbc.js +10 -0
- package/dist/client/964.5ab736effd480a42.js +10 -0
- package/dist/client/972.dd7f074d5f12e171.js +10 -0
- package/dist/client/AddNodeContext.d.ts +1 -9
- package/dist/client/BranchContext.d.ts +2 -10
- package/dist/client/FlowContext.d.ts +10 -5
- package/dist/client/NodeClipboardContext.d.ts +12 -2
- package/dist/client/NodeDragContext.d.ts +14 -2
- package/dist/client/RemoveNodeContext.d.ts +16 -2
- package/dist/client/WorkflowTasks.d.ts +26 -3
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/client/nodeVariableUtils.d.ts +7 -6
- package/dist/client/nodes/calculation.d.ts +3 -75
- package/dist/client/nodes/condition.d.ts +7 -111
- package/dist/client/nodes/create.d.ts +3 -124
- package/dist/client/nodes/destroy.d.ts +2 -57
- package/dist/client/nodes/end.d.ts +2 -23
- package/dist/client/nodes/index.d.ts +2 -91
- package/dist/client/nodes/multi-conditions.d.ts +10 -48
- package/dist/client/nodes/output.d.ts +2 -44
- package/dist/client/nodes/query.d.ts +3 -255
- package/dist/client/nodes/update.d.ts +2 -117
- package/dist/client/style.d.ts +7 -27
- package/dist/client/triggers/collection.d.ts +3 -181
- package/dist/client/triggers/index.d.ts +2 -36
- package/dist/client/triggers/schedule/index.d.ts +8 -65
- package/dist/client/utils.d.ts +4 -5
- package/dist/client/variable.d.ts +7 -53
- package/dist/client-v2/119.81195bcd0d451279.js +10 -0
- package/dist/client-v2/142.a8c8df2a9abb43c5.js +10 -0
- package/dist/client-v2/159.cb221540c286cd32.js +10 -0
- package/dist/client-v2/276.7f746d899e221e2f.js +10 -0
- package/dist/client-v2/326.bdc99ad8e7590970.js +10 -0
- package/dist/client-v2/346.8c038b3c99d4fdc9.js +10 -0
- package/dist/client-v2/382.05f5482bb512b179.js +10 -0
- package/dist/client-v2/387.5e61d648d16dbf1b.js +10 -0
- package/dist/client-v2/394.515ed058e7f72797.js +10 -0
- package/dist/client-v2/438.b7df0416b66f8f64.js +10 -0
- package/dist/client-v2/513.617697f74783a611.js +10 -0
- package/dist/client-v2/54.d3daf06e53092726.js +10 -0
- package/dist/client-v2/635.14a6f21cf4f16345.js +10 -0
- package/dist/client-v2/677.7382807126d9621a.js +10 -0
- package/dist/client-v2/719.05cf070ef89a78f4.js +10 -0
- package/dist/client-v2/728.4e8322ff8fce87b9.js +10 -0
- package/dist/client-v2/739.5b60845103064f8d.js +10 -0
- package/dist/client-v2/759.7b162ad3adf450f1.js +10 -0
- package/dist/client-v2/772.8e5148d8c1518449.js +10 -0
- package/dist/client-v2/938.717e47af39485b29.js +10 -0
- package/dist/client-v2/ExecutionCanvas.d.ts +15 -0
- package/dist/client-v2/canvas/AddNodeContext.d.ts +35 -0
- package/dist/client-v2/canvas/AddNodeContext.shared.d.ts +33 -0
- package/dist/client-v2/canvas/AddNodeSlot.d.ts +20 -0
- package/dist/client-v2/canvas/Branch.d.ts +32 -0
- package/dist/client-v2/canvas/BranchContext.d.ts +29 -0
- package/dist/client-v2/canvas/BranchRenderContext.d.ts +14 -0
- package/dist/client-v2/canvas/CanvasContent.d.ts +20 -0
- package/dist/client-v2/canvas/DownstreamBranchIndex.d.ts +20 -0
- package/dist/client-v2/canvas/Instruction.d.ts +139 -0
- package/dist/{client/triggers/schedule/EndsByField.d.ts → client-v2/canvas/JobButton.d.ts} +3 -3
- package/dist/client-v2/canvas/Node.d.ts +38 -0
- package/dist/client-v2/canvas/NodeClipboardContext.d.ts +64 -0
- package/dist/client-v2/canvas/NodeConfigDrawer.d.ts +27 -0
- package/dist/client-v2/canvas/NodeDragContext.d.ts +83 -0
- package/dist/client-v2/canvas/RemoveNodeContext.d.ts +45 -0
- package/dist/client-v2/canvas/WorkflowTypedVariableInput.d.ts +16 -0
- package/dist/client-v2/canvas/WorkflowVariableInput.d.ts +40 -0
- package/dist/client-v2/canvas/WorkflowVariableJsonTextArea.d.ts +15 -0
- package/dist/client-v2/canvas/WorkflowVariableTag.d.ts +22 -0
- package/dist/client-v2/canvas/WorkflowVariableTextArea.d.ts +18 -0
- package/dist/client-v2/canvas/adaptVariableOptionToMetaTree.d.ts +48 -0
- package/dist/client-v2/canvas/addNodeController.d.ts +70 -0
- package/dist/client-v2/canvas/collectionFieldOptions.d.ts +57 -0
- package/dist/client-v2/canvas/contexts.d.ts +86 -0
- package/dist/client-v2/canvas/dropImpact.d.ts +28 -0
- package/dist/client-v2/canvas/instructionAvailability.d.ts +26 -0
- package/dist/client-v2/canvas/nodeRenderDispatch.d.ts +79 -0
- package/dist/client-v2/canvas/nodeTree.d.ts +21 -0
- package/dist/client-v2/canvas/nodeVariableUtils.d.ts +14 -0
- package/dist/client-v2/canvas/removeNodeUtils.d.ts +31 -0
- package/dist/client-v2/canvas/style.d.ts +35 -0
- package/dist/client-v2/canvas/textAreaInsertion.d.ts +14 -0
- package/dist/client-v2/canvas/useWorkflowInstruction.d.ts +23 -0
- package/dist/client-v2/canvas/useWorkflowVariableOptions.d.ts +40 -0
- package/dist/client-v2/canvas/workflowVariableConverters.d.ts +13 -0
- package/dist/client-v2/components/Calculation.d.ts +18 -0
- package/dist/client-v2/components/ExecutionStatusIcon.d.ts +18 -0
- package/dist/{client/triggers/schedule/RepeatField.d.ts → client-v2/components/ExecutionStatusTag.d.ts} +3 -4
- package/dist/client-v2/components/ExecutionViewHeader.d.ts +29 -0
- package/dist/client-v2/components/ExecutionsDropdown.d.ts +25 -0
- package/dist/client-v2/components/FilterDynamicComponent.d.ts +28 -0
- package/dist/client-v2/components/HideVariableContext.d.ts +11 -0
- package/dist/client-v2/components/JobResultModal.d.ts +11 -0
- package/dist/client-v2/components/RadioWithTooltip.d.ts +23 -0
- package/dist/client-v2/components/SyncModeSelect.d.ts +16 -0
- package/dist/{client/triggers/schedule/OnField.d.ts → client-v2/components/SyncModeTag.d.ts} +3 -3
- package/dist/client-v2/components/TestRunButton.d.ts +36 -0
- package/dist/client-v2/components/TimeoutInput.d.ts +15 -0
- package/dist/client-v2/components/WorkflowCanvasHeader.d.ts +17 -0
- package/dist/client-v2/components/WorkflowDetailsModal.d.ts +25 -0
- package/dist/client-v2/components/WorkflowEnabledSwitch.d.ts +16 -0
- package/dist/client-v2/components/WorkflowMenu.d.ts +17 -0
- package/dist/client-v2/components/WorkflowRevisionsDropdown.d.ts +15 -0
- package/dist/client-v2/components/WorkflowVariableWrapper.d.ts +25 -0
- package/dist/client-v2/components/collection/AppendsSelect.d.ts +15 -0
- package/dist/client-v2/components/collection/AssignedFieldsEditor.d.ts +24 -0
- package/dist/client-v2/components/collection/CollectionCascader.d.ts +15 -0
- package/dist/client-v2/components/collection/FieldsSelect.d.ts +16 -0
- package/dist/client-v2/components/collection/PaginationFields.d.ts +14 -0
- package/dist/client-v2/components/collection/SortFieldsInput.d.ts +19 -0
- package/dist/client-v2/components/collection/TriggerCollectionRecordSelect.d.ts +15 -0
- package/dist/client-v2/components/collection/index.d.ts +16 -0
- package/dist/client-v2/components/collection/utils.d.ts +42 -0
- package/dist/client-v2/components/formatResultForDisplay.d.ts +17 -0
- package/dist/client-v2/components/jobStatus.d.ts +27 -0
- package/dist/client-v2/components/renderEngineReference.d.ts +10 -0
- package/dist/client-v2/components/workflowCanvas.d.ts +41 -0
- package/dist/client-v2/constants.d.ts +19 -0
- package/dist/client-v2/hooks/useWorkflowRuntimePaths.d.ts +16 -0
- package/dist/client-v2/index.d.ts +48 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +41 -0
- package/dist/{client → client-v2}/models/NodeDetailsGridModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/NodeDetailsModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/NodeValueModel.d.ts +1 -1
- package/dist/{client → client-v2}/models/TaskCardCommonItemModel.d.ts +1 -1
- package/dist/client-v2/models/WorkflowTasksTopbarActionModel.d.ts +18 -0
- package/dist/{client → client-v2}/models/index.d.ts +2 -0
- package/dist/client-v2/models/triggerWorkflows.d.ts +43 -0
- package/dist/client-v2/nodes/calculation.d.ts +38 -0
- package/dist/client-v2/nodes/collectionNode.d.ts +29 -0
- package/dist/client-v2/nodes/components/calculation.d.ts +11 -0
- package/dist/client-v2/nodes/components/collection.d.ts +15 -0
- package/dist/client-v2/nodes/components/condition.d.ts +25 -0
- package/dist/client-v2/nodes/components/conditionShared.d.ts +20 -0
- package/dist/client-v2/nodes/components/create.d.ts +12 -0
- package/dist/client-v2/nodes/components/destroy.d.ts +12 -0
- package/dist/{client/triggers/schedule/ScheduleConfig.d.ts → client-v2/nodes/components/end.d.ts} +1 -1
- package/dist/client-v2/nodes/components/filter.d.ts +17 -0
- package/dist/client-v2/nodes/components/multi-conditions.d.ts +13 -0
- package/dist/client-v2/nodes/components/multiConditionsShared.d.ts +20 -0
- package/dist/client-v2/nodes/components/output.d.ts +10 -0
- package/dist/client-v2/nodes/components/query.d.ts +12 -0
- package/dist/client-v2/nodes/components/update.d.ts +12 -0
- package/dist/client-v2/nodes/condition.d.ts +46 -0
- package/dist/client-v2/nodes/create.d.ts +30 -0
- package/dist/client-v2/nodes/destroy.d.ts +24 -0
- package/dist/client-v2/nodes/end.d.ts +21 -0
- package/dist/client-v2/nodes/multi-conditions.d.ts +34 -0
- package/dist/client-v2/nodes/output.d.ts +29 -0
- package/dist/client-v2/nodes/query.d.ts +32 -0
- package/dist/client-v2/nodes/update.d.ts +25 -0
- package/dist/client-v2/pages/ExecutionHistoryDrawer.d.ts +13 -0
- package/dist/client-v2/pages/ExecutionViewPage.d.ts +10 -0
- package/dist/client-v2/pages/WorkflowCanvasPage.d.ts +10 -0
- package/dist/client-v2/pages/WorkflowCategoryTabs.d.ts +25 -0
- package/dist/client-v2/pages/WorkflowFormDrawer.d.ts +40 -0
- package/dist/client-v2/pages/WorkflowPane.d.ts +10 -0
- package/dist/client-v2/pages/WorkflowTasksPage.d.ts +10 -0
- package/dist/client-v2/plugin.d.ts +119 -0
- package/dist/client-v2/taskCenter.d.ts +105 -0
- package/dist/client-v2/triggers/ExecuteWorkflowButton.d.ts +35 -0
- package/dist/client-v2/triggers/TriggerConfig.d.ts +22 -0
- package/dist/client-v2/triggers/TriggerExecutionButton.d.ts +13 -0
- package/dist/client-v2/triggers/collection/CollectionConfig.d.ts +14 -0
- package/dist/client-v2/triggers/collection/TriggerCollectionConfig.d.ts +11 -0
- package/dist/client-v2/triggers/collection/constants.d.ts +28 -0
- package/dist/client-v2/triggers/collection/index.d.ts +40 -0
- package/dist/client-v2/triggers/index.d.ts +63 -0
- package/dist/client-v2/triggers/schedule/EndsByField.d.ts +17 -0
- package/dist/client-v2/triggers/schedule/OnField.d.ts +20 -0
- package/dist/client-v2/triggers/schedule/RepeatField.d.ts +23 -0
- package/dist/client-v2/triggers/schedule/ScheduleConfig.d.ts +17 -0
- package/dist/client-v2/triggers/schedule/ScheduleModes.d.ts +41 -0
- package/dist/{client → client-v2}/triggers/schedule/TriggerScheduleConfig.d.ts +1 -0
- package/dist/{client → client-v2}/triggers/schedule/constants.d.ts +8 -5
- package/dist/client-v2/triggers/schedule/index.d.ts +40 -0
- package/dist/client-v2/triggers/schedule/locale/Cron.zh-CN.d.ts +11 -0
- package/dist/client-v2/utils/contextSingleton.d.ts +9 -0
- package/dist/common/collections/userWorkflowTaskStats.d.ts +54 -0
- package/dist/common/collections/userWorkflowTaskStats.js +87 -0
- package/dist/common/collections/workflows.d.ts +16 -0
- package/dist/common/collections/workflows.js +5 -0
- package/dist/common/defaultWorkflowFilter.d.ts +21 -0
- package/dist/common/defaultWorkflowFilter.js +38 -0
- package/dist/common/executionStatus.d.ts +44 -0
- package/dist/common/executionStatus.js +133 -0
- package/dist/externalVersion.js +16 -13
- package/dist/locale/de-DE.json +14 -1
- package/dist/locale/en-US.json +29 -1
- package/dist/locale/es-ES.json +14 -1
- package/dist/locale/fr-FR.json +14 -1
- package/dist/locale/hu-HU.json +14 -1
- package/dist/locale/id-ID.json +14 -1
- package/dist/locale/it-IT.json +14 -1
- package/dist/locale/ja-JP.json +14 -1
- package/dist/locale/ko-KR.json +14 -1
- package/dist/locale/nl-NL.json +14 -1
- package/dist/locale/pt-BR.json +14 -1
- package/dist/locale/ru-RU.json +14 -1
- package/dist/locale/tr-TR.json +14 -1
- package/dist/locale/uk-UA.json +14 -1
- package/dist/locale/vi-VN.json +14 -1
- package/dist/locale/zh-CN.json +28 -1
- package/dist/locale/zh-TW.json +20 -1
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/joi/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/server/Dispatcher.d.ts +24 -13
- package/dist/server/Dispatcher.js +162 -144
- package/dist/server/ExecutionTimeoutManager.js +2 -1
- package/dist/server/Plugin.d.ts +57 -11
- package/dist/server/Plugin.js +355 -15
- package/dist/server/Processor.d.ts +1 -7
- package/dist/server/Processor.js +11 -7
- package/dist/server/actions/executions.js +3 -6
- package/dist/server/actions/index.js +3 -1
- package/dist/server/actions/jobs.js +1 -2
- package/dist/server/actions/userWorkflowTaskStats.d.ts +10 -0
- package/dist/server/actions/userWorkflowTaskStats.js +112 -0
- package/dist/server/actions/workflows.d.ts +1 -0
- package/dist/server/actions/workflows.js +28 -2
- package/dist/server/collections/userWorkflowTaskStats.d.ts +11 -0
- package/dist/server/collections/userWorkflowTaskStats.js +43 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/types/Execution.d.ts +2 -0
- package/dist/server/types/Job.d.ts +5 -0
- package/dist/server/types/Workflow.d.ts +1 -0
- package/dist/server/utils.d.ts +1 -0
- package/dist/server/utils.js +5 -0
- package/dist/swagger/index.d.ts +68 -1
- package/dist/swagger/index.js +61 -1
- package/package.json +4 -2
- package/dist/client/618.c91be3f6e4d73501.js +0 -10
- package/dist/client/67.6eab22df32aca212.js +0 -10
- package/dist/client/964.5e11e1820fece37b.js +0 -10
- package/dist/client/triggers/schedule/ScheduleModes.d.ts +0 -170
- package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -42
|
@@ -6,69 +6,12 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
export default class extends Trigger {
|
|
18
|
-
sync: boolean;
|
|
19
|
-
title: string;
|
|
20
|
-
description: string;
|
|
21
|
-
presetFieldset: {
|
|
22
|
-
mode: {
|
|
23
|
-
type: string;
|
|
24
|
-
title: string;
|
|
25
|
-
name: string;
|
|
26
|
-
'x-decorator': string;
|
|
27
|
-
'x-component': string;
|
|
28
|
-
enum: {
|
|
29
|
-
value: number;
|
|
30
|
-
label: string;
|
|
31
|
-
}[];
|
|
32
|
-
required: boolean;
|
|
33
|
-
default: number;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
fieldset: {
|
|
37
|
-
config: {
|
|
38
|
-
type: string;
|
|
39
|
-
'x-component': string;
|
|
40
|
-
'x-component-props': {};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
triggerFieldset: {
|
|
44
|
-
proxy: {
|
|
45
|
-
type: string;
|
|
46
|
-
'x-component': string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
validate(config: any): any;
|
|
50
|
-
scope: {
|
|
51
|
-
useCollectionDataSource: typeof useCollectionDataSource;
|
|
52
|
-
};
|
|
53
|
-
components: {
|
|
54
|
-
ScheduleConfig: () => import("react").JSX.Element;
|
|
55
|
-
TriggerScheduleConfig: typeof TriggerScheduleConfig;
|
|
56
|
-
TriggerCollectionRecordSelect: typeof TriggerCollectionRecordSelect;
|
|
57
|
-
WorkflowVariableWrapper: typeof WorkflowVariableWrapper;
|
|
58
|
-
};
|
|
59
|
-
useVariables: typeof useVariables;
|
|
60
|
-
useInitializers(config: any): SchemaInitializerItemType | null;
|
|
61
|
-
/**
|
|
62
|
-
* 2.0
|
|
63
|
-
*/
|
|
64
|
-
getCreateModelMenuItem({ config }: {
|
|
65
|
-
config: any;
|
|
66
|
-
}): SubModelItem | null;
|
|
67
|
-
useTempAssociationSource(config: any, workflow: any): {
|
|
68
|
-
collection: any;
|
|
69
|
-
nodeId: any;
|
|
70
|
-
nodeKey: string;
|
|
71
|
-
nodeType: "workflow";
|
|
72
|
-
};
|
|
9
|
+
/**
|
|
10
|
+
* v1 schedule trigger wrapper. The canonical metadata, loaders, validation,
|
|
11
|
+
* variables, and v2 block-create hooks live in `client-v2/triggers/schedule`.
|
|
12
|
+
* The legacy Formily artifacts are deliberately dropped here, so v1 trigger
|
|
13
|
+
* surfaces fall through to the inherited v2 loaders.
|
|
14
|
+
*/
|
|
15
|
+
import V2ScheduleTrigger from '../../../client-v2/triggers/schedule';
|
|
16
|
+
export default class ScheduleTrigger extends V2ScheduleTrigger {
|
|
73
17
|
}
|
|
74
|
-
export {};
|
package/dist/client/utils.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import type { BranchContextValue } from './BranchContext';
|
|
10
|
-
export
|
|
10
|
+
export { linkNodes } from '../client-v2/canvas/nodeTree';
|
|
11
11
|
export declare function traverseSchema(schema: any, fn: any): void;
|
|
12
12
|
export declare function getWorkflowDetailPath(id: string | number): string;
|
|
13
13
|
export declare function getWorkflowExecutionsPath(id: string | number): string;
|
|
@@ -15,9 +15,9 @@ type WorkflowCapabilityContext = {
|
|
|
15
15
|
engine: {
|
|
16
16
|
isWorkflowSync(workflow: any): boolean;
|
|
17
17
|
};
|
|
18
|
-
workflow
|
|
19
|
-
upstream
|
|
20
|
-
branchIndex
|
|
18
|
+
workflow?: any;
|
|
19
|
+
upstream?: any;
|
|
20
|
+
branchIndex?: number | null;
|
|
21
21
|
syncOnly?: boolean;
|
|
22
22
|
branchContext?: Pick<BranchContextValue, 'syncOnly'> | null;
|
|
23
23
|
};
|
|
@@ -26,4 +26,3 @@ type AvailableInstruction = {
|
|
|
26
26
|
isAvailable?(ctx: WorkflowCapabilityContext): boolean;
|
|
27
27
|
};
|
|
28
28
|
export declare function getInstructionAvailable(instruction: AvailableInstruction, ctx: WorkflowCapabilityContext): string;
|
|
29
|
-
export {};
|
|
@@ -6,40 +6,11 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type VariableOption
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
label?: string | React.ReactNode;
|
|
15
|
-
children?: VariableOption[] | null;
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
};
|
|
18
|
-
export type VariableDataType = 'boolean' | 'number' | 'string' | 'date' | {
|
|
19
|
-
type: 'reference';
|
|
20
|
-
options: {
|
|
21
|
-
collection: string;
|
|
22
|
-
multiple?: boolean;
|
|
23
|
-
entity?: boolean;
|
|
24
|
-
};
|
|
25
|
-
} | ((field: any, options: {
|
|
26
|
-
collectionManager?: CollectionManager;
|
|
27
|
-
}) => boolean);
|
|
28
|
-
export type UseVariableOptions = {
|
|
29
|
-
types?: VariableDataType[];
|
|
30
|
-
fieldNames?: {
|
|
31
|
-
label?: string;
|
|
32
|
-
value?: string;
|
|
33
|
-
children?: string;
|
|
34
|
-
};
|
|
35
|
-
appends?: string[] | null;
|
|
36
|
-
depth?: number;
|
|
37
|
-
};
|
|
38
|
-
export declare const defaultFieldNames: {
|
|
39
|
-
readonly label: "label";
|
|
40
|
-
readonly value: "value";
|
|
41
|
-
readonly children: "children";
|
|
42
|
-
};
|
|
9
|
+
/// <reference types="react" />
|
|
10
|
+
export { getCollectionFieldOptions, BaseTypeSets, defaultFieldNames } from '../client-v2/canvas/collectionFieldOptions';
|
|
11
|
+
export type { VariableOption, VariableDataType, UseVariableOptions } from '../client-v2/canvas/collectionFieldOptions';
|
|
12
|
+
import { type VariableOption, type UseVariableOptions } from '../client-v2/canvas/collectionFieldOptions';
|
|
13
|
+
import { HideVariableContext, useHideVariable } from '../client-v2/components/HideVariableContext';
|
|
43
14
|
export declare const nodesOptions: {
|
|
44
15
|
label: string;
|
|
45
16
|
value: string;
|
|
@@ -62,18 +33,8 @@ export declare const systemOptions: {
|
|
|
62
33
|
value: string;
|
|
63
34
|
useOptions(options: UseVariableOptions): any;
|
|
64
35
|
};
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated
|
|
67
|
-
*/
|
|
68
|
-
export declare const BaseTypeSets: {
|
|
69
|
-
boolean: Set<string>;
|
|
70
|
-
number: Set<string>;
|
|
71
|
-
string: Set<string>;
|
|
72
|
-
date: Set<string>;
|
|
73
|
-
};
|
|
74
36
|
export declare function useWorkflowVariableOptions(options?: UseVariableOptions, preset?: VariableOption[]): VariableOption[];
|
|
75
|
-
export declare function
|
|
76
|
-
export declare function useGetDataSourceCollectionManager(dataSourceName?: any): CollectionManager;
|
|
37
|
+
export declare function useGetDataSourceCollectionManager(dataSourceName?: any): import("@nocobase/client").CollectionManager;
|
|
77
38
|
export declare function WorkflowVariableInput({ variableOptions, ...props }: {
|
|
78
39
|
[x: string]: any;
|
|
79
40
|
variableOptions: any;
|
|
@@ -94,11 +55,4 @@ export declare function WorkflowVariableJSON({ variableOptions, ...props }: {
|
|
|
94
55
|
* @experimental
|
|
95
56
|
*/
|
|
96
57
|
export declare function WorkflowVariableWrapper(props: any): JSX.Element;
|
|
97
|
-
|
|
98
|
-
* @experimental
|
|
99
|
-
*/
|
|
100
|
-
export declare const HideVariableContext: React.Context<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* @experimental
|
|
103
|
-
*/
|
|
104
|
-
export declare function useHideVariable(): boolean;
|
|
58
|
+
export { HideVariableContext, useHideVariable };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["119"],{9082:function(e,n,t){t.d(n,{ConditionCanvasComponent:function(){return b},ConditionFieldset:function(){return m},ConditionPresetFieldset:function(){return d}});var r=t(9155),a=t.n(r),o=t(2059),l=t(9651),i=t(244),u=t(2235),c=t(5980),s=t(1173),f=t(9488);function m(){var e=(0,f.kj)();return a().createElement(a().Fragment,null,a().createElement(o.Form.Item,{name:["config","rejectOnFalse"],label:e("Mode")},a().createElement(o.Radio.Group,{disabled:!0,options:[{value:!0,label:e('Continue when "Yes"')},{value:!1,label:e('Branch into "Yes" and "No"')}]})),a().createElement(s.FW,{prefix:["config"]}))}function d(){var e=(0,f.kj)();return a().createElement(o.Form.Item,{name:["config","rejectOnFalse"],label:e("Mode"),rules:[{required:!0}],initialValue:!0},a().createElement(o.Radio.Group,{options:[{value:!0,label:e('Continue when "Yes"')},{value:!1,label:e('Branch into "Yes" and "No"')}]}))}function b(e){var n,t=e.data,r=(0,f.kj)(),o=(0,c.A)().styles,s=(null!=(n=(0,u.$K)())?n:{}).nodes,m=t.id,d=t.config,b=(void 0===d?{}:d).rejectOnFalse,p=(null!=s?s:[]).find(function(e){return e.upstreamId===m&&1===e.branchIndex}),v=(null!=s?s:[]).find(function(e){return e.upstreamId===m&&0===e.branchIndex});return a().createElement(i.z,{data:t},b?null:a().createElement("div",{className:o.nodeSubtreeClass},a().createElement("div",{className:o.branchBlockClass},a().createElement(l.l,{from:t,entry:v,branchIndex:0}),a().createElement(l.l,{from:t,entry:p,branchIndex:1})),a().createElement("div",{className:o.conditionClass},a().createElement("span",{style:{right:"4em"}},r("No")),a().createElement("span",{style:{left:"4em"}},r("Yes")))))}},1173:function(e,n,t){t.d(n,{FW:function(){return g}});var r=t(9155),a=t.n(r),o=t(8275),l=t(2059),i=t(5606),u=t(3440),c=t(9785),s=t(3210),f=t(9488);function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function d(e,n,t,r,a,o,l){try{var i=e[o](l),u=i.value}catch(e){t(e);return}i.done?n(u):Promise.resolve(u).then(r,a)}function b(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw r}}return o}}(e,n)||v(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,n){if(e){if("string"==typeof e)return m(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,n)}}var y="basic";function h(e,n){return p(e).concat([n])}function g(e){var n,t,r,m=e.prefix,v=e.calculationLabel,g=e.expressionLabel,E=e.expressionItemProps,w=(0,f.kj)(),j=(n=(0,f.kj)(),t=Array.from(o.evaluators.getEntities()).filter(function(e){return["math.js","formula.js"].includes(b(e,1)[0])}).map(function(e){var n=b(e,2),t=n[0],r=n[1];return{value:t,label:r.label,tooltip:r.tooltip}}),[{value:y,label:n("Basic")}].concat(p(t))),I=null!=(r=l.Form.useWatch(h(m,"engine")))?r:y;return a().createElement(a().Fragment,null,a().createElement(l.Form.Item,{name:h(m,"engine"),label:w("Calculation engine"),rules:[{required:!0}],initialValue:y},a().createElement(c.$,{options:j})),a().createElement(l.Form.Item,{name:h(m,"calculation"),label:null!=v?v:w("Condition"),hidden:I!==y,dependencies:[h(m,"engine")],rules:[{required:I===y}]},a().createElement(u.S_,null)),a().createElement(l.Form.Item,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({name:h(m,"expression"),label:null!=g?g:w("Condition expression"),hidden:I===y,dependencies:[h(m,"engine")],validateTrigger:["onChange","onBlur"],rules:[{required:I!==y},{validator:function(e,n){var t;return(t=function(){var e,t;return function(e,n){var t,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(t)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(t=1,r&&(a=2&c[0]?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=n.call(e,o)}catch(e){c=[6,e],r=0}finally{t=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(r){if(I===y||!n||!(e=o.evaluators.get(I)))return[2];t=String(n).trim().replace(/{{([^{}]+)}}/g,' "1" ');try{e.evaluate(t)}catch(e){throw Error(w("Expression syntax error"))}return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function l(e){d(o,r,a,l,i,"next",e)}function i(e){d(o,r,a,l,i,"throw",e)}l(void 0)})})()}}],extra:I===y?void 0:(0,s.s)(I,w)},E),a().createElement(i.M,null)))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["142"],{5329:function(e,n,t){t.d(n,{F:function(){return u}});var l=t(9155),r=t.n(l),o=t(2059),a=t(7806),i=t(9488);function c(e){var n=e.value,t=e.onChange,o=e.disabled,i=e.onCollectionChanged,c=(0,l.useRef)();return r().createElement(a.XJ,{value:n,disabled:o,onChange:function(e){var l,r=null!=(l=c.current)?l:n;null==t||t(e),r&&r!==e&&(null==i||i(r,e)),c.current=e}})}function u(e){var n=e.disabled,t=e.onCollectionChanged,l=(0,i.kj)();return r().createElement(o.Form.Item,{name:["config","collection"],label:l("Collection"),rules:[{required:!0}]},r().createElement(c,{disabled:n,onCollectionChanged:t}))}},6855:function(e,n,t){t.d(n,{F:function(){return f}});var l=t(9155),r=t.n(l),o=t(2059),a=t(7768),i=t(1801),c=t(2235),u=t(9488);function s(e,n,t,l,r,o,a){try{var i=e[o](a),c=i.value}catch(e){t(e);return}i.done?n(c):Promise.resolve(c).then(l,r)}function f(e){var n,t=e.collection,l=e.label,f=e.name,m=e.required,d=e.maxAssociationFieldDepth,p=(0,u.kj)(),h=(0,c.Zt)(),v=!!(null==h||null==(n=h.versionStats)?void 0:n.executed);return r().createElement(o.Form.Item,{name:void 0===f?["config","params","filter"]:f,label:null!=l?l:p("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===m||m?[{validator:function(e,n){var t;return(t=function(){return function(e,n){var t,l,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(t=1,l&&(r=2&u[0]?l.return:u[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,u[1])).done)return r;switch(l=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,l=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(r=(r=o.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){o.label=u[1];break}if(6===u[0]&&o.label<r[1]){o.label=r[1],r=u;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(u);break}r[2]&&o.ops.pop(),o.trys.pop();continue}u=n.call(e,o)}catch(e){u=[6,e],l=0}finally{t=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){if(!(0,a.isValidFilter)(n))throw Error(p("Please add at least one condition"));return[2]})},function(){var e=this,n=arguments;return new Promise(function(l,r){var o=t.apply(e,n);function a(e){s(o,l,r,a,i,"next",e)}function i(e){s(o,l,r,a,i,"throw",e)}a(void 0)})})()}}]:void 0},r().createElement(i.N$,{collection:t,disabled:v,maxAssociationFieldDepth:void 0===d?2:d}))}},693:function(e,n,t){t.d(n,{QueryFieldset:function(){return d},QueryPresetFieldset:function(){return p}});var l=t(9155),r=t.n(l),o=t(2059),a=t(2235),i=t(7806),c=t(9785),u=t(9488),s=t(5329),f=t(6855);function m(){var e=(0,u.kj)(),n=o.Form.useWatch(["config","collection"]);return n?r().createElement(r().Fragment,null,r().createElement(f.F,{collection:n,required:!1}),r().createElement(o.Form.Item,{name:["config","params","sort"],label:e("Sort")},r().createElement(i.o5,{collection:n})),r().createElement(i.uc,{pageName:["config","params","page"],pageSizeName:["config","params","pageSize"]}),r().createElement(o.Form.Item,{name:["config","params","appends"],label:e("Preload associations"),extra:e("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.")},r().createElement(i.Kr,{collection:n}))):null}function d(){var e,n,t=(0,u.kj)(),i=(0,a.TA)(),f=o.Form.useFormInstance(),d=[{label:(e=(0,u.kj)())("Single record"),value:!1,tooltip:e("The result will be an object of the first matching record only, or null if no matched record.")},{label:e("Multiple records"),value:!0,tooltip:e("The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.")}];return(0,l.useEffect)(function(){void 0===f.getFieldValue(["config","multiple"])&&f.setFieldValue(["config","multiple"],!1)},[f]),r().createElement(r().Fragment,null,r().createElement(s.F,{disabled:!!(null==i||null==(n=i.config)?void 0:n.collection),onCollectionChanged:function(){f.setFieldValue(["config","params"],{})}}),r().createElement(o.Form.Item,{name:["config","multiple"],label:t("Result type")},r().createElement(c.$,{options:d})),r().createElement(m,null),r().createElement(o.Form.Item,{name:["config","failOnEmpty"],valuePropName:"checked"},r().createElement(o.Checkbox,null,t("Exit when query result is null"))))}function p(){return r().createElement(s.F,null)}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["159"],{2066:function(e,r,n){n.d(r,{CalculationFieldset:function(){return p}});var t=n(9155),o=n.n(t),a=n(2059),l=n(8275),i=n(9785),u=n(3210),c=n(5606),s=n(9488);function f(e,r,n,t,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?r(u):Promise.resolve(u).then(t,o)}function p(){var e,r=(0,s.kj)(),n=null!=(e=a.Form.useWatch(["config","engine"]))?e:"formula.js";return o().createElement(o().Fragment,null,o().createElement(a.Form.Item,{name:["config","engine"],label:r("Calculation engine"),rules:[{required:!0}],initialValue:"formula.js"},o().createElement(i.$,{options:(0,l.getOptions)()})),o().createElement(a.Form.Item,{name:["config","expression"],label:r("Calculation expression"),dependencies:[["config","engine"]],validateTrigger:["onChange","onBlur"],rules:[{required:!0},{validator:function(e,t){var o;return(o=function(){var e,o;return function(e,r){var n,t,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,t&&(o=2&c[0]?t.return:c[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,c[1])).done)return o;switch(t=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,t=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],t=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){if(!t||!(e=l.evaluators.get(n)))return[2];o=String(t).trim().replace(/{{([^{}]+)}}/g,' "1" ');try{e.evaluate(o)}catch(e){throw Error(r("Expression syntax error"))}return[2]})},function(){var e=this,r=arguments;return new Promise(function(n,t){var a=o.apply(e,r);function l(e){f(a,n,t,l,i,"next",e)}function i(e){f(a,n,t,l,i,"throw",e)}l(void 0)})})()}}],extra:(0,u.s)(n,r)},o().createElement(c.M,null)))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["276"],{5329:function(e,n,t){t.d(n,{F:function(){return c}});var r=t(9155),o=t.n(r),l=t(2059),a=t(7806),i=t(9488);function u(e){var n=e.value,t=e.onChange,l=e.disabled,i=e.onCollectionChanged,u=(0,r.useRef)();return o().createElement(a.XJ,{value:n,disabled:l,onChange:function(e){var r,o=null!=(r=u.current)?r:n;null==t||t(e),o&&o!==e&&(null==i||i(o,e)),u.current=e}})}function c(e){var n=e.disabled,t=e.onCollectionChanged,r=(0,i.kj)();return o().createElement(l.Form.Item,{name:["config","collection"],label:r("Collection"),rules:[{required:!0}]},o().createElement(u,{disabled:n,onCollectionChanged:t}))}},9671:function(e,n,t){t.d(n,{DestroyFieldset:function(){return s},DestroyPresetFieldset:function(){return f}});var r=t(9155),o=t.n(r),l=t(2059),a=t(2235),i=t(5329),u=t(6855);function c(){var e=l.Form.useWatch(["config","collection"]);return e?o().createElement(u.F,{collection:e}):null}function s(){var e,n=(0,a.TA)(),t=l.Form.useFormInstance();return o().createElement(o().Fragment,null,o().createElement(i.F,{disabled:!!(null==n||null==(e=n.config)?void 0:e.collection),onCollectionChanged:function(){t.setFieldValue(["config","params","filter"],{})}}),o().createElement(c,null))}function f(){return o().createElement(i.F,null)}},6855:function(e,n,t){t.d(n,{F:function(){return f}});var r=t(9155),o=t.n(r),l=t(2059),a=t(7768),i=t(1801),u=t(2235),c=t(9488);function s(e,n,t,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){t(e);return}i.done?n(u):Promise.resolve(u).then(r,o)}function f(e){var n,t=e.collection,r=e.label,f=e.name,d=e.required,v=e.maxAssociationFieldDepth,b=(0,c.kj)(),h=(0,u.Zt)(),p=!!(null==h||null==(n=h.versionStats)?void 0:n.executed);return o().createElement(l.Form.Item,{name:void 0===f?["config","params","filter"]:f,label:null!=r?r:b("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===d||d?[{validator:function(e,n){var t;return(t=function(){return function(e,n){var t,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=n.call(e,l)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){if(!(0,a.isValidFilter)(n))throw Error(b("Please add at least one condition"));return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var l=t.apply(e,n);function a(e){s(l,r,o,a,i,"next",e)}function i(e){s(l,r,o,a,i,"throw",e)}a(void 0)})})()}}]:void 0},o().createElement(i.N$,{collection:t,disabled:p,maxAssociationFieldDepth:void 0===v?2:v}))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["326"],{5927:function(e,t,n){n.d(t,{t:function(){return i}});var r=n(2059),o=n(9155),a=n.n(o),l=n(9488);function i(e){var t=e.value,n=(0,l.ec)().t;return t?a().createElement(r.Tag,{color:"orange"},n("Synchronously")):a().createElement(r.Tag,{color:"cyan"},n("Asynchronously"))}},4315:function(e,t,n){n.d(t,{S:function(){return I}});var r,o=n(7375),a=n(3485),l=n(7694),i=n(2625),c=n(2059),u=n(9185),s=n.n(u),p=n(9155),d=n.n(p),m=n(358),f={dumpRules:{group:"log"},migrationRules:["schema-only"],name:"executions",dataCategory:"business",shared:!0,fields:[{type:"snowflakeId",name:"id",interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"Input","x-component-props":{},"x-read-pretty":!0},primaryKey:!0,allowNull:!1},{type:"bigInt",name:"workflowId",interface:"id",uiSchema:{type:"number",title:'{{t("Version ID", { ns: "'.concat(m.C,'" })}}'),"x-component":"InputNumber","x-component-props":{},"x-read-pretty":!0}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",interface:"m2o",uiSchema:{type:"object",title:'{{t("Version", { ns: "'.concat(m.C,'" })}}'),"x-component":"AssociationField","x-component-props":{fieldNames:{label:"id",value:"id"}},"x-read-pretty":!0}},{type:"string",name:"key"},{type:"string",name:"eventKey",unique:!0},{type:"hasMany",name:"jobs",onDelete:"CASCADE"},{type:"json",name:"context"},{type:"integer",name:"status",interface:"select",uiSchema:{title:'{{t("Status", { ns: "'.concat(m.C,'" })}}'),type:"string","x-component":"Select","x-decorator":"FormItem",enum:"{{ExecutionStatusOptions}}"}},{type:"string",name:"reason",uiSchema:{title:'{{t("Reason", { ns: "'.concat(m.C,'" })}}'),type:"string","x-component":"Select","x-decorator":"FormItem",enum:"{{ExecutionReasonOptions}}"}},{type:"boolean",name:"dispatched",defaultValue:!1},{type:"bigInt",name:"parentExecutionId",interface:"id",uiSchema:{type:"number",title:'{{t("Parent execution ID", { ns: "'.concat(m.C,'" })}}'),"x-component":"InputNumber","x-component-props":{},"x-read-pretty":!0}},{type:"json",name:"stack"},{type:"json",name:"output"},{type:"datetime",name:"startedAt",uiSchema:{type:"datetime",title:'{{t("Started at", { ns: "'.concat(m.C,'" })}}'),"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"datetime",name:"expiresAt",uiSchema:{type:"datetime",title:'{{t("Expires at", { ns: "'.concat(m.C,'" })}}'),"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"datetime",name:"createdAt",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Triggered at", { ns: "'.concat(m.C,'" })}}'),"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"boolean",name:"manually",interface:"checkbox",uiSchema:{type:"boolean",title:'{{t("Triggered manually", { ns: "'.concat(m.C,'" })}}'),"x-component":"Checkbox","x-component-props":{},"x-read-pretty":!0}}],indexes:[{fields:["dispatched","id"]},{fields:["status","expiresAt"]},{fields:["parentExecutionId","status"]}]},y=n(9239),b=n(9488);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=(h(r={},y.GO.QUEUEING,d().createElement(o.HourglassOutlined,null)),h(r,y.GO.STARTED,d().createElement(o.LoadingOutlined,null)),h(r,y.GO.RESOLVED,d().createElement(o.CheckOutlined,null)),h(r,y.GO.FAILED,d().createElement(o.ExclamationOutlined,null)),h(r,y.GO.ERROR,d().createElement(o.CloseOutlined,null)),h(r,y.GO.ABORTED,d().createElement(o.MinusOutlined,{rotate:90})),h(r,y.GO.CANCELED,d().createElement(o.MinusOutlined,{rotate:45})),h(r,y.GO.REJECTED,d().createElement(o.MinusOutlined,null)),h(r,y.GO.RETRY_NEEDED,d().createElement(o.RedoOutlined,null)),r);function E(e){var t=e.value,n=(0,b.kj)(),r=y.m2[t];if(!r)return null;var o=g[t];return d().createElement(c.Tag,{color:r.color,icon:o},n(r.label))}var v=n(7001);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t,n,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function O(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){x(a,r,o,l,i,"next",e)}function i(e){x(a,r,o,l,i,"throw",e)}l(void 0)})}}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var A=["workflow"];function j(e){var t=e.workflowKey,n=(0,b.ec)().t,r=(0,b.kj)(),u=(0,l.useFlowContext)(),m=(0,l.useFlowEngine)(),f=(0,v.TD)().getWorkflowExecutionPath,h=c.theme.useToken().token,g=c.App.useApp(),w=g.modal,x=g.message,k=u.api.resource("executions"),S=(0,p.useMemo)(function(){var e,t,n,r;return null==(r=m.context.dataSourceManager)||null==(n=r.getDataSource)||null==(t=n.call(r,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"executions")},[m]),j=C((0,p.useState)(1),2),I=j[0],T=j[1],P=C((0,p.useState)(20),2),R=P[0],M=P[1],F=C((0,p.useState)(void 0),2),G=F[0],_=F[1],z=C((0,p.useState)([]),2),N=z[0],B=z[1],K=(0,i.useMemoizedFn)(function(e){_(e),T(1)}),V=(0,i.useRequest)(function(){return O(function(){var e;return D(this,function(n){switch(n.label){case 0:return e=G?{$and:[{key:t},G]}:{key:t},[4,k.list({page:I,pageSize:R,sort:["-id"],except:["context","output","stack"],filter:e})];case 1:var r,o,a,l,i;return[2,{records:l=Array.isArray(a=null==(o=null==(r=n.sent())?void 0:r.data)?void 0:o.data)?a:Array.isArray(null==a?void 0:a.data)?a.data:[],total:(i=(null==o?void 0:o.meta)||(null==a?void 0:a.meta)||{}).count||i.total||l.length}]}})})()},{refreshDeps:[I,R,G,t]}),U=V.data,Y=V.loading,L=V.refresh,H=(0,i.useMemoizedFn)(function(e,t){if(t!==R){M(t),T(1);return}T(e)}),q=(0,i.useMemoizedFn)(function(e){w.confirm({title:n("Delete record"),content:n("Are you sure you want to delete it?"),onOk:function(){return O(function(){return D(this,function(t){switch(t.label){case 0:return[4,k.destroy({filterByTk:e})];case 1:return t.sent(),B([]),L(),[2]}})})()}})}),Q=(0,i.useMemoizedFn)(function(){w.confirm({title:n("Clear all executions"),content:n("Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?"),onOk:function(){return O(function(){return D(this,function(e){switch(e.label){case 0:return[4,k.destroy({filter:{key:t}})];case 1:return e.sent(),x.success(n("Operation succeeded")),B([]),L(),[2]}})})()}})}),$=(0,i.useMemoizedFn)(function(e){w.confirm({title:n("Cancel the execution"),icon:d().createElement(o.ExclamationCircleFilled,null),content:n("Are you sure you want to cancel the execution?"),onOk:function(){return O(function(){return D(this,function(t){switch(t.label){case 0:return[4,k.cancel({filterByTk:e.id})];case 1:return t.sent(),x.success(n("Operation succeeded")),L(),[2]}})})()}})}),J=(0,i.useMemoizedFn)(function(e){var t,n;null==(n=u.view)||null==(t=n.close)||t.call(n),u.router.navigate(f(e.id))}),W=(0,p.useMemo)(function(){return[{title:n("ID"),dataIndex:"id"},{title:n("Triggered at"),dataIndex:"createdAt",render:function(e){return e?s()(e).format("YYYY-MM-DD HH:mm:ss"):null}},{title:n("Version"),dataIndex:"workflowId",render:function(e){return null!=e?"#".concat(e):null}},{title:n("Status"),dataIndex:"status",render:function(e,t){return d().createElement(c.Space,null,d().createElement(E,{value:e}),t.status===y.GO.STARTED||t.status===y.GO.QUEUEING?d().createElement(c.Tooltip,{title:n("Cancel the execution")},d().createElement(c.Button,{type:"link",danger:!0,onClick:function(){return $(t)},shape:"circle",size:"small",icon:d().createElement(o.StopOutlined,null)})):null)}},{title:n("Actions"),width:160,render:function(e,t){return d().createElement(c.Space,{size:"middle",wrap:!1,style:{whiteSpace:"nowrap"}},d().createElement("a",{onClick:function(){return J(t)}},n("View")),t.status!==y.GO.STARTED?d().createElement("a",{onClick:function(){return q(t.id)}},n("Delete")):null)}}]},[$,q,J,n]);return d().createElement("div",null,d().createElement(c.Flex,{justify:"space-between",align:"center",style:{marginBottom:h.margin}},d().createElement(a.CollectionFilter,{collection:S,nonfilterableFieldNames:A,onChange:K,t:r}),d().createElement(c.Space,null,d().createElement(c.Button,{icon:d().createElement(o.ReloadOutlined,null),onClick:function(){return L()}},n("Refresh")),d().createElement(c.Button,{icon:d().createElement(o.DeleteOutlined,null),disabled:!N.length,onClick:function(){return q(N)}},n("Delete")),d().createElement(c.Button,{danger:!0,onClick:Q},n("Clear")))),d().createElement(a.Table,{rowKey:"id",loading:Y,columns:W,dataSource:(null==U?void 0:U.records)||[],rowSelection:{selectedRowKeys:N,onChange:B},pagination:{current:I,pageSize:R,total:(null==U?void 0:U.total)||0,onChange:H}}))}function I(e){var t=e.workflowKey,n=(0,b.kj)(),r=(0,p.useMemo)(function(){var e=y.hi.map(function(e){return{value:e.value,label:n(e.label)}});return[S(k({},f),{fields:f.fields.map(function(t){return(null==t?void 0:t.name)==="status"&&t.uiSchema?S(k({},t),{uiSchema:S(k({},t.uiSchema),{enum:e})}):t})})]},[n]);return d().createElement(a.ExtendCollectionsProvider,{collections:r},d().createElement(j,{workflowKey:t}))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["346"],{3253:function(e,n,t){var r=t(9168),o=t.n(r),a=t(8433),i=t.n(a)()(o());i.push([e.id,".react-js-cron {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n.react-js-cron > div,\n.react-js-cron-field {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.react-js-cron-field {\n margin-bottom: 10px;\n}\n.react-js-cron-field > span {\n margin-left: 5px;\n}\ndiv.react-js-cron-select {\n margin-left: 5px;\n}\n.react-js-cron-select.react-js-cron-select-no-prefix {\n margin-left: 0;\n}\ndiv.react-js-cron-error .react-js-cron-select .ant-select-selector {\n border-color: #ff4d4f;\n background: #fff6f6;\n}\ndiv.react-js-cron-custom-select {\n min-width: 70px;\n z-index: 1;\n}\ndiv.react-js-cron-error div.react-js-cron-custom-select {\n background: #fff6f6;\n}\ndiv.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector {\n padding-left: 11px;\n padding-right: 30px;\n}\n.react-js-cron-read-only\n div.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector {\n padding-right: 11px;\n}\ndiv.react-js-cron-custom-select .ant-select-selection-search {\n width: 0 !important;\n margin: 0 !important;\n}\ndiv.react-js-cron-custom-select .ant-select-selection-placeholder {\n position: static;\n top: 50%;\n right: auto;\n left: auto;\n transform: none;\n transition: none;\n opacity: 1;\n color: inherit;\n}\n.react-js-cron-week-days-placeholder\n .react-js-cron-custom-select\n .ant-select-selection-placeholder,\n.react-js-cron-month-days-placeholder\n .react-js-cron-custom-select\n .ant-select-selection-placeholder {\n opacity: 0.4;\n}\n.react-js-cron-custom-select-dropdown {\n min-width: 0 !important;\n width: 170px !important;\n}\n.react-js-cron-custom-select-dropdown .rc-virtual-list {\n max-height: none !important;\n}\n.react-js-cron-custom-select-dropdown-grid .rc-virtual-list-holder-inner {\n display: grid !important;\n grid-template-columns: repeat(4, 1fr);\n}\n.react-js-cron-custom-select-dropdown-grid\n .rc-virtual-list-holder-inner\n .ant-select-item-option-content {\n text-align: center;\n}\n.react-js-cron-custom-select-dropdown-hours-twelve-hour-clock {\n width: 260px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-large {\n width: 300px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-large\n .rc-virtual-list-holder-inner {\n grid-template-columns: repeat(7, 1fr);\n}\n.react-js-cron-custom-select-dropdown-minutes-medium {\n width: 215px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-medium\n .rc-virtual-list-holder-inner {\n grid-template-columns: repeat(5, 1fr);\n}\n.react-js-cron-period > span:first-child {\n margin-left: 0 !important;\n}\n.react-js-cron-period\n .react-js-cron-select.ant-select-single.ant-select-open\n .ant-select-selection-item {\n opacity: 1;\n}\n.react-js-cron-select-dropdown-period {\n min-width: 0 !important;\n width: auto !important;\n}\n.react-js-cron-clear-button {\n margin-left: 10px;\n margin-bottom: 10px;\n}\n.react-js-cron-disabled .react-js-cron-select.ant-select-disabled {\n background: #f5f5f5;\n}\ndiv.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector\n > .ant-select-selection-overflow {\n align-items: center;\n flex: initial;\n}\n",""]),n.A=i},8433:function(e){e.exports=function(e){var n=[];return n.toString=function(){return this.map(function(n){var t="",r=void 0!==n[5];return n[4]&&(t+="@supports (".concat(n[4],") {")),n[2]&&(t+="@media ".concat(n[2]," {")),r&&(t+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),t+=e(n),r&&(t+="}"),n[2]&&(t+="}"),n[4]&&(t+="}"),t}).join("")},n.i=function(e,t,r,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var c=0;c<this.length;c++){var l=this[c][0];null!=l&&(i[l]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);r&&i[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),t&&(u[2]&&(u[1]="@media ".concat(u[2]," {").concat(u[1],"}")),u[2]=t),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),n.push(u))}},n}},9168:function(e){e.exports=function(e){return e[1]}},2837:function(e,n,t){t.d(n,{l4:function(){return F}});var r=t(2295),o=t(2059),a=t(9155),i=function(){return(i=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function c(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function l(e,n,t){if(t||2==arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var s=[{name:"@yearly",value:"0 0 1 1 *"},{name:"@annually",value:"0 0 1 1 *"},{name:"@monthly",value:"0 0 1 * *"},{name:"@weekly",value:"0 0 * * 0"},{name:"@daily",value:"0 0 * * *"},{name:"@midnight",value:"0 0 * * *"},{name:"@hourly",value:"0 * * * *"}],u=[{type:"minutes",min:0,max:59,total:60},{type:"hours",min:0,max:23,total:24},{type:"month-days",min:1,max:31,total:31},{type:"months",min:1,max:12,total:12,alt:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},{type:"week-days",min:0,max:6,total:7,alt:["SUN","MON","TUE","WED","THU","FRI","SAT"]}],d={everyText:"every",emptyMonths:"every month",emptyMonthDays:"every day of the month",emptyMonthDaysShort:"day of the month",emptyWeekDays:"every day of the week",emptyWeekDaysShort:"day of the week",emptyHours:"every hour",emptyMinutes:"every minute",emptyMinutesForHourPeriod:"every",yearOption:"year",monthOption:"month",weekOption:"week",dayOption:"day",hourOption:"hour",minuteOption:"minute",rebootOption:"reboot",prefixPeriod:"Every",prefixMonths:"in",prefixMonthDays:"on",prefixWeekDays:"on",prefixWeekDaysForMonthAndYearPeriod:"and",prefixHours:"at",prefixMinutes:":",prefixMinutesForHourPeriod:"at",suffixMinutesForHourPeriod:"minute(s)",errorInvalidCron:"Invalid cron expression",clearButtonText:"Clear",weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],altWeekDays:["SUN","MON","TUE","WED","THU","FRI","SAT"],altMonths:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]};function p(e,n){for(var t=[],r=e;r<=n;r++)t.push(r);return t}function m(e){return e.sort(function(e,n){return e-n}),e}function f(e){var n=[];return e.forEach(function(e){0>n.indexOf(e)&&n.push(e)}),n}function h(e){return Object.entries(e).filter(function(e){var n=e[0],t=e[1];return n&&t}).map(function(e){return e[0]}).join(" ")}function y(e,n){e&&e({type:"invalid_cron",description:n.errorInvalidCron||d.errorInvalidCron})}function v(e){var n=parseInt(e,10),t=Number(e);return n===t?t:NaN}function g(e,n,t,r,o,a,i,c,l,d,h,g,b,x){t&&t(void 0),n(!1);var j=!1;if(!e){if("always"===r||a&&"for-default-value"===r)return;j=!0}if(!j){if(c&&(!0===c||c.includes(e))){if("@reboot"===e)return void x("reboot");var w=s.find(function(n){return n.name===e});w&&(e=w.value)}try{var M=function(e){if("string"!=typeof e)throw Error("Invalid cron string");var n=e.replace(/\s+/g," ").trim().split(" ");if(5===n.length)return n.map(function(e,n){var t=u[n];if("*"===e||"*/1"===e)return[];var r=m(f(k((function(e,n,t){if(t){e=e.toUpperCase();for(var r=0;r<t.length;r++)e=e.replace(t[r],"".concat(r+n))}return e})(e,t.min,t.alt).split(",").map(function(n){var r,o=n.split("/");if(o.length>2)throw Error('Invalid value "'.concat(e,' for "').concat(t.type,'"'));var a=o[0],i=o[1];r="*"===a?p(t.min,t.max):function(e,n,t){var r=e.split("-");if(1===r.length){var o=v(r[0]);if(isNaN(o))throw Error('Invalid value "'.concat(n,'" for ').concat(t.type));return[o]}if(2===r.length){var a=v(r[0]),i=v(r[1]);if(isNaN(a)||isNaN(i))throw Error('Invalid value "'.concat(n,'" for ').concat(t.type));if(i<a)throw Error('Max range is less than min range in "'.concat(e,'" for ').concat(t.type));return p(a,i)}throw Error('Invalid value "'.concat(e,'" for ').concat(t.type))}(a,e,t);var c=function(e,n){if(void 0!==e){var t=v(e);if(isNaN(t)||t<1)throw Error('Invalid interval step value "'.concat(e,'" for ').concat(n.type));return t}}(i,t),l=r,s=c;if(s){var u=l[0];l=l.filter(function(e){return e%s==u%s||e===u})}return l}).flat(),t))),o=O(r,t);if(void 0!==o)throw Error('Value "'.concat(o,'" out of range for ').concat(t.type));return r.length===t.total?[]:r});throw Error("Invalid cron string format")}(e),N=M[3].length>0?"year":M[2].length>0?"month":M[4].length>0?"week":M[1].length>0?"day":M[0].length>0?"hour":"minute";x(N),l(M[0]),d(M[1]),h(M[2]),g(M[3]),b(M[4])}catch(e){j=!0}}j&&(o.current=e,n(!0),y(t,i))}function b(e,n,t,r,o,a,i){return"reboot"===e?"@reboot":["minute"!==e&&a?a:[],"minute"!==e&&"hour"!==e&&o?o:[],("year"===e||"month"===e)&&t?t:[],"year"===e&&n?n:[],("year"===e||"month"===e||"week"===e)&&r?r:[]].map(function(e,n){var t=u[n];return x(w(e,t),t,i)}).join(" ")}function x(e,n,t,r,o){var a="";if(e.length===n.max-n.min+1||0===e.length)a="*";else{var i,c,l,s,u,d=function(e){if(e.length>2){var n=e[1]-e[0];if(n>1)return n}}(e);a=d&&function(e,n){for(var t=1;t<e.length;t++){var r=e[t-1];if(e[t]-r!==n)return!1}return!0}(e,d)?(i=e[0],c=M(e),l=e.length===(c-i)/d+1,i===n.min&&c+d>n.max&&l||0)?"*/".concat(d):"".concat(j(e[0],n,t,r,o),"-").concat(j(M(e),n,t,r,o),"/").concat(d):(s=[],u=null,e.forEach(function(e,n,t){e!==t[n+1]-1?null!==u?(s.push([u,e]),u=null):s.push(e):null===u&&(u=e)}),s).map(function(e){return Array.isArray(e)?"".concat(j(e[0],n,t,r,o),"-").concat(j(e[1],n,t,r,o)):j(e,n,t,r,o)}).join(",")}return a}function j(e,n,t,r,o){var a=e.toString(),i=n.type,c=n.alt,l=n.min,s=r&&(!0===r||r.includes(i)),u="24-hour-clock"===o&&("hours"===i||"minutes"===i);if(t&&"week-days"===i||t&&"months"===i?a=c[e-l]:e<10&&(s||u)&&(a=a.padStart(2,"0")),"hours"===i&&"12-hour-clock"===o){var d=e>=12?"PM":"AM",p=e%12||12;p<10&&s&&(p=p.toString().padStart(2,"0")),a="".concat(p).concat(d)}return a}function w(e,n){var t=m(f(k(e,n)));if(0===t.length)return t;var r=O(t,n);if(void 0!==r)throw Error('Value "'.concat(r,'" out of range for ').concat(n.type));return t}function k(e,n){return"week-days"===n.type&&(e=e.map(function(e){return 7===e?0:e})),e}function O(e,n){var t=e[0],r=e[e.length-1];return t<n.min?t:r>n.max?r:void 0}function M(e){return e[e.length-1]}function N(e){var n=e.value,t=e.grid,s=void 0===t||t,u=e.optionsList,p=e.setValue,f=e.locale,y=e.className,v=e.humanizeLabels,g=e.disabled,b=e.readOnly,k=e.leadingZero,O=e.clockFormat,M=e.period,N=e.unit,D=e.periodicityOnDoubleClick,S=e.mode,C=c(e,["value","grid","optionsList","setValue","locale","className","humanizeLabels","disabled","readOnly","leadingZero","clockFormat","period","unit","periodicityOnDoubleClick","mode"]),A=(0,a.useMemo)(function(){if(n&&Array.isArray(n))return n.map(function(e){return e.toString()})},[n]),E=(0,a.useMemo)(function(){return u?u.map(function(e,n){return{value:(0===N.min?n:n+1).toString(),label:e}}):l([],Array(N.total),!0).map(function(e,n){var t=0===N.min?n:n+1;return{value:t.toString(),label:j(t,N,v,k,O)}})},[u,k,v,O]),P=JSON.stringify(f),F=(0,a.useCallback)(function(e){var t=e.value;if(!n||n[0]!==Number(t))return(0,r.jsx)(r.Fragment,{});var o=x(w(n,N),N,v,k,O),a=o.match(/^\*\/([0-9]+),?/)||[];return(0,r.jsx)("div",{children:a[1]?"".concat(f.everyText||d.everyText," ").concat(a[1]):o})},[n,P,v,k,O]),T=(0,a.useCallback)(function(e){var t=Array.isArray(e)?m(e):[e],r=t;n&&(r="single"===S?[]:l([],n,!0),t.forEach(function(e){var t=Number(e);r=n.some(function(e){return e===t})?r.filter(function(e){return e!==t}):m(l(l([],r,!0),[t],!1))})),r.length===N.total?p([]):p(r)},[p,n]),_=(0,a.useCallback)(function(e){if(0!==e&&1!==e){for(var t=N.total+N.min,r=[],o=N.min;o<t;o++)o%e==0&&r.push(o);var a=n&&r&&n.length===r.length&&n.every(function(e,n){return e===r[n]});p(r.length===E.length||a?[]:r)}else p([])},[n,E,p]),V=(0,a.useRef)([]),I=(0,a.useCallback)(function(e){if(!b){var n=V.current;n.push({time:(new Date).getTime(),value:Number(e)});var t=window.setTimeout(function(){D&&n.length>1&&n[n.length-1].time-n[n.length-2].time<300?n[n.length-1].value===n[n.length-2].value?_(Number(e)):T([n[n.length-2].value,n[n.length-1].value]):T(Number(e)),V.current=[]},300);return function(){window.clearTimeout(t)}}},[V,T,_,b,D]),H=(0,a.useCallback)(function(){b||p([])},[p,b]),W=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select":!0,"react-js-cron-custom-select":!0})["".concat(y,"-select")]=!!y,e))},[y]),L=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select-dropdown":!0})["react-js-cron-select-dropdown-".concat(N.type)]=!0,e["react-js-cron-custom-select-dropdown"]=!0,e["react-js-cron-custom-select-dropdown-".concat(N.type)]=!0,e["react-js-cron-custom-select-dropdown-minutes-large"]="minutes"===N.type&&"hour"!==M&&"day"!==M,e["react-js-cron-custom-select-dropdown-minutes-medium"]="minutes"===N.type&&("day"===M||"hour"===M),e["react-js-cron-custom-select-dropdown-hours-twelve-hour-clock"]="hours"===N.type&&"12-hour-clock"===O,e["react-js-cron-custom-select-dropdown-grid"]=!!s,e["".concat(y,"-select-dropdown")]=!!y,e["".concat(y,"-select-dropdown-").concat(N.type)]=!!y,e))},[y,s,O,M]);return(0,r.jsx)(o.Select,i({mode:"single"!==S||D?"multiple":void 0,allowClear:!b,virtual:!1,open:!b&&void 0,value:A,onClear:H,tagRender:F,className:W,popupClassName:L,options:E,showSearch:!1,showArrow:!b,menuItemSelectedIcon:null,dropdownMatchSelectWidth:!1,onSelect:I,onDeselect:I,disabled:g,dropdownAlign:"minutes"!==N.type&&"hours"!==N.type||"day"===M||"hour"===M?void 0:{points:["tr","br"]},"data-testid":"custom-select-".concat(N.type)},C))}function D(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.disabled,s=e.readOnly,p=e.leadingZero,m=e.clockFormat,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-hours":!0})["".concat(c,"-field")]=!!c,e["".concat(c,"-hours")]=!!c,e))},[c]);return(0,r.jsxs)("div",i({className:g},{children:[""!==o.prefixHours&&(0,r.jsx)("span",{children:o.prefixHours||d.prefixHours}),(0,r.jsx)(N,{placeholder:o.emptyHours||d.emptyHours,value:n,unit:u[1],setValue:t,locale:o,className:c,disabled:l,readOnly:s,leadingZero:p,clockFormat:m,period:f,periodicityOnDoubleClick:y,mode:v})]}))}function S(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.disabled,s=e.readOnly,p=e.leadingZero,m=e.clockFormat,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-minutes":!0})["".concat(c,"-field")]=!!c,e["".concat(c,"-minutes")]=!!c,e))},[c]);return(0,r.jsxs)("div",i({className:g},{children:["hour"===f?""!==o.prefixMinutesForHourPeriod&&(0,r.jsx)("span",{children:o.prefixMinutesForHourPeriod||d.prefixMinutesForHourPeriod}):""!==o.prefixMinutes&&(0,r.jsx)("span",{children:o.prefixMinutes||d.prefixMinutes}),(0,r.jsx)(N,{placeholder:"hour"===f?o.emptyMinutesForHourPeriod||d.emptyMinutesForHourPeriod:o.emptyMinutes||d.emptyMinutes,value:n,unit:u[0],setValue:t,locale:o,className:c,disabled:l,readOnly:s,leadingZero:p,clockFormat:m,period:f,periodicityOnDoubleClick:y,mode:v}),"hour"===f&&""!==o.suffixMinutesForHourPeriod&&(0,r.jsx)("span",{children:o.suffixMinutesForHourPeriod||d.suffixMinutesForHourPeriod})]}))}function C(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.weekDays,s=e.disabled,p=e.readOnly,m=e.leadingZero,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=!l||0===l.length,b=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-month-days":!0,"react-js-cron-month-days-placeholder":!g})["".concat(c,"-field")]=!!c,e["".concat(c,"-month-days")]=!!c,e))},[c,g]),x=JSON.stringify(o),j=(0,a.useMemo)(function(){return g?o.emptyMonthDays||d.emptyMonthDays:o.emptyMonthDaysShort||d.emptyMonthDaysShort},[g,x]);return p&&(!n||!(n.length>0))&&(n&&0!==n.length||l&&0!==l.length)?null:(0,r.jsxs)("div",i({className:b},{children:[""!==o.prefixMonthDays&&(0,r.jsx)("span",{children:o.prefixMonthDays||d.prefixMonthDays}),(0,r.jsx)(N,{placeholder:j,value:n,setValue:t,unit:u[2],locale:o,className:c,disabled:s,readOnly:p,leadingZero:m,period:f,periodicityOnDoubleClick:y,mode:v})]}))}function A(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.humanizeLabels,s=e.disabled,p=e.readOnly,m=e.period,f=e.periodicityOnDoubleClick,y=e.mode,v=o.months||d.months,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-months":!0})["".concat(c,"-field")]=!!c,e["".concat(c,"-months")]=!!c,e))},[c]);return(0,r.jsxs)("div",i({className:g},{children:[""!==o.prefixMonths&&(0,r.jsx)("span",{children:o.prefixMonths||d.prefixMonths}),(0,r.jsx)(N,{placeholder:o.emptyMonths||d.emptyMonths,optionsList:v,grid:!1,value:n,unit:i(i({},u[3]),{alt:o.altMonths||d.altMonths}),setValue:t,locale:o,className:c,humanizeLabels:l,disabled:s,readOnly:p,period:m,periodicityOnDoubleClick:f,mode:y})]}))}function E(e){var n=e.value,t=e.setValue,c=e.locale,l=e.className,s=e.disabled,u=e.readOnly,p=e.shortcuts,m=e.allowedPeriods,f=[];m.includes("year")&&f.push({value:"year",label:c.yearOption||d.yearOption}),m.includes("month")&&f.push({value:"month",label:c.monthOption||d.monthOption}),m.includes("week")&&f.push({value:"week",label:c.weekOption||d.weekOption}),m.includes("day")&&f.push({value:"day",label:c.dayOption||d.dayOption}),m.includes("hour")&&f.push({value:"hour",label:c.hourOption||d.hourOption}),m.includes("minute")&&f.push({value:"minute",label:c.minuteOption||d.minuteOption}),m.includes("reboot")&&p&&(!0===p||p.includes("@reboot"))&&f.push({value:"reboot",label:c.rebootOption||d.rebootOption});var y=(0,a.useCallback)(function(e){u||t(e)},[t,u]),v=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-period":!0})["".concat(l,"-field")]=!!l,e["".concat(l,"-period")]=!!l,e))},[l]),g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select":!0,"react-js-cron-select-no-prefix":""===c.prefixPeriod})["".concat(l,"-select")]=!!l,e))},[l,c.prefixPeriod]),b=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select-dropdown":!0,"react-js-cron-select-dropdown-period":!0})["".concat(l,"-select-dropdown")]=!!l,e["".concat(l,"-select-dropdown-period")]=!!l,e))},[l]);return(0,r.jsxs)("div",i({className:v},{children:[""!==c.prefixPeriod&&(0,r.jsx)("span",{children:c.prefixPeriod||d.prefixPeriod}),(0,r.jsx)(o.Select,{defaultValue:n,value:n,onChange:y,options:f,className:g,popupClassName:b,disabled:s,showArrow:!u,open:!u&&void 0,"data-testid":"select-period"},JSON.stringify(c))]}))}function P(e){var n=e.value,t=e.setValue,o=e.locale,c=e.className,l=e.humanizeLabels,s=e.monthDays,p=e.disabled,m=e.readOnly,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=o.weekDays||d.weekDays,b="week"===f||!s||0===s.length,x=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-week-days":!0,"react-js-cron-week-days-placeholder":!b})["".concat(c,"-field")]=!!c,e["".concat(c,"-week-days")]=!!c,e))},[c,b]),j=JSON.stringify(o),w=(0,a.useMemo)(function(){return b?o.emptyWeekDays||d.emptyWeekDays:o.emptyWeekDaysShort||d.emptyWeekDaysShort},[b,j]),k="week"===f||!m||n&&n.length>0||(!n||0===n.length)&&(!s||0===s.length),O=!m||s&&s.length>0||(!s||0===s.length)&&(!n||0===n.length);return k?(0,r.jsxs)("div",i({className:x},{children:[""!==o.prefixWeekDays&&("week"===f||!O)&&(0,r.jsx)("span",{children:o.prefixWeekDays||d.prefixWeekDays}),""!==o.prefixWeekDaysForMonthAndYearPeriod&&"week"!==f&&O&&(0,r.jsx)("span",{children:o.prefixWeekDaysForMonthAndYearPeriod||d.prefixWeekDaysForMonthAndYearPeriod}),(0,r.jsx)(N,{placeholder:w,optionsList:g,grid:!1,value:n,unit:i(i({},u[4]),{alt:o.altWeekDays||d.altWeekDays}),setValue:t,locale:o,className:c,humanizeLabels:l,disabled:p,readOnly:m,period:f,periodicityOnDoubleClick:y,mode:v})]})):null}function F(e){var n,t=e.clearButton,l=void 0===t||t,s=e.clearButtonProps,u=void 0===s?{}:s,p=e.clearButtonAction,m=void 0===p?"fill-with-every":p,f=e.locale,v=void 0===f?d:f,x=e.value,j=void 0===x?"":x,w=e.setValue,k=e.displayError,O=void 0===k||k,M=e.onError,N=e.className,F=e.defaultPeriod,T=e.allowEmpty,_=void 0===T?"for-default-value":T,V=e.humanizeLabels,I=void 0===V||V,H=e.humanizeValue,W=void 0!==H&&H,L=e.disabled,R=void 0!==L&&L,U=e.readOnly,J=void 0!==U&&U,z=e.leadingZero,Z=void 0!==z&&z,B=e.shortcuts,Y=void 0===B?["@yearly","@annually","@monthly","@weekly","@daily","@midnight","@hourly"]:B,G=e.clockFormat,$=e.periodicityOnDoubleClick,q=void 0===$||$,K=e.mode,Q=void 0===K?"multiple":K,X=e.allowedDropdowns,ee=void 0===X?["period","months","month-days","week-days","hours","minutes"]:X,en=e.allowedPeriods,et=(0,a.useRef)(j),er=(0,a.useRef)(void 0===F?"day":F),eo=(0,a.useState)(),ea=eo[0],ei=eo[1],ec=(0,a.useState)(),el=ec[0],es=ec[1],eu=(0,a.useState)(),ed=eu[0],ep=eu[1],em=(0,a.useState)(),ef=em[0],eh=em[1],ey=(0,a.useState)(),ev=ey[0],eg=ey[1],eb=(0,a.useState)(),ex=eb[0],ej=eb[1],ew=(0,a.useState)(!1),ek=ew[0],eO=ew[1],eM=(0,a.useState)(!1),eN=eM[0],eD=eM[1],eS=(n=(0,a.useRef)(eN),(0,a.useEffect)(function(){n.current=eN},[eN]),n.current),eC=JSON.stringify(v);(0,a.useEffect)(function(){g(j,eO,M,_,et,!0,v,Y,ej,eg,es,ep,eh,ei)},[]),(0,a.useEffect)(function(){j!==et.current&&g(j,eO,M,_,et,!1,v,Y,ej,eg,es,ep,eh,ei)},[j,et,eC,_,Y]),(0,a.useEffect)(function(){if(!(ea||ex||ed||el||ef||ev)||eN||eS)eN&&eD(!1);else{var e=ea||er.current,n=b(e,ed,el,ef,ev,ex,W);w(n,{selectedPeriod:e}),et.current=n,M&&M(void 0),eO(!1)}},[ea,el,ed,ef,ev,ex,W,eN]);var eA=(0,a.useCallback)(function(){es(void 0),ep(void 0),eh(void 0),eg(void 0),ej(void 0);var e="",n="reboot"!==ea&&ea?ea:er.current;n!==ea&&ei(n),"fill-with-every"===m&&(e=b(n,void 0,void 0,void 0,void 0,void 0)),w(e,{selectedPeriod:n}),et.current=e,eD(!0),"never"===_&&"empty"===m?(eO(!0),y(M,v)):(M&&M(void 0),eO(!1))},[ea,w,M,m]),eE=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron":!0,"react-js-cron-error":ek&&O,"react-js-cron-disabled":R,"react-js-cron-read-only":J})["".concat(N)]=!!N,e["".concat(N,"-error")]=ek&&O&&!!N,e["".concat(N,"-disabled")]=R&&!!N,e["".concat(N,"-read-only")]=J&&!!N,e))},[N,ek,O,R,J]),eP=u.className,eF=c(u,["className"]),eT=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-clear-button":!0})["".concat(N,"-clear-button")]=!!N,e["".concat(eP)]=!!eP,e))},[N,eP]),e_=JSON.stringify(eF),eV=(0,a.useMemo)(function(){return l&&!J?(0,r.jsx)(o.Button,i({className:eT,danger:!0,type:"primary",disabled:R},eF,{onClick:eA},{children:v.clearButtonText||d.clearButtonText})):null},[l,J,eC,eT,R,e_,eA]),eI=ea||er.current;return(0,r.jsxs)("div",i({className:eE},{children:[ee.includes("period")&&(0,r.jsx)(E,{value:eI,setValue:ei,locale:v,className:N,disabled:R,readOnly:J,shortcuts:Y,allowedPeriods:void 0===en?["year","month","week","day","hour","minute","reboot"]:en}),"reboot"===eI?eV:(0,r.jsxs)(r.Fragment,{children:["year"===eI&&ee.includes("months")&&(0,r.jsx)(A,{value:ed,setValue:ep,locale:v,className:N,humanizeLabels:I,disabled:R,readOnly:J,period:eI,periodicityOnDoubleClick:q,mode:Q}),("year"===eI||"month"===eI)&&ee.includes("month-days")&&(0,r.jsx)(C,{value:el,setValue:es,locale:v,className:N,weekDays:ef,disabled:R,readOnly:J,leadingZero:Z,period:eI,periodicityOnDoubleClick:q,mode:Q}),("year"===eI||"month"===eI||"week"===eI)&&ee.includes("week-days")&&(0,r.jsx)(P,{value:ef,setValue:eh,locale:v,className:N,humanizeLabels:I,monthDays:el,disabled:R,readOnly:J,period:eI,periodicityOnDoubleClick:q,mode:Q}),(0,r.jsxs)("div",{children:["minute"!==eI&&"hour"!==eI&&ee.includes("hours")&&(0,r.jsx)(D,{value:ev,setValue:eg,locale:v,className:N,disabled:R,readOnly:J,leadingZero:Z,clockFormat:G,period:eI,periodicityOnDoubleClick:q,mode:Q}),"minute"!==eI&&ee.includes("minutes")&&(0,r.jsx)(S,{value:ex,setValue:ej,locale:v,period:eI,className:N,disabled:R,readOnly:J,leadingZero:Z,clockFormat:G,periodicityOnDoubleClick:q,mode:Q}),eV]})]})]}))}Object.freeze({__proto__:null,setValuesFromCronString:g,getCronStringFromValues:b,partToString:x,formatValue:j,parsePartArray:w})},9245:function(e,n,t){var r=t(9155),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,t){var r,a={},s=null,u=null;for(r in void 0!==t&&(s=""+t),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(u=n.ref),n)i.call(n,r)&&!l.hasOwnProperty(r)&&(a[r]=n[r]);if(e&&e.defaultProps)for(r in n=e.defaultProps)void 0===a[r]&&(a[r]=n[r]);return{$$typeof:o,type:e,key:s,ref:u,props:a,_owner:c.current}}n.Fragment=a,n.jsx=s,n.jsxs=s},2295:function(e,n,t){e.exports=t(9245)},4693:function(e,n,t){var r=t(4673),o=t.n(r),a=t(8598),i=t.n(a),c=t(9262),l=t.n(c),s=t(8657),u=t.n(s),d=t(1357),p=t.n(d),m=t(1626),f=t.n(m),h=t(3253),y={};y.styleTagTransform=f(),y.setAttributes=u(),y.insert=l().bind(null,"head"),y.domAPI=i(),y.insertStyleElement=p(),o()(h.A,y),h.A&&h.A.locals&&h.A.locals},4673:function(e){var n=[];function t(e){for(var t=-1,r=0;r<n.length;r++)if(n[r].identifier===e){t=r;break}return t}function r(e,r){for(var o={},a=[],i=0;i<e.length;i++){var c=e[i],l=r.base?c[0]+r.base:c[0],s=o[l]||0,u="".concat(l," ").concat(s);o[l]=s+1;var d=t(u),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)n[d].references++,n[d].updater(p);else{var m=function(e,n){var t=n.domAPI(n);return t.update(e),function(n){n?(n.css!==e.css||n.media!==e.media||n.sourceMap!==e.sourceMap||n.supports!==e.supports||n.layer!==e.layer)&&t.update(e=n):t.remove()}}(p,r);r.byIndex=i,n.splice(i,0,{identifier:u,updater:m,references:1})}a.push(u)}return a}e.exports=function(e,o){var a=r(e=e||[],o=o||{});return function(e){e=e||[];for(var i=0;i<a.length;i++){var c=t(a[i]);n[c].references--}for(var l=r(e,o),s=0;s<a.length;s++){var u=t(a[s]);0===n[u].references&&(n[u].updater(),n.splice(u,1))}a=l}}},9262:function(e){var n={};e.exports=function(e,t){var r=function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}(e);if(!r)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(t)}},1357:function(e){e.exports=function(e){var n=document.createElement("style");return e.setAttributes(n,e.attributes),e.insert(n,e.options),n}},8657:function(e,n,t){e.exports=function(e){var n=t.nc;n&&e.setAttribute("nonce",n)}},8598:function(e){e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var n=e.insertStyleElement(e);return{update:function(t){var r,o,a;r="",t.supports&&(r+="@supports (".concat(t.supports,") {")),t.media&&(r+="@media ".concat(t.media," {")),(o=void 0!==t.layer)&&(r+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),r+=t.css,o&&(r+="}"),t.media&&(r+="}"),t.supports&&(r+="}"),(a=t.sourceMap)&&"u">typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,n,e.options)},remove:function(){var e;null===(e=n).parentNode||e.parentNode.removeChild(e)}}}},1626:function(e){e.exports=function(e,n){if(n.styleSheet)n.styleSheet.cssText=e;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(e))}}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["382"],{8765:function(e,r,n){n.r(r),n.d(r,{TriggerCollectionConfig:function(){return i}});var o=n(2059),t=n(9155),l=n.n(t),a=n(7806),c=n(9488);function i(){var e=(0,c.kj)();return l().createElement(o.Form.Item,{name:"data",label:e("Trigger data"),extra:e("Choose a record or primary key of a record in the collection to trigger."),rules:[{required:!0}]},l().createElement(a.g4,null))}r.default=i}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["387"],{2034:function(e,t,n){n.d(t,{i:function(){return M}});var r=n(9155),o=n.n(r),l=n(2059),a=n(7375),i=n(5477),c=n(7694),u=n(5980),s=n(9651),f=n(2235),m=n(3052),d=n(9488),p=n(4759),g=n(2625),v=n(3485),y=n(2404);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e){var t,n,r,i=e.triggerTitle,c=(0,d.kj)(),s=null!=(n=(0,f.$K)())?n:{},m=s.execution,p=s.workflow,g=function(e){if(Array.isArray(e))return e}(t=o().useState(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return b(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),v=g[0],w=g[1],E=(0,u.A)().styles;return m?o().createElement(o().Fragment,null,o().createElement(l.Tooltip,{title:c("View result")},o().createElement(l.Button,{type:"primary",shape:"circle",size:"small",icon:o().createElement(a.InfoOutlined,null),className:E.nodeJobButtonClass,onClick:function(e){e.stopPropagation(),w(!0)},onMouseDown:function(e){return e.stopPropagation()}})),o().createElement(l.Modal,{open:v,onCancel:function(){return w(!1)},width:980,footer:null,title:o().createElement("div",{className:E.nodeTitleClass},o().createElement(l.Tag,null,i),o().createElement("strong",null,null==p?void 0:p.title)),destroyOnClose:!0,modalRender:function(e){return o().createElement("div",{onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()}},e)}},o().createElement("div",{style:{marginBottom:16}},o().createElement("div",{style:{fontWeight:500,marginBottom:8}},c("Triggered at"),":"),o().createElement("div",null,(0,y.fU)(null==m?void 0:m.createdAt))),o().createElement("div",{style:{fontWeight:500,marginBottom:8}},c("Trigger variables"),":"),o().createElement(l.Input.TextArea,{value:JSON.stringify(null!=(r=null==m?void 0:m.context)?r:null,null,2),disabled:!0,autoSize:{minRows:4,maxRows:20},className:E.nodeJobResultClass,style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}}))):null}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,l,a){try{var i=e[l](a),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){h(l,r,o,a,i,"next",e)}function i(e){h(l,r,o,a,i,"throw",e)}a(void 0)})}}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function A(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return l.label++,{value:u[1],done:!1};case 5:l.label++,r=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){l.label=u[1];break}if(6===u[0]&&l.label<o[1]){l.label=o[1],o=u;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(u);break}o[2]&&l.ops.pop(),l.trys.pop();continue}u=t.call(e,l)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function x(){var e=O(["\n margin-bottom: ","px;\n padding: ","px;\n background-color: ",";\n\n > *:last-child {\n margin-bottom: 0;\n }\n\n dl {\n display: flex;\n align-items: baseline;\n margin: 0;\n }\n\n dt {\n color: ",";\n }\n\n dt::after {\n content: ':';\n margin-right: ","px;\n }\n\n dd {\n margin: 0;\n }\n\n p {\n margin-top: ","px;\n color: ",";\n }\n "]);return x=function(){return e},e}function j(){var e=O(["\n .ant-form-item {\n margin-bottom: ","px;\n }\n\n .ant-form-item-extra {\n margin-top: ","px;\n }\n "]);return j=function(){return e},e}function N(e){var t=e.trigger,n=e.t,r=l.theme.useToken().token;if(!t.description)return null;var a=(0,i.css)(x(),r.marginLG,r.padding,r.colorFillAlter,r.colorText,r.marginXS,r.marginSM,r.colorTextDescription);return o().createElement("div",{className:a},o().createElement("dl",null,o().createElement("dt",null,n("Trigger type")),o().createElement("dd",null,o().createElement(l.Tag,null,n(t.title)))),o().createElement("p",null,n(t.description)))}function R(e){var t,n=e.trigger,a=e.workflow,u=e.onSubmitted,s=(0,c.useFlowContext)(),m=(0,d.kj)(),p=l.theme.useToken().token,y=l.App.useApp().message,b=!!(null==a||null==(t=a.versionStats)?void 0:t.executed),w=T(l.Form.useForm(),1)[0],E=T((0,r.useState)(!1),2),h=E[0],C=E[1],S=(0,r.useMemo)(function(){return(null==n?void 0:n.FieldsetLoader)?(0,r.lazy)(n.FieldsetLoader):null},[n]),O=(0,r.useMemo)(function(){var e;return{config:null!=(e=a.config)?e:{}}},[a.config]);(0,r.useEffect)(function(){w.setFieldsValue(O)},[w,O]);var x=(0,g.useMemoizedFn)(function(){return k(function(){var e,t,n;return A(this,function(r){switch(r.label){case 0:return[4,w.validateFields()];case 1:e=r.sent(),C(!0),r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,s.api.resource("workflows").update({filterByTk:a.id,values:{config:null!=(t=e.config)?t:{}}})];case 3:return r.sent(),null==u||u(),[3,6];case 4:throw n=r.sent(),y.error(m("Failed to save trigger")),console.error(n),n;case 5:return C(!1),[7];case 6:return[2]}})})()}),R=(0,i.css)(j(),p.margin,p.marginXXS);return o().createElement(f.cB.Provider,{value:{workflow:a,refresh:u}},o().createElement(f.AA.Provider,{value:a},o().createElement(v.DrawerFormLayout,{title:m("Trigger"),onSubmit:x,submitting:h,submitText:m("Submit"),cancelText:m("Cancel"),footer:b?o().createElement("span",null):void 0},o().createElement("div",{style:{paddingBottom:48}},o().createElement(l.Form,{className:R,form:w,layout:"vertical",disabled:b,requiredMark:function(e,t){return t.required?o().createElement(o().Fragment,null,o().createElement("span",{style:{color:p.colorError}},"*"),e):e}},n?o().createElement(N,{trigger:n,t:m}):null,S?o().createElement(r.Suspense,{fallback:o().createElement(l.Skeleton,{active:!0,paragraph:{rows:4}})},o().createElement(S,null)):o().createElement(l.Typography.Paragraph,{type:"secondary"},n?m("This trigger's configuration has not been migrated to the new canvas yet."):m("This trigger type is not available in the new canvas yet.")))))))}function I(e){var t=e.message,n=e.token;return o().createElement("span",{style:{fontSize:n.fontSize,fontWeight:"normal",lineHeight:n.lineHeight}},t)}function F(){var e,t,n=(0,c.useFlowContext)(),i=(0,d.kj)(),s=l.theme.useToken().token,m=(0,u.A)(),v=m.styles,y=m.cx,b=null!=(e=(0,f.$K)())?e:{},E=b.workflow,h=b.refresh,O=!!(0,f.S8)(),x=n.app.pm.get(p.q),j=(null==E?void 0:E.type)?x.getTriggerOptions(E.type):void 0,N=j?i(j.title):null!=(t=null==E?void 0:E.type)?t:i("Unknown trigger"),F=O?[]:x.getWorkflowNotices({surface:"trigger-node-card",workflow:E}),P=T((0,r.useState)(""),2),D=P[0],M=P[1];(0,r.useEffect)(function(){var e,t;M(null!=(e=null!=(t=null==E?void 0:E.triggerTitle)?t:null==E?void 0:E.title)?e:N)},[N,null==E?void 0:E.title,null==E?void 0:E.triggerTitle]);var z=(0,g.useMemoizedFn)(function(e){return k(function(){var t;return A(this,function(r){switch(r.label){case 0:if(!(null==E?void 0:E.id)||(M(t=e||N),t===E.triggerTitle))return[2];return[4,n.api.resource("workflows").update({filterByTk:E.id,values:{triggerTitle:t}})];case 1:return r.sent(),null==h||h(),[2]}})})()}),B=(0,g.useMemoizedFn)(function(){if(null==E?void 0:E.id){var e;(e={ctx:n,trigger:j,workflow:E,refresh:h}).ctx.viewer.drawer({width:"50%",closable:!0,content:function(){return o().createElement(R,{trigger:e.trigger,workflow:e.workflow,onSubmitted:e.refresh})}})}});if(!E)return null;var _=i("Trigger");return o().createElement("div",{className:v.nodeClass,role:"button","aria-label":"".concat(_,"-").concat(D),onClick:function(e){if(e.currentTarget.contains(e.target)){var t,n,r;n=t=e.target,(null!=(r=HTMLElement)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)&&t.closest("textarea, input, button, a, .ant-dropdown, .workflow-node-actions, .ant-modal")||B()}}},o().createElement("div",{className:y(v.nodeCardClass,{invalid:!j})},o().createElement("div",{className:v.nodeHeaderClass},o().createElement("div",{className:y(v.nodeMetaClass,"workflow-node-meta")},o().createElement(l.Tag,{color:j?"gold":"error",icon:o().createElement(a.ThunderboltOutlined,null)},o().createElement("span",{className:"type"},N))),o().createElement("div",{className:"workflow-node-actions"},o().createElement(w,{triggerTitle:N}))),o().createElement("div",{className:"workflow-node-title"},o().createElement(l.Input.TextArea,{value:D,onChange:function(e){return M(e.target.value)},onBlur:function(e){return k(function(){return A(this,function(t){switch(t.label){case 0:return[4,z(e.target.value)];case 1:return t.sent(),[2]}})})()},autoSize:!0,disabled:O,"aria-label":i("Trigger title")})),F.map(function(e){return o().createElement(l.Alert,{key:e.key,type:e.type||"warning",showIcon:!0,icon:function(e,t){var n={fontSize:t.fontSize,marginTop:t.marginXXS};switch(e){case"error":return o().createElement(a.CloseCircleFilled,{style:S(C({},n),{color:t.colorError})});case"info":return o().createElement(a.InfoCircleFilled,{style:S(C({},n),{color:t.colorInfo})});case"success":return o().createElement(a.CheckCircleFilled,{style:S(C({},n),{color:t.colorSuccess})});default:return o().createElement(a.ExclamationCircleFilled,{style:S(C({},n),{color:t.colorWarning})})}}(e.type||"warning",s),message:o().createElement(I,{message:e.message,token:s}),style:{marginTop:s.marginSM,alignItems:"flex-start"}})})))}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(){var e,t=(0,u.A)().styles,n=(0,d.kj)(),r=(0,c.useFlowEngine)(),i=(0,m.x)(),s=null==i?void 0:i.clipboard;if(!s)return null;var f=r.context.app.pm.get(p.q),g=null==f?void 0:f.getInstruction(s.type),v=g?n(g.title):s.type;return o().createElement("div",{className:t.clipboardPreviewClass},o().createElement("div",{className:"workflow-clipboard-header"},o().createElement("span",null,n("Copied node")),o().createElement(l.Button,{type:"text",size:"small",icon:o().createElement(a.CloseOutlined,null),onClick:function(){return null==i?void 0:i.clearClipboard()}})),o().createElement("div",{className:"workflow-clipboard-card"},o().createElement("div",{className:"workflow-clipboard-type"},v),o().createElement("div",{className:"workflow-clipboard-title"},null!=(e=s.title)?e:s.type)))}function M(e){var t,n,a=e.entry,c=(0,u.A)(),m=c.styles,p=c.cx,g=(0,d.kj)(),v=(0,f.S8)();(null!=(n=(0,f.$K)())?n:{}).workflow;var y=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(100))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return P(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],w=y[1];return o().createElement("div",{className:p(m.workflowPageClass,(0,i.css)({height:"100%"}))},o().createElement("div",{className:"workflow-canvas-wrapper"},o().createElement("div",{className:"workflow-canvas",style:{zoom:b/100}},o().createElement("div",{className:p(m.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement("div",{className:m.branchClass},v?o().createElement(l.Alert,{type:"warning",showIcon:!0,message:g("Executed workflow cannot be modified. Could be copied to a new version to modify."),style:{marginBottom:"1em"}}):null,o().createElement(F,null),o().createElement("div",{className:p(m.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement(s.l,{entry:a})),o().createElement("div",{className:m.terminalClass},g("End"))))),o().createElement(D,null),o().createElement("div",{className:"workflow-canvas-zoomer"},o().createElement(l.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:b,onChange:w}))))}},8761:function(e,t,n){n.d(t,{K:function(){return r}});function r(e){var t=new Map;e.forEach(function(e){return t.set(e.id,e)});var n=!0,r=!1,o=void 0;try{for(var l,a=t.values()[Symbol.iterator]();!(n=(l=a.next()).done);n=!0){var i=l.value;i.upstreamId&&(i.upstream=t.get(i.upstreamId)),i.downstreamId&&(i.downstream=t.get(i.downstreamId))}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}},7001:function(e,t,n){n.d(t,{TD:function(){return i}});var r=n(2625),o=n(3485),l=n(8401);function a(){return"modern"===(0,o.getRouteRuntimeVersion)()}function i(){var e=(0,r.useMemoizedFn)(function(e){return a()?(0,l.JG)(e):"/admin/settings/workflow/workflows/".concat(e)}),t=(0,r.useMemoizedFn)(function(e){return a()?(0,l.Pq)(e):"/admin/settings/workflow/executions/".concat(e)});return{isV2Runtime:a(),getWorkflowCanvasPath:e,getWorkflowExecutionPath:t}}},9239:function(e,t,n){n.d(t,{GO:function(){return l},QQ:function(){return c},hi:function(){return a},m2:function(){return i}});var r=n(358);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},a=[{value:l.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(r.C,'" })}}'),color:"blue",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(r.C,'" })}}')},{value:l.STARTED,label:'{{t("On going", { ns: "'.concat(r.C,'" })}}'),color:"gold",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(r.C,'" })}}')},{value:l.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(r.C,'" })}}'),color:"green",description:'{{t("Successfully finished.", { ns: "'.concat(r.C,'" })}}')},{value:l.FAILED,label:'{{t("Failed", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(r.C,'" })}}')},{value:l.ERROR,label:'{{t("Error", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Some node meets error.", { ns: "'.concat(r.C,'" })}}')},{value:l.ABORTED,label:'{{t("Aborted", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(r.C,'" })}}')},{value:l.CANCELED,label:'{{t("Canceled", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(r.C,'" })}}')},{value:l.REJECTED,label:'{{t("Rejected", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Rejected from a manual node.", { ns: "'.concat(r.C,'" })}}')},{value:l.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("General failed but should do another try.", { ns: "'.concat(r.C,'" })}}')}],i=a.reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{}),c=[{value:r.K.TIMEOUT,label:'{{t("Timed out", { ns: "'.concat(r.C,'" })}}')},{value:r.K.MANUAL_CANCEL,label:'{{t("Canceled manually", { ns: "'.concat(r.C,'" })}}')},{value:r.K.PARENT_ABORTED,label:'{{t("Aborted with parent execution", { ns: "'.concat(r.C,'" })}}')}].reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{})}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["394"],{4137:function(e,l,n){n.r(l),n.d(l,{TriggerScheduleConfig:function(){return m}});var t=n(2059),r=n(9185),a=n.n(r),i=n(9155),o=n.n(i),u=n(2235),c=n(7806),d=n(9488),h=n(4869),v=n(1993);function f(e){var l=e.value,n=e.onChange,r=e.placeholder;return o().createElement(t.DatePicker,{showTime:!0,value:l?a()(l):null,placeholder:r,style:{width:"100%"},onChange:function(e){return null==n?void 0:n(e?e.toDate():null)}})}function m(){var e,l=(0,u.Zt)(),n=(0,d.kj)();if((null==l||null==(e=l.config)?void 0:e.mode)===v.a.DATE_FIELD){var r=h.th[v.a.DATE_FIELD].data;return o().createElement(t.Form.Item,{name:"data",label:n(r.title),extra:r.description?n(r.description):void 0,rules:r.required?[{required:!0}]:void 0},o().createElement(c.g4,null))}var a=h.th[v.a.STATIC].date;return o().createElement(t.Form.Item,{name:"date",label:n(a.title),initialValue:new Date,rules:a.required?[{required:!0}]:void 0},o().createElement(f,{placeholder:a.placeholder?n(a.placeholder):void 0}))}l.default=m}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["438"],{7653:function(e,t,n){n.r(t),n.d(t,{default:function(){return U}});var r,o=n(7694),l=n(2625),a=n(2059),i=n(9155),u=n.n(i),c=n(4442),s=n(2034),f=n(2235),d=n(8761),p=n(7375),m=n(9239),y=n(7001),v=n(9488),b=n(8401);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=(h(r={},m.GO.QUEUEING,u().createElement(p.HourglassOutlined,null)),h(r,m.GO.STARTED,u().createElement(p.LoadingOutlined,null)),h(r,m.GO.RESOLVED,u().createElement(p.CheckOutlined,null)),h(r,m.GO.FAILED,u().createElement(p.ExclamationOutlined,null)),h(r,m.GO.ERROR,u().createElement(p.CloseOutlined,null)),h(r,m.GO.ABORTED,u().createElement(p.MinusOutlined,{rotate:90})),h(r,m.GO.CANCELED,u().createElement(p.MinusOutlined,{rotate:45})),h(r,m.GO.REJECTED,u().createElement(p.MinusOutlined,null)),h(r,m.GO.RETRY_NEEDED,u().createElement(p.RedoOutlined,null)),r);function E(e){var t,n=e.value,r=(0,v.kj)(),o=a.theme.useToken().token,l=m.m2[n];if(!l)return null;var i=null!=(t=g[n])?t:u().createElement(p.ClockCircleOutlined,null),c=o.controlHeightSM;return u().createElement(a.Tooltip,{title:r(l.label)},u().createElement(a.Tag,{color:l.color,style:{marginInlineEnd:o.marginXS,borderRadius:"50%",padding:0,width:c,height:c,lineHeight:"".concat(c,"px"),textAlign:"center"}},i))}var w=n(2404);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||j(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,t)}}function A(e){var t=e.execution,n=e.refresh,r=(0,o.useFlowContext)(),c=a.theme.useToken().token,s=r.api.resource("executions"),f=(0,l.useRequest)(function(){var e;return(e=function(){var e,n,r,o,l,a,i,u;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:return[4,Promise.all([s.list({filter:{key:t.key,id:{$lt:t.id}},sort:"-id",pageSize:10,fields:["id","status","createdAt"]}),s.list({filter:{key:t.key,id:{$gt:t.id}},sort:"id",pageSize:10,fields:["id","status","createdAt"]})])];case 1:return a=(l=O.apply(void 0,[c.sent(),2]))[0],i=l[1],u=null!=(e=null==a||null==(r=a.data)?void 0:r.data)?e:[],[2,x((null!=(n=null==i||null==(o=i.data)?void 0:o.data)?n:[]).slice().reverse()).concat([t],x(u))]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){S(l,r,o,a,i,"next",e)}function i(e){S(l,r,o,a,i,"throw",e)}a(void 0)})})()},{manual:!0}),d=f.data,m=f.run,y=(0,l.useMemoizedFn)(function(e){var n=e.key;String(n)!==String(t.id)&&r.router.navigate((0,b.Pq)(n))}),v=(0,i.useMemo)(function(){return(null!=d?d:[t]).map(function(e){var t;return{key:"".concat(e.id),icon:u().createElement(E,{value:null!=(t=e.status)?t:null}),label:u().createElement("span",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:c.marginXL,minWidth:5*c.sizeXXL}},u().createElement("span",null,"#".concat(e.id)),u().createElement("time",{style:{fontSize:c.fontSizeSM,color:c.colorTextTertiary}},(0,w.fU)(e.createdAt)))}})},[d,t,c]);return u().createElement(a.Space,{size:c.marginXXS},u().createElement(a.Dropdown,{trigger:["click"],onOpenChange:function(e){return e&&m()},menu:{onClick:y,selectedKeys:["".concat(t.id)],items:v}},u().createElement(a.Space,{style:{cursor:"pointer"}},u().createElement("strong",null,"#".concat(t.id)),u().createElement(p.DownOutlined,null))),n?u().createElement(a.Button,{type:"link",size:"small",icon:u().createElement(p.ReloadOutlined,null),onClick:n}):null)}function T(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function I(e){var t,n=e.execution,r=(0,v.kj)(),o=m.m2[n.status];if(!o)return null;var l=n.reason?m.QQ[n.reason]:void 0;return u().createElement(a.Tag,{color:o.color},u().createElement(a.Space,{size:4},r(o.label),n.reason?u().createElement(a.Tooltip,{title:r(null!=(t=null==l?void 0:l.label)?t:n.reason),placement:"bottom"},u().createElement(p.QuestionCircleOutlined,null)):null))}function C(e){var t=e.execution,n=e.resource,r=e.refresh,o=(0,v.ec)().t,i=(0,v.kj)(),s=(0,y.TD)().getWorkflowCanvasPath,f=a.theme.useToken().token,d=a.App.useApp(),b=d.modal,h=d.message,g=t.workflow,E=t.status===m.GO.STARTED||t.status===m.GO.QUEUEING,k=(0,l.useMemoizedFn)(function(){b.confirm({title:o("Cancel the execution"),content:o("Are you sure you want to cancel the execution?"),onOk:function(){var e;return(e=function(){return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,n.cancel({filterByTk:t.id})];case 1:return e.sent(),h.success(o("Operation succeeded")),r(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){T(l,r,o,a,i,"next",e)}function i(e){T(l,r,o,a,i,"throw",e)}a(void 0)})})()}})});return u().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:f.margin,flexWrap:"wrap",padding:"".concat(f.paddingSM,"px ").concat(f.padding,"px"),background:f.colorBgContainer,borderBottom:"1px solid ".concat(f.colorBorderSecondary)}},u().createElement(a.Breadcrumb,{items:[{title:u().createElement(c.Link,{to:"/admin/settings/workflow"},o("Workflow"))},{title:(null==g?void 0:g.id)!=null?u().createElement(a.Tooltip,{title:"Key: ".concat(g.key)},u().createElement(c.Link,{to:s(g.id)},i(g.title||""))):i((null==g?void 0:g.title)||"")},{title:u().createElement(A,{execution:{id:t.id,key:t.key,status:t.status,createdAt:t.createdAt},refresh:r})}]}),u().createElement("div",{style:{display:"flex",alignItems:"center",gap:f.marginXS}},u().createElement(I,{execution:t}),E?u().createElement(a.Tooltip,{title:o("Cancel the execution")},u().createElement(a.Button,{type:"link",danger:!0,shape:"circle",size:"small",icon:u().createElement(p.StopOutlined,null),onClick:k})):null,u().createElement("time",{style:{opacity:.65}},(0,w.fU)(t.updatedAt))))}var R=n(2723),P=n(7060),B=n(5980),G=n(8364);function z(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function D(e){var t,n=e.jobId,r=(0,o.useFlowContext)(),i=(0,v.kj)(),c=(0,B.A)().styles,s=(0,l.useRequest)(function(){var e;return(e=function(){var e,t,o;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:return[4,r.api.resource("jobs").get({filterByTk:n})];case 1:return[2,null!=(e=null==(o=l.sent())||null==(t=o.data)?void 0:t.data)?e:null]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){z(l,r,o,a,i,"next",e)}function i(e){z(l,r,o,a,i,"throw",e)}a(void 0)})})()}),f=s.data;return s.loading?u().createElement(a.Spin,null):u().createElement(u().Fragment,null,u().createElement("div",{style:{marginBottom:16}},u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Status"),":"),u().createElement(P._T,{value:null!=(t=null==f?void 0:f.status)?t:null})),u().createElement("div",{style:{marginBottom:16}},u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Executed at"),":"),u().createElement("div",null,(0,w.fU)(null==f?void 0:f.updatedAt))),u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Node result"),":"),u().createElement(a.Input.TextArea,{value:(0,G.S)(null==f?void 0:f.result),disabled:!0,autoSize:{minRows:4,maxRows:20},className:c.nodeJobResultClass,style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}}),(null==f?void 0:f.log)?u().createElement(u().Fragment,null,u().createElement("div",{style:{marginTop:16,marginBottom:8,fontWeight:500}},i("Log")),u().createElement(a.Input.TextArea,{value:f.log,disabled:!0,autoSize:{minRows:4,maxRows:20},style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}})):null)}function M(){var e,t,n,r,o=null!=(e=(0,f.$K)())?e:{},l=o.viewJob,i=o.setViewJob,c=(0,v.kj)(),s=(0,R.Y)(null==l||null==(t=l.node)?void 0:t.type),d=(0,B.A)().styles;return u().createElement(a.Modal,{open:!!l,onCancel:function(){return null==i?void 0:i(null)},footer:null,width:980,title:u().createElement("div",{className:d.nodeTitleClass},u().createElement(a.Tag,null,s?c(s.title):null==l||null==(n=l.node)?void 0:n.type),u().createElement("strong",null,null==l||null==(r=l.node)?void 0:r.title)),destroyOnClose:!0,modalRender:function(e){return u().createElement("div",{onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()}},e)}},(null==l?void 0:l.id)!=null?u().createElement(D,{jobId:l.id}):null)}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function F(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}}var L=function(e){var t,n=e.record,r=e.resource,o=e.refresh,l=(0,v.ec)().t,p=(0,c.useNavigate)(),m=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||F(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=m[0],b=m[1],h=null!=n?n:{},g=h.jobs,E=void 0===g?[]:g,w=h.workflow,k=function(e,t){if(null==e)return{};var n,r,o,l={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r]);return l}if(l=function(e,t){if(null==e)return{};var n,r,o={},l=Object.getOwnPropertyNames(e);for(r=0;r<l.length;r++)n=l[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r]);return l}(h,["jobs","workflow"]),S=(0,i.useMemo)(function(){var e,t,n=function(e){if(Array.isArray(e))return _(e)}(e=null!=(t=null==w?void 0:w.nodes)?t:[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||F(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return(0,d.K)(n),!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;e.forEach(function(e){e.jobs=[],n.set(e.id,e)}),t.forEach(function(e){var t=n.get(e.nodeId);t&&(t.jobs.push(e),e.node={id:t.id,key:t.key,title:t.title,type:t.type})}),e.forEach(function(e){e.jobs=e.jobs.sort(function(e,t){return e.id-t.id})})}(n,E),n},[E,null==w?void 0:w.nodes]),O=(0,i.useMemo)(function(){var e;return null!=(e=S.find(function(e){return!e.upstream}))?e:null},[S]);return((0,i.useEffect)(function(){if(null==y?void 0:y.id){var e=E.find(function(e){return String(e.id)===String(y.id)});e&&b(e)}},[E,null==y?void 0:y.id]),w)?u().createElement(f.cB.Provider,{value:{workflow:w.type?w:null,nodes:S,execution:k,viewJob:y,setViewJob:b}},u().createElement(C,{execution:n,resource:r,refresh:o}),u().createElement(s.i,{entry:O}),u().createElement(M,null)):u().createElement(a.Result,{status:"404",title:l("Not found"),subTitle:l("Workflow of execution is not existed"),extra:u().createElement(a.Button,{onClick:function(){p(-1)}},l("Go back"))})};function N(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function U(){(0,v.ec)();var e=(0,o.useFlowContext)(),t=a.theme.useToken().token,n=(0,c.useParams)().id,r=e.api.resource("executions"),i=(0,l.useRequest)(function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:if(!n)return[2,null];return[4,r.get({filterByTk:n,appends:["jobs","workflow","workflow.nodes","workflow.versionStats","workflow.stats"],except:["jobs.result","workflow.options"]})];case 1:return e=t.sent(),[2,(0,w.iD)(e)]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){N(l,r,o,a,i,"next",e)}function i(e){N(l,r,o,a,i,"throw",e)}a(void 0)})})()},{refreshDeps:[n]}),s=i.data,f=i.refresh,d=(null==s?void 0:s.id)!=null&&String(s.id)===String(n)?s:null;return n?d?u().createElement("div",{style:{display:"flex",flexDirection:"column",height:"100dvh",minHeight:0,overflow:"hidden",width:"100%",boxSizing:"border-box",background:t.colorBgLayout}},u().createElement("div",{style:{flex:1,minHeight:0,overflow:"hidden",position:"relative",width:"100%"}},u().createElement(L,{record:d,resource:r,refresh:f}))):u().createElement(a.Spin,null):null}}}]);
|