@nocobase/flow-engine 2.0.50 → 2.0.51

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.
@@ -43,6 +43,10 @@ function encodeFilterByTk(val) {
43
43
  return encodeURIComponent(String(val));
44
44
  }
45
45
  __name(encodeFilterByTk, "encodeFilterByTk");
46
+ function hasUsableSourceId(sourceId) {
47
+ return sourceId !== void 0 && sourceId !== null && String(sourceId) !== "";
48
+ }
49
+ __name(hasUsableSourceId, "hasUsableSourceId");
46
50
  function generatePathnameFromViewParams(viewParams) {
47
51
  if (!viewParams || viewParams.length === 0) {
48
52
  return "/admin";
@@ -62,8 +66,8 @@ function generatePathnameFromViewParams(viewParams) {
62
66
  segments.push("filterbytk", encoded);
63
67
  }
64
68
  }
65
- if (viewParam.sourceId) {
66
- segments.push("sourceid", viewParam.sourceId);
69
+ if (hasUsableSourceId(viewParam.sourceId)) {
70
+ segments.push("sourceid", String(viewParam.sourceId));
67
71
  }
68
72
  });
69
73
  return "/" + segments.join("/");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/flow-engine",
3
- "version": "2.0.50",
3
+ "version": "2.0.51",
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.0.50",
12
- "@nocobase/shared": "2.0.50",
11
+ "@nocobase/sdk": "2.0.51",
12
+ "@nocobase/shared": "2.0.51",
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": "cd183287e7be7bb75349ad91a006f5fa53993962"
40
+ "gitHead": "f77260e6a5471835f9dac39c55fe1aebd11b65f1"
41
41
  }
@@ -26,6 +26,10 @@ function encodeFilterByTk(val: SharedViewParam['filterByTk']): string {
26
26
  return encodeURIComponent(String(val));
27
27
  }
28
28
 
29
+ function hasUsableSourceId(sourceId: unknown): sourceId is string | number {
30
+ return sourceId !== undefined && sourceId !== null && String(sourceId) !== '';
31
+ }
32
+
29
33
  /**
30
34
  * 将 ViewParam 数组转换为 pathname
31
35
  *
@@ -65,8 +69,8 @@ export function generatePathnameFromViewParams(viewParams: ViewParams[]): string
65
69
  segments.push('filterbytk', encoded);
66
70
  }
67
71
  }
68
- if (viewParam.sourceId) {
69
- segments.push('sourceid', viewParam.sourceId);
72
+ if (hasUsableSourceId(viewParam.sourceId)) {
73
+ segments.push('sourceid', String(viewParam.sourceId));
70
74
  }
71
75
  });
72
76