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

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;
@@ -433,6 +543,17 @@
433
543
  transform: translateY(-50%);
434
544
  width: 2em;
435
545
  height: 6em;
546
+ `,
547
+ terminalClass: css2`
548
+ display: flex;
549
+ align-items: center;
550
+ justify-content: center;
551
+ flex-shrink: 0;
552
+ width: 4em;
553
+ height: 4em;
554
+ border-radius: 50%;
555
+ background-color: ${token.colorText};
556
+ color: ${token.colorBgContainer};
436
557
  `
437
558
  };
438
559
  });
@@ -3711,25 +3832,22 @@
3711
3832
  }
3712
3833
  function filterTypedFields({ fields, types, appends: appends2, compile, getCollectionFields }) {
3713
3834
  return fields.filter((field) => {
3714
- const match = (types == null ? void 0 : types.length) ? types.some((type) => matchFieldType(field, type, appends2)) : true;
3835
+ if (types == null ? void 0 : types.length) {
3836
+ return types.some((type) => matchFieldType(field, type, appends2));
3837
+ }
3715
3838
  if (isAssociationField(field)) {
3716
3839
  const nextAppends = getNextAppends(field, appends2);
3717
3840
  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;
3841
+ return (nextAppends.length || included) && filterTypedFields({
3842
+ fields: getNormalizedFields(field.target, { compile, getCollectionFields }),
3843
+ types,
3844
+ // depth: depth - 1,
3845
+ appends: nextAppends,
3846
+ compile,
3847
+ getCollectionFields
3848
+ }).length;
3732
3849
  }
3850
+ return true;
3733
3851
  });
3734
3852
  }
3735
3853
  function useWorkflowVariableOptions(options = {}) {
@@ -3920,7 +4038,7 @@
3920
4038
  ValueBlock.Result = Result$1;
3921
4039
  function matchToManyField(field, appends2) {
3922
4040
  const fieldPrefix = `${field.name}.`;
3923
- return ["hasMany", "belongsToMany"].includes(field.type) && (appends2 ? appends2.includes(field.name) || appends2.some((item) => item.startsWith(fieldPrefix)) : true);
4041
+ return ["hasOne", "belongsTo"].includes(field.type) && (appends2 ? appends2.includes(field.name) || appends2.some((item) => item.startsWith(fieldPrefix)) : true) || ["hasMany", "belongsToMany"].includes(field.type);
3924
4042
  }
3925
4043
  function useAssociatedFields() {
3926
4044
  const compile = client.useCompile();
@@ -5126,122 +5244,6 @@
5126
5244
  }
5127
5245
  );
5128
5246
  }
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
5247
  const delay = {
5246
5248
  title: `{{t("Delay", { ns: "${NAMESPACE}" })}}`,
5247
5249
  type: "delay",
@@ -5534,7 +5536,7 @@
5534
5536
  const api = client.useAPIClient();
5535
5537
  const resource = api.resource(props.collection);
5536
5538
  const __parent = React.useContext(client.BlockRequestContext);
5537
- return /* @__PURE__ */ jsxRuntimeExports.jsx(client.CollectionProvider, { collection: props.collection, children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.RecordProvider, { record: values2, parent: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.BlockRequestContext.Provider, { value: { block: "form", props, field, service, resource, __parent }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
5539
+ return !userJob.status || values2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(client.CollectionProvider, { collection: props.collection, children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.RecordProvider, { record: values2, parent: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.BlockRequestContext.Provider, { value: { block: "form", props, field, service, resource, __parent }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
5538
5540
  client.FormBlockContext.Provider,
5539
5541
  {
5540
5542
  value: {
@@ -5550,7 +5552,7 @@
5550
5552
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: formBlockRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(react.RecursionField, { schema: fieldSchema, onlyRenderProperties: true }) })
5551
5553
  ] })
5552
5554
  }
5553
- ) }) }) });
5555
+ ) }) }) }) : null;
5554
5556
  }
5555
5557
  function InternalFormBlockInitializer({ insert, schema, ...others }) {
5556
5558
  const { getTemplateSchemaByMode } = client.useSchemaTemplateManager();
@@ -5697,7 +5699,7 @@
5697
5699
  }),
5698
5700
  [values2]
5699
5701
  );
5700
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
5702
+ return !userJob.status || values2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
5701
5703
  client.CollectionProvider,
5702
5704
  {
5703
5705
  collection: {
@@ -5716,7 +5718,7 @@
5716
5718
  }
5717
5719
  ) })
5718
5720
  }
5719
- );
5721
+ ) : null;
5720
5722
  }
5721
5723
  function CustomFormBlockInitializer({ insert, ...props }) {
5722
5724
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -5760,11 +5762,7 @@
5760
5762
  "x-decorator": "ActionBarProvider",
5761
5763
  "x-component": "ActionBar",
5762
5764
  "x-component-props": {
5763
- layout: "one-column",
5764
- style: {
5765
- marginTop: "1.5em",
5766
- flexWrap: "wrap"
5767
- }
5765
+ layout: "one-column"
5768
5766
  },
5769
5767
  "x-initializer": "AddActionButton",
5770
5768
  properties: {
@@ -7357,20 +7355,39 @@
7357
7355
  var classnamesExports = classnames$1.exports;
7358
7356
  const classnames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
7359
7357
  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;
7358
+ statusButtonClass: css2`
7359
+ border: none;
7360
+ .ant-tag {
7361
+ width: 100%;
7362
+ height: 100%;
7363
+ padding: 0;
7364
+ margin-right: 0;
7365
+ border-radius: 50%;
7366
+ text-align: center;
7367
+ }
7368
+ `,
7369
+ noStatusButtonClass: css2`
7370
+ border-width: 2px;
7368
7371
  `
7369
7372
  }));
7370
- function StatusIcon(props) {
7371
- const { icon, color } = JobStatusOptionsMap[props.status];
7373
+ function StatusButton(props) {
7374
+ var _a;
7372
7375
  const { styles } = useStyles();
7373
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tag, { color, className: classnames(styles.statusIconClass, props.className), children: icon });
7376
+ let tag = null;
7377
+ if (typeof props.status !== "undefined" && ((_a = props.statusMap) == null ? void 0 : _a[props.status])) {
7378
+ const { icon, color } = props.statusMap[props.status];
7379
+ tag = /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tag, { color, children: icon });
7380
+ }
7381
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
7382
+ antd.Button,
7383
+ {
7384
+ ...props,
7385
+ shape: "circle",
7386
+ size: "small",
7387
+ className: classnames(tag ? styles.statusButtonClass : styles.noStatusButtonClass, props.className),
7388
+ children: tag
7389
+ }
7390
+ );
7374
7391
  }
7375
7392
  const instructions = new client$1.Registry();
7376
7393
  instructions.register("calculation", calculation);
@@ -7401,7 +7418,7 @@
7401
7418
  return;
7402
7419
  }
7403
7420
  await form.submit();
7404
- await ((_b = (_a = api.resource("flow_nodes", data.id)).update) == null ? void 0 : _b.call(_a, {
7421
+ await ((_b = (_a = api.resource("flow_nodes")).update) == null ? void 0 : _b.call(_a, {
7405
7422
  filterByTk: data.id,
7406
7423
  values: {
7407
7424
  config: form.values
@@ -7476,7 +7493,7 @@
7476
7493
  if (!workflow) {
7477
7494
  return null;
7478
7495
  }
7479
- const resource = api.resource("workflows.nodes", workflow.id);
7496
+ const resource = api.resource("flow_nodes");
7480
7497
  async function onRemove() {
7481
7498
  async function onOk() {
7482
7499
  var _a;
@@ -7524,10 +7541,6 @@
7524
7541
  }
7525
7542
  );
7526
7543
  }
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
7544
  function JobButton() {
7532
7545
  const { execution, setViewJob } = useFlowContext();
7533
7546
  const { jobs } = useNodeContext() ?? {};
@@ -7536,19 +7549,7 @@
7536
7549
  return null;
7537
7550
  }
7538
7551
  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
- );
7552
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(StatusButton, { className: styles.nodeJobButtonClass, disabled: true });
7552
7553
  }
7553
7554
  function onOpenJob({ key }) {
7554
7555
  const job = jobs.find((item) => item.id == key);
@@ -7561,32 +7562,33 @@
7561
7562
  items: jobs.map((job) => {
7562
7563
  return {
7563
7564
  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
- )
7565
+ label: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
7566
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StatusButton, { statusMap: JobStatusOptionsMap, status: job.status }),
7567
+ /* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: client$1.str2moment(job.updatedAt).format("YYYY-MM-DD HH:mm:ss") })
7568
+ ] })
7583
7569
  };
7584
7570
  }),
7585
- onClick: onOpenJob
7571
+ onClick: onOpenJob,
7572
+ className: styles.dropdownClass
7586
7573
  },
7587
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(InnerJobButton, { job: jobs[jobs.length - 1] })
7574
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
7575
+ StatusButton,
7576
+ {
7577
+ statusMap: JobStatusOptionsMap,
7578
+ status: jobs[jobs.length - 1].status,
7579
+ className: styles.nodeJobButtonClass
7580
+ }
7581
+ )
7582
+ }
7583
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
7584
+ StatusButton,
7585
+ {
7586
+ statusMap: JobStatusOptionsMap,
7587
+ status: jobs[0].status,
7588
+ onClick: () => setViewJob(jobs[0]),
7589
+ className: styles.nodeJobButtonClass
7588
7590
  }
7589
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(InnerJobButton, { job: jobs[0], onClick: () => setViewJob(jobs[0]) });
7591
+ );
7590
7592
  }
7591
7593
  function NodeDefaultView(props) {
7592
7594
  const { data, children } = props;
@@ -7865,7 +7867,7 @@
7865
7867
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "workflow-canvas", children: [
7866
7868
  /* @__PURE__ */ jsxRuntimeExports.jsx(TriggerConfig, {}),
7867
7869
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.branchBlockClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Branch, { entry }) }),
7868
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: client.cx("end", styles.nodeCardClass), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: client.cx(styles.nodeMetaClass), children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tag, { color: "#333", children: lang("End") }) }) })
7870
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.terminalClass, children: lang("End") })
7869
7871
  ] });
7870
7872
  }
7871
7873
  function attachJobs(nodes, jobs = []) {
@@ -8007,16 +8009,17 @@
8007
8009
  antd.Dropdown,
8008
8010
  {
8009
8011
  menu: {
8010
- className: styles.executionsDropdownRowClass,
8011
8012
  onClick,
8013
+ defaultSelectedKeys: [`${execution.id}`],
8014
+ className: client.cx(styles.dropdownClass, styles.executionsDropdownRowClass),
8012
8015
  items: [...executionsAfter, execution, ...executionsBefore].map((item) => {
8013
8016
  return {
8014
8017
  key: item.id,
8015
- label: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: classnames("row", { current: item.id === execution.id }), children: [
8018
+ label: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
8016
8019
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "id", children: `#${item.id}` }),
8017
8020
  /* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: client$1.str2moment(item.createdAt).format("YYYY-MM-DD HH:mm:ss") })
8018
8021
  ] }),
8019
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(StatusIcon, { status: item.status })
8022
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StatusButton, { statusMap: ExecutionStatusOptionsMap, status: item.status }) })
8020
8023
  };
8021
8024
  })
8022
8025
  },
@@ -8428,7 +8431,7 @@
8428
8431
  menu: {
8429
8432
  onClick: onSwitchVersion,
8430
8433
  defaultSelectedKeys: [`${workflow.id}`],
8431
- className: client.cx(styles.workflowVersionDropdownClass),
8434
+ className: client.cx(styles.dropdownClass, styles.workflowVersionDropdownClass),
8432
8435
  items: revisions.sort((a, b2) => b2.id - a.id).map((item, index) => ({
8433
8436
  key: `${item.id}`,
8434
8437
  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;
@@ -16,5 +17,6 @@ declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<
16
17
  addButtonClass: import("antd-style").SerializedStyles;
17
18
  conditionClass: import("antd-style").SerializedStyles;
18
19
  loopLineClass: import("antd-style").SerializedStyles;
20
+ terminalClass: import("antd-style").SerializedStyles;
19
21
  }>;
20
22
  export default useStyles;
@@ -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-24T16:05:19.318Z"}
@@ -1 +1 @@
1
- {"type":"commonjs","_lastModified":"2023-08-18T08:41:03.882Z"}
1
+ {"type":"commonjs","_lastModified":"2023-08-24T16:05:18.684Z"}