@nocobase/plugin-workflow 0.8.0-alpha.7 → 0.8.0-alpha.9

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.
@@ -198,9 +198,7 @@ function ExecutionCanvas() {
198
198
  color: statusOption.color
199
199
  }, compile(statusOption.label)), _react().default.createElement("time", null, (0, _client2().str2moment)(execution.updatedAt).format('YYYY-MM-DD HH:mm:ss')))), _react().default.createElement("div", {
200
200
  className: "workflow-canvas"
201
- }, _react().default.createElement(_triggers.TriggerConfig, {
202
- workflow: workflow
203
- }), _react().default.createElement("div", {
201
+ }, _react().default.createElement(_triggers.TriggerConfig, null), _react().default.createElement("div", {
204
202
  className: _style.branchBlockClass
205
203
  }, _react().default.createElement(_Branch.Branch, {
206
204
  entry: entry
@@ -268,9 +268,7 @@ function WorkflowCanvas() {
268
268
  onClick: onRevision
269
269
  }, t('Copy to new version')) : null)), _react().default.createElement("div", {
270
270
  className: "workflow-canvas"
271
- }, _react().default.createElement(_triggers.TriggerConfig, {
272
- workflow: workflow
273
- }), _react().default.createElement("div", {
271
+ }, _react().default.createElement(_triggers.TriggerConfig, null), _react().default.createElement("div", {
274
272
  className: _style.branchBlockClass
275
273
  }, _react().default.createElement(_Branch.Branch, {
276
274
  entry: entry
@@ -23,6 +23,4 @@ export interface Trigger {
23
23
  getter?(node: any): React.ReactElement;
24
24
  }
25
25
  export declare const triggers: Registry<Trigger>;
26
- export declare const TriggerConfig: ({ workflow }: {
27
- workflow: any;
28
- }) => JSX.Element;
26
+ export declare const TriggerConfig: () => JSX.Element;
@@ -216,14 +216,15 @@ function TriggerExecution() {
216
216
  });
217
217
  }
218
218
 
219
- const TriggerConfig = ({
220
- workflow
221
- }) => {
219
+ const TriggerConfig = () => {
222
220
  const _useTranslation2 = (0, _reactI18next().useTranslation)(),
223
221
  t = _useTranslation2.t;
224
222
 
225
223
  const compile = (0, _client2().useCompile)();
226
224
 
225
+ const _useFlowContext3 = (0, _FlowContext.useFlowContext)(),
226
+ workflow = _useFlowContext3.workflow;
227
+
227
228
  if (!workflow || !workflow.type) {
228
229
  return null;
229
230
  }
@@ -261,9 +262,14 @@ const TriggerConfig = ({
261
262
  'x-component': 'Action.Drawer',
262
263
  'x-decorator': 'Form',
263
264
  'x-decorator-props': {
264
- initialValue: {
265
- config
265
+ useValues(options) {
266
+ return (0, _client2().useRequest)(() => Promise.resolve({
267
+ data: {
268
+ config
269
+ }
270
+ }), options);
266
271
  }
272
+
267
273
  },
268
274
  properties: {
269
275
  config: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-workflow",
3
- "version": "0.8.0-alpha.7",
3
+ "version": "0.8.0-alpha.9",
4
4
  "main": "lib/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "licenses": [
@@ -10,18 +10,18 @@
10
10
  }
11
11
  ],
12
12
  "dependencies": {
13
- "@nocobase/actions": "0.8.0-alpha.7",
14
- "@nocobase/client": "0.8.0-alpha.7",
15
- "@nocobase/database": "0.8.0-alpha.7",
16
- "@nocobase/server": "0.8.0-alpha.7",
17
- "@nocobase/utils": "0.8.0-alpha.7",
13
+ "@nocobase/actions": "0.8.0-alpha.9",
14
+ "@nocobase/client": "0.8.0-alpha.9",
15
+ "@nocobase/database": "0.8.0-alpha.9",
16
+ "@nocobase/server": "0.8.0-alpha.9",
17
+ "@nocobase/utils": "0.8.0-alpha.9",
18
18
  "classnames": "^2.3.1",
19
19
  "cron-parser": "4.4.0",
20
20
  "json-templates": "^4.2.0",
21
21
  "react-js-cron": "^1.4.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@nocobase/test": "0.8.0-alpha.7"
24
+ "@nocobase/test": "0.8.0-alpha.9"
25
25
  },
26
- "gitHead": "8d6ee41e3ff401922cd8d2d93bc15e289cdf2977"
26
+ "gitHead": "6afe02d59bb22df0f96a7605c9001dcc17a30d6a"
27
27
  }