ATLAS-3526 :- UI doesn't pick the classification from Saved search body if it has *.
Signed-off-by: nixonrodrigues <nixon@apache.org>
diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js
index 46b47b0..51134b5 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -462,6 +462,7 @@
},
manualRender: function(paramObj) {
this.updateQueryObject(paramObj);
+ this.renderTypeTagList(paramObj);
this.setValues(paramObj);
},
getFilterBox: function() {
@@ -489,10 +490,13 @@
tagStr = typeStr,
foundNewClassification = false,
optionsValue = this.options.value;
+ if (options && options.tag) {
+ optionsValue = options;
+ }
this.typeHeaders.fullCollection.each(function(model) {
var name = Utils.getName(model.toJSON(), 'name');
if (model.get('category') == 'ENTITY' && (serviceTypeToBefiltered && serviceTypeToBefiltered.length ? _.contains(serviceTypeToBefiltered, model.get('serviceType')) : true)) {
- var entityCount = (that.entityCountObj.entity.entityActive[name] + (that.entityCountObj.entity.entityDeleted[name] ? that.entityCountObj.entity.entityDeleted[name] : 0));
+ var entityCount = (that.entityCountObj.entity.entityActive[name] || 0) + (that.entityCountObj.entity.entityDeleted[name] || 0);
typeStr += '<option value="' + (name) + '" data-name="' + (name) + '">' + (name) + ' ' + (entityCount ? "(" + _.numberFormatWithComa(entityCount) + ")" : '') + '</option>';
}
if (isTypeOnly == undefined && model.get('category') == 'CLASSIFICATION') {
diff --git a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
index 5da5dcc..d47ae7a 100644
--- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
@@ -114,7 +114,7 @@
}
if (code == 13) {
var tagValue = this.ui.wildCardValue.val();
- if(tagValue.indexOf("*")!= -1 ){
+ if (tagValue.indexOf("*") != -1) {
that.findSearchResult(tagValue);
}
@@ -247,6 +247,10 @@
this.ui.classificationSearchTree.jstree(true).deselect_all();
this.tagId = null;
} else {
+ if ((that.options.value.tag.indexOf('*') != -1)) {
+ that.ui.classificationSearchTree.jstree(true).deselect_all();
+ that.ui.wildCardValue.val(that.options.value.tag);
+ }
var dataFound = this.classificationDefCollection.fullCollection.find(function(obj) {
return obj.get("name") === that.options.value.tag
});
@@ -779,4 +783,4 @@
});
return ClassificationTreeLayoutView;
-});
+});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
index 649632e..864c1a2 100644
--- a/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
@@ -282,10 +282,8 @@
}
if (categoryType == "ENTITY") {
var entityCount =
- that.entityCountObj.entity.entityActive[model.get("name")] +
- (that.entityCountObj.entity.entityDeleted[model.get("name")] ?
- that.entityCountObj.entity.entityDeleted[model.get("name")] :
- 0),
+ (that.entityCountObj.entity.entityActive[model.get("name")] || 0) +
+ (that.entityCountObj.entity.entityDeleted[model.get("name")] || 0),
modelname = entityCount ? model.get("name") + " (" + _.numberFormatWithComa(entityCount) + ")" : model.get("name");
if (that.options.value) {
isSelected = that.options.value.type ? that.options.value.type == model.get("name") : false;