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([
'views/search/SearchDetailLayoutView'
], function(Header, SideNavLayoutView, SearchDetailLayoutView) {
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,
isTypeTagNotExists = false,
tempParam = _.extend({}, paramObj);
......
......@@ -521,7 +521,16 @@ define(['require',
this.ui.tagLov.select2({
placeholder: "Select Classification",
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);
......@@ -769,4 +778,4 @@ define(['require',
}
});
return SearchLayoutView;
});
\ No newline at end of file
});
......@@ -286,6 +286,24 @@ define([
if (paramObj.tagFilters) {
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;
}
}
}
}
......@@ -447,7 +465,7 @@ define([
// 'value': paramObj
// }, that.preFetchedCollectionLists, that.sharedObj)
// );
// }
// }
// });
that.renderViewIfNotExists({
......@@ -581,4 +599,4 @@ define([
}
});
return AppRouter;
});
\ No newline at end of file
});
......@@ -114,7 +114,10 @@ define([
}
if (code == 13) {
var tagValue = this.ui.wildCardValue.val();
that.findSearchResult(tagValue);
if(tagValue.indexOf("*")!= -1 ){
that.findSearchResult(tagValue);
}
}
};
......
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