@nocobase/plugin-multi-app-share-collection 0.18.0-alpha.9 → 0.19.0-alpha.2
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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"@formily/react": "2.3.0",
|
|
3
|
-
"@nocobase/client": "0.
|
|
4
|
-
"@nocobase/plugin-multi-app-manager": "0.
|
|
5
|
-
"antd": "5.12.
|
|
3
|
+
"@nocobase/client": "0.19.0-alpha.2",
|
|
4
|
+
"@nocobase/plugin-multi-app-manager": "0.19.0-alpha.2",
|
|
5
|
+
"antd": "5.12.8",
|
|
6
6
|
"react": "18.2.0",
|
|
7
|
-
"@nocobase/utils": "0.
|
|
7
|
+
"@nocobase/utils": "0.19.0-alpha.2",
|
|
8
8
|
"react-i18next": "11.18.6",
|
|
9
|
-
"@nocobase/
|
|
10
|
-
"
|
|
11
|
-
"
|
|
9
|
+
"@nocobase/database": "0.19.0-alpha.2",
|
|
10
|
+
"@nocobase/server": "0.19.0-alpha.2",
|
|
11
|
+
"lodash": "4.17.21"
|
|
12
12
|
};
|
|
@@ -23,6 +23,7 @@ module.exports = __toCommonJS(update_apps_collections_exports);
|
|
|
23
23
|
var import_server = require("@nocobase/server");
|
|
24
24
|
var import_utils = require("@nocobase/utils");
|
|
25
25
|
class update_apps_collections_default extends import_server.Migration {
|
|
26
|
+
appVersion = "<0.9.3-alpha.1";
|
|
26
27
|
async up() {
|
|
27
28
|
const result = await this.app.version.satisfies("<0.9.3-alpha.1");
|
|
28
29
|
if (!result) {
|
package/dist/server/plugin.js
CHANGED
|
@@ -41,27 +41,12 @@ class SubAppPlugin extends import_server.Plugin {
|
|
|
41
41
|
beforeLoad() {
|
|
42
42
|
const mainApp = this.options.mainApp;
|
|
43
43
|
const subApp = this.app;
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"collection-manager",
|
|
49
|
-
"file-manager",
|
|
50
|
-
"graph-collection-manager",
|
|
51
|
-
"map",
|
|
52
|
-
"sequence-field",
|
|
53
|
-
"snapshot-field",
|
|
54
|
-
"verification",
|
|
55
|
-
"localization-management"
|
|
56
|
-
];
|
|
57
|
-
const collectionGroups = mainApp.db.collectionGroupManager.getGroups();
|
|
58
|
-
const sharedCollectionGroupsCollections = [];
|
|
59
|
-
for (const group of collectionGroups) {
|
|
60
|
-
if (sharedCollectionGroups.includes(group.namespace)) {
|
|
61
|
-
sharedCollectionGroupsCollections.push(...group.collections);
|
|
44
|
+
const sharedCollections = [];
|
|
45
|
+
for (const collection of mainApp.db.collections.values()) {
|
|
46
|
+
if (collection.options.shared) {
|
|
47
|
+
sharedCollections.push(collection.name);
|
|
62
48
|
}
|
|
63
49
|
}
|
|
64
|
-
const sharedCollections = [...sharedCollectionGroupsCollections.flat(), "users", "users_jobs"];
|
|
65
50
|
subApp.on("beforeLoadPlugin", (plugin) => {
|
|
66
51
|
if (plugin.name === "collection-manager") {
|
|
67
52
|
plugin.setLoadFilter({
|
|
@@ -223,9 +208,7 @@ class MultiAppShareCollectionPlugin extends import_server.Plugin {
|
|
|
223
208
|
this.app.log.warn("multi-app-share-collection plugin need multi-app-manager plugin enabled");
|
|
224
209
|
return;
|
|
225
210
|
}
|
|
226
|
-
await this.
|
|
227
|
-
directory: (0, import_path.resolve)(__dirname, "collections")
|
|
228
|
-
});
|
|
211
|
+
await this.importCollections((0, import_path.resolve)(__dirname, "collections"));
|
|
229
212
|
this.app.resourcer.registerActionHandlers({
|
|
230
213
|
"applications:shareCollections": async (ctx, next) => {
|
|
231
214
|
const { filterByTk, values } = ctx.action.params;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "多应用数据表共享",
|
|
5
5
|
"description": "",
|
|
6
6
|
"description.zh-CN": "",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.19.0-alpha.2",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@formily/react": "2.x",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@nocobase/test": "0.x",
|
|
24
24
|
"@nocobase/utils": "0.x"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "cff5b77ecf12ccdb450d50d505b3aa44a68478c8"
|
|
27
27
|
}
|