@nocobase/plugin-ui-schema-storage 2.1.0-beta.30 → 2.1.0-beta.32
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/dist/externalVersion.js +7 -8
- package/dist/server/server.js +8 -36
- package/package.json +2 -3
package/dist/externalVersion.js
CHANGED
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
12
|
-
"@nocobase/database": "2.1.0-beta.
|
|
13
|
-
"@nocobase/cache": "2.1.0-beta.
|
|
14
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.32",
|
|
12
|
+
"@nocobase/database": "2.1.0-beta.32",
|
|
13
|
+
"@nocobase/cache": "2.1.0-beta.32",
|
|
14
|
+
"@nocobase/utils": "2.1.0-beta.32",
|
|
15
15
|
"lodash": "4.18.1",
|
|
16
|
-
"@nocobase/
|
|
17
|
-
"@nocobase/
|
|
18
|
-
"@nocobase/
|
|
19
|
-
"@nocobase/resourcer": "2.1.0-beta.30",
|
|
16
|
+
"@nocobase/server": "2.1.0-beta.32",
|
|
17
|
+
"@nocobase/actions": "2.1.0-beta.32",
|
|
18
|
+
"@nocobase/resourcer": "2.1.0-beta.32",
|
|
20
19
|
"@formily/json-schema": "2.3.7"
|
|
21
20
|
};
|
package/dist/server/server.js
CHANGED
|
@@ -82,7 +82,6 @@ class PluginUISchemaStorageServer extends import_server.Plugin {
|
|
|
82
82
|
}
|
|
83
83
|
async beforeLoad() {
|
|
84
84
|
const db = this.app.db;
|
|
85
|
-
const pm = this.app.pm;
|
|
86
85
|
this.serverHooks = new import_server_hooks.ServerHooks(db);
|
|
87
86
|
this.app.db.registerModels({ MagicAttributeModel: import_database.MagicAttributeModel, UiSchemaModel: import_model.UiSchemaModel, ServerHookModel: import_model2.ServerHookModel });
|
|
88
87
|
this.registerRepository();
|
|
@@ -99,19 +98,7 @@ class PluginUISchemaStorageServer extends import_server.Plugin {
|
|
|
99
98
|
model.set("name", (0, import_utils.uid)());
|
|
100
99
|
}
|
|
101
100
|
});
|
|
102
|
-
|
|
103
|
-
var _a;
|
|
104
|
-
const localizationPlugin = pm.get("localization");
|
|
105
|
-
const texts = [];
|
|
106
|
-
const changedFields = extractFields(model.toJSON());
|
|
107
|
-
if (!changedFields.length) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
changedFields.forEach((field) => {
|
|
111
|
-
field && texts.push({ text: compile(field), module: `resources.ui-schema-storage` });
|
|
112
|
-
});
|
|
113
|
-
await ((_a = localizationPlugin == null ? void 0 : localizationPlugin.addNewTexts) == null ? void 0 : _a.call(localizationPlugin, texts, options));
|
|
114
|
-
});
|
|
101
|
+
this.registerLocalizationSource();
|
|
115
102
|
db.on("uiSchemas.afterCreate", async function insertSchema(model, options) {
|
|
116
103
|
const { transaction } = options;
|
|
117
104
|
const uiSchemaRepository = db.getCollection("uiSchemas").repository;
|
|
@@ -178,29 +165,14 @@ class PluginUISchemaStorageServer extends import_server.Plugin {
|
|
|
178
165
|
await this.importCollections((0, import_path.resolve)(__dirname, "collections"));
|
|
179
166
|
}
|
|
180
167
|
registerLocalizationSource() {
|
|
181
|
-
|
|
182
|
-
if (!localizationPlugin) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
localizationPlugin.sourceManager.registerSource("ui-schema-storage", {
|
|
168
|
+
this.app.localeManager.registerSource("ui-schema-storage", {
|
|
186
169
|
title: (0, import_utils.tval)("UiSchema"),
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const changedFields = extractFields(route.schema);
|
|
194
|
-
if (changedFields.length) {
|
|
195
|
-
changedFields.forEach((field) => {
|
|
196
|
-
resources[field] = "";
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
return {
|
|
201
|
-
"ui-schema-storage": resources
|
|
202
|
-
};
|
|
203
|
-
}
|
|
170
|
+
collections: [
|
|
171
|
+
{
|
|
172
|
+
collection: "uiSchemas",
|
|
173
|
+
getTexts: (model) => extractFields(model.toJSON()).map((field) => compile(field)).filter(Boolean).map((text) => ({ text, module: `resources.ui-schema-storage` }))
|
|
174
|
+
}
|
|
175
|
+
]
|
|
204
176
|
});
|
|
205
177
|
}
|
|
206
178
|
}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Provides centralized UI schema storage service.",
|
|
7
7
|
"description.zh-CN": "提供中心化的 UI schema 存储服务。",
|
|
8
8
|
"description.ru-RU": "Предоставляет централизованный сервис хранения UI схем.",
|
|
9
|
-
"version": "2.1.0-beta.
|
|
9
|
+
"version": "2.1.0-beta.32",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/ui-schema-storage",
|
|
@@ -21,13 +21,12 @@
|
|
|
21
21
|
"@nocobase/client": "2.x",
|
|
22
22
|
"@nocobase/database": "2.x",
|
|
23
23
|
"@nocobase/plugin-error-handler": "2.x",
|
|
24
|
-
"@nocobase/plugin-localization": "2.x",
|
|
25
24
|
"@nocobase/resourcer": "2.x",
|
|
26
25
|
"@nocobase/server": "2.x",
|
|
27
26
|
"@nocobase/test": "2.x",
|
|
28
27
|
"@nocobase/utils": "2.x"
|
|
29
28
|
},
|
|
30
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "659c5efe992da7118d33c768bbd9e837a2c4716f",
|
|
31
30
|
"keywords": [
|
|
32
31
|
"System & security"
|
|
33
32
|
]
|