This is an automated email from the ASF dual-hosted git repository. nixon pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push: new e302e89 ATLAS-3526 :- UI doesn't pick the classification from Saved search body if it has *. e302e89 is described below commit e302e8968367c365d9da1356cd446410f84afbbf Author: sameer79 <findsameersha...@yahoo.co.in> AuthorDate: Fri Nov 15 12:21:10 2019 +0530 ATLAS-3526 :- UI doesn't pick the classification from Saved search body if it has *. Signed-off-by: nixonrodrigues <ni...@apache.org> (cherry picked from commit e3e7f2e070674d00eba8171123ffe0b7d58751b1) --- dashboardv2/public/js/views/search/SearchLayoutView.js | 6 +++++- .../public/js/views/search/tree/ClassificationTreeLayoutView.js | 8 ++++++-- dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js | 6 ++---- 3 files changed, 13 insertions(+), 7 deletions(-) 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 @@ define(['require', }, manualRender: function(paramObj) { this.updateQueryObject(paramObj); + this.renderTypeTagList(paramObj); this.setValues(paramObj); }, getFilterBox: function() { @@ -489,10 +490,13 @@ define(['require', 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 @@ define([ } if (code == 13) { var tagValue = this.ui.wildCardValue.val(); - if(tagValue.indexOf("*")!= -1 ){ + if (tagValue.indexOf("*") != -1) { that.findSearchResult(tagValue); } @@ -247,6 +247,10 @@ define([ 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 @@ define([ }); 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 @@ define([ } 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;