@nocobase/plugin-collection-tree 1.6.0-beta.2 → 1.6.0-beta.4

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.
@@ -8,11 +8,11 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.6.0-beta.2",
11
+ "@nocobase/client": "1.6.0-beta.4",
12
+ "@nocobase/database": "1.6.0-beta.4",
13
+ "@nocobase/utils": "1.6.0-beta.4",
12
14
  "lodash": "4.17.21",
13
- "@nocobase/database": "1.6.0-beta.2",
14
- "@nocobase/utils": "1.6.0-beta.2",
15
- "@nocobase/data-source-manager": "1.6.0-beta.2",
16
- "@nocobase/server": "1.6.0-beta.2",
15
+ "@nocobase/data-source-manager": "1.6.0-beta.4",
16
+ "@nocobase/server": "1.6.0-beta.4",
17
17
  "sequelize": "6.35.2"
18
18
  };
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { CountOptions, FindOptions, Repository, FindAndCountOptions, Model } from '@nocobase/database';
9
+ import { CountOptions, FindAndCountOptions, FindOptions, Model, Repository } from '@nocobase/database';
10
10
  import { TreeCollection } from './tree-collection';
11
11
  export declare class AdjacencyListRepository extends Repository {
12
12
  collection: TreeCollection;
@@ -39,9 +39,9 @@ __export(adjacency_list_repository_exports, {
39
39
  AdjacencyListRepository: () => AdjacencyListRepository
40
40
  });
41
41
  module.exports = __toCommonJS(adjacency_list_repository_exports);
42
- var import_lodash = __toESM(require("lodash"));
43
42
  var import_database = require("@nocobase/database");
44
43
  var import_utils = require("@nocobase/utils");
44
+ var import_lodash = __toESM(require("lodash"));
45
45
  class AdjacencyListRepository extends import_database.Repository {
46
46
  async update(options) {
47
47
  return super.update({
@@ -209,7 +209,8 @@ class AdjacencyListRepository extends import_database.Repository {
209
209
  return rootIds.size;
210
210
  }
211
211
  async count(countOptions) {
212
- if (countOptions.raw || !countOptions.tree) {
212
+ countOptions = countOptions || {};
213
+ if ((countOptions == null ? void 0 : countOptions.raw) || !(countOptions == null ? void 0 : countOptions.tree)) {
213
214
  return await super.count(countOptions);
214
215
  }
215
216
  if (!(0, import_utils.isValidFilter)(countOptions.filter) && !countOptions.filterByTk) {
@@ -62,6 +62,7 @@ class PluginCollectionTreeServer extends import_server.Plugin {
62
62
  const name = `${dataSource.name}_${collection.name}_path`;
63
63
  const parentForeignKey = ((_a = collection.treeParentField) == null ? void 0 : _a.foreignKey) || "parentId";
64
64
  const options = {};
65
+ options["mainCollection"] = collection.name;
65
66
  if (collection.options.schema) {
66
67
  options["schema"] = collection.options.schema;
67
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-collection-tree",
3
- "version": "1.6.0-beta.2",
3
+ "version": "1.6.0-beta.4",
4
4
  "displayName": "Collection: Tree",
5
5
  "displayName.zh-CN": "数据表:树",
6
6
  "description": "Provides tree collection template",
@@ -14,5 +14,5 @@
14
14
  "@nocobase/server": "1.x",
15
15
  "@nocobase/test": "1.x"
16
16
  },
17
- "gitHead": "476ab2f424d86f585c8fba1459568c8aec49a5c6"
17
+ "gitHead": "4419f433716dadf34886b261d9abe20e74551044"
18
18
  }