EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
category fix
Yuri Kuznetsov76dfbb1baac6
diff --git a/client/src/collections/tree.js b/client/src/collections/tree.jsindex 5746ab6c20..5855285943 100644--- a/client/src/collections/tree.js+++ b/client/src/collections/tree.js@@ -32,6 +32,9 @@ import Collection from 'collection';class TreeCollection extends Collection {+ /**+ * @return {TreeCollection}+ */createSeed() {const seed = new this.constructor();@@ -61,37 +64,40 @@ class TreeCollection extends Collection {*/this.categoryData = response.data || null;- const f = (l, depth) => {- l.forEach(d => {- d.depth = depth;+ const prepare = (list, depth) => {+ list.forEach(data => {+ data.depth = depth;- const c = this.createSeed();+ const childCollection = this.createSeed();- if (d.childList) {- if (d.childList.length) {- f(d.childList, depth + 1);- c.set(d.childList);- d.childCollection = c;+ childCollection.parentId = data.id;++ if (data.childList) {+ if (data.childList.length) {+ prepare(data.childList, depth + 1);++ childCollection.set(data.childList);+ data.childCollection = childCollection;return;}- d.childCollection = c;+ data.childCollection = childCollection;return;}- if (d.childList === null) {- d.childCollection = null;+ if (data.childList === null) {+ data.childCollection = null;return;}- d.childCollection = c;+ data.childCollection = childCollection;});};- f(list, 0);+ prepare(list, 0);return list;}@@ -104,8 +110,6 @@ class TreeCollection extends Collection {options.data.parentId = this.parentId;}- options.data.maxDepth = this.maxDepth;-return super.fetch(options);}}diff --git a/client/src/views/list-with-categories.js b/client/src/views/list-with-categories.jsindex ec8e96abae..54f282fc6c 100644--- a/client/src/views/list-with-categories.js+++ b/client/src/views/list-with-categories.js@@ -500,7 +500,6 @@ class ListWithCategories extends ListView {collection.setOrder(null, null);collection.url = `${collection.entityType}/action/listTree`;- collection.maxDepth = null;collection.data.checkIfEmpty = true;if (!this.getAcl().checkScope(this.scope, 'create')) {diff --git a/client/src/views/record/list-tree-item.js b/client/src/views/record/list-tree-item.jsindex 57f58c1b61..138d53f6df 100644--- a/client/src/views/record/list-tree-item.js+++ b/client/src/views/record/list-tree-item.js@@ -233,7 +233,6 @@ class ListTreeRecordItemView extends View {this.getCollectionFactory().create(this.scope, collection => {collection.url = this.collection.url;collection.parentId = this.model.id;- collection.maxDepth = null;Espo.Ui.notify(' ... ');diff --git a/client/src/views/record/list-tree.js b/client/src/views/record/list-tree.jsindex f975e8422c..61c749d67d 100644--- a/client/src/views/record/list-tree.js+++ b/client/src/views/record/list-tree.js@@ -285,12 +285,6 @@ class ListTreeRecordView extends ListRecordView {}this.collection.fetch();-- /*this.collection.push(model);-- this.buildRows(() => {- this.render();- });*/});});}