@nocobase/database 1.3.44-beta → 1.3.45-beta
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.
|
@@ -58,7 +58,11 @@ const _BooleanInterface = class _BooleanInterface extends import_base_interface.
|
|
|
58
58
|
const option = enumConfig.find((item) => item.value === value);
|
|
59
59
|
return option == null ? void 0 : option.label;
|
|
60
60
|
} else {
|
|
61
|
-
|
|
61
|
+
const label = value ? "True" : value === null || value === void 0 ? "" : "False";
|
|
62
|
+
if (ctx == null ? void 0 : ctx.t) {
|
|
63
|
+
return ctx.t(label, { ns: "action-export" });
|
|
64
|
+
}
|
|
65
|
+
return label;
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
};
|
|
@@ -64,7 +64,13 @@ const _MultipleSelectInterface = class _MultipleSelectInterface extends import_b
|
|
|
64
64
|
const enumConfig = ((_a = this.options.uiSchema) == null ? void 0 : _a.enum) || [];
|
|
65
65
|
return import_lodash.default.castArray(value).map((value2) => {
|
|
66
66
|
const option = enumConfig.find((item) => item.value === value2);
|
|
67
|
-
|
|
67
|
+
if (option) {
|
|
68
|
+
if (ctx == null ? void 0 : ctx.t) {
|
|
69
|
+
return ctx.t(option.label, { ns: "lm-collections" });
|
|
70
|
+
}
|
|
71
|
+
return option.label;
|
|
72
|
+
}
|
|
73
|
+
return value2;
|
|
68
74
|
}).join(",");
|
|
69
75
|
}
|
|
70
76
|
};
|
|
@@ -52,7 +52,13 @@ const _SelectInterface = class _SelectInterface extends import_base_interface.Ba
|
|
|
52
52
|
var _a;
|
|
53
53
|
const enumConfig = ((_a = this.options.uiSchema) == null ? void 0 : _a.enum) || [];
|
|
54
54
|
const option = enumConfig.find((item) => item.value === value);
|
|
55
|
-
|
|
55
|
+
if (option) {
|
|
56
|
+
if (ctx == null ? void 0 : ctx.t) {
|
|
57
|
+
return ctx.t(option.label, { ns: "lm-collections" });
|
|
58
|
+
}
|
|
59
|
+
return option.label;
|
|
60
|
+
}
|
|
61
|
+
return value;
|
|
56
62
|
}
|
|
57
63
|
};
|
|
58
64
|
__name(_SelectInterface, "SelectInterface");
|
|
@@ -39,7 +39,7 @@ const _ToOneInterface = class _ToOneInterface extends import_base_interface.Base
|
|
|
39
39
|
if (!str) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
|
-
const { filterKey, targetCollection, transaction } = ctx;
|
|
42
|
+
const { filterKey, associationField, targetCollection, transaction } = ctx;
|
|
43
43
|
const targetInstance = await targetCollection.repository.findOne({
|
|
44
44
|
filter: {
|
|
45
45
|
[filterKey]: str
|
|
@@ -49,8 +49,8 @@ const _ToOneInterface = class _ToOneInterface extends import_base_interface.Base
|
|
|
49
49
|
if (!targetInstance) {
|
|
50
50
|
throw new Error(`"${str}" not found in ${targetCollection.model.name} ${filterKey}`);
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
return targetInstance[
|
|
52
|
+
const targetKey = associationField.targetKey || targetCollection.model.primaryKeyAttribute;
|
|
53
|
+
return targetInstance[targetKey];
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
__name(_ToOneInterface, "ToOneInterface");
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/database",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.45-beta",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/logger": "1.3.
|
|
10
|
-
"@nocobase/utils": "1.3.
|
|
9
|
+
"@nocobase/logger": "1.3.45-beta",
|
|
10
|
+
"@nocobase/utils": "1.3.45-beta",
|
|
11
11
|
"async-mutex": "^0.3.2",
|
|
12
12
|
"chalk": "^4.1.1",
|
|
13
13
|
"cron-parser": "4.4.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
39
39
|
"directory": "packages/database"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "d568bfc1a01f461fbec0cc50b8c6ae5e1901038c"
|
|
42
42
|
}
|