@nocobase/flow-engine 2.0.0-alpha.49 → 2.0.0-alpha.50
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.
- package/lib/acl/Acl.d.ts +2 -1
- package/lib/acl/Acl.js +19 -23
- package/lib/flowEngine.js +20 -8
- package/lib/locale/de-DE.json +63 -0
- package/lib/locale/en-US.json +48 -48
- package/lib/locale/es-ES.json +63 -0
- package/lib/locale/fr-FR.json +63 -0
- package/lib/locale/hu-HU.json +63 -0
- package/lib/locale/id-ID.json +63 -0
- package/lib/locale/index.d.ts +94 -94
- package/lib/locale/it-IT.json +63 -0
- package/lib/locale/ja-JP.json +63 -0
- package/lib/locale/ko-KR.json +63 -0
- package/lib/locale/nl-NL.json +63 -0
- package/lib/locale/pt-BR.json +63 -0
- package/lib/locale/ru-RU.json +63 -0
- package/lib/locale/tr-TR.json +63 -0
- package/lib/locale/uk-UA.json +63 -0
- package/lib/locale/vi-VN.json +63 -0
- package/lib/locale/zh-CN.json +48 -48
- package/lib/locale/zh-TW.json +63 -0
- package/lib/models/flowModel.d.ts +2 -2
- package/lib/resources/multiRecordResource.js +1 -17
- package/lib/resources/singleRecordResource.js +1 -17
- package/lib/types.d.ts +8 -0
- package/lib/utils/serverContextParams.d.ts +3 -0
- package/lib/utils/serverContextParams.js +2 -0
- package/lib/utils/variablesParams.js +2 -1
- package/lib/views/createViewMeta.d.ts +1 -0
- package/lib/views/createViewMeta.js +39 -18
- package/package.json +4 -4
- package/src/__tests__/createViewMeta.popup.test.ts +8 -1
- package/src/acl/Acl.tsx +19 -24
- package/src/flowEngine.ts +24 -7
- package/src/locale/de-DE.json +63 -0
- package/src/locale/en-US.json +48 -48
- package/src/locale/es-ES.json +63 -0
- package/src/locale/fr-FR.json +63 -0
- package/src/locale/hu-HU.json +63 -0
- package/src/locale/id-ID.json +63 -0
- package/src/locale/it-IT.json +63 -0
- package/src/locale/ja-JP.json +63 -0
- package/src/locale/ko-KR.json +63 -0
- package/src/locale/nl-NL.json +63 -0
- package/src/locale/pt-BR.json +63 -0
- package/src/locale/ru-RU.json +63 -0
- package/src/locale/tr-TR.json +63 -0
- package/src/locale/uk-UA.json +63 -0
- package/src/locale/vi-VN.json +63 -0
- package/src/locale/zh-CN.json +48 -48
- package/src/locale/zh-TW.json +63 -0
- package/src/models/__tests__/flowEngine.resolveUse.test.ts +58 -0
- package/src/models/flowModel.tsx +2 -4
- package/src/resources/multiRecordResource.ts +1 -20
- package/src/resources/singleRecordResource.ts +1 -17
- package/src/types.ts +12 -0
- package/src/utils/__tests__/variablesParams.test.ts +33 -0
- package/src/utils/serverContextParams.ts +5 -0
- package/src/utils/variablesParams.ts +2 -1
- package/src/views/createViewMeta.ts +27 -5
|
@@ -147,7 +147,9 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
147
147
|
return {
|
|
148
148
|
collection: res.collectionName,
|
|
149
149
|
dataSourceKey: res.dataSourceKey || "main",
|
|
150
|
-
filterByTk: res.filterByTk
|
|
150
|
+
filterByTk: res.filterByTk,
|
|
151
|
+
associationName: res.associationName,
|
|
152
|
+
sourceId: res.sourceId
|
|
151
153
|
};
|
|
152
154
|
}
|
|
153
155
|
}
|
|
@@ -161,7 +163,7 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
161
163
|
return ((_d = (_c = ds == null ? void 0 : ds.collectionManager) == null ? void 0 : _c.getCollection) == null ? void 0 : _d.call(_c, ref.collection)) || null;
|
|
162
164
|
}, "getCurrentCollection");
|
|
163
165
|
const getParentRecordRef = /* @__PURE__ */ __name(async (level, flowCtx) => {
|
|
164
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
166
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
165
167
|
try {
|
|
166
168
|
const useCtx = flowCtx || ctx;
|
|
167
169
|
const nav = (_a = useCtx.view) == null ? void 0 : _a.navigation;
|
|
@@ -171,22 +173,29 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
171
173
|
if (idx < 0) return void 0;
|
|
172
174
|
const parent = stack[idx];
|
|
173
175
|
if (!(parent == null ? void 0 : parent.viewUid)) return void 0;
|
|
174
|
-
let model = (
|
|
176
|
+
let model = (_b = useCtx.engine) == null ? void 0 : _b.getModel(parent.viewUid, true);
|
|
175
177
|
if (!model) {
|
|
176
178
|
try {
|
|
177
179
|
model = await useCtx.engine.loadModel({ uid: parent.viewUid });
|
|
178
180
|
} catch (e) {
|
|
179
|
-
(
|
|
181
|
+
(_d = (_c = useCtx.logger || ctx.logger) == null ? void 0 : _c.warn) == null ? void 0 : _d.call(_c, { err: e }, "[FlowEngine] popup.getParentRecordRef loadModel failed");
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
|
-
const params = ((
|
|
184
|
+
const params = ((_e = model == null ? void 0 : model.getStepParams) == null ? void 0 : _e.call(model, "popupSettings", "openView")) || {};
|
|
183
185
|
const collection = params == null ? void 0 : params.collectionName;
|
|
184
186
|
const dataSourceKey = (params == null ? void 0 : params.dataSourceKey) || "main";
|
|
185
187
|
const filterByTk = (parent == null ? void 0 : parent.filterByTk) ?? (parent == null ? void 0 : parent.sourceId);
|
|
186
188
|
if (!collection || typeof filterByTk === "undefined" || filterByTk === null) return void 0;
|
|
187
|
-
|
|
189
|
+
const ref = {
|
|
190
|
+
collection,
|
|
191
|
+
dataSourceKey,
|
|
192
|
+
filterByTk,
|
|
193
|
+
sourceId: parent == null ? void 0 : parent.sourceId,
|
|
194
|
+
associationName: params == null ? void 0 : params.associationName
|
|
195
|
+
};
|
|
196
|
+
return ref;
|
|
188
197
|
} catch (e) {
|
|
189
|
-
(
|
|
198
|
+
(_g = (_f = (flowCtx == null ? void 0 : flowCtx.logger) || ctx.logger) == null ? void 0 : _f.warn) == null ? void 0 : _g.call(_f, { err: e }, "[FlowEngine] popup.getParentRecordRef failed");
|
|
190
199
|
return void 0;
|
|
191
200
|
}
|
|
192
201
|
}, "getParentRecordRef");
|
|
@@ -236,6 +245,7 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
236
245
|
properties: /* @__PURE__ */ __name(async () => ({
|
|
237
246
|
dataSourceKey: { type: "string", title: t("Data source key") },
|
|
238
247
|
collectionName: { type: "string", title: t("Collection name") },
|
|
248
|
+
associationName: { type: "string", title: t("Association name") },
|
|
239
249
|
filterByTk: { type: "string", title: t("filterByTk") },
|
|
240
250
|
sourceId: { type: "string", title: t("sourceId") }
|
|
241
251
|
}), "properties")
|
|
@@ -258,7 +268,16 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
258
268
|
const ref = await resolveRecordRef(c);
|
|
259
269
|
const inputArgs = (_a = c.view) == null ? void 0 : _a.inputArgs;
|
|
260
270
|
const params = {};
|
|
261
|
-
if (ref)
|
|
271
|
+
if (ref) {
|
|
272
|
+
const merged = { ...ref };
|
|
273
|
+
if (!merged.associationName && (inputArgs == null ? void 0 : inputArgs.associationName)) {
|
|
274
|
+
merged.associationName = inputArgs.associationName;
|
|
275
|
+
}
|
|
276
|
+
if (typeof merged.sourceId === "undefined" && typeof (inputArgs == null ? void 0 : inputArgs.sourceId) !== "undefined") {
|
|
277
|
+
merged.sourceId = inputArgs == null ? void 0 : inputArgs.sourceId;
|
|
278
|
+
}
|
|
279
|
+
params.record = merged;
|
|
280
|
+
}
|
|
262
281
|
try {
|
|
263
282
|
const nav = (_b = c.view) == null ? void 0 : _b.navigation;
|
|
264
283
|
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
@@ -297,7 +316,7 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
297
316
|
return params;
|
|
298
317
|
}, "buildVariablesParams"),
|
|
299
318
|
properties: /* @__PURE__ */ __name(async () => {
|
|
300
|
-
var _a, _b, _c, _d, _e, _f
|
|
319
|
+
var _a, _b, _c, _d, _e, _f;
|
|
301
320
|
const props = {};
|
|
302
321
|
props.uid = { type: "string", title: t("Popup uid") };
|
|
303
322
|
const recordFactory = /* @__PURE__ */ __name(async () => {
|
|
@@ -322,11 +341,11 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
322
341
|
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
323
342
|
const last = stack == null ? void 0 : stack[stack.length - 1];
|
|
324
343
|
if (last == null ? void 0 : last.viewUid) {
|
|
325
|
-
let model = (
|
|
344
|
+
let model = (_c = ctx == null ? void 0 : ctx.engine) == null ? void 0 : _c.getModel(last.viewUid, true);
|
|
326
345
|
if (!model) {
|
|
327
346
|
model = await ctx.engine.loadModel({ uid: last.viewUid });
|
|
328
347
|
}
|
|
329
|
-
const p = ((
|
|
348
|
+
const p = ((_d = model == null ? void 0 : model.getStepParams) == null ? void 0 : _d.call(model, "popupSettings", "openView")) || {};
|
|
330
349
|
assoc = (p == null ? void 0 : p.associationName) || assoc;
|
|
331
350
|
dsKey = (p == null ? void 0 : p.dataSourceKey) || dsKey;
|
|
332
351
|
}
|
|
@@ -354,7 +373,7 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
354
373
|
}
|
|
355
374
|
}
|
|
356
375
|
} catch (err) {
|
|
357
|
-
(
|
|
376
|
+
(_f = (_e = ctx.logger) == null ? void 0 : _e.debug) == null ? void 0 : _f.call(_e, { err }, "[FlowEngine] popup.properties: build sourceRecord failed");
|
|
358
377
|
}
|
|
359
378
|
const resourceMeta = {
|
|
360
379
|
type: "object",
|
|
@@ -362,6 +381,7 @@ function createPopupMeta(ctx, anchorView) {
|
|
|
362
381
|
properties: /* @__PURE__ */ __name(async () => ({
|
|
363
382
|
dataSourceKey: { type: "string", title: t("Data source key") },
|
|
364
383
|
collectionName: { type: "string", title: t("Collection name") },
|
|
384
|
+
associationName: { type: "string", title: t("Association name") },
|
|
365
385
|
filterByTk: { type: "string", title: t("filterByTk") },
|
|
366
386
|
sourceId: { type: "string", title: t("sourceId") }
|
|
367
387
|
}), "properties")
|
|
@@ -386,14 +406,14 @@ async function buildPopupRuntime(ctx, view) {
|
|
|
386
406
|
const nav = view == null ? void 0 : view.navigation;
|
|
387
407
|
const stack = Array.isArray(nav == null ? void 0 : nav.viewStack) ? nav.viewStack : [];
|
|
388
408
|
const buildNode = /* @__PURE__ */ __name(async (idx) => {
|
|
389
|
-
var _a2, _b2, _c, _d, _e, _f
|
|
409
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
390
410
|
if (idx < 0 || !((_a2 = stack[idx]) == null ? void 0 : _a2.viewUid)) return void 0;
|
|
391
411
|
const viewUid = stack[idx].viewUid;
|
|
392
|
-
let model = (
|
|
412
|
+
let model = (_b2 = ctx.engine) == null ? void 0 : _b2.getModel(viewUid, true);
|
|
393
413
|
if (!model) {
|
|
394
|
-
model = await ((
|
|
414
|
+
model = await ((_c = ctx.engine) == null ? void 0 : _c.loadModel({ uid: viewUid }));
|
|
395
415
|
}
|
|
396
|
-
const p = ((
|
|
416
|
+
const p = ((_d = model == null ? void 0 : model.getStepParams) == null ? void 0 : _d.call(model, "popupSettings", "openView")) || {};
|
|
397
417
|
const collectionName = p == null ? void 0 : p.collectionName;
|
|
398
418
|
const dataSourceKey = (p == null ? void 0 : p.dataSourceKey) || "main";
|
|
399
419
|
const node = {
|
|
@@ -401,8 +421,9 @@ async function buildPopupRuntime(ctx, view) {
|
|
|
401
421
|
resource: {
|
|
402
422
|
dataSourceKey,
|
|
403
423
|
collectionName,
|
|
404
|
-
|
|
405
|
-
|
|
424
|
+
associationName: p == null ? void 0 : p.associationName,
|
|
425
|
+
filterByTk: (_e = stack[idx]) == null ? void 0 : _e.filterByTk,
|
|
426
|
+
sourceId: (_f = stack[idx]) == null ? void 0 : _f.sourceId
|
|
406
427
|
}
|
|
407
428
|
};
|
|
408
429
|
const parentNode = await buildNode(idx - 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/flow-engine",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.50",
|
|
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.0-alpha.
|
|
12
|
-
"@nocobase/shared": "2.0.0-alpha.
|
|
11
|
+
"@nocobase/sdk": "2.0.0-alpha.50",
|
|
12
|
+
"@nocobase/shared": "2.0.0-alpha.50",
|
|
13
13
|
"ahooks": "^3.7.2",
|
|
14
14
|
"dayjs": "^1.11.9",
|
|
15
15
|
"dompurify": "^3.0.2",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
],
|
|
37
37
|
"author": "NocoBase Team",
|
|
38
38
|
"license": "AGPL-3.0",
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "a6eb64abf3632e116ad0b295a7f410270a1059d1"
|
|
40
40
|
}
|
|
@@ -68,6 +68,7 @@ describe('createViewMeta - popup variables', () => {
|
|
|
68
68
|
? {
|
|
69
69
|
collectionName: 'posts',
|
|
70
70
|
dataSourceKey: 'main',
|
|
71
|
+
associationName: 'users.posts',
|
|
71
72
|
}
|
|
72
73
|
: undefined,
|
|
73
74
|
),
|
|
@@ -92,7 +93,13 @@ describe('createViewMeta - popup variables', () => {
|
|
|
92
93
|
// record 应来自锚定视图的 openView 配置
|
|
93
94
|
const vars = (await meta.buildVariablesParams!(ctx)) as any;
|
|
94
95
|
expect(vars).toBeTruthy();
|
|
95
|
-
expect(vars.record).toEqual({
|
|
96
|
+
expect(vars.record).toEqual({
|
|
97
|
+
collection: 'posts',
|
|
98
|
+
dataSourceKey: 'main',
|
|
99
|
+
filterByTk: 111,
|
|
100
|
+
associationName: 'users.posts',
|
|
101
|
+
sourceId: 42,
|
|
102
|
+
});
|
|
96
103
|
|
|
97
104
|
// 确认没有误用 ctx.view(settings-uid)的集合
|
|
98
105
|
expect(vars.record.collection).not.toBe('comments');
|
package/src/acl/Acl.tsx
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { FlowModel } from '../models/flowModel';
|
|
11
10
|
import { FlowEngine } from '../flowEngine';
|
|
11
|
+
import { FlowModel } from '../models/flowModel';
|
|
12
12
|
|
|
13
13
|
interface CheckOptions {
|
|
14
14
|
dataSourceKey: string;
|
|
@@ -18,7 +18,7 @@ interface CheckOptions {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export class ACL {
|
|
21
|
-
private
|
|
21
|
+
private data: Record<string, any> = {};
|
|
22
22
|
private loaded = false;
|
|
23
23
|
private loadingPromise: Promise<void> | null = null;
|
|
24
24
|
// 用于识别当前鉴权状态(例如切换登录用户后应重新加载)
|
|
@@ -27,6 +27,10 @@ export class ACL {
|
|
|
27
27
|
|
|
28
28
|
constructor(private flowEngine: FlowEngine) {}
|
|
29
29
|
|
|
30
|
+
setData(data: Record<string, any>) {
|
|
31
|
+
this.data = data;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
async load() {
|
|
31
35
|
// 基于 token 识别登录态是否发生变化
|
|
32
36
|
const currentToken = this.flowEngine?.context?.api?.auth?.token || '';
|
|
@@ -35,42 +39,34 @@ export class ACL {
|
|
|
35
39
|
if (this.loaded && this.lastToken !== currentToken) {
|
|
36
40
|
this.loaded = false;
|
|
37
41
|
this.loadingPromise = null;
|
|
38
|
-
this.
|
|
42
|
+
this.data = {};
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
this.dataSources = data || {};
|
|
49
|
-
this.loaded = true;
|
|
50
|
-
this.lastToken = currentToken;
|
|
51
|
-
})();
|
|
52
|
-
}
|
|
45
|
+
const { data } = await this.flowEngine.context.api.request({
|
|
46
|
+
url: 'roles:check',
|
|
47
|
+
});
|
|
48
|
+
this.data = data?.data || {};
|
|
49
|
+
this.loaded = true;
|
|
50
|
+
this.lastToken = currentToken;
|
|
53
51
|
|
|
54
52
|
await this.loadingPromise;
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
getActionAlias(actionName: string) {
|
|
58
|
-
return this.
|
|
56
|
+
return this.data.actionAlias?.[actionName] || actionName;
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
inResources(resourceName: string) {
|
|
62
|
-
return this.
|
|
60
|
+
return this.data.resources?.includes?.(resourceName);
|
|
63
61
|
}
|
|
64
62
|
getResourceActionParams(resourceName, actionName) {
|
|
65
63
|
const actionAlias = this.getActionAlias(actionName);
|
|
66
|
-
return
|
|
67
|
-
this.dataSources.data?.actions?.[`${resourceName}:${actionAlias}`] || this.dataSources.data?.actions?.[actionName]
|
|
68
|
-
);
|
|
64
|
+
return this.data.actions?.[`${resourceName}:${actionAlias}`] || this.data.actions?.[actionName];
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
getStrategyActionParams(actionName: string) {
|
|
72
68
|
const actionAlias = this.getActionAlias(actionName);
|
|
73
|
-
const strategyAction = this.
|
|
69
|
+
const strategyAction = this.data?.strategy?.actions?.find((action) => {
|
|
74
70
|
const [value] = action.split(':');
|
|
75
71
|
return value === actionAlias;
|
|
76
72
|
});
|
|
@@ -109,9 +105,8 @@ export class ACL {
|
|
|
109
105
|
}
|
|
110
106
|
|
|
111
107
|
async aclCheck(options: CheckOptions): Promise<boolean> {
|
|
112
|
-
await this.load();
|
|
113
|
-
const {
|
|
114
|
-
const { allowAll } = data;
|
|
108
|
+
// await this.load();
|
|
109
|
+
const { allowAll } = this.data;
|
|
115
110
|
if (allowAll) {
|
|
116
111
|
return true;
|
|
117
112
|
}
|
package/src/flowEngine.ts
CHANGED
|
@@ -31,6 +31,7 @@ import type {
|
|
|
31
31
|
PersistOptions,
|
|
32
32
|
ResourceType,
|
|
33
33
|
RegisteredModelClassName,
|
|
34
|
+
ResolveUseResult,
|
|
34
35
|
} from './types';
|
|
35
36
|
import { isInheritedFrom } from './utils';
|
|
36
37
|
|
|
@@ -459,9 +460,11 @@ export class FlowEngine {
|
|
|
459
460
|
extra?: { delegateToParent?: boolean; delegate?: FlowContext },
|
|
460
461
|
): T {
|
|
461
462
|
const { parentId, uid, use: modelClassName, subModels } = options;
|
|
463
|
+
const parentModel = parentId ? (this._modelInstances.get(parentId) as FlowModel | undefined) : undefined;
|
|
462
464
|
const ModelClass = this._resolveModelClass(
|
|
463
465
|
typeof modelClassName === 'string' ? this.getModelClass(modelClassName) : modelClassName,
|
|
464
466
|
options,
|
|
467
|
+
parentModel,
|
|
465
468
|
);
|
|
466
469
|
|
|
467
470
|
if (uid && this._modelInstances.has(uid)) {
|
|
@@ -516,7 +519,18 @@ export class FlowEngine {
|
|
|
516
519
|
private _resolveModelClass(
|
|
517
520
|
initial: ModelConstructor | undefined,
|
|
518
521
|
options: CreateModelOptions,
|
|
522
|
+
parent?: FlowModel,
|
|
519
523
|
): ModelConstructor | undefined {
|
|
524
|
+
const normalize = (
|
|
525
|
+
resolved: ResolveUseResult | void,
|
|
526
|
+
): { target?: RegisteredModelClassName | ModelConstructor; stop?: boolean } => {
|
|
527
|
+
if (!resolved) return {};
|
|
528
|
+
if (typeof resolved === 'object' && 'use' in resolved) {
|
|
529
|
+
return { target: resolved.use, stop: !!resolved.stop };
|
|
530
|
+
}
|
|
531
|
+
return { target: resolved as any, stop: false };
|
|
532
|
+
};
|
|
533
|
+
|
|
520
534
|
let current = initial;
|
|
521
535
|
const visited = new Set<ModelConstructor>();
|
|
522
536
|
|
|
@@ -528,29 +542,32 @@ export class FlowEngine {
|
|
|
528
542
|
visited.add(current);
|
|
529
543
|
|
|
530
544
|
const resolver = (current as any)?.resolveUse as
|
|
531
|
-
| ((opts: CreateModelOptions, engine: FlowEngine) =>
|
|
545
|
+
| ((opts: CreateModelOptions, engine: FlowEngine, parent?: FlowModel) => ResolveUseResult | void)
|
|
532
546
|
| undefined;
|
|
533
547
|
if (typeof resolver !== 'function') {
|
|
534
548
|
break;
|
|
535
549
|
}
|
|
536
550
|
|
|
537
|
-
const
|
|
538
|
-
if (!
|
|
551
|
+
const { target, stop } = normalize(resolver(options, this, parent));
|
|
552
|
+
if (!target || target === current) {
|
|
539
553
|
break;
|
|
540
554
|
}
|
|
541
555
|
|
|
542
556
|
let next: ModelConstructor | undefined;
|
|
543
|
-
if (typeof
|
|
544
|
-
next = this.getModelClass(
|
|
557
|
+
if (typeof target === 'string') {
|
|
558
|
+
next = this.getModelClass(target);
|
|
545
559
|
if (!next) {
|
|
546
|
-
console.warn(`FlowEngine: resolveUse returned '${
|
|
560
|
+
console.warn(`FlowEngine: resolveUse returned '${target}' but no model is registered under that name.`);
|
|
547
561
|
return undefined;
|
|
548
562
|
}
|
|
549
563
|
} else {
|
|
550
|
-
next =
|
|
564
|
+
next = target;
|
|
551
565
|
}
|
|
552
566
|
|
|
553
567
|
current = next;
|
|
568
|
+
if (stop) {
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
554
571
|
}
|
|
555
572
|
|
|
556
573
|
return current;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
|
|
4
|
+
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Common actions": "Common actions",
|
|
7
|
+
"Complete configuration": "Complete configuration",
|
|
8
|
+
"Configuration": "Configuration",
|
|
9
|
+
"Configuration popup cancelled or error": "Configuration popup cancelled or error",
|
|
10
|
+
"Configuration saved": "Configuration saved",
|
|
11
|
+
"Confirm delete": "Confirm delete",
|
|
12
|
+
"Copy UID": "Copy UID",
|
|
13
|
+
"Copy error info": "Copy error info",
|
|
14
|
+
"Copy failed": "Copy failed",
|
|
15
|
+
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.",
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
17
|
+
"Copy popup UID": "Copy popup UID",
|
|
18
|
+
"Data blocks": "Data blocks",
|
|
19
|
+
"Delete": "Delete",
|
|
20
|
+
"Delete failed": "Delete failed",
|
|
21
|
+
"Delete operation failed": "Delete operation failed",
|
|
22
|
+
"Delete operation failed, please check the console for details.": "Delete operation failed, please check the console for details.",
|
|
23
|
+
"Download logs": "Download logs",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
25
|
+
"Error saving configuration": "Error saving configuration",
|
|
26
|
+
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
27
|
+
"Error submitting form": "Error submitting form",
|
|
28
|
+
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
29
|
+
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
30
|
+
"Failed to add sub model": "Failed to add sub model",
|
|
31
|
+
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
32
|
+
"Failed to get action {{action}}": "Failed to get action {{action}}",
|
|
33
|
+
"Failed to get configurable flows for model {{model}}": "Failed to get configurable flows for model {{model}}",
|
|
34
|
+
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "Failed to import FormDialog or FormStep",
|
|
36
|
+
"Failed to import Formily components": "Failed to import Formily components",
|
|
37
|
+
"Feedback": "Feedback",
|
|
38
|
+
"Filter blocks": "Filter blocks",
|
|
39
|
+
"Flow with key {{flowKey}} not found": "Flow with key {{flowKey}} not found",
|
|
40
|
+
"Form validation failed": "Form validation failed",
|
|
41
|
+
"Invalid input parameters": "Invalid input parameters",
|
|
42
|
+
"Invalid model provided": "Invalid model provided",
|
|
43
|
+
"Invalid subModelKey format": "Invalid subModelKey format: {{subModelKey}}",
|
|
44
|
+
"Model with ID {{uid}} not found": "Model with ID {{uid}} not found",
|
|
45
|
+
"Name": "Name",
|
|
46
|
+
"Next step": "Next step",
|
|
47
|
+
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
48
|
+
"OK": "OK",
|
|
49
|
+
"Other blocks": "Other blocks",
|
|
50
|
+
"Previous step": "Previous step",
|
|
51
|
+
"Render failed": "Render failed",
|
|
52
|
+
"Step configuration": "Step configuration",
|
|
53
|
+
"Step parameter configuration": "Step parameter configuration",
|
|
54
|
+
"Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
|
|
55
|
+
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "This is likely a NocoBase internals bug. Please open an issue at",
|
|
57
|
+
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
58
|
+
"This variable is not available": "This variable is not available",
|
|
59
|
+
"Try again": "Try again",
|
|
60
|
+
"UID copied to clipboard": "UID copied to clipboard",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
62
|
+
"here": "here"
|
|
63
|
+
}
|
package/src/locale/en-US.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"Configuration": "Configuration",
|
|
6
|
-
"Step configuration": "Step configuration",
|
|
7
|
-
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
8
|
-
"Failed to import Formily components": "Failed to import Formily components",
|
|
9
|
-
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
10
|
-
"Configuration saved": "Configuration saved",
|
|
11
|
-
"Error saving configuration": "Error saving configuration",
|
|
12
|
-
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
13
|
-
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
14
|
-
"OK": "OK",
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
|
|
4
|
+
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
15
5
|
"Cancel": "Cancel",
|
|
16
|
-
"
|
|
17
|
-
"Error submitting form": "Error submitting form",
|
|
6
|
+
"Common actions": "Common actions",
|
|
18
7
|
"Complete configuration": "Complete configuration",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"UID
|
|
8
|
+
"Configuration": "Configuration",
|
|
9
|
+
"Configuration popup cancelled or error": "Configuration popup cancelled or error",
|
|
10
|
+
"Configuration saved": "Configuration saved",
|
|
11
|
+
"Confirm delete": "Confirm delete",
|
|
12
|
+
"Copy UID": "Copy UID",
|
|
13
|
+
"Copy error info": "Copy error info",
|
|
24
14
|
"Copy failed": "Copy failed",
|
|
25
|
-
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
26
15
|
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
17
|
+
"Copy popup UID": "Copy popup UID",
|
|
18
|
+
"Data blocks": "Data blocks",
|
|
19
|
+
"Delete": "Delete",
|
|
30
20
|
"Delete failed": "Delete failed",
|
|
21
|
+
"Delete operation failed": "Delete operation failed",
|
|
31
22
|
"Delete operation failed, please check the console for details.": "Delete operation failed, please check the console for details.",
|
|
32
|
-
"
|
|
23
|
+
"Download logs": "Download logs",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
25
|
+
"Error saving configuration": "Error saving configuration",
|
|
26
|
+
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
27
|
+
"Error submitting form": "Error submitting form",
|
|
28
|
+
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
29
|
+
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
30
|
+
"Failed to add sub model": "Failed to add sub model",
|
|
31
|
+
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
33
32
|
"Failed to get action {{action}}": "Failed to get action {{action}}",
|
|
34
33
|
"Failed to get configurable flows for model {{model}}": "Failed to get configurable flows for model {{model}}",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"here": "here",
|
|
39
|
-
"Render failed": "Render failed",
|
|
34
|
+
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "Failed to import FormDialog or FormStep",
|
|
36
|
+
"Failed to import Formily components": "Failed to import Formily components",
|
|
40
37
|
"Feedback": "Feedback",
|
|
41
|
-
"Download logs": "Download logs",
|
|
42
|
-
"Copy error info": "Copy error info",
|
|
43
|
-
"Try again": "Try again",
|
|
44
|
-
"Data blocks": "Data blocks",
|
|
45
38
|
"Filter blocks": "Filter blocks",
|
|
46
|
-
"
|
|
39
|
+
"Flow with key {{flowKey}} not found": "Flow with key {{flowKey}} not found",
|
|
40
|
+
"Form validation failed": "Form validation failed",
|
|
47
41
|
"Invalid input parameters": "Invalid input parameters",
|
|
42
|
+
"Invalid model provided": "Invalid model provided",
|
|
48
43
|
"Invalid subModelKey format": "Invalid subModelKey format: {{subModelKey}}",
|
|
49
|
-
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
50
|
-
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
51
|
-
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
52
|
-
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
53
|
-
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
54
|
-
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
55
|
-
"Failed to add sub model": "Failed to add sub model",
|
|
56
|
-
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
57
|
-
"Add": "Add",
|
|
58
|
-
"Name": "Name",
|
|
59
44
|
"Model with ID {{uid}} not found": "Model with ID {{uid}} not found",
|
|
60
|
-
"
|
|
45
|
+
"Name": "Name",
|
|
46
|
+
"Next step": "Next step",
|
|
47
|
+
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
48
|
+
"OK": "OK",
|
|
49
|
+
"Other blocks": "Other blocks",
|
|
50
|
+
"Previous step": "Previous step",
|
|
51
|
+
"Render failed": "Render failed",
|
|
52
|
+
"Step configuration": "Step configuration",
|
|
53
|
+
"Step parameter configuration": "Step parameter configuration",
|
|
54
|
+
"Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
|
|
55
|
+
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "This is likely a NocoBase internals bug. Please open an issue at",
|
|
57
|
+
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
61
58
|
"This variable is not available": "This variable is not available",
|
|
62
|
-
"
|
|
63
|
-
|
|
59
|
+
"Try again": "Try again",
|
|
60
|
+
"UID copied to clipboard": "UID copied to clipboard",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
62
|
+
"here": "here"
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
|
|
4
|
+
"Array index out of bounds": "Array index {{index}} out of bounds for '{{subKey}}'",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Common actions": "Common actions",
|
|
7
|
+
"Complete configuration": "Complete configuration",
|
|
8
|
+
"Configuration": "Configuration",
|
|
9
|
+
"Configuration popup cancelled or error": "Configuration popup cancelled or error",
|
|
10
|
+
"Configuration saved": "Configuration saved",
|
|
11
|
+
"Confirm delete": "Confirm delete",
|
|
12
|
+
"Copy UID": "Copy UID",
|
|
13
|
+
"Copy error info": "Copy error info",
|
|
14
|
+
"Copy failed": "Copy failed",
|
|
15
|
+
"Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.": "Copy failed under HTTP. Clipboard API is unavailable on non-HTTPS pages. Please copy [{{uid}}] manually.",
|
|
16
|
+
"Copy failed, please copy [{{uid}}] manually.": "Copy failed, please copy [{{uid}}] manually.",
|
|
17
|
+
"Copy popup UID": "Copy popup UID",
|
|
18
|
+
"Data blocks": "Data blocks",
|
|
19
|
+
"Delete": "Delete",
|
|
20
|
+
"Delete failed": "Delete failed",
|
|
21
|
+
"Delete operation failed": "Delete operation failed",
|
|
22
|
+
"Delete operation failed, please check the console for details.": "Delete operation failed, please check the console for details.",
|
|
23
|
+
"Download logs": "Download logs",
|
|
24
|
+
"Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider": "Drawer API is not available, please ensure it is used within FlowEngineGlobalsContextProvider",
|
|
25
|
+
"Error saving configuration": "Error saving configuration",
|
|
26
|
+
"Error saving configuration, please check console": "Error saving configuration, please check console",
|
|
27
|
+
"Error submitting form": "Error submitting form",
|
|
28
|
+
"Expected array for subModel": "Expected array for '{{subKey}}', got {{type}}",
|
|
29
|
+
"Expected object for subModel": "Expected object for '{{subKey}}', got array",
|
|
30
|
+
"Failed to add sub model": "Failed to add sub model",
|
|
31
|
+
"Failed to destroy model after creation error": "Failed to destroy model after creation error",
|
|
32
|
+
"Failed to get action {{action}}": "Failed to get action {{action}}",
|
|
33
|
+
"Failed to get configurable flows for model {{model}}": "Failed to get configurable flows for model {{model}}",
|
|
34
|
+
"Failed to import FormDialog": "Failed to import FormDialog",
|
|
35
|
+
"Failed to import FormDialog or FormStep": "Failed to import FormDialog or FormStep",
|
|
36
|
+
"Failed to import Formily components": "Failed to import Formily components",
|
|
37
|
+
"Feedback": "Feedback",
|
|
38
|
+
"Filter blocks": "Filter blocks",
|
|
39
|
+
"Flow with key {{flowKey}} not found": "Flow with key {{flowKey}} not found",
|
|
40
|
+
"Form validation failed": "Form validation failed",
|
|
41
|
+
"Invalid input parameters": "Invalid input parameters",
|
|
42
|
+
"Invalid model provided": "Invalid model provided",
|
|
43
|
+
"Invalid subModelKey format": "Invalid subModelKey format: {{subModelKey}}",
|
|
44
|
+
"Model with ID {{uid}} not found": "Model with ID {{uid}} not found",
|
|
45
|
+
"Name": "Name",
|
|
46
|
+
"Next step": "Next step",
|
|
47
|
+
"No createModelOptions found for item": "No createModelOptions found for item",
|
|
48
|
+
"OK": "OK",
|
|
49
|
+
"Other blocks": "Other blocks",
|
|
50
|
+
"Previous step": "Previous step",
|
|
51
|
+
"Render failed": "Render failed",
|
|
52
|
+
"Step configuration": "Step configuration",
|
|
53
|
+
"Step parameter configuration": "Step parameter configuration",
|
|
54
|
+
"Step with key {{stepKey}} not found": "Step with key {{stepKey}} not found",
|
|
55
|
+
"Submodel not found": "Submodel '{{subKey}}' not found",
|
|
56
|
+
"This is likely a NocoBase internals bug. Please open an issue at": "This is likely a NocoBase internals bug. Please open an issue at",
|
|
57
|
+
"This step has no configurable parameters": "This step has no configurable parameters",
|
|
58
|
+
"This variable is not available": "This variable is not available",
|
|
59
|
+
"Try again": "Try again",
|
|
60
|
+
"UID copied to clipboard": "UID copied to clipboard",
|
|
61
|
+
"createModelOptions must specify use property": "createModelOptions must specify \"use\" property",
|
|
62
|
+
"here": "here"
|
|
63
|
+
}
|