@nocobase/plugin-multi-app-share-collection 0.18.0-alpha.8 → 0.19.0-alpha.1

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.
@@ -1,12 +1,12 @@
1
1
  module.exports = {
2
2
  "@formily/react": "2.3.0",
3
- "@nocobase/client": "0.18.0-alpha.8",
4
- "@nocobase/plugin-multi-app-manager": "0.18.0-alpha.8",
5
- "antd": "5.12.2",
3
+ "@nocobase/client": "0.19.0-alpha.1",
4
+ "@nocobase/plugin-multi-app-manager": "0.19.0-alpha.1",
5
+ "antd": "5.12.8",
6
6
  "react": "18.2.0",
7
- "@nocobase/utils": "0.18.0-alpha.8",
7
+ "@nocobase/utils": "0.19.0-alpha.1",
8
8
  "react-i18next": "11.18.6",
9
- "@nocobase/server": "0.18.0-alpha.8",
10
- "lodash": "4.17.21",
11
- "@nocobase/database": "0.18.0-alpha.8"
9
+ "@nocobase/database": "0.19.0-alpha.1",
10
+ "@nocobase/server": "0.19.0-alpha.1",
11
+ "lodash": "4.17.21"
12
12
  };
@@ -1,4 +1,5 @@
1
1
  import { Migration } from '@nocobase/server';
2
2
  export default class extends Migration {
3
+ appVersion: string;
3
4
  up(): Promise<void>;
4
5
  }
@@ -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) {
@@ -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 sharedCollectionGroups = [
45
- "audit-logs",
46
- "workflow",
47
- "charts",
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.db.import({
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.18.0-alpha.8",
7
+ "version": "0.19.0-alpha.1",
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": "727d42f6f14e5f863831da3dbf3255ba1165b567"
26
+ "gitHead": "64601944412fc4d2e2bd05f4b982118dd28247dc"
27
27
  }