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',
CommonViewFunction.fetchRootClassificationAttributes({
url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]),
classification: Enums.addOnClassification[0],
classification: Enums.addOnClassification,
callback: function() {
--that.asyncFetchCounter;
startApp();
......
......@@ -1012,7 +1012,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
cache: true,
success: function(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) {
......
......@@ -258,18 +258,15 @@ define([
this.ui.classificationSearchTree.jstree(true).deselect_all();
this.tagId = null;
} 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;
if (this.tagId) {
this.ui.classificationSearchTree.jstree(true).deselect_node(this.tagId);
}
this.tagId = Globals[that.options.value.tag].guid;
this.ui.classificationSearchTree.jstree(true).select_node(this.tagId);
} else if (this.tagId !== "_ALL_CLASSIFICATION_TYPES" && that.options.value.tag !== this.tagId) {
if ((that.options.value.tag.indexOf('*') != -1)) {
that.ui.classificationSearchTree.jstree(true).deselect_all();
} 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)) {
that.ui.wildCardValue.val(that.options.value.tag);
}
var dataFound = this.classificationDefCollection.fullCollection.find(function(obj) {
return obj.get("name") === that.options.value.tag
});
......@@ -513,8 +510,10 @@ define([
return classificationData;
},
pushRootClassificationToJstree: function(data) {
var rootClassification = Globals[Enums.addOnClassification[0]];
var isSelected = this.options.value && this.options.value.tag ? this.options.value.tag == rootClassification.name : false;
var that = this;
_.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 = {
text: _.escape(rootClassification.name),
name: rootClassification.name,
......@@ -530,6 +529,7 @@ define([
}
}
data.push(rootClassificationNode);
});
return data;
},
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