@nocobase/flow-engine 2.1.0-alpha.37 → 2.1.0-alpha.38

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.
@@ -153,7 +153,7 @@ const _FlowExecutor = class _FlowExecutor {
153
153
  const stepDefaultParams = await (0, import_utils.resolveDefaultParams)(step.defaultParams, runtimeCtx);
154
154
  combinedParams = { ...stepDefaultParams };
155
155
  } else {
156
- flowContext.logger.error(
156
+ flowContext.logger.warn(
157
157
  `BaseModel.applyFlow: Step '${stepKey}' in flow '${flowKey}' has neither 'use' nor 'handler'. Skipping.`
158
158
  );
159
159
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/flow-engine",
3
- "version": "2.1.0-alpha.37",
3
+ "version": "2.1.0-alpha.38",
4
4
  "private": false,
5
5
  "description": "A standalone flow engine for NocoBase, managing workflows, models, and actions.",
6
6
  "main": "lib/index.js",
@@ -8,8 +8,8 @@
8
8
  "dependencies": {
9
9
  "@formily/antd-v5": "1.x",
10
10
  "@formily/reactive": "2.x",
11
- "@nocobase/sdk": "2.1.0-alpha.37",
12
- "@nocobase/shared": "2.1.0-alpha.37",
11
+ "@nocobase/sdk": "2.1.0-alpha.38",
12
+ "@nocobase/shared": "2.1.0-alpha.38",
13
13
  "ahooks": "^3.7.2",
14
14
  "axios": "^1.7.0",
15
15
  "dayjs": "^1.11.9",
@@ -37,5 +37,5 @@
37
37
  ],
38
38
  "author": "NocoBase Team",
39
39
  "license": "Apache-2.0",
40
- "gitHead": "8b45f4586ea5b386b376188cfc1012ec12e9bc8b"
40
+ "gitHead": "cc99815fc9ae0612d6db0db5ebbc87a774fff8ed"
41
41
  }
@@ -158,7 +158,7 @@ export class FlowExecutor {
158
158
  const stepDefaultParams = await resolveDefaultParams(step.defaultParams, runtimeCtx);
159
159
  combinedParams = { ...stepDefaultParams };
160
160
  } else {
161
- flowContext.logger.error(
161
+ flowContext.logger.warn(
162
162
  `BaseModel.applyFlow: Step '${stepKey}' in flow '${flowKey}' has neither 'use' nor 'handler'. Skipping.`,
163
163
  );
164
164
  continue;
@@ -546,6 +546,34 @@ describe('FlowModel', () => {
546
546
 
547
547
  loggerSpy.mockRestore();
548
548
  });
549
+
550
+ test('should warn and skip step when use and handler are both missing', async () => {
551
+ const warnSpy = vi.spyOn(model.context.logger, 'warn').mockImplementation(() => {});
552
+ const errorSpy = vi.spyOn(model.context.logger, 'error').mockImplementation(() => {});
553
+
554
+ TestFlowModel.registerFlow({
555
+ key: 'settingsOnlyFlow',
556
+ steps: {
557
+ edit: {
558
+ title: 'Edit',
559
+ uiSchema: {},
560
+ },
561
+ },
562
+ });
563
+
564
+ const result = await model.applyFlow('settingsOnlyFlow');
565
+
566
+ expect(result).toEqual({});
567
+ expect(warnSpy).toHaveBeenCalledWith(
568
+ expect.stringContaining("Step 'edit' in flow 'settingsOnlyFlow' has neither 'use' nor 'handler'"),
569
+ );
570
+ expect(errorSpy).not.toHaveBeenCalledWith(
571
+ expect.stringContaining("Step 'edit' in flow 'settingsOnlyFlow' has neither 'use' nor 'handler'"),
572
+ );
573
+
574
+ warnSpy.mockRestore();
575
+ errorSpy.mockRestore();
576
+ });
549
577
  });
550
578
 
551
579
  describe('beforeRender flows', () => {