You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by su...@apache.org on 2016/08/11 18:35:34 UTC

incubator-atlas git commit: Show Tag / Taxonomy Listing in sorted order

Repository: incubator-atlas
Updated Branches:
  refs/heads/master bf2e60917 -> c1efcf061


Show Tag / Taxonomy Listing in sorted order


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/c1efcf06
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/c1efcf06
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/c1efcf06

Branch: refs/heads/master
Commit: c1efcf061d39d46ae184cd180455b001e0a33b75
Parents: bf2e609
Author: kalyanikk <ka...@freestoneinfotech.com>
Authored: Thu Aug 11 14:54:19 2016 +0530
Committer: Suma Shivaprasad <su...@gmail.com>
Committed: Thu Aug 11 11:34:20 2016 -0700

----------------------------------------------------------------------
 .../js/views/business_catalog/TreeLayoutView.js    |  5 ++++-
 .../public/js/views/search/SearchLayoutView.js     |  2 +-
 dashboardv2/public/js/views/tag/TagLayoutView.js   | 17 +++++++----------
 dashboardv2/public/js/views/tag/addTagModalView.js |  6 +++++-
 4 files changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1efcf06/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js b/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
index d9fc621..be47725 100644
--- a/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
@@ -403,7 +403,10 @@ define(['require',
                 }
 
                 function createTerm() {
-                    _.each(that.childCollection.fullCollection.models, function(model, key) {
+                    that.childCollection.fullCollection.comparator = function(model) {
+                        return model.get('name').toLowerCase();
+                    }
+                    that.childCollection.fullCollection.sort().each(function(model, key) {
                         var name = Utils.checkTagOrTerm(model.get('name'), true);
                         var hrefUrl = "/api" + model.get('href').split("/api")[1];
                         if (name.name) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1efcf06/dashboardv2/public/js/views/search/SearchLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js
index 7f5e364..f2b8a38 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -118,7 +118,7 @@ define(['require',
                 this.ui.typeLov.empty();
                 var str = '<option></option>';
                 this.typecollection.fullCollection.comparator = function(model) {
-                    return model.get('tags');
+                    return model.get('tags').toLowerCase();
                 }
                 this.typecollection.fullCollection.sort().each(function(model) {
                     str += '<option>' + model.get("tags") + '</option>';

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1efcf06/dashboardv2/public/js/views/tag/TagLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagLayoutView.js b/dashboardv2/public/js/views/tag/TagLayoutView.js
index 16c69c4..b1cb6cc 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -51,11 +51,7 @@ define(['require',
             events: function() {
                 var events = {};
                 events["click " + this.ui.createTag] = 'onClickCreateTag';
-                /* events["dblclick " + this.ui.tags] = function(e) {
-                     this.onTagList(e, true);
-                 }*/
                 events["click " + this.ui.tags] = 'onTagList';
-                // events["click " + this.ui.referesh] = 'refereshClick';
                 events["keyup " + this.ui.offLineSearchTag] = 'offlineSearchTag';
                 events["click " + this.ui.deleteTerm] = 'onDeleteTerm';
                 events['click ' + this.ui.refreshTag] = 'fetchCollections';
@@ -69,7 +65,6 @@ define(['require',
                 _.extend(this, _.pick(options, 'globalVent', 'tag'));
                 this.tagCollection = new VTagList();
                 this.collection = new Backbone.Collection();
-
                 this.json = {
                     "enumTypes": [],
                     "traitTypes": [],
@@ -157,16 +152,18 @@ define(['require',
             tagsAndTypeGenerator: function(collection, searchString) {
                 var that = this,
                     str = '';
-                _.each(this[collection].fullCollection.models, function(model) {
-                    var tagName = model.get("tags");
+                that.tagCollection.fullCollection.comparator = function(model) {
+                    return model.get('tags').toLowerCase();
+                }
+                that.tagCollection.fullCollection.sort().each(function(model) {
                     if (searchString) {
-                        if (tagName.search(new RegExp(searchString, "i")) != -1) {
-                            str = '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + tagName + '"  data-name="`' + tagName + '`" >' + tagName + '</a></li>' + str;
+                        if (model.get('tags').search(new RegExp(searchString, "i")) != -1) {
+                            str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + model.get('tags') + '"  data-name="`' + model.get('tags') + '`" >' + model.get('tags') + '</a></li>';
                         } else {
                             return;
                         }
                     } else {
-                        str = '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + tagName + '"  data-name="`' + tagName + '`">' + tagName + '</a></li>' + str;
+                        str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + model.get('tags') + '"  data-name="`' + model.get('tags') + '`">' + model.get('tags') + '</a></li>';
                     }
                 });
                 this.ui.tagsParent.empty().html(str);

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1efcf06/dashboardv2/public/js/views/tag/addTagModalView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/addTagModalView.js b/dashboardv2/public/js/views/tag/addTagModalView.js
index 83a7ab0..2a0b004 100644
--- a/dashboardv2/public/js/views/tag/addTagModalView.js
+++ b/dashboardv2/public/js/views/tag/addTagModalView.js
@@ -95,8 +95,12 @@ define(['require',
             }, this);
         },
         tagsCollection: function() {
+            this.collection.fullCollection.comparator = function(model) {
+                return model.get('tags').toLowerCase();
+            }
+
             var str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>';
-            _.each(this.collection.fullCollection.models, function(obj, key) {
+            this.collection.fullCollection.sort().each(function(obj, key) {
                 str += '<option>' + obj.get('tags') + '</option>';
             });
             this.ui.addTagOptions.html(str);