Commit 0ce149e8 by sameer79 Committed by nixonrodrigues

ATLAS-3502 : UI : Atlas UI accepts the partial search for classifications

parent 25044cee
...@@ -308,6 +308,25 @@ define([ ...@@ -308,6 +308,25 @@ define([
'views/search/SearchDetailLayoutView' 'views/search/SearchDetailLayoutView'
], function(Header, SideNavLayoutView, SearchDetailLayoutView) { ], function(Header, SideNavLayoutView, SearchDetailLayoutView) {
var paramObj = Utils.getUrlState.getQueryParams(); var paramObj = Utils.getUrlState.getQueryParams();
if (paramObj.tag) {
var tagValidate = paramObj.tag,
isTagPresent = false;
if ((tagValidate.indexOf('*') == -1)) {
classificationDefCollection.fullCollection.each(function(model) {
var name = Utils.getName(model.toJSON(), 'name');
if (model.get('category') == 'CLASSIFICATION') {
if (tagValidate) {
if (name === tagValidate) {
isTagPresent = true;
}
}
}
});
if (!isTagPresent) {
paramObj.tag = null;
}
}
}
var isinitialView = true, var isinitialView = true,
isTypeTagNotExists = false, isTypeTagNotExists = false,
tempParam = _.extend({}, paramObj); tempParam = _.extend({}, paramObj);
......
...@@ -521,7 +521,16 @@ define(['require', ...@@ -521,7 +521,16 @@ define(['require',
this.ui.tagLov.select2({ this.ui.tagLov.select2({
placeholder: "Select Classification", placeholder: "Select Classification",
allowClear: true, allowClear: true,
tags: true tags: true,
createTag: function(tag) {
if (tag.term.indexOf('*') != -1) {
return {
id: tag.term,
text: tag.term,
isNew: true
};
}
}
}); });
} }
that.ui.typeLov.html(typeStr); that.ui.typeLov.html(typeStr);
......
...@@ -286,6 +286,24 @@ define([ ...@@ -286,6 +286,24 @@ define([
if (paramObj.tagFilters) { if (paramObj.tagFilters) {
paramObj.tagFilters = null; paramObj.tagFilters = null;
} }
} else {
var tagValidate = paramObj.tag,
isTagPresent = false;
if ((tagValidate.indexOf('*') == -1)) {
classificationDefCollection.fullCollection.each(function(model) {
var name = Utils.getName(model.toJSON(), 'name');
if (model.get('category') == 'CLASSIFICATION') {
if (tagValidate) {
if (name === tagValidate) {
isTagPresent = true;
}
}
}
});
if (!isTagPresent) {
paramObj.tag = null;
}
}
} }
} }
......
...@@ -114,8 +114,11 @@ define([ ...@@ -114,8 +114,11 @@ define([
} }
if (code == 13) { if (code == 13) {
var tagValue = this.ui.wildCardValue.val(); var tagValue = this.ui.wildCardValue.val();
if(tagValue.indexOf("*")!= -1 ){
that.findSearchResult(tagValue); that.findSearchResult(tagValue);
} }
}
}; };
return events; return events;
......
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