This is an automated email from the ASF dual-hosted git repository.
nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 0ce149e ATLAS-3502 : UI : Atlas UI accepts the partial search for
classifications
0ce149e is described below
commit 0ce149e877ed17a4b3876bf9012071ccf3e5f603
Author: sameer79 <[email protected]>
AuthorDate: Thu Oct 31 17:43:11 2019 +0530
ATLAS-3502 : UI : Atlas UI accepts the partial search for classifications
Signed-off-by: nixonrodrigues <[email protected]>
---
dashboardv2/public/js/router/Router.js | 19 +++++++++++++++++++
.../public/js/views/search/SearchLayoutView.js | 13 +++++++++++--
dashboardv3/public/js/router/Router.js | 22 ++++++++++++++++++++--
.../search/tree/ClassificationTreeLayoutView.js | 5 ++++-
4 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/dashboardv2/public/js/router/Router.js
b/dashboardv2/public/js/router/Router.js
index b7cc327..8a0bee0 100644
--- a/dashboardv2/public/js/router/Router.js
+++ b/dashboardv2/public/js/router/Router.js
@@ -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);
diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js
b/dashboardv2/public/js/views/search/SearchLayoutView.js
index 8ae16f6..46b47b0 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -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
+});
diff --git a/dashboardv3/public/js/router/Router.js
b/dashboardv3/public/js/router/Router.js
index e20959c..d069b96 100644
--- a/dashboardv3/public/js/router/Router.js
+++ b/dashboardv3/public/js/router/Router.js
@@ -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
+});
diff --git
a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
index d395761..1d54a9a 100644
--- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
@@ -114,7 +114,10 @@ define([
}
if (code == 13) {
var tagValue = this.ui.wildCardValue.val();
- that.findSearchResult(tagValue);
+ if(tagValue.indexOf("*")!= -1 ){
+ that.findSearchResult(tagValue);
+ }
+
}
};