Commit f1df13dc by sameer79 Committed by nixonrodrigues

ATLAS-3664 - Beta UI : Fix Option to select CLASSIFIED and NOT_CLASSIFIED.

parent 14b57dbd
...@@ -342,7 +342,7 @@ require(['App', ...@@ -342,7 +342,7 @@ require(['App',
CommonViewFunction.fetchRootClassificationAttributes({ CommonViewFunction.fetchRootClassificationAttributes({
url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]), url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]),
classification: Enums.addOnClassification[0], classification: Enums.addOnClassification,
callback: function() { callback: function() {
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
......
...@@ -1012,7 +1012,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -1012,7 +1012,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
cache: true, cache: true,
success: function(response) { success: function(response) {
if (response) { if (response) {
Globals[options.classification] = Object.assign(response, { name: options.classification, guid: options.classification }); _.each(options.classification, function(rootClassification) {
var responseData = $.extend(true, {}, response);
Globals[rootClassification] = Object.assign(responseData, { name: rootClassification, guid: rootClassification });
});
} }
}, },
complete: function(response) { complete: function(response) {
......
...@@ -258,18 +258,15 @@ define([ ...@@ -258,18 +258,15 @@ define([
this.ui.classificationSearchTree.jstree(true).deselect_all(); this.ui.classificationSearchTree.jstree(true).deselect_all();
this.tagId = null; this.tagId = null;
} else { } else {
if (that.options.value.tag === "_ALL_CLASSIFICATION_TYPES" && this.tagId !== "_ALL_CLASSIFICATION_TYPES") { if ((that.options.value.tag === "_ALL_CLASSIFICATION_TYPES" && this.tagId !== "_ALL_CLASSIFICATION_TYPES") || (that.options.value.tag === "_NOT_CLASSIFIED" && this.tagId !== "_NOT_CLASSIFIED") || (that.options.value.tag === "_CLASSIFIED" && this.tagId !== "_CLASSIFIED")) {
this.fromManualRender = true; this.fromManualRender = true;
if (this.tagId) { if (this.tagId) {
this.ui.classificationSearchTree.jstree(true).deselect_node(this.tagId); this.ui.classificationSearchTree.jstree(true).deselect_node(this.tagId);
} }
this.tagId = Globals[that.options.value.tag].guid; this.tagId = Globals[that.options.value.tag].guid;
this.ui.classificationSearchTree.jstree(true).select_node(this.tagId); this.ui.classificationSearchTree.jstree(true).select_node(this.tagId);
} else if (this.tagId !== "_ALL_CLASSIFICATION_TYPES" && that.options.value.tag !== this.tagId) { } else if ((this.tagId !== "_ALL_CLASSIFICATION_TYPES" && that.options.value.tag !== this.tagId) || (this.tagId !== "_NOT_CLASSIFIED" && that.options.value.tag !== this.tagId) || (this.tagId !== "_CLASSIFIED" && that.options.value.tag !== this.tagId)) {
if ((that.options.value.tag.indexOf('*') != -1)) {
that.ui.classificationSearchTree.jstree(true).deselect_all();
that.ui.wildCardValue.val(that.options.value.tag); that.ui.wildCardValue.val(that.options.value.tag);
}
var dataFound = this.classificationDefCollection.fullCollection.find(function(obj) { var dataFound = this.classificationDefCollection.fullCollection.find(function(obj) {
return obj.get("name") === that.options.value.tag return obj.get("name") === that.options.value.tag
}); });
...@@ -513,8 +510,10 @@ define([ ...@@ -513,8 +510,10 @@ define([
return classificationData; return classificationData;
}, },
pushRootClassificationToJstree: function(data) { pushRootClassificationToJstree: function(data) {
var rootClassification = Globals[Enums.addOnClassification[0]]; var that = this;
var isSelected = this.options.value && this.options.value.tag ? this.options.value.tag == rootClassification.name : false; _.each(Enums.addOnClassification, function(addOnClassification) {
var rootClassification = Globals[addOnClassification];
var isSelected = that.options.value && that.options.value.tag ? that.options.value.tag == rootClassification.name : false;
var rootClassificationNode = { var rootClassificationNode = {
text: _.escape(rootClassification.name), text: _.escape(rootClassification.name),
name: rootClassification.name, name: rootClassification.name,
...@@ -530,6 +529,7 @@ define([ ...@@ -530,6 +529,7 @@ define([
} }
} }
data.push(rootClassificationNode); data.push(rootClassificationNode);
});
return data; return data;
}, },
generateSearchTree: function(options) { generateSearchTree: function(options) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment