You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2021/04/14 10:34:34 UTC
[atlas] branch master updated (af2cc74 -> e6f2a8a)
This is an automated email from the ASF dual-hosted git repository.
nixon pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git.
from af2cc74 ATLAS-3903: UI - Glossary category not reflected in the tree after creation.
new 7b0ecd1 Revert "ATLAS-3903: UI - Glossary category not reflected in the tree after creation."
new e6f2a8a ATLAS-3903:UI v1 Glossary category not reflected in the tree after creation.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../public/js/views/glossary/GlossaryLayoutView.js | 25 +++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
[atlas] 01/02: Revert "ATLAS-3903: UI - Glossary category not
reflected in the tree after creation."
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 7b0ecd1dcb92dad5b9a0659f7b5f2a7fa1d95f93
Author: nixonrodrigues <ni...@apache.org>
AuthorDate: Wed Apr 14 16:03:00 2021 +0530
Revert "ATLAS-3903: UI - Glossary category not reflected in the tree after creation."
This reverts commit af2cc7496ef4c856545a730b2e0859066b8dd4b5.
---
.../js/views/glossary/GlossaryDetailLayoutView.js | 5 +-
.../public/js/views/glossary/GlossaryLayoutView.js | 54 +++++-----------
.../js/views/glossary/GlossaryDetailLayoutView.js | 5 +-
.../js/views/search/tree/GlossaryTreeLayoutView.js | 73 +++++++---------------
4 files changed, 42 insertions(+), 95 deletions(-)
diff --git a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
index 24a8b06..bb8fe8f 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
@@ -346,8 +346,7 @@ define(['require',
return terms;
},
onClickAddTermBtn: function(e) {
- var that = this,
- glossary = this.glossaryCollection;
+ var glossary = this.glossaryCollection;
if (this.value && this.value.gId) {
var foundModel = this.glossaryCollection.find({ guid: this.value.gId });
if (foundModel) {
@@ -360,7 +359,7 @@ define(['require',
}
var obj = {
callback: function() {
- that.getData();
+ this.getData();
},
glossaryCollection: glossary,
},
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index ac7435c..5d9ba74 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -344,56 +344,34 @@ define(['require',
node: parent,
objGuid: obj.guid
});
+
if (type == "category" && obj.categories) {
- var isSelected = false,
- parentGuid = obj.guid,
- parentCategoryGuid = null,
- categoryList = [],
- catrgoryRelation = [];
_.each(obj.categories, function(category) {
- if (that.options.value) {
- isSelected = that.options.value.guid ? that.options.value.guid == category.categoryGuid : false;
+ if (category.parentCategoryGuid) {
+ return;
}
-
var typeName = category.typeName || "GlossaryCategory",
guid = category.categoryGuid,
categoryObj = {
- id: guid,
- guid: guid,
- text: _.escape(category.displayText),
- type: typeName,
- gType: "category",
- glossaryId: obj.guid,
- glossaryName: obj.name,
- children: [],
- model: category,
- icon: "fa fa-files-o"
+ "text": _.escape(category.displayText),
+ "type": typeName,
+ "gType": "category",
+ "guid": guid,
+ "id": guid,
+ "parent": obj,
+ "glossaryId": obj.guid,
+ "glossaryName": obj.name,
+ "model": category,
+ "children": true,
+ "icon": "fa fa-files-o",
};
categoryObj.state = getSelectedState({
index: i,
node: categoryObj,
objGuid: guid
})
- if (category.parentCategoryGuid) {
- catrgoryRelation.push({ parent: category.parentCategoryGuid, child: guid })
- }
- categoryList.push(categoryObj);
+ parent.children.push(categoryObj)
});
- _.each(categoryList, function(category) {
- var getRelation = _.find(catrgoryRelation, function(catrgoryObj) {
- if (catrgoryObj.child == category.guid) return catrgoryObj;
- })
- if (getRelation) {
- _.map(categoryList, function(catrgoryObj) {
- if (catrgoryObj.guid == getRelation.parent) {
- catrgoryObj["children"].push(category);
- };
- })
- } else {
- parent.children.push(category)
- }
- })
-
}
if (type == "term" && obj.terms) {
_.each(obj.terms, function(term) {
@@ -712,7 +690,7 @@ define(['require',
}), { silent: true });
} else if (that.value.gType == "category") {
glossary.set('categories', _.reject(glossary.get('categories'), function(obj) {
- return obj.categoryGuid == guid || obj.parentCategoryGuid == guid;
+ return obj.categoryGuid == guid;
}), { silent: true });
} else {
glossary = that.glossaryCollection.fullCollection.first();
diff --git a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
index 24bfa2a..551e229 100644
--- a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
+++ b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
@@ -361,8 +361,7 @@ define(['require',
return terms;
},
onClickAddTermBtn: function(e) {
- var that = this,
- glossary = this.glossaryCollection;
+ var glossary = this.glossaryCollection;
if (this.value && this.value.gId) {
var foundModel = this.glossaryCollection.find({ guid: this.value.gId });
if (foundModel) {
@@ -375,7 +374,7 @@ define(['require',
}
var obj = {
callback: function() {
- that.getData();
+ this.getData();
},
glossaryCollection: glossary,
},
diff --git a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
index 421855d..4a327d8 100644
--- a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
@@ -389,46 +389,36 @@ define([
var isSelected = false,
parentGuid = obj.guid,
parentCategoryGuid = null,
- categoryList = [],
- catrgoryRelation = [];
+ getParentCategory = function() {
+ var parentCategory = _.find(parent.model.categories, function(subCategory) {
+ return subCategory.categoryGuid === parentCategoryGuid;
+ });
+ return parentCategory;
+ };
_.each(obj.categories, function(category) {
if (that.options.value) {
isSelected = that.options.value.guid ? that.options.value.guid == category.categoryGuid : false;
}
-
+ if (category.parentCategoryGuid) {
+ return;
+ }
var typeName = category.typeName || "GlossaryCategory",
guid = category.categoryGuid,
categoryObj = {
- id: guid,
- guid: guid,
- text: _.escape(category.displayText),
- type: typeName,
- gType: "category",
- glossaryId: obj.guid,
- glossaryName: obj.name,
- children: [],
- model: category,
- icon: "fa fa-files-o"
+ "text": _.escape(category.displayText),
+ "type": typeName,
+ "gType": "category",
+ "guid": guid,
+ "id": guid,
+ "parent": obj,
+ "glossaryId": obj.guid,
+ "glossaryName": obj.name,
+ "model": category,
+ "children": true,
+ "icon": "fa fa-files-o"
};
- if (category.parentCategoryGuid) {
- catrgoryRelation.push({ parent: category.parentCategoryGuid, child: guid })
- }
- categoryList.push(categoryObj);
+ parent.children.push(categoryObj)
});
- _.each(categoryList, function(category) {
- var getRelation = _.find(catrgoryRelation, function(catrgoryObj) {
- if (catrgoryObj.child == category.guid) return catrgoryObj;
- })
- if (getRelation) {
- _.map(categoryList, function(catrgoryObj) {
- if (catrgoryObj.guid == getRelation.parent) {
- catrgoryObj["children"].push(category);
- };
- })
- } else {
- parent.children.push(category)
- }
- })
}
if (that.isTermView && obj.terms) {
var isSelected = false;
@@ -501,26 +491,7 @@ define([
CommonViewFunction.createEditGlossaryCategoryTerm({
"isCategoryView": true,
"collection": that.glossaryCollection,
- "callback": function(updateCollection) {
- var updatedObj = {
- categoryGuid: updateCollection.guid,
- displayText: updateCollection.name,
- relationGuid: updateCollection.anchor ? updateCollection.anchor.relationGuid : null
- },
- glossary = that.glossaryCollection.fullCollection.findWhere({ guid: updateCollection.anchor.glossaryGuid });
- if (updateCollection.parentCategory) {
- updatedObj["parentCategoryGuid"] = updateCollection.parentCategory.categoryGuid;
- }
- if (glossary) {
- var glossaryAttributes = glossary.attributes || null;
- if (glossaryAttributes) {
- if (glossaryAttributes.categories) {
- glossaryAttributes['categories'].push(updatedObj);
- } else {
- glossaryAttributes['categories'] = [updatedObj];
- }
- }
- }
+ "callback": function() {
that.ui.termSearchTree.jstree(true).refresh();
},
"node": selectednode[0].original
[atlas] 02/02: ATLAS-3903:UI v1 Glossary category not reflected in
the tree after creation.
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit e6f2a8afe3877db2f63e50137926ffe73ae6a991
Author: prasad pawar <pr...@freestoneinfotech.com>
AuthorDate: Mon Apr 12 11:11:23 2021 +0530
ATLAS-3903:UI v1 Glossary category not reflected in the tree after creation.
---
.../js/views/glossary/GlossaryDetailLayoutView.js | 5 +-
.../public/js/views/glossary/GlossaryLayoutView.js | 79 ++++++++++++++++------
.../js/views/glossary/GlossaryDetailLayoutView.js | 5 +-
.../js/views/search/tree/GlossaryTreeLayoutView.js | 73 ++++++++++++++------
4 files changed, 115 insertions(+), 47 deletions(-)
diff --git a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
index bb8fe8f..24a8b06 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
@@ -346,7 +346,8 @@ define(['require',
return terms;
},
onClickAddTermBtn: function(e) {
- var glossary = this.glossaryCollection;
+ var that = this,
+ glossary = this.glossaryCollection;
if (this.value && this.value.gId) {
var foundModel = this.glossaryCollection.find({ guid: this.value.gId });
if (foundModel) {
@@ -359,7 +360,7 @@ define(['require',
}
var obj = {
callback: function() {
- this.getData();
+ that.getData();
},
glossaryCollection: glossary,
},
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index 5d9ba74..0de5c35 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -344,34 +344,56 @@ define(['require',
node: parent,
objGuid: obj.guid
});
-
if (type == "category" && obj.categories) {
+ var isSelected = false,
+ parentGuid = obj.guid,
+ parentCategoryGuid = null,
+ categoryList = [],
+ catrgoryRelation = [];
_.each(obj.categories, function(category) {
- if (category.parentCategoryGuid) {
- return;
+ if (that.options.value) {
+ isSelected = that.options.value.guid ? that.options.value.guid == category.categoryGuid : false;
}
+
var typeName = category.typeName || "GlossaryCategory",
guid = category.categoryGuid,
categoryObj = {
- "text": _.escape(category.displayText),
- "type": typeName,
- "gType": "category",
- "guid": guid,
- "id": guid,
- "parent": obj,
- "glossaryId": obj.guid,
- "glossaryName": obj.name,
- "model": category,
- "children": true,
- "icon": "fa fa-files-o",
+ id: guid,
+ guid: guid,
+ text: _.escape(category.displayText),
+ type: typeName,
+ gType: "category",
+ glossaryId: obj.guid,
+ glossaryName: obj.name,
+ children: [],
+ model: category,
+ icon: "fa fa-files-o"
};
categoryObj.state = getSelectedState({
index: i,
node: categoryObj,
objGuid: guid
})
- parent.children.push(categoryObj)
+ if (category.parentCategoryGuid) {
+ catrgoryRelation.push({ parent: category.parentCategoryGuid, child: guid })
+ }
+ categoryList.push(categoryObj);
});
+ _.each(categoryList, function(category) {
+ var getRelation = _.find(catrgoryRelation, function(catrgoryObj) {
+ if (catrgoryObj.child == category.guid) return catrgoryObj;
+ })
+ if (getRelation) {
+ _.map(categoryList, function(catrgoryObj) {
+ if (catrgoryObj.guid == getRelation.parent) {
+ catrgoryObj["children"].push(category);
+ };
+ })
+ } else {
+ parent.children.push(category)
+ }
+ })
+
}
if (type == "term" && obj.terms) {
_.each(obj.terms, function(term) {
@@ -651,12 +673,27 @@ define(['require',
CommonViewFunction.createEditGlossaryCategoryTerm({
"isCategoryView": true,
"collection": that.glossaryCollection,
- "callback": function() {
- if (that.value.gType == "glossary") {
- that.getGlossary();
- } else {
- that.ui.categoryTree.jstree(true).refresh();
+ "callback": function(updateCollection) {
+ var updatedObj = {
+ categoryGuid: updateCollection.guid,
+ displayText: updateCollection.name,
+ relationGuid: updateCollection.anchor ? updateCollection.anchor.relationGuid : null
+ },
+ glossary = that.glossaryCollection.fullCollection.findWhere({ guid: updateCollection.anchor.glossaryGuid });
+ if (updateCollection.parentCategory) {
+ updatedObj["parentCategoryGuid"] = updateCollection.parentCategory.categoryGuid;
+ }
+ if (glossary) {
+ var glossaryAttributes = glossary.attributes || null;
+ if (glossaryAttributes) {
+ if (glossaryAttributes.categories) {
+ glossaryAttributes['categories'].push(updatedObj);
+ } else {
+ glossaryAttributes['categories'] = [updatedObj];
+ }
+ }
}
+ that.ui.categoryTree.jstree(true).refresh();
},
"node": this.glossary.selectedItem
})
@@ -690,7 +727,7 @@ define(['require',
}), { silent: true });
} else if (that.value.gType == "category") {
glossary.set('categories', _.reject(glossary.get('categories'), function(obj) {
- return obj.categoryGuid == guid;
+ return obj.categoryGuid == guid || obj.parentCategoryGuid == guid;
}), { silent: true });
} else {
glossary = that.glossaryCollection.fullCollection.first();
diff --git a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
index 551e229..24bfa2a 100644
--- a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
+++ b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
@@ -361,7 +361,8 @@ define(['require',
return terms;
},
onClickAddTermBtn: function(e) {
- var glossary = this.glossaryCollection;
+ var that = this,
+ glossary = this.glossaryCollection;
if (this.value && this.value.gId) {
var foundModel = this.glossaryCollection.find({ guid: this.value.gId });
if (foundModel) {
@@ -374,7 +375,7 @@ define(['require',
}
var obj = {
callback: function() {
- this.getData();
+ that.getData();
},
glossaryCollection: glossary,
},
diff --git a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
index 4a327d8..421855d 100644
--- a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
@@ -389,36 +389,46 @@ define([
var isSelected = false,
parentGuid = obj.guid,
parentCategoryGuid = null,
- getParentCategory = function() {
- var parentCategory = _.find(parent.model.categories, function(subCategory) {
- return subCategory.categoryGuid === parentCategoryGuid;
- });
- return parentCategory;
- };
+ categoryList = [],
+ catrgoryRelation = [];
_.each(obj.categories, function(category) {
if (that.options.value) {
isSelected = that.options.value.guid ? that.options.value.guid == category.categoryGuid : false;
}
- if (category.parentCategoryGuid) {
- return;
- }
+
var typeName = category.typeName || "GlossaryCategory",
guid = category.categoryGuid,
categoryObj = {
- "text": _.escape(category.displayText),
- "type": typeName,
- "gType": "category",
- "guid": guid,
- "id": guid,
- "parent": obj,
- "glossaryId": obj.guid,
- "glossaryName": obj.name,
- "model": category,
- "children": true,
- "icon": "fa fa-files-o"
+ id: guid,
+ guid: guid,
+ text: _.escape(category.displayText),
+ type: typeName,
+ gType: "category",
+ glossaryId: obj.guid,
+ glossaryName: obj.name,
+ children: [],
+ model: category,
+ icon: "fa fa-files-o"
};
- parent.children.push(categoryObj)
+ if (category.parentCategoryGuid) {
+ catrgoryRelation.push({ parent: category.parentCategoryGuid, child: guid })
+ }
+ categoryList.push(categoryObj);
});
+ _.each(categoryList, function(category) {
+ var getRelation = _.find(catrgoryRelation, function(catrgoryObj) {
+ if (catrgoryObj.child == category.guid) return catrgoryObj;
+ })
+ if (getRelation) {
+ _.map(categoryList, function(catrgoryObj) {
+ if (catrgoryObj.guid == getRelation.parent) {
+ catrgoryObj["children"].push(category);
+ };
+ })
+ } else {
+ parent.children.push(category)
+ }
+ })
}
if (that.isTermView && obj.terms) {
var isSelected = false;
@@ -491,7 +501,26 @@ define([
CommonViewFunction.createEditGlossaryCategoryTerm({
"isCategoryView": true,
"collection": that.glossaryCollection,
- "callback": function() {
+ "callback": function(updateCollection) {
+ var updatedObj = {
+ categoryGuid: updateCollection.guid,
+ displayText: updateCollection.name,
+ relationGuid: updateCollection.anchor ? updateCollection.anchor.relationGuid : null
+ },
+ glossary = that.glossaryCollection.fullCollection.findWhere({ guid: updateCollection.anchor.glossaryGuid });
+ if (updateCollection.parentCategory) {
+ updatedObj["parentCategoryGuid"] = updateCollection.parentCategory.categoryGuid;
+ }
+ if (glossary) {
+ var glossaryAttributes = glossary.attributes || null;
+ if (glossaryAttributes) {
+ if (glossaryAttributes.categories) {
+ glossaryAttributes['categories'].push(updatedObj);
+ } else {
+ glossaryAttributes['categories'] = [updatedObj];
+ }
+ }
+ }
that.ui.termSearchTree.jstree(true).refresh();
},
"node": selectednode[0].original