@nocobase/plugin-workflow 0.12.0-alpha.5 → 0.13.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function StatusButton(props: any): React.JSX.Element;
@@ -13,6 +13,7 @@ export declare const ExecutionStatusOptions: {
13
13
  value: any;
14
14
  label: string;
15
15
  color: string;
16
+ icon: React.JSX.Element;
16
17
  description: string;
17
18
  }[];
18
19
  export declare const ExecutionStatusOptionsMap: {};
@@ -89,6 +89,130 @@
89
89
  description ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: description }) : null
90
90
  ] });
91
91
  }
92
+ const EXECUTION_STATUS = {
93
+ QUEUEING: null,
94
+ STARTED: 0,
95
+ RESOLVED: 1,
96
+ FAILED: -1,
97
+ ERROR: -2,
98
+ ABORTED: -3,
99
+ CANCELED: -4,
100
+ REJECTED: -5
101
+ };
102
+ const ExecutionStatusOptions = [
103
+ {
104
+ value: EXECUTION_STATUS.QUEUEING,
105
+ label: `{{t("Queueing", { ns: "${NAMESPACE}" })}}`,
106
+ color: "blue",
107
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.HourglassOutlined, {}),
108
+ description: `{{t("Triggered but still waiting in queue to execute.", { ns: "${NAMESPACE}" })}}`
109
+ },
110
+ {
111
+ value: EXECUTION_STATUS.STARTED,
112
+ label: `{{t("On going", { ns: "${NAMESPACE}" })}}`,
113
+ color: "gold",
114
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.LoadingOutlined, {}),
115
+ description: `{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "${NAMESPACE}" })}}`
116
+ },
117
+ {
118
+ value: EXECUTION_STATUS.RESOLVED,
119
+ label: `{{t("Resolved", { ns: "${NAMESPACE}" })}}`,
120
+ color: "green",
121
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CheckOutlined, {}),
122
+ description: `{{t("Successfully finished.", { ns: "${NAMESPACE}" })}}`
123
+ },
124
+ {
125
+ value: EXECUTION_STATUS.FAILED,
126
+ label: `{{t("Failed", { ns: "${NAMESPACE}" })}}`,
127
+ color: "red",
128
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.ExclamationOutlined, {}),
129
+ description: `{{t("Failed to satisfy node configurations.", { ns: "${NAMESPACE}" })}}`
130
+ },
131
+ {
132
+ value: EXECUTION_STATUS.ERROR,
133
+ label: `{{t("Error", { ns: "${NAMESPACE}" })}}`,
134
+ color: "red",
135
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CloseOutlined, {}),
136
+ description: `{{t("Some node meets error.", { ns: "${NAMESPACE}" })}}`
137
+ },
138
+ {
139
+ value: EXECUTION_STATUS.ABORTED,
140
+ label: `{{t("Aborted", { ns: "${NAMESPACE}" })}}`,
141
+ color: "red",
142
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, { rotate: 90 }),
143
+ description: `{{t("Running of some node was aborted by program flow.", { ns: "${NAMESPACE}" })}}`
144
+ },
145
+ {
146
+ value: EXECUTION_STATUS.CANCELED,
147
+ label: `{{t("Canceled", { ns: "${NAMESPACE}" })}}`,
148
+ color: "volcano",
149
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, { rotate: 45 }),
150
+ description: `{{t("Manually canceled whole execution when waiting.", { ns: "${NAMESPACE}" })}}`
151
+ },
152
+ {
153
+ value: EXECUTION_STATUS.REJECTED,
154
+ label: `{{t("Rejected", { ns: "${NAMESPACE}" })}}`,
155
+ color: "volcano",
156
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, {}),
157
+ description: `{{t("Rejected from a manual node.", { ns: "${NAMESPACE}" })}}`
158
+ }
159
+ ];
160
+ const ExecutionStatusOptionsMap = ExecutionStatusOptions.reduce(
161
+ (map, option) => Object.assign(map, { [option.value]: option }),
162
+ {}
163
+ );
164
+ const JOB_STATUS = {
165
+ PENDING: 0,
166
+ RESOLVED: 1,
167
+ FAILED: -1,
168
+ ERROR: -2,
169
+ ABORTED: -3,
170
+ CANCELED: -4,
171
+ REJECTED: -5
172
+ };
173
+ const JobStatusOptions = [
174
+ {
175
+ value: JOB_STATUS.PENDING,
176
+ label: `{{t("Pending", { ns: "${NAMESPACE}" })}}`,
177
+ color: "gold",
178
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.ClockCircleOutlined, {})
179
+ },
180
+ {
181
+ value: JOB_STATUS.RESOLVED,
182
+ label: `{{t("Resolved", { ns: "${NAMESPACE}" })}}`,
183
+ color: "green",
184
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CheckOutlined, {})
185
+ },
186
+ {
187
+ value: JOB_STATUS.FAILED,
188
+ label: `{{t("Failed", { ns: "${NAMESPACE}" })}}`,
189
+ color: "red",
190
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.ExclamationOutlined, {})
191
+ },
192
+ { value: JOB_STATUS.ERROR, label: `{{t("Error", { ns: "${NAMESPACE}" })}}`, color: "red", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CloseOutlined, {}) },
193
+ {
194
+ value: JOB_STATUS.ABORTED,
195
+ label: `{{t("Aborted", { ns: "${NAMESPACE}" })}}`,
196
+ color: "red",
197
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, { rotate: 90 })
198
+ },
199
+ {
200
+ value: JOB_STATUS.CANCELED,
201
+ label: `{{t("Canceled", { ns: "${NAMESPACE}" })}}`,
202
+ color: "volcano",
203
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, { rotate: 45 })
204
+ },
205
+ {
206
+ value: JOB_STATUS.REJECTED,
207
+ label: `{{t("Rejected", { ns: "${NAMESPACE}" })}}`,
208
+ color: "volcano",
209
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, {})
210
+ }
211
+ ];
212
+ const JobStatusOptionsMap = JobStatusOptions.reduce(
213
+ (map, option) => Object.assign(map, { [option.value]: option }),
214
+ {}
215
+ );
92
216
  const useStyles$1 = client.createStyles(({ css: css2, token }) => {
93
217
  return {
94
218
  workflowPageClass: css2`
@@ -104,12 +228,11 @@
104
228
  position: relative;
105
229
  padding: 0.5rem 1rem;
106
230
  background: ${token.colorBgContainer};
107
- border-bottom: 1px solid ${token.colorBorder};
231
+ border-bottom: 1px solid ${token.colorBorderSecondary};
108
232
 
109
233
  header {
110
234
  display: flex;
111
235
  align-items: center;
112
- min-height: 2rem;
113
236
  }
114
237
 
115
238
  aside {
@@ -143,7 +266,7 @@
143
266
  }
144
267
  }
145
268
  `,
146
- workflowVersionDropdownClass: css2`
269
+ dropdownClass: css2`
147
270
  .ant-dropdown-menu-item {
148
271
  justify-content: flex-end;
149
272
  .ant-dropdown-menu-title-content {
@@ -153,11 +276,15 @@
153
276
  text-align: right;
154
277
 
155
278
  time {
156
- width: 12em;
157
- color: ${token.colorText};
279
+ width: 14em;
158
280
  font-size: 80%;
159
281
  }
160
-
282
+ }
283
+ }
284
+ `,
285
+ workflowVersionDropdownClass: css2`
286
+ .ant-dropdown-menu-item {
287
+ .ant-dropdown-menu-title-content {
161
288
  strong {
162
289
  font-weight: normal;
163
290
  }
@@ -177,24 +304,11 @@
177
304
  }
178
305
  `,
179
306
  executionsDropdownRowClass: css2`
180
- .row {
181
- display: flex;
182
- align-items: baseline;
183
-
184
- &.current {
185
- font-weight: bold;
186
- }
187
-
307
+ .ant-dropdown-menu-item {
188
308
  .id {
189
309
  flex-grow: 1;
190
310
  text-align: right;
191
311
  }
192
-
193
- time {
194
- width: 12em;
195
- color: ${token.colorText};
196
- font-size: 80%;
197
- }
198
312
  }
199
313
  `,
200
314
  branchBlockClass: css2`
@@ -364,10 +478,6 @@
364
478
  justify-content: center;
365
479
  align-items: center;
366
480
  color: ${token.colorTextLightSolid};
367
-
368
- &[type='button'] {
369
- border: none;
370
- }
371
481
  `,
372
482
  nodeHeaderClass: css2`
373
483
  position: relative;
@@ -3711,25 +3821,22 @@
3711
3821
  }
3712
3822
  function filterTypedFields({ fields, types, appends: appends2, compile, getCollectionFields }) {
3713
3823
  return fields.filter((field) => {
3714
- const match = (types == null ? void 0 : types.length) ? types.some((type) => matchFieldType(field, type, appends2)) : true;
3824
+ if (types == null ? void 0 : types.length) {
3825
+ return types.some((type) => matchFieldType(field, type, appends2));
3826
+ }
3715
3827
  if (isAssociationField(field)) {
3716
3828
  const nextAppends = getNextAppends(field, appends2);
3717
3829
  const included = appends2.includes(field.name);
3718
- if (match) {
3719
- return included;
3720
- } else {
3721
- return (nextAppends.length || included) && filterTypedFields({
3722
- fields: getNormalizedFields(field.target, { compile, getCollectionFields }),
3723
- types,
3724
- // depth: depth - 1,
3725
- appends: nextAppends,
3726
- compile,
3727
- getCollectionFields
3728
- }).length;
3729
- }
3730
- } else {
3731
- return match;
3830
+ return (nextAppends.length || included) && filterTypedFields({
3831
+ fields: getNormalizedFields(field.target, { compile, getCollectionFields }),
3832
+ types,
3833
+ // depth: depth - 1,
3834
+ appends: nextAppends,
3835
+ compile,
3836
+ getCollectionFields
3837
+ }).length;
3732
3838
  }
3839
+ return true;
3733
3840
  });
3734
3841
  }
3735
3842
  function useWorkflowVariableOptions(options = {}) {
@@ -3920,7 +4027,7 @@
3920
4027
  ValueBlock.Result = Result$1;
3921
4028
  function matchToManyField(field, appends2) {
3922
4029
  const fieldPrefix = `${field.name}.`;
3923
- return ["hasMany", "belongsToMany"].includes(field.type) && (appends2 ? appends2.includes(field.name) || appends2.some((item) => item.startsWith(fieldPrefix)) : true);
4030
+ return ["hasOne", "belongsTo"].includes(field.type) && (appends2 ? appends2.includes(field.name) || appends2.some((item) => item.startsWith(fieldPrefix)) : true) || ["hasMany", "belongsToMany"].includes(field.type);
3924
4031
  }
3925
4032
  function useAssociatedFields() {
3926
4033
  const compile = client.useCompile();
@@ -5126,122 +5233,6 @@
5126
5233
  }
5127
5234
  );
5128
5235
  }
5129
- const EXECUTION_STATUS = {
5130
- QUEUEING: null,
5131
- STARTED: 0,
5132
- RESOLVED: 1,
5133
- FAILED: -1,
5134
- ERROR: -2,
5135
- ABORTED: -3,
5136
- CANCELED: -4,
5137
- REJECTED: -5
5138
- };
5139
- const ExecutionStatusOptions = [
5140
- {
5141
- value: EXECUTION_STATUS.QUEUEING,
5142
- label: `{{t("Queueing", { ns: "${NAMESPACE}" })}}`,
5143
- color: "blue",
5144
- description: `{{t("Triggered but still waiting in queue to execute.", { ns: "${NAMESPACE}" })}}`
5145
- },
5146
- {
5147
- value: EXECUTION_STATUS.STARTED,
5148
- label: `{{t("On going", { ns: "${NAMESPACE}" })}}`,
5149
- color: "gold",
5150
- description: `{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "${NAMESPACE}" })}}`
5151
- },
5152
- {
5153
- value: EXECUTION_STATUS.RESOLVED,
5154
- label: `{{t("Resolved", { ns: "${NAMESPACE}" })}}`,
5155
- color: "green",
5156
- description: `{{t("Successfully finished.", { ns: "${NAMESPACE}" })}}`
5157
- },
5158
- {
5159
- value: EXECUTION_STATUS.FAILED,
5160
- label: `{{t("Failed", { ns: "${NAMESPACE}" })}}`,
5161
- color: "red",
5162
- description: `{{t("Failed to satisfy node configurations.", { ns: "${NAMESPACE}" })}}`
5163
- },
5164
- {
5165
- value: EXECUTION_STATUS.ERROR,
5166
- label: `{{t("Error", { ns: "${NAMESPACE}" })}}`,
5167
- color: "red",
5168
- description: `{{t("Some node meets error.", { ns: "${NAMESPACE}" })}}`
5169
- },
5170
- {
5171
- value: EXECUTION_STATUS.ABORTED,
5172
- label: `{{t("Aborted", { ns: "${NAMESPACE}" })}}`,
5173
- color: "red",
5174
- description: `{{t("Running of some node was aborted by program flow.", { ns: "${NAMESPACE}" })}}`
5175
- },
5176
- {
5177
- value: EXECUTION_STATUS.CANCELED,
5178
- label: `{{t("Canceled", { ns: "${NAMESPACE}" })}}`,
5179
- color: "volcano",
5180
- description: `{{t("Manually canceled whole execution when waiting.", { ns: "${NAMESPACE}" })}}`
5181
- },
5182
- {
5183
- value: EXECUTION_STATUS.REJECTED,
5184
- label: `{{t("Rejected", { ns: "${NAMESPACE}" })}}`,
5185
- color: "volcano",
5186
- description: `{{t("Rejected from a manual node.", { ns: "${NAMESPACE}" })}}`
5187
- }
5188
- ];
5189
- const ExecutionStatusOptionsMap = ExecutionStatusOptions.reduce(
5190
- (map, option) => Object.assign(map, { [option.value]: option }),
5191
- {}
5192
- );
5193
- const JOB_STATUS = {
5194
- PENDING: 0,
5195
- RESOLVED: 1,
5196
- FAILED: -1,
5197
- ERROR: -2,
5198
- ABORTED: -3,
5199
- CANCELED: -4,
5200
- REJECTED: -5
5201
- };
5202
- const JobStatusOptions = [
5203
- {
5204
- value: JOB_STATUS.PENDING,
5205
- label: `{{t("Pending", { ns: "${NAMESPACE}" })}}`,
5206
- color: "gold",
5207
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.ClockCircleOutlined, {})
5208
- },
5209
- {
5210
- value: JOB_STATUS.RESOLVED,
5211
- label: `{{t("Resolved", { ns: "${NAMESPACE}" })}}`,
5212
- color: "green",
5213
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CheckOutlined, {})
5214
- },
5215
- {
5216
- value: JOB_STATUS.FAILED,
5217
- label: `{{t("Failed", { ns: "${NAMESPACE}" })}}`,
5218
- color: "red",
5219
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.ExclamationOutlined, {})
5220
- },
5221
- { value: JOB_STATUS.ERROR, label: `{{t("Error", { ns: "${NAMESPACE}" })}}`, color: "red", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CloseOutlined, {}) },
5222
- {
5223
- value: JOB_STATUS.ABORTED,
5224
- label: `{{t("Aborted", { ns: "${NAMESPACE}" })}}`,
5225
- color: "red",
5226
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, { rotate: 90 })
5227
- },
5228
- {
5229
- value: JOB_STATUS.CANCELED,
5230
- label: `{{t("Canceled", { ns: "${NAMESPACE}" })}}`,
5231
- color: "volcano",
5232
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, { rotate: 45 })
5233
- },
5234
- {
5235
- value: JOB_STATUS.REJECTED,
5236
- label: `{{t("Rejected", { ns: "${NAMESPACE}" })}}`,
5237
- color: "volcano",
5238
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MinusOutlined, {})
5239
- }
5240
- ];
5241
- const JobStatusOptionsMap = JobStatusOptions.reduce(
5242
- (map, option) => Object.assign(map, { [option.value]: option }),
5243
- {}
5244
- );
5245
5236
  const delay = {
5246
5237
  title: `{{t("Delay", { ns: "${NAMESPACE}" })}}`,
5247
5238
  type: "delay",
@@ -7357,20 +7348,39 @@
7357
7348
  var classnamesExports = classnames$1.exports;
7358
7349
  const classnames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
7359
7350
  const useStyles = client.createStyles(({ css: css2, token }) => ({
7360
- statusIconClass: css2`
7361
- padding: 0;
7362
- width: ${token.sizeLG}px;
7363
- height: ${token.sizeLG}px;
7364
- line-height: ${token.sizeLG}px;
7365
- margin-right: 0;
7366
- border-radius: 50%;
7367
- text-align: center;
7351
+ statusButtonClass: css2`
7352
+ border: none;
7353
+ .ant-tag {
7354
+ width: 100%;
7355
+ height: 100%;
7356
+ padding: 0;
7357
+ margin-right: 0;
7358
+ border-radius: 50%;
7359
+ text-align: center;
7360
+ }
7361
+ `,
7362
+ noStatusButtonClass: css2`
7363
+ border-width: 2px;
7368
7364
  `
7369
7365
  }));
7370
- function StatusIcon(props) {
7371
- const { icon, color } = JobStatusOptionsMap[props.status];
7366
+ function StatusButton(props) {
7367
+ var _a;
7372
7368
  const { styles } = useStyles();
7373
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tag, { color, className: classnames(styles.statusIconClass, props.className), children: icon });
7369
+ let tag = null;
7370
+ if (typeof props.status !== "undefined" && ((_a = props.statusMap) == null ? void 0 : _a[props.status])) {
7371
+ const { icon, color } = props.statusMap[props.status];
7372
+ tag = /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tag, { color, children: icon });
7373
+ }
7374
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
7375
+ antd.Button,
7376
+ {
7377
+ ...props,
7378
+ shape: "circle",
7379
+ size: "small",
7380
+ className: classnames(tag ? styles.statusButtonClass : styles.noStatusButtonClass, props.className),
7381
+ children: tag
7382
+ }
7383
+ );
7374
7384
  }
7375
7385
  const instructions = new client$1.Registry();
7376
7386
  instructions.register("calculation", calculation);
@@ -7401,7 +7411,7 @@
7401
7411
  return;
7402
7412
  }
7403
7413
  await form.submit();
7404
- await ((_b = (_a = api.resource("flow_nodes", data.id)).update) == null ? void 0 : _b.call(_a, {
7414
+ await ((_b = (_a = api.resource("flow_nodes")).update) == null ? void 0 : _b.call(_a, {
7405
7415
  filterByTk: data.id,
7406
7416
  values: {
7407
7417
  config: form.values
@@ -7476,7 +7486,7 @@
7476
7486
  if (!workflow) {
7477
7487
  return null;
7478
7488
  }
7479
- const resource = api.resource("workflows.nodes", workflow.id);
7489
+ const resource = api.resource("flow_nodes");
7480
7490
  async function onRemove() {
7481
7491
  async function onOk() {
7482
7492
  var _a;
@@ -7524,10 +7534,6 @@
7524
7534
  }
7525
7535
  );
7526
7536
  }
7527
- function InnerJobButton({ job, ...props }) {
7528
- const { styles } = useStyles$1();
7529
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { ...props, shape: "circle", size: "small", className: client.cx(styles.nodeJobButtonClass, props.className), children: /* @__PURE__ */ jsxRuntimeExports.jsx(StatusIcon, { status: job.status }) });
7530
- }
7531
7537
  function JobButton() {
7532
7538
  const { execution, setViewJob } = useFlowContext();
7533
7539
  const { jobs } = useNodeContext() ?? {};
@@ -7536,19 +7542,7 @@
7536
7542
  return null;
7537
7543
  }
7538
7544
  if (!jobs.length) {
7539
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
7540
- "span",
7541
- {
7542
- className: client.cx(
7543
- styles.nodeJobButtonClass,
7544
- client.css`
7545
- border: 2px solid #d9d9d9;
7546
- border-radius: 50%;
7547
- cursor: not-allowed;
7548
- `
7549
- )
7550
- }
7551
- );
7545
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(StatusButton, { className: styles.nodeJobButtonClass, disabled: true });
7552
7546
  }
7553
7547
  function onOpenJob({ key }) {
7554
7548
  const job = jobs.find((item) => item.id == key);
@@ -7561,32 +7555,33 @@
7561
7555
  items: jobs.map((job) => {
7562
7556
  return {
7563
7557
  key: job.id,
7564
- label: /* @__PURE__ */ jsxRuntimeExports.jsxs(
7565
- "div",
7566
- {
7567
- className: client.css`
7568
- display: flex;
7569
- align-items: center;
7570
- gap: 0.5em;
7571
-
7572
- time {
7573
- color: #999;
7574
- font-size: 0.8em;
7575
- }
7576
- `,
7577
- children: [
7578
- /* @__PURE__ */ jsxRuntimeExports.jsx(StatusIcon, { status: job.status }),
7579
- /* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: client$1.str2moment(job.updatedAt).format("YYYY-MM-DD HH:mm:ss") })
7580
- ]
7581
- }
7582
- )
7558
+ label: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
7559
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StatusButton, { statusMap: JobStatusOptionsMap, status: job.status }),
7560
+ /* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: client$1.str2moment(job.updatedAt).format("YYYY-MM-DD HH:mm:ss") })
7561
+ ] })
7583
7562
  };
7584
7563
  }),
7585
- onClick: onOpenJob
7564
+ onClick: onOpenJob,
7565
+ className: styles.dropdownClass
7586
7566
  },
7587
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(InnerJobButton, { job: jobs[jobs.length - 1] })
7567
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
7568
+ StatusButton,
7569
+ {
7570
+ statusMap: JobStatusOptionsMap,
7571
+ status: jobs[jobs.length - 1].status,
7572
+ className: styles.nodeJobButtonClass
7573
+ }
7574
+ )
7575
+ }
7576
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
7577
+ StatusButton,
7578
+ {
7579
+ statusMap: JobStatusOptionsMap,
7580
+ status: jobs[0].status,
7581
+ onClick: () => setViewJob(jobs[0]),
7582
+ className: styles.nodeJobButtonClass
7588
7583
  }
7589
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(InnerJobButton, { job: jobs[0], onClick: () => setViewJob(jobs[0]) });
7584
+ );
7590
7585
  }
7591
7586
  function NodeDefaultView(props) {
7592
7587
  const { data, children } = props;
@@ -8007,16 +8002,17 @@
8007
8002
  antd.Dropdown,
8008
8003
  {
8009
8004
  menu: {
8010
- className: styles.executionsDropdownRowClass,
8011
8005
  onClick,
8006
+ defaultSelectedKeys: [`${execution.id}`],
8007
+ className: client.cx(styles.dropdownClass, styles.executionsDropdownRowClass),
8012
8008
  items: [...executionsAfter, execution, ...executionsBefore].map((item) => {
8013
8009
  return {
8014
8010
  key: item.id,
8015
- label: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: classnames("row", { current: item.id === execution.id }), children: [
8011
+ label: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
8016
8012
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "id", children: `#${item.id}` }),
8017
8013
  /* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: client$1.str2moment(item.createdAt).format("YYYY-MM-DD HH:mm:ss") })
8018
8014
  ] }),
8019
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(StatusIcon, { status: item.status })
8015
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StatusButton, { statusMap: ExecutionStatusOptionsMap, status: item.status }) })
8020
8016
  };
8021
8017
  })
8022
8018
  },
@@ -8428,7 +8424,7 @@
8428
8424
  menu: {
8429
8425
  onClick: onSwitchVersion,
8430
8426
  defaultSelectedKeys: [`${workflow.id}`],
8431
- className: client.cx(styles.workflowVersionDropdownClass),
8427
+ className: client.cx(styles.dropdownClass, styles.workflowVersionDropdownClass),
8432
8428
  items: revisions.sort((a, b2) => b2.id - a.id).map((item, index) => ({
8433
8429
  key: `${item.id}`,
8434
8430
  icon: item.current ? /* @__PURE__ */ jsxRuntimeExports.jsx(icons.RightOutlined, {}) : null,
@@ -1,5 +1,6 @@
1
1
  declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
2
  workflowPageClass: import("antd-style").SerializedStyles;
3
+ dropdownClass: import("antd-style").SerializedStyles;
3
4
  workflowVersionDropdownClass: import("antd-style").SerializedStyles;
4
5
  executionsDropdownRowClass: import("antd-style").SerializedStyles;
5
6
  branchBlockClass: import("antd-style").SerializedStyles;
@@ -1 +1 @@
1
- {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2023-08-18T08:41:04.503Z"}
1
+ {"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2023-08-24T10:48:00.480Z"}
@@ -1 +1 @@
1
- {"type":"commonjs","_lastModified":"2023-08-18T08:41:03.882Z"}
1
+ {"type":"commonjs","_lastModified":"2023-08-24T10:47:59.850Z"}
@@ -1,11 +1,11 @@
1
1
  import { Plugin } from '@nocobase/server';
2
2
  import { Registry } from '@nocobase/utils';
3
- import { Instruction } from './instructions';
3
+ import { Logger } from '@nocobase/logger';
4
4
  import Processor from './Processor';
5
- import { Trigger } from './triggers';
6
5
  import { CustomFunction } from './functions';
7
- import { Logger } from '@nocobase/logger';
8
- import type { WorkflowModel, ExecutionModel } from './types';
6
+ import { Instruction } from './instructions';
7
+ import { Trigger } from './triggers';
8
+ import type { ExecutionModel, WorkflowModel } from './types';
9
9
  type ID = number | string;
10
10
  export default class WorkflowPlugin extends Plugin {
11
11
  instructions: Registry<Instruction>;
@@ -22,10 +22,10 @@ export default class WorkflowPlugin extends Plugin {
22
22
  trigger(workflow: WorkflowModel, context: object, options?: {
23
23
  context?: any;
24
24
  }): void;
25
- private prepare;
26
25
  resume(job: any): Promise<void>;
26
+ createProcessor(execution: ExecutionModel, options?: {}): Processor;
27
+ private prepare;
27
28
  private dispatch;
28
29
  private process;
29
- createProcessor(execution: ExecutionModel, options?: {}): Processor;
30
30
  }
31
31
  export {};