Commit 1ccb7c71 by kevalbhatt Committed by nixonrodrigues

ATLAS-3598 : Beta UI: Issues with single click functionality in left hand panel.

parent ffd2e2b5
...@@ -214,7 +214,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa ...@@ -214,7 +214,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
renderGlobalSearch: function() { renderGlobalSearch: function() {
var that = this; var that = this;
require(["views/search/GlobalSearchLayoutView"], function(GlobalSearchLayoutView) { require(["views/search/GlobalSearchLayoutView"], function(GlobalSearchLayoutView) {
that.RGlobalSearchLayoutView.show(new GlobalSearchLayoutView(_.extend({ closeOnSubmit: true }, that.options)));
that.RGlobalSearchLayoutView.show(new GlobalSearchLayoutView(_.extend({ closeOnSubmit: true }, _.omit(that.options, "value"))));
}); });
}, },
renderSearchResult: function() { renderSearchResult: function() {
...@@ -303,8 +304,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa ...@@ -303,8 +304,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
this.renderQueryBuilder(_.extend({}, obj, { this.renderQueryBuilder(_.extend({}, obj, {
tag: false, tag: false,
type: true, type: true,
attrObj: attrTypeObj, attrObj: attrTypeObj
applicableType: that.options.value ? that.options.value.type : null
}), this.RQueryBuilderEntity); }), this.RQueryBuilderEntity);
this.ui.entityName.html(that.options.value.type); this.ui.entityName.html(that.options.value.type);
......
...@@ -258,6 +258,14 @@ define([ ...@@ -258,6 +258,14 @@ 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") {
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)) { if ((that.options.value.tag.indexOf('*') != -1)) {
that.ui.classificationSearchTree.jstree(true).deselect_all(); that.ui.classificationSearchTree.jstree(true).deselect_all();
that.ui.wildCardValue.val(that.options.value.tag); that.ui.wildCardValue.val(that.options.value.tag);
...@@ -275,10 +283,6 @@ define([ ...@@ -275,10 +283,6 @@ define([
this.ui.classificationSearchTree.jstree(true).select_node(dataFound.get("guid")); this.ui.classificationSearchTree.jstree(true).select_node(dataFound.get("guid"));
} }
} }
if (!dataFound && Globals[that.options.value.tag]) {
this.fromManualRender = true;
this.typeId = Globals[that.options.value.tag].guid;
this.ui.classificationSearchTree.jstree(true).select_node(this.typeId);
} }
} }
}, },
...@@ -516,8 +520,8 @@ define([ ...@@ -516,8 +520,8 @@ define([
name: rootClassification.name, name: rootClassification.name,
type: rootClassification.category, type: rootClassification.category,
gType: "Classification", gType: "Classification",
guid: "root-classification", guid: rootClassification.guid,
id: "root-classification", id: rootClassification.guid,
model: rootClassification, model: rootClassification,
children: [], children: [],
icon: "fa fa-tag", icon: "fa fa-tag",
......
...@@ -171,6 +171,14 @@ define([ ...@@ -171,6 +171,14 @@ define([
this.ui.entitySearchTree.jstree(true).deselect_all(); this.ui.entitySearchTree.jstree(true).deselect_all();
this.typeId = null; this.typeId = null;
} else { } else {
if (that.options.value.type === "_ALL_ENTITY_TYPES" && this.typeId !== "_ALL_ENTITY_TYPES") {
this.fromManualRender = true;
if (this.typeId) {
this.ui.entitySearchTree.jstree(true).deselect_node(this.typeId);
}
this.typeId = Globals[that.options.value.type].guid;
this.ui.entitySearchTree.jstree(true).select_node(this.typeId);
} else if (this.typeId !== "_ALL_ENTITY_TYPES" && that.options.value.type !== this.typeId) {
var dataFound = this.typeHeaders.fullCollection.find(function(obj) { var dataFound = this.typeHeaders.fullCollection.find(function(obj) {
return obj.get("name") === that.options.value.type return obj.get("name") === that.options.value.type
}); });
...@@ -184,10 +192,6 @@ define([ ...@@ -184,10 +192,6 @@ define([
this.ui.entitySearchTree.jstree(true).select_node(dataFound.get("guid")); this.ui.entitySearchTree.jstree(true).select_node(dataFound.get("guid"));
} }
} }
if (!dataFound && Globals[that.options.value.type]) {
this.fromManualRender = true;
this.typeId = Globals[that.options.value.type].guid;
this.ui.entitySearchTree.jstree(true).select_node(this.typeId);
} }
} }
}, },
...@@ -301,7 +305,7 @@ define([ ...@@ -301,7 +305,7 @@ define([
text: _.escape(modelname), text: _.escape(modelname),
name: model.get("name"), name: model.get("name"),
type: model.get("category"), type: model.get("category"),
gType: "serviceType", gType: "Entity",
guid: model.get("guid"), guid: model.get("guid"),
id: model.get("guid"), id: model.get("guid"),
model: model, model: model,
...@@ -336,7 +340,7 @@ define([ ...@@ -336,7 +340,7 @@ define([
text: _.escape(rootEntity.name), text: _.escape(rootEntity.name),
name: rootEntity.name, name: rootEntity.name,
type: rootEntity.category, type: rootEntity.category,
gType: "serviceType", gType: "Entity",
guid: rootEntity.guid, guid: rootEntity.guid,
id: rootEntity.guid, id: rootEntity.guid,
model: rootEntity, model: rootEntity,
...@@ -389,7 +393,7 @@ define([ ...@@ -389,7 +393,7 @@ define([
parent = { parent = {
icon: "fa fa-folder-o", icon: "fa fa-folder-o",
type: type, type: type,
gType: "serviceType", gType: "ServiceType",
children: getParrent.children, children: getParrent.children,
text: _.escape(textName), text: _.escape(textName),
name: data[parents[i]].name, name: data[parents[i]].name,
......
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