You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2017/12/22 01:49:46 UTC

[1/3] atlas git commit: ATLAS-2295: UI updates for classifications

Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 96616f7fc -> 549bfc77b


http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/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 37f9301..b2a82b5 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -40,10 +40,14 @@ define(['require',
             /** ui selector cache */
             ui: {
                 tagsParent: "[data-id='tagsParent']",
+                tagsList: "[data-id='tagsList']",
                 createTag: "[data-id='createTag']",
                 tags: "[data-id='tags']",
                 offLineSearchTag: "[data-id='offlineSearchTag']",
-                refreshTag: '[data-id="refreshTag"]'
+                treeLov: "[data-id='treeLov']",
+                refreshTag: '[data-id="refreshTag"]',
+                tagView: 'input[name="tagView"]',
+                expandArrow: '[data-id="expandArrow"]'
             },
             /** ui events hash */
             events: function() {
@@ -51,7 +55,10 @@ define(['require',
                 events["click " + this.ui.createTag] = 'onClickCreateTag';
                 events["click " + this.ui.tags] = 'onTagList';
                 events["keyup " + this.ui.offLineSearchTag] = 'offlineSearchTag';
+                events["change " + this.ui.treeLov] = 'onTreeSelect';
                 events['click ' + this.ui.refreshTag] = 'fetchCollections';
+                events["change " + this.ui.tagView] = 'tagViewToggle';
+                events["click " + this.ui.expandArrow] = 'toggleChild';
                 return events;
             },
             /**
@@ -59,14 +66,27 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'tag', 'collection', 'typeHeaders', 'value'));
+                _.extend(this, _.pick(options, 'tag', 'collection', 'typeHeaders', 'value', 'enumDefCollection'));
+                this.viewType = "flat";
+                this.query = {
+                    flat: {
+                        tagName: null
+                    },
+                    tree: {
+                        tagName: null
+                    }
+                };
+                if (this.value && this.value.viewType) {
+                    this.viewType = this.value.viewType;
+                }
+                this.query[this.viewType].tagName = this.tag;
             },
             bindEvents: function() {
                 var that = this;
                 this.listenTo(this.collection, "reset add remove", function() {
                     this.tagsGenerator();
                 }, this);
-                this.ui.tagsParent.on('click', 'li.parent-node a', function() {
+                this.ui.tagsList.on('click', 'li.parent-node a', function() {
                     that.setUrl(this.getAttribute("href"));
                 });
                 $('body').on('click', '.tagPopoverOptions li', function(e) {
@@ -83,18 +103,63 @@ define(['require',
                 this.collection.fetch({ reset: true });
                 this.ui.offLineSearchTag.val("");
             },
-            manualRender: function(tagName) {
-                this.tag = tagName;
+            manualRender: function(options) {
+                this.tag = options && options.tagName;
+                _.extend(this.value, options);
+                this.query[this.viewType].tagName = this.tag;
+                if (options && options.viewType) {
+                    this.viewType = options.viewType;
+                }
                 if (!this.createTag) {
                     this.setValues(true);
                 }
             },
+            renderTreeList: function() {
+                var that = this;
+                this.ui.treeLov.empty();
+                var treeStr = '<option></option>';
+                this.collection.fullCollection.each(function(model) {
+                    var name = Utils.getName(model.toJSON(), 'name'),
+                        checkTagOrTerm = Utils.checkTagOrTerm(name);
+                    if (checkTagOrTerm && checkTagOrTerm.tag) {
+                        treeStr += '<option>' + (name) + '</option>';
+                    }
+                });
+                that.ui.treeLov.html(treeStr);
+                that.ui.treeLov.select2({
+                    placeholder: "Search tag",
+                    allowClear: true
+                });
+            },
+            onTreeSelect: function() {
+                var name = this.ui.treeLov.val();
+                Utils.setUrl({
+                    url: (name ? '#!/tag/tagAttribute/' + name : '#!/tag'),
+                    urlParams: {
+                        viewType: 'tree',
+                    },
+                    mergeBrowserUrl: false,
+                    trigger: true,
+                    updateTabState: true
+                });
+            },
             setValues: function(manual) {
-                var $firstEl = this.ui.tagsParent.find('li a') ? this.ui.tagsParent.find('li a').first() : null;
+                var el = this.ui.tagsList;
+                if (this.viewType == "tree") {
+                    el = this.ui.tagsParent;
+                    if (!this.ui.tagView.prop("checked")) {
+                        this.ui.tagView.prop("checked", true).trigger("change");
+                    }
+                } else {
+                    if (this.ui.tagView.prop("checked")) {
+                        this.ui.tagView.prop("checked", false).trigger("change");
+                    }
+                }
+                var $firstEl = el.find('li a') ? el.find('li a').first() : null;
                 if (Utils.getUrlState.isTagTab()) {
                     if (!this.tag) {
                         this.selectFirst = false;
-                        this.ui.tagsParent.find('li').first().addClass('active');
+                        el.find('li').first().addClass('active');
                         if ($firstEl && $firstEl.length) {
                             url: $firstEl.attr("href"),
                             Utils.setUrl({
@@ -105,13 +170,15 @@ define(['require',
                         }
                     } else {
                         var presentTag = this.collection.fullCollection.findWhere({ name: this.tag }),
-                            url = Utils.getUrlState.getQueryUrl().hash,
+                            url = Utils.getUrlState.getQueryUrl().queyParams[0],
                             tag = this.tag,
-                            query = null;
+                            query = Utils.getUrlState.getQueryParams() || null;
                         if (!presentTag) {
                             tag = $firstEl.data('name');
                             url = $firstEl && $firstEl.length ? $firstEl.attr("href") : '#!/tag';
-                            query = $firstEl && $firstEl.length ? { dlttag: true } : null
+                            if ($firstEl && $firstEl.length) {
+                                _.extend(query, { dlttag: true })
+                            }
                         }
                         Utils.setUrl({
                             url: url,
@@ -121,66 +188,182 @@ define(['require',
                         if (!presentTag) {
                             return false;
                         }
-                        this.ui.tagsParent.find('li').removeClass('active');
-                        var target = this.ui.tagsParent.find('li').filter(function() {
-                            return $(this).text() === tag;
-                        }).addClass('active');
-                        if (this.createTag || !manual) {
-                            if (target && target.offset()) {
-                                $('#sidebar-wrapper').animate({
-                                    scrollTop: target.offset().top - 100
-                                }, 500);
+                        el.find('li').removeClass('active'); // remove selected
+                        el.find('li.parent-node').each(function() {
+                            // based on browser url select tag.
+                            var target = $(this);
+                            if (target.children('div').find('a').text() === tag) {
+                                target.addClass('active');
+                                target.parents('ul').addClass('show').removeClass('hide'); // Don't use toggle
+                                if (this.createTag || !manual) {
+                                    if (target.offset()) {
+                                        $('#sidebar-wrapper').animate({
+                                            scrollTop: target.offset().top - 100
+                                        }, 500);
+                                    }
+                                }
+                                return false;
                             }
-                        }
-
+                        });
                     }
                 }
             },
             tagsGenerator: function(searchString) {
-                var str = '';
+                var tagParents = '',
+                    tagLists = '';
+
                 if (this.collection && this.collection.fullCollection.length) {
-                    this.collection.fullCollection.comparator = function(model) {
-                        return Utils.getName(model.toJSON(), 'name').toLowerCase();
+                    var sortedCollection = this.collection.fullCollection;
+                    this.tagTreeList = this.getTagTreeList({ collection: sortedCollection });
+                    if (searchString) {
+                        if (this.viewType == "flat") {
+                            this.ui.tagsList.empty().html(this.generateTree({ 'data': sortedCollection, 'searchString': searchString }));
+                        } else {
+                            this.ui.tagsParent.empty().html(this.generateTree({ 'data': this.tagTreeList, 'isTree': true, 'searchString': searchString }));
+                        }
+                    } else {
+                        this.ui.tagsParent.empty().html(this.generateTree({ 'data': this.tagTreeList, 'isTree': true, 'searchString': searchString }));
+                        this.ui.tagsList.empty().html(this.generateTree({ 'data': sortedCollection, 'searchString': searchString }));
+
+                    }
+                    this.createTagAction();
+                    this.setValues();
+                    this.renderTreeList();
+                    if (this.createTag) {
+                        this.createTag = false;
+                    }
+                }
+            },
+            getTagTreeList: function(options) {
+                var that = this,
+                    collection = options.collection,
+                    listOfParents = {},
+                    getChildren = function(options) {
+                        var children = options.children,
+                            data = [];
+                        if (children && children.length) {
+                            _.each(children, function(name) {
+                                var child = collection.find({ 'name': name });
+                                if (child) {
+                                    var modelJSON = child.toJSON();
+                                    data.push({
+                                        name: name,
+                                        children: getChildren({ children: modelJSON.subTypes })
+                                    });
+                                }
+                            });
+                        }
+                        return data;
+                    }
+                collection.each(function(model) {
+                    var modelJSON = model.toJSON();
+                    if (modelJSON.superTypes.length == 0) {
+                        var name = modelJSON.name,
+                            checkTagOrTerm = Utils.checkTagOrTerm(name);
+                        if (checkTagOrTerm && checkTagOrTerm.tag) {
+                            listOfParents[name] = {
+                                name: name,
+                                children: getChildren({ children: modelJSON.subTypes })
+                            }
+                        }
+                    }
+                });
+                return listOfParents;
+            },
+            generateTree: function(options) {
+                var data = options.data,
+                    isTree = options.isTree,
+                    searchString = options.searchString,
+                    that = this,
+                    element = '',
+                    getElString = function(options) {
+                        var name = options.name,
+                            hasChild = isTree && options.children && options.children.length;
+                        return '<li class="parent-node" data-id="tags">' +
+                            '<div><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div>' +
+                            (hasChild ? '<i class="fa toggleArrow fa-angle-right" data-id="expandArrow" data-name="' + name + '"></i>' : '') +
+                            '<a href="#!/tag/tagAttribute/' + name + '?viewType=' + (isTree ? 'tree' : 'flat') + '"  data-name="' + name + '">' + name + '</a></div>' +
+                            (isTree && hasChild ? '<ul class="child hide">' + that.generateTree({ 'data': options.children, 'isTree': isTree }) + '</ul>' : '') + '</li>';
                     };
-                    this.collection.fullCollection.sort().each(function(model) {
-                        var name = Utils.getName(model.toJSON(), 'name');
-                        var checkTagOrTerm = Utils.checkTagOrTerm(name);
-                        if (checkTagOrTerm.tag) {
+                if (isTree) {
+                    _.each(data, function(obj) {
+                        element += getElString({
+                            name: obj.name,
+                            children: obj.children
+                        });
+                    });
+                } else {
+                    data.each(function(obj) {
+                        var name = obj.get('name'),
+                            checkTagOrTerm = Utils.checkTagOrTerm(name);
+                        if (checkTagOrTerm && checkTagOrTerm.tag) {
                             if (searchString) {
                                 if (name.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/' + name + '"  data-name="' + name + '" >' + name + '</a></li>';
+                                    element += getElString({
+                                        name: obj.get('name'),
+                                        children: null
+                                    });
                                 } 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/' + name + '"  data-name="' + name + '">' + name + '</a></li>';
+                                element += getElString({
+                                    name: obj.get('name'),
+                                    children: null
+                                });
                             }
                         }
                     });
-                    this.ui.tagsParent.empty().html(str);
-                    this.setValues();
-                    this.createTagAction();
-                    if (this.createTag) {
-                        this.createTag = false;
-                    }
+                }
+                return element;
+            },
+            toggleChild: function(e) {
+                var el = $(e.currentTarget);
+                if (el) {
+                    el.parent().siblings('ul.child').toggleClass('hide show');
+                }
+            },
+            tagViewToggle: function(e) {
+                if (e.currentTarget.checked) {
+                    this.$('.tree-view').show();
+                    this.$('.list-view').hide();
+                    this.viewType = "tree";
+                } else {
+                    this.viewType = "flat";
+                    this.$('.tree-view').hide();
+                    this.$('.list-view').show();
+                }
+                if (Utils.getUrlState.isTagTab()) {
+                    var name = this.query[this.viewType].tagName;
+                    Utils.setUrl({
+                        url: (name ? '#!/tag/tagAttribute/' + name : '#!/tag'),
+                        urlParams: {
+                            viewType: this.viewType,
+                        },
+                        mergeBrowserUrl: false,
+                        trigger: true,
+                        updateTabState: true
+                    });
                 }
             },
             onClickCreateTag: function(e) {
-                var that = this;
+                var that = this,
+                    nodeName = e.currentTarget.nodeName;
                 $(e.currentTarget).attr("disabled", "true");
                 require([
                     'views/tag/CreateTagLayoutView',
                     'modules/Modal'
                 ], function(CreateTagLayoutView, Modal) {
-                    var view = new CreateTagLayoutView({ 'tagCollection': that.collection });
-                    var modal = new Modal({
-                        title: 'Create a new tag',
-                        content: view,
-                        cancelText: "Cancel",
-                        okCloses: false,
-                        okText: 'Create',
-                        allowCancel: true,
-                    }).open();
+                    var name = (!(nodeName == "BUTTON") ? that.query[that.viewType].tagName : null);
+                    var view = new CreateTagLayoutView({ 'tagCollection': that.collection, 'selectedTag': name, 'enumDefCollection': enumDefCollection }),
+                        modal = new Modal({
+                            title: 'Create a new tag',
+                            content: view,
+                            cancelText: "Cancel",
+                            okCloses: false,
+                            okText: 'Create',
+                            allowCancel: true,
+                        }).open();
                     modal.$el.find('button.ok').attr("disabled", "true");
                     view.ui.tagName.on('keyup', function(e) {
                         modal.$el.find('button.ok').removeAttr("disabled");
@@ -272,7 +455,6 @@ define(['require',
                             ]
                         }
                     }
-
                     if (duplicateAttributeList.length) {
                         if (duplicateAttributeList.length < 2) {
                             var text = "Attribute <b>" + duplicateAttributeList.join(",") + "</b> is duplicate !"
@@ -302,9 +484,21 @@ define(['require',
                 };
                 new this.collection.model().set(this.json).save(null, {
                     success: function(model, response) {
+                        var classificationDefs = model.get('classificationDefs');
                         that.ui.createTag.removeAttr("disabled");
                         that.createTag = true;
-                        that.collection.add(model.get('classificationDefs'));
+                        if (classificationDefs[0]) {
+                            _.each(classificationDefs[0].superTypes, function(superType) {
+                                var superTypeModel = that.collection.fullCollection.find({ name: superType }),
+                                    subTypes = [];
+                                if (superTypeModel) {
+                                    subTypes = superTypeModel.get('subTypes');
+                                    subTypes.push(classificationDefs[0].name);
+                                    superTypeModel.set({ 'subTypes': _.uniq(subTypes) });
+                                }
+                            });
+                        }
+                        that.collection.fullCollection.add(classificationDefs);
                         that.setUrl('#!/tag/tagAttribute/' + ref.ui.tagName.val(), true);
                         Utils.notifySuccess({
                             content: "Tag " + that.name + Messages.addSuccessMessage
@@ -323,8 +517,10 @@ define(['require',
                 });
             },
             onTagList: function(e, toggle) {
-                this.ui.tagsParent.find('li').removeClass("active");
-                $(e.currentTarget).addClass("active");
+                if (e.target.nodeName === "A") {
+                    $(e.currentTarget).parents('ul.tag-tree').find('li.active').removeClass("active");
+                    $(e.currentTarget).addClass("active");
+                }
             },
             offlineSearchTag: function(e) {
                 var type = $(e.currentTarget).data('type');
@@ -339,6 +535,7 @@ define(['require',
                         content: function() {
                             return "<ul>" +
                                 "<li class='listTerm' ><i class='fa fa-search'></i> <a href='javascript:void(0)' data-fn='onSearchTag'>Search Tag</a></li>" +
+                                "<li class='listTerm' ><i class='fa fa-plus'></i> <a href='javascript:void(0)' data-fn='onClickCreateTag'>Create Sub-tag</a></li>" +
                                 "<li class='listTerm' ><i class='fa fa-trash-o'></i> <a href='javascript:void(0)' data-fn='onDeleteTag'>Delete Tag</a></li>" +
                                 "</ul>";
                         }
@@ -346,10 +543,14 @@ define(['require',
                 });
             },
             onSearchTag: function() {
+                var el = this.ui.tagsList;
+                if (this.viewType == "tree") {
+                    el = this.ui.tagsParent;
+                }
                 Utils.setUrl({
                     url: '#!/search/searchResult',
                     urlParams: {
-                        tag: this.ui.tagsParent.find('li.active').find('>a[data-name]').data('name'),
+                        tag: el.find('li.active').find('a[data-name]').data('name'),
                         searchType: "basic",
                         dslChecked: false
                     },

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/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 7269ad9..3207b24 100644
--- a/dashboardv2/public/js/views/tag/addTagModalView.js
+++ b/dashboardv2/public/js/views/tag/addTagModalView.js
@@ -53,8 +53,7 @@ define(['require',
          * @constructs
          */
         initialize: function(options) {
-            _.extend(this, _.pick(options, 'modalCollection', 'guid', 'callback', 'multiple', 'showLoader', 'hideLoader', 'tagList', 'tagModel', 'enumDefCollection'));
-            this.collection = new VTagList();
+            _.extend(this, _.pick(options, 'collection', 'modalCollection', 'guid', 'callback', 'multiple', 'showLoader', 'hideLoader', 'tagList', 'tagModel', 'enumDefCollection'));
             this.commonCollection = new VTagList();
             var that = this,
                 modalObj = {
@@ -184,17 +183,12 @@ define(['require',
 
         onRender: function() {
             var that = this;
-            $.extend(this.collection.queryParams, { type: 'classification' });
             this.hideAttributeBox();
-            this.collection.fetch({
-                reset: true,
-                complete: function() {
-                    if (that.tagModel) {
-                        that.fetchTagSubData(that.tagModel.typeName);
-                    }
-                    that.showAttributeBox();
-                },
-            });
+            this.tagsCollection();
+            if (this.tagModel) {
+                this.fetchTagSubData(that.tagModel.typeName);
+            }
+            that.showAttributeBox();
         },
         bindEvents: function() {
             var that = this;
@@ -207,20 +201,16 @@ define(['require',
             }, this);
         },
         tagsCollection: function() {
-            var that = this;
-            this.collection.fullCollection.comparator = function(model) {
-                return Utils.getName(model.toJSON(), 'name').toLowerCase();
-            }
-
-            var str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>';
-            this.collection.fullCollection.sort().each(function(obj, key) {
-                var name = Utils.getName(obj.toJSON(), 'name');
-                if (name === "TaxonomyTerm") {
-                    return;
-                }
-                // using obj.get('name') insted of name variable because if html is presen in name then escaped name will not found in tagList.
-                if (_.indexOf(that.tagList, obj.get('name')) === -1) {
-                    str += '<option ' + (that.tagModel && that.tagModel.typeName === name ? 'selected' : '') + '>' + name + '</option>';
+            var that = this,
+                str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>';
+            this.collection.fullCollection.each(function(obj, key) {
+                var name = Utils.getName(obj.toJSON(), 'name'),
+                    checkTagOrTerm = Utils.checkTagOrTerm(name);
+                if (checkTagOrTerm && checkTagOrTerm.tag) {
+                    // using obj.get('name') insted of name variable because if html is presen in name then escaped name will not found in tagList.
+                    if (_.indexOf(that.tagList, obj.get('name')) === -1) {
+                        str += '<option ' + (that.tagModel && that.tagModel.typeName === name ? 'selected' : '') + '>' + name + '</option>';
+                    }
                 }
             });
             this.ui.addTagOptions.html(str);


[2/3] atlas git commit: ATLAS-2295: UI updates for classifications

Posted by ma...@apache.org.
ATLAS-2295: UI updates for classifications

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


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

Branch: refs/heads/branch-0.8
Commit: 403139f32a9a3a1116cbeb0cb0dd5daffda49883
Parents: 96616f7
Author: Keval Bhatt <kb...@hortonworks.com>
Authored: Tue Dec 12 20:14:02 2017 +0530
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Thu Dec 21 17:41:44 2017 -0800

----------------------------------------------------------------------
 dashboardv2/public/css/scss/override.scss       |   3 +
 dashboardv2/public/css/scss/tag.scss            | 135 ++++++---
 dashboardv2/public/css/scss/theme.scss          |   5 +
 dashboardv2/public/js/main.js                   |  18 +-
 dashboardv2/public/js/router/Router.js          |   5 +-
 .../business_catalog/BusinessCatalogHeader.html |   2 +-
 .../js/templates/common/TableLayout_tmpl.html   |   2 +-
 .../js/templates/common/aboutAtlas_tmpl.html    |   4 +-
 .../detail_page/DetailPageLayoutView_tmpl.html  |   4 +-
 .../entity/CreateEntityLayoutView_tmpl.html     |  12 +-
 .../profile/ProfileColumnLayoutView_tmpl.html   |  12 +-
 .../profile/ProfileTableLayoutView_tmpl.html    |   8 +-
 .../search/SearchResultLayoutView_tmpl.html     |   8 +-
 .../search/save/SaveSearchItemView_tmpl.html    |   6 -
 .../tag/TagAttributeDetailLayoutView_tmpl.html  |  16 +-
 .../tag/TagAttributeItemView_tmpl.html          |   6 +-
 .../js/templates/tag/TagLayoutView_tmpl.html    |  38 ++-
 .../templates/tag/createTagLayoutView_tmpl.html |   2 +-
 dashboardv2/public/js/utils/Utils.js            |   9 +-
 .../BusinessCatalogLayoutView.js                |   7 +-
 .../views/business_catalog/SideNavLayoutView.js |   4 +-
 .../js/views/business_catalog/TreeLayoutView.js |  16 +-
 .../views/detail_page/DetailPageLayoutView.js   |   1 +
 .../js/views/entity/CreateEntityLayoutView.js   |   9 +-
 .../public/js/views/schema/SchemaLayoutView.js  |   3 +-
 .../js/views/search/SearchDetailLayoutView.js   |   2 +-
 .../public/js/views/search/SearchLayoutView.js  |  45 ++-
 .../js/views/search/SearchResultLayoutView.js   |  11 +-
 .../public/js/views/tag/AddTagAttributeView.js  |  18 +-
 .../public/js/views/tag/CreateTagLayoutView.js  |  16 +-
 .../views/tag/TagAttributeDetailLayoutView.js   |  46 ++-
 .../public/js/views/tag/TagAttributeItemView.js |   6 +-
 .../public/js/views/tag/TagDetailLayoutView.js  |   3 +-
 .../js/views/tag/TagDetailTableLayoutView.js    |   6 +-
 .../public/js/views/tag/TagLayoutView.js        | 303 +++++++++++++++----
 .../public/js/views/tag/addTagModalView.js      |  42 +--
 36 files changed, 561 insertions(+), 272 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/css/scss/override.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/override.scss b/dashboardv2/public/css/scss/override.scss
index 3d6f554..d21a697 100644
--- a/dashboardv2/public/css/scss/override.scss
+++ b/dashboardv2/public/css/scss/override.scss
@@ -112,6 +112,9 @@ td {
     td {
         white-space: normal;
     }
+    .select-all-header-cell{
+        width : 42px;
+    }
 }
 
 .backgrid-paginator ul {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/css/scss/tag.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/tag.scss b/dashboardv2/public/css/scss/tag.scss
index 8b5e6e2..53b3d96 100644
--- a/dashboardv2/public/css/scss/tag.scss
+++ b/dashboardv2/public/css/scss/tag.scss
@@ -23,65 +23,112 @@
         height: 150px;
         overflow-y: auto;
     }
+    .child>li,
     >li {
         list-style: none;
         cursor: pointer;
         &.parent-node {
             position: relative;
-            margin-top: 5px;
-            /* margin-bottom: 5px; */
-            border-radius: 4px;
-            &:hover {
-                background-color: $color_star_dust_approx;
-            }
             &.active {
-                background-color: $color_jungle_green_approx;
-                border: none;
-                .tools {
-                    display: block
+                &>div {
+                    background-color: $color_jungle_green_approx;
+                    border: none;
+                    .tools {
+                        display: block
+                    }
+                    &:hover {
+                        background-color: $color_jungle_green_approx;
+                    }
+                }
+                ul.child {
+                    &:after {
+                        height: 4px;
+                        top: -5px;
+                    }
                 }
             }
-            >ul>li {
-                line-height: 30px;
-                margin-left: -20px;
-                text-indent: 20px;
+            &>div {
+                position: relative;
+                margin-top: 5px;
+                /* margin-bottom: 5px; */
+                border-radius: 4px;
                 &:hover {
-                    background-color: $color_keppel_approx;
+                    background-color: $color_star_dust_approx;
                 }
-                &.selected {
-                    background-color: $color_keppel_approx;
+                >.fa.toggleArrow {
+                    position: absolute;
+                    left: 0;
+                    padding: 8px;
+                    cursor: pointer;
+                } // >ul>li {
+                //     line-height: 30px;
+                //     margin-left: -20px;
+                //     text-indent: 20px;
+                //     &:hover {
+                //         background-color: $color_keppel_approx;
+                //     }
+                //     &.selected {
+                //         background-color: $color_keppel_approx;
+                //     }
+                // }
+                .tools {
+                    display: none;
+                    position: absolute;
+                    right: 0;
+                    color: $white;
+                    padding: 5px 10px;
+                }
+                >a,
+                >div>a {
+                    display: block;
+                    color: $white !important;
+                    white-space: nowrap;
+                    padding: 5px 10px;
+                    max-width: 91%;
+                    @include ellipsis();
+                    font-size: 14px;
+                    &:hover {
+                        color: $white !important;
+                        text-decoration: none !important;
+                    }
+                }
+                >i+a {
+                    padding: 5px 25px;
                 }
             }
-            .tools {
-                display: none;
-                position: absolute;
-                right: 0;
-                color: $white;
-                padding: 5px 10px;
-            }
-        }
-        >a,
-        >div>a {
-            display: block;
-            color: $white !important;
-            white-space: nowrap;
-            padding: 5px 10px;
-            max-width: 91%;
-            @include ellipsis();
-            font-size: 14px;
-            &:hover {
-                color: $white !important;
-                text-decoration: none !important;
+            >ul.child {
+                margin-left: 11px;
+                padding-left: 10px;
+                border-left: 1px dotted gray;
+                position: relative;
+                &:after {
+                    position: absolute;
+                    content: "";
+                    height: 13px;
+                    width: 11px;
+                    top: -14px;
+                    left: -1px;
+                    border-left: 1px dotted gray;
+                }
+                li {
+                    &.parent-node {
+                        &:after {
+                            position: absolute;
+                            content: "";
+                            height: 2px;
+                            width: 14px;
+                            top: 16px;
+                            left: -9px;
+                            border-top: 1px dotted gray;
+                        }
+                        &.active:after {
+                            width: 9px;
+                        }
+                    }
+                }
             }
         }
     }
-    >ul {
-        padding-left: 20px;
-        li {}
-    }
-    .tagAsset {
-        display: none;
-    }
 }
 
 .input-group.attributes .form-control {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/css/scss/theme.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/theme.scss b/dashboardv2/public/css/scss/theme.scss
index dae7827..499f5df 100644
--- a/dashboardv2/public/css/scss/theme.scss
+++ b/dashboardv2/public/css/scss/theme.scss
@@ -145,6 +145,11 @@ a {
     }
 }
 
+.cursor-default,
+.cursor-default a {
+    cursor: default;
+}
+
 .blue-link {
     color: $color_havelock_blue_approx;
     &:focus {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/main.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/main.js b/dashboardv2/public/js/main.js
index 1a9f342..389ed5b 100644
--- a/dashboardv2/public/js/main.js
+++ b/dashboardv2/public/js/main.js
@@ -160,7 +160,7 @@ require.config({
         'daterangepicker': 'libs/bootstrap-daterangepicker/js/daterangepicker',
         'nvd3': 'libs/nvd3/nv.d3.min',
         'sparkline': 'libs/sparkline/jquery.sparkline.min',
-        'table-dragger' : 'libs/table-dragger/table-dragger'
+        'table-dragger': 'libs/table-dragger/table-dragger'
     },
 
     /**
@@ -240,6 +240,10 @@ require(['App',
     this.entityDefCollection.fetch({
         skipDefaultError: true,
         complete: function() {
+            that.entityDefCollection.fullCollection.comparator = function(model) {
+                return model.get('name').toLowerCase();
+            };
+            that.entityDefCollection.fullCollection.sort({ silent: true });
             --that.asyncFetchCounter;
             startApp();
         }
@@ -247,6 +251,10 @@ require(['App',
     this.typeHeaders.fetch({
         skipDefaultError: true,
         complete: function() {
+            that.typeHeaders.fullCollection.comparator = function(model) {
+                return model.get('name').toLowerCase();
+            }
+            that.typeHeaders.fullCollection.sort({ silent: true });
             --that.asyncFetchCounter;
             startApp();
         }
@@ -254,6 +262,10 @@ require(['App',
     this.enumDefCollection.fetch({
         skipDefaultError: true,
         complete: function() {
+            that.enumDefCollection.fullCollection.comparator = function(model) {
+                return model.get('name').toLowerCase();
+            };
+            that.enumDefCollection.fullCollection.sort({ silent: true });
             --that.asyncFetchCounter;
             startApp();
         }
@@ -261,6 +273,10 @@ require(['App',
     this.classificationDefCollection.fetch({
         skipDefaultError: true,
         complete: function() {
+            that.classificationDefCollection.fullCollection.comparator = function(model) {
+                return model.get('name').toLowerCase();
+            };
+            that.classificationDefCollection.fullCollection.sort({ silent: true });
             --that.asyncFetchCounter;
             startApp();
         }

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/router/Router.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/router/Router.js b/dashboardv2/public/js/router/Router.js
index 7790aef..5ef3b49 100644
--- a/dashboardv2/public/js/router/Router.js
+++ b/dashboardv2/public/js/router/Router.js
@@ -200,7 +200,8 @@ define([
                     }
                     App.rSideNav.show(new SideNavLayoutView(
                         _.extend({
-                            'tag': tagName
+                            'tag': tagName,
+                            'value': paramObj
                         }, that.preFetchedCollectionLists, that.sharedObj)
                     ));
                 } else {
@@ -211,7 +212,7 @@ define([
                             updateTabState: true
                         });
                     }
-                    App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(tagName);
+                    App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(_.extend({}, paramObj, { 'tagName': tagName }));
                     App.rSideNav.currentView.selectTab();
                 }
                 if (tagName) {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html b/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
index 3f8928e..3582d8c 100644
--- a/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
+++ b/dashboardv2/public/js/templates/business_catalog/BusinessCatalogHeader.html
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<ol class="breadcrumb col-md-6">
+<ol class="breadcrumb col-sm-6">
 </ol>
 <header class="clearfix">
     <div class="btn-group pull-right header-menu">

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/common/TableLayout_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/common/TableLayout_tmpl.html b/dashboardv2/public/js/templates/common/TableLayout_tmpl.html
index 0ec8301..a1104ab 100644
--- a/dashboardv2/public/js/templates/common/TableLayout_tmpl.html
+++ b/dashboardv2/public/js/templates/common/TableLayout_tmpl.html
@@ -37,7 +37,7 @@
     </div>
     {{#if includePagination}}
     <div class="row clearfix banded pagination-box">
-        <div class="col-md-offset-4 col-md-8">
+        <div class="col-sm-offset-4 col-sm-8">
             <div class="inline-content-fr">
                 <div data-id="r_pagination" class="inline"></div>
                 {{#if includePageSize}}

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/common/aboutAtlas_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/common/aboutAtlas_tmpl.html b/dashboardv2/public/js/templates/common/aboutAtlas_tmpl.html
index a3cf90a..2eca2e3 100644
--- a/dashboardv2/public/js/templates/common/aboutAtlas_tmpl.html
+++ b/dashboardv2/public/js/templates/common/aboutAtlas_tmpl.html
@@ -15,8 +15,8 @@
  * limitations under the License.
 -->
 <div class="row">
-    <div class="col-md-4">
-        <div class="col-md-8 subContent">
+    <div class="col-sm-4">
+        <div class="col-sm-8 subContent">
             <p data-id="atlasVersion"></p>
             <br>
             <p class="text-info">Get involved!</p>

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
index 8acd8e4..a322edd 100644
--- a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
@@ -18,7 +18,7 @@
     <div class="fontLoader">
         <i class="fa fa-refresh fa-spin-custom"></i>
     </div>
-    <div class="entityDetail form-horizontal col-md-12">
+    <div class="entityDetail form-horizontal col-sm-12">
         <div class="row">
             <a href="javascript:void(0);" data-id="backButton"><i class="fa fa-chevron-left"></i>  Back To Results</a>
         </div>
@@ -80,7 +80,7 @@
                 </div>
                 <div class="panel-body">
                     <div class="row">
-                        <div class="col-md-12">
+                        <div class="col-sm-12">
                             <ul class="nav nav-tabs ">
                                 <li role="properties" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li>
                                 <li role="tags"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li>

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
index 55f70a1..689fa29 100644
--- a/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/CreateEntityLayoutView_tmpl.html
@@ -19,15 +19,15 @@
         <div class="col-sm-12 form-group">
             <div class="row">
                 {{#if guid}}
-                <div class="col-md-8">
-                    <label class="col-md-6 row-margin-bottom" data-id="assetName"></label>
+                <div class="col-sm-8">
+                    <label class="col-sm-6 row-margin-bottom" data-id="assetName"></label>
                 </div>
                 {{else}}
-                <div class="col-md-8">
-                    <select class="form-control col-md-6 row-margin-bottom" data-id="entityList"></select>
+                <div class="col-sm-8">
+                    <select class="form-control col-sm-6 row-margin-bottom" data-id="entityList"></select>
                 </div>
                 {{/if}}
-                <div class="col-md-4">
+                <div class="col-sm-4">
                     <span class="pull-left">Required</span>
                     <label class="switch pull-left">
                         <input type="checkbox" class="switch-input" name="toggleRequired" value="text">
@@ -37,7 +37,7 @@
                 </div>
             </div>
         </div>
-        <div class="col-md-12 entityInputData" data-id="entityInputData"></div>
+        <div class="col-sm-12 entityInputData" data-id="entityInputData"></div>
     </div>
 </form>
 <div class="fontLoader-relative entityLoader" style="display:none">

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/profile/ProfileColumnLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/profile/ProfileColumnLayoutView_tmpl.html b/dashboardv2/public/js/templates/profile/ProfileColumnLayoutView_tmpl.html
index 5903afb..17bd972 100644
--- a/dashboardv2/public/js/templates/profile/ProfileColumnLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/profile/ProfileColumnLayoutView_tmpl.html
@@ -16,15 +16,15 @@
 -->
 <div class="row">
     <div class="">
-        <div class="col-md-3 rowValue">
+        <div class="col-sm-3 rowValue">
             <div><span class="graphkey">Rows</span></div>
             <div><span class="graphval"><div class="value-loader"></div></span></div>
         </div>
-        <div class="col-md-3 table_created">
+        <div class="col-sm-3 table_created">
             <div><span class="graphkey">Date Created</span></div>
             <div><span class="graphval"><div class="value-loader"></div></span></div>
         </div>
-        <div class="col-md-6 table_name">
+        <div class="col-sm-6 table_name">
             <div><span class="graphkey">Table</span></div>
             <div><span class="graphval"><div class="value-loader"></div></span></div>
         </div>
@@ -32,7 +32,7 @@
 </div>
 <hr/>
 <div class="row">
-    <h4 class="col-md-12">{{typeObject.label}}</h4>
+    <h4 class="col-sm-12">{{typeObject.label}}</h4>
 </div>
 <div class="row">
     <a href="javascript:void(0);" data-id="backToYear" style="display: none"><i class="fa fa-chevron-left"></i>  Back To Year</a>
@@ -40,10 +40,10 @@
 </br>
 <div class="row">
     <div class="">
-        <div class="col-md-10">
+        <div class="col-sm-10">
             <svg class="graph" width="100%" height="250px"></svg>
         </div>
-        <div class="col-md-2 profileGraphDetail">
+        <div class="col-sm-2 profileGraphDetail">
             {{#if profileData}}
             <div class="">
                 <div><span class="graphkey">Cardinality</span></div>

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/profile/ProfileTableLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/profile/ProfileTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/profile/ProfileTableLayoutView_tmpl.html
index d0ae3e0..1939203 100644
--- a/dashboardv2/public/js/templates/profile/ProfileTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/profile/ProfileTableLayoutView_tmpl.html
@@ -16,19 +16,19 @@
 -->
 <div class="row">
     <div class="">
-        <div class="col-md-3 rowValue">
+        <div class="col-sm-3 rowValue">
             <div><span class="graphkey">Rows</span></div>
             <div><span class="graphval"><div class="value-loader"></div></span></div>
         </div>
-        <div class="col-md-3 table_created">
+        <div class="col-sm-3 table_created">
             <div><span class="graphkey">Date Created</span></div>
             <div><span class="graphval"><div class="value-loader"></div></span></div>
         </div>
-        <div class="col-md-3 table_name">
+        <div class="col-sm-3 table_name">
             <div><span class="graphkey">Table</span></div>
             <div><span class="graphval"><div class="value-loader"></div></span></div>
         </div>
-        <div class="col-md-3 db_name">
+        <div class="col-sm-3 db_name">
             <div><span class="graphkey">DB</span></div>
             <div><span class="graphval"><div class="value-loader"></div></span></div>
         </div>

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index 80960d4..66e780e 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -25,10 +25,10 @@
     <div class="searchTable">
         <div class="row well">
             <div class="row form-group pagination-box" style="display: none;">
-                <div class="col-md-4">
+                <div class="col-sm-4">
                     <span class="labelShowRecord pull-left" data-id="pageRecordText"> </span>
                 </div>
-                <div class="col-md-8 inline-content-fr">
+                <div class="col-sm-8 inline-content-fr">
                     <div class="inline" data-id="colManager"></div>
                     <div class="inline" data-id="containerCheckBox" style="display: none;">
                         <label class="checkbox-inline btn" for="inputLabel">
@@ -53,7 +53,7 @@
                 {{/if}}
             </div>
             <div class="row pagination-box" style="display: none">
-                <div class="col-md-offset-4 col-md-8">
+                <div class="col-sm-offset-4 col-sm-8">
                     <div class="inline-content-fr">
                         <div class="backgrid-paginator inline">
                             <ul class="" data-id="paginationDiv" style="display:none">
@@ -72,7 +72,7 @@
                                 </li>
                             </ul>
                         </div>
-                        <div class="inline col-md-4" data-id="paginationDiv">
+                        <div class="inline col-sm-4" data-id="paginationDiv">
                             <div class="input-group" data-id="goToPageDiv">
                                 <input type="text" class="form-control number-input" data-id="gotoPage" placeholder="Goto Page" />
                                 <span class="input-group-btn">

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/search/save/SaveSearchItemView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/search/save/SaveSearchItemView_tmpl.html b/dashboardv2/public/js/templates/search/save/SaveSearchItemView_tmpl.html
index 9c47c24..28fa733 100644
--- a/dashboardv2/public/js/templates/search/save/SaveSearchItemView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/save/SaveSearchItemView_tmpl.html
@@ -14,12 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<!-- <div class="row">
-    <div class="col-md-10"><span>{{name}}</span></div>
-    <div class="col-md-2">
-        <button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button>
-    </div>
-</div> -->
 <div data-id="{{guid}}" class="item">
     <div class="tools">
         <i class="fa fa-ellipsis-h saveSearchPopover" data-original-title="" title="" data-id=""></i>

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
index 715a04c..d418782 100644
--- a/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
@@ -18,13 +18,23 @@
     <div class="fontLoader">
         <i class="fa fa-refresh fa-spin-custom"></i>
     </div>
-    <div class="tagDetail clearfix form-horizontal col-md-12">
+    <div class="tagDetail clearfix form-horizontal col-sm-12">
         <h1 class="form-group"><span data-id="title"></span></h1>
         <button type="button" data-id="editButton" class="btn btn-sm btn-action pull-right"><i class="fa fa-pencil"></i></button>
         <p class="form-group" data-id="description"></p>
         <div class="superType form-group" style="display:none">
-            <label class="control-label-sm-pr pull-left">Derived From:</label>
-            <div data-id="showSuperType" class="btn-inline">
+            <label class="control-label-sm-pr pull-left">Direct super-tags:</label>
+            <div data-id="superType" class="btn-inline">
+            </div>
+        </div>
+        <div class="subType form-group" style="display:none">
+            <label class="control-label-sm-pr pull-left">Direct sub-tags:</label>
+            <div data-id="subType" class="btn-inline">
+            </div>
+        </div>
+        <div class="entityType form-group cursor-default" style="display:none">
+            <label class="control-label-sm-pr pull-left">Entity-types:</label>
+            <div data-id="entityType" class="btn-inline">
             </div>
         </div>
         <div class="attributes form-group">

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/tag/TagAttributeItemView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagAttributeItemView_tmpl.html b/dashboardv2/public/js/templates/tag/TagAttributeItemView_tmpl.html
index 68f6423..0212e8a 100644
--- a/dashboardv2/public/js/templates/tag/TagAttributeItemView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagAttributeItemView_tmpl.html
@@ -15,11 +15,11 @@
  * limitations under the License.
 -->
 <div class="form-group clearfix">
-    <div class="col-md-7">
+    <div class="col-sm-7">
         <input class="form-control attributeInput" data-id="attributeInput" placeholder="Attribute name">
         </input>
     </div>
-    <div class="col-md-3">
+    <div class="col-sm-3">
         <select class="form-control dataTypeSelector" data-id="dataTypeSelector">
             <option selected="selected">string</option>
             <option>boolean</option>
@@ -31,7 +31,7 @@
             <option>date</option>
         </select>
     </div>
-    <div class="col-md-2 attributePlusData" align="right">
+    <div class="col-sm-2 attributePlusData" align="right">
         <button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button>
     </div>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
index 16e41a2..f786df4 100644
--- a/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
@@ -14,10 +14,36 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<div class="clearfix add-seperator">
-    <button type="button" class="btn btn-action btn-md pull-left" data-id="createTag" type="button"><i class="fa fa-plus"></i> Create Tag</button>
-    <button type="button" class="btn btn-action btn-md pull-right" title="Refresh" data-id="refreshTag" onclick="this.blur();" type="button"><i class="fa fa-refresh"></i></button>
+<div class="col-sm-12 add-seperator">
+    <div class="row">
+        <div class="col-sm-6 no-padding" style="margin-top: 5px;">
+            <span class="pull-left">Flat</span>
+            <label class="switch pull-left">
+                <input type="checkbox" class="switch-input" name="tagView" value="text" />
+                <span class="switch-slider"></span>
+            </label>
+            <span class="pull-left">Tree</span>
+        </div>
+        <div class="col-sm-6 no-padding-right">
+            <button type="button" class="btn btn-action btn-md pull-right" title="Refresh" data-id="refreshTag" onclick="this.blur();" type="button"><i class="fa fa-refresh"></i></button>
+            <button type="button" class="btn btn-action btn-md pull-right" data-id="createTag" type="button"><i class="fa fa-plus"></i></button>
+        </div>
+    </div>
 </div>
-<input type="text" class="form-control" data-id="offlineSearchTag" placeholder="Search Tags">
-<ul class="tag-tree" data-id="tagsParent">
-</ul>
\ No newline at end of file
+<!-- <div class="clearfix add-seperator">
+    <button type="button" class="btn btn-action btn-md pull-left" data-id="createTag" type="button"><i class="fa fa-plus"></i> Create Tag</button>
+</div> -->
+<div class="row">
+    <div class="list-view col-sm-12">
+        <input type="text" class="form-control" data-id="offlineSearchTag" placeholder="Search Tags">
+        <ul class="tag-tree" data-id="tagsList">
+        </ul>
+    </div>
+    <div class="tree-view col-sm-12" style="display: none;">
+        <div class="treeLov">
+            <select class="form-control" data-id="treeLov"></select>
+        </div>
+        <ul class="tag-tree" data-id="tagsParent">
+        </ul>
+    </div>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
index d9c5907..40827ef 100644
--- a/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
@@ -35,7 +35,7 @@
     </div>
     {{#if create}}
     <div class="form-group">
-        <div class="col-md-12">
+        <div class="col-sm-12">
             <label>Select tags to inherit attributes(optional)</label>
             <p class="text-gray">Attributes define additional properties for the tag</p>
             <select class="form-control" data-id="parentTagList" multiple="multiple"></select>

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/utils/Utils.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index 492eb39..a43e740 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -306,19 +306,20 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
             }
         },
         isInitial: function() {
-            return this.getQueryUrl().firstValue == undefined ? true : false;
+            return this.getQueryUrl().firstValue == undefined;
         },
         isTagTab: function(url) {
-            return this.getQueryUrl(url).firstValue == "tag" ? true : false;
+            var quey = this.getQueryUrl(url);
+            return quey.firstValue == "tag" || quey.queyParams[0] == "#!/tag";
         },
         isTaxonomyTab: function(url) {
             return this.getQueryUrl(url).firstValue == "taxonomy" ? true : false;
         },
         isSearchTab: function(url) {
-            return this.getQueryUrl(url).firstValue == "search" ? true : false;
+            return this.getQueryUrl(url).firstValue == "search";
         },
         isDetailPage: function(url) {
-            return this.getQueryUrl(url).firstValue == "detailPage" ? true : false;
+            return this.getQueryUrl(url).firstValue == "detailPage";
         },
         getLastValue: function() {
             return this.getQueryUrl().lastValue;

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js b/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js
index e7c657f..b971dcb 100644
--- a/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/BusinessCatalogLayoutView.js
@@ -42,7 +42,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'url'));
+                _.extend(this, _.pick(options, 'url', 'classificationDefCollection'));
             },
             bindEvents: function() {},
             onRender: function() {
@@ -53,7 +53,8 @@ define(['require',
                 require(['views/business_catalog/TreeLayoutView'], function(TreeLayoutView) {
                     that.RTreeLayoutView.show(new TreeLayoutView({
                         url: that.url,
-                        viewBased: true
+                        viewBased: true,
+                        classificationDefCollection: that.classificationDefCollection,
                     }));
                 });
             },
@@ -62,4 +63,4 @@ define(['require',
             }
         });
     return BusinessCatalogLayoutView;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js b/dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
index 3dbaab4..944a202 100644
--- a/dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
@@ -103,7 +103,8 @@ define(['require',
             var that = this;
             require(['views/business_catalog/BusinessCatalogLayoutView'], function(BusinessCatalogLayoutView) {
                 that.RBusinessCatalogLayoutView.show(new BusinessCatalogLayoutView({
-                    url: that.url
+                    url: that.url,
+                    classificationDefCollection: that.classificationDefCollection,
                 }));
             });
         },
@@ -114,6 +115,7 @@ define(['require',
                     collection: that.classificationDefCollection,
                     tag: that.tag,
                     value: that.value,
+                    enumDefCollection: that.enumDefCollection,
                     typeHeaders: that.typeHeaders
                 }));
             });

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/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 90b87be..36a93bc 100644
--- a/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
+++ b/dashboardv2/public/js/views/business_catalog/TreeLayoutView.js
@@ -88,7 +88,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'url', 'viewBased'));
+                _.extend(this, _.pick(options, 'url', 'viewBased', 'classificationDefCollection'));
                 this.parentCollection = new VCatalogList();
                 this.childCollection = new VCatalogList();
                 this.taxanomy = new VCatalogList();
@@ -120,6 +120,10 @@ define(['require',
                 this.listenTo(this.parentCollection, 'error', function(model, response) {
                     this.hideLoader();
                 }, this);
+                $('body').on('click', '.termPopoverOptions li', function(e) {
+                    that.$('.termPopover').popover('hide');
+                    that[$(this).find('a').data('fn')](e);
+                });
             },
             onRender: function() {
                 var that = this;
@@ -400,11 +404,9 @@ define(['require',
                 }
                 this.hideLoader();
                 if (this.viewBased) {
-
-
                     Utils.generatePopover({
                         el: this.$('.termPopover'),
-                        container: this.$el,
+                        contentClass: 'termPopoverOptions',
                         popoverOptions: {
                             content: function() {
                                 var lis = "<li class='listTerm'><i class='fa fa-plus'></i> <a href='javascript:void(0)' data-fn='onAddTerm'>Create Subterm</a></li>";
@@ -416,10 +418,6 @@ define(['require',
                                 return "<ul>" + lis + "</ul>";
                             }
                         }
-                    }).parent('.tools').off('click').on('click', 'li', function(e) {
-                        e.stopPropagation();
-                        that.$('.termPopover').popover('hide');
-                        that[$(this).find('a').data('fn')](e);
                     });
                 }
             },
@@ -470,6 +468,7 @@ define(['require',
                 view.model.set({ description: view.ui.termDetail.val() }).save(null, {
                     success: function(model, response) {
                         that.create = true;
+                        that.classificationDefCollection.fetch({reset:true});
                         that.fetchTaxanomyCollections();
                         that.fetchCollection(url, true);
                         Utils.notifySuccess({
@@ -520,6 +519,7 @@ define(['require',
                                     updateTabState: true
                                 });
                             }
+                            that.classificationDefCollection.fetch({reset:true});
                             that.fetchCollection(termURL, true);
                         },
                         cust_error: function(model, response) {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index 4a1c601..b73bb5e 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -361,6 +361,7 @@ define(['require',
                         },
                         showLoader: that.showLoader.bind(that),
                         hideLoader: that.hideLoader.bind(that),
+                        collection: that.classificationDefCollection,
                         enumDefCollection: that.enumDefCollection
                     });
                     view.modal.on('ok', function() {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
index 36fe827..a645237 100644
--- a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
+++ b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
@@ -234,10 +234,7 @@ define(['require',
                     }
                 } else {
                     var str = '<option disabled="disabled" selected>--Select entity-type--</option>';
-                    this.entityDefCollection.fullCollection.comparator = function(model) {
-                        return model.get('name');
-                    }
-                    this.entityDefCollection.fullCollection.sort().each(function(val) {
+                    this.entityDefCollection.fullCollection.each(function(val) {
                         var name = Utils.getName(val.toJSON());
                         if (Globals.entityTypeConfList) {
                             if (_.isEmptyArray(Globals.entityTypeConfList)) {
@@ -400,9 +397,9 @@ define(['require',
             },
             getContainer: function(value) {
                 var entityLabel = this.capitalize(value.name);
-                return '<div class="row form-group ' + value.isOptional + '"><span class="col-md-3">' +
+                return '<div class="row form-group ' + value.isOptional + '"><span class="col-sm-3">' +
                     '<label><span class="' + (value.isOptional ? 'true' : 'false required') + '">' + entityLabel + '</span><span class="center-block ellipsis text-gray" title="Data Type : ' + value.typeName + '">' + '(' + Utils.escapeHtml(value.typeName) + ')' + '</span></label></span>' +
-                    '<span class="col-md-9">' + (this.getElement(value)) +
+                    '<span class="col-sm-9">' + (this.getElement(value)) +
                     '</input></span></div>';
             },
             getFieldSet: function(name, alloptional, attributeInput) {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/schema/SchemaLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/schema/SchemaLayoutView.js b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
index bd825f3..f20ec2b 100644
--- a/dashboardv2/public/js/views/schema/SchemaLayoutView.js
+++ b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
@@ -86,7 +86,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'guid', 'entityDefCollection', 'attribute', 'fetchCollection', 'enumDefCollection'));
+                _.extend(this, _.pick(options, 'guid', 'classificationDefCollection', 'entityDefCollection', 'attribute', 'fetchCollection', 'enumDefCollection'));
                 this.schemaCollection = new VSchemaList([], {});
                 this.commonTableOptions = {
                     collection: this.schemaCollection,
@@ -340,6 +340,7 @@ define(['require',
                         },
                         hideLoader: that.hideLoader.bind(that),
                         showLoader: that.showLoader.bind(that),
+                        collection: that.classificationDefCollection,
                         enumDefCollection: that.enumDefCollection
                     });
                     // view.saveTagData = function() {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/search/SearchDetailLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchDetailLayoutView.js b/dashboardv2/public/js/views/search/SearchDetailLayoutView.js
index cfb2aa4..7ab60ec 100644
--- a/dashboardv2/public/js/views/search/SearchDetailLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchDetailLayoutView.js
@@ -43,7 +43,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'value', 'initialView', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'searchTableColumns'));
+                _.extend(this, _.pick(options, 'value', 'initialView', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'searchTableColumns'));
             },
             bindEvents: function() {},
             onRender: function() {

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/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 255480c..cfdb265 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -190,19 +190,15 @@ define(['require',
             },
             bindEvents: function(param) {
                 this.listenTo(this.typeHeaders, "reset", function(value) {
-                    this.renderTypeTagList();
-                    this.setValues();
-                    this.ui.typeLov.select2({
-                        placeholder: "Select",
-                        allowClear: true
-                    });
-                    this.ui.tagLov.select2({
-                        placeholder: "Select",
-                        allowClear: true
-                    });
-                    this.checkForButtonVisiblity();
+                    this.initializeValues();
                 }, this);
             },
+            initializeValues: function() {
+                this.renderTypeTagList();
+                this.setValues();
+                this.checkForButtonVisiblity();
+                this.renderSaveSearch();
+            },
             makeFilterButtonActive: function(filtertypeParam) {
                 var filtertype = ['entityFilters', 'tagFilters'],
                     that = this;
@@ -312,17 +308,7 @@ define(['require',
             },
             onRender: function() {
                 // array of tags which is coming from url
-                this.renderTypeTagList();
-                this.setValues();
-                this.ui.typeLov.select2({
-                    placeholder: "Select",
-                    allowClear: true
-                });
-                this.ui.tagLov.select2({
-                    placeholder: "Select",
-                    allowClear: true
-                });
-                this.renderSaveSearch();
+                this.initializeValues();
             },
             updateQueryObject: function(param) {
                 if (param && param.searchType) {
@@ -351,7 +337,7 @@ define(['require',
             },
             onRefreshButton: function() {
                 this.fetchCollection();
-                //to check url query param contain type or not 
+                //to check url query param contain type or not
                 var checkURLValue = Utils.getUrlState.getQueryParams(this.url);
                 if (this.searchVent && (_.has(checkURLValue, "tag") || _.has(checkURLValue, "type") || _.has(checkURLValue, "query"))) {
                     this.searchVent.trigger('search:refresh');
@@ -426,10 +412,7 @@ define(['require',
                 this.ui.typeLov.empty();
                 var typeStr = '<option></option>',
                     tagStr = typeStr;
-                this.typeHeaders.fullCollection.comparator = function(model) {
-                    return Utils.getName(model.toJSON(), 'name').toLowerCase();
-                }
-                this.typeHeaders.fullCollection.sort().each(function(model) {
+                this.typeHeaders.fullCollection.each(function(model) {
                     var name = Utils.getName(model.toJSON(), 'name');
                     if (model.get('category') == 'ENTITY') {
                         typeStr += '<option>' + (name) + '</option>';
@@ -443,6 +426,14 @@ define(['require',
                 });
                 that.ui.typeLov.html(typeStr);
                 that.ui.tagLov.html(tagStr);
+                this.ui.typeLov.select2({
+                    placeholder: "Select",
+                    allowClear: true
+                });
+                this.ui.tagLov.select2({
+                    placeholder: "Select",
+                    allowClear: true
+                });
             },
             setValues: function(paramObj) {
                 var arr = [],

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/search/SearchResultLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 0bd5fa8..6bd92f7 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -146,7 +146,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns'));
+                _.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns'));
                 this.entityModel = new VEntity();
                 this.searchCollection = new VSearchList();
                 this.limit = 25;
@@ -860,6 +860,7 @@ define(['require',
                         tagList: that.getTagList(guid, multiple),
                         showLoader: that.showLoader.bind(that),
                         hideLoader: that.hideLoader.bind(that),
+                        collection: that.classificationDefCollection,
                         enumDefCollection: that.enumDefCollection
                     });
                 });
@@ -884,13 +885,13 @@ define(['require',
                 }
             },
             showLoader: function() {
-                this.$('.fontLoader:not(.for-ignore)').show();
-                this.$('.tableOverlay').show();
+                this.$('.fontLoader:not(.for-ignore)').addClass('show');
+                this.$('.tableOverlay').addClass('show');
             },
             hideLoader: function() {
-                this.$('.fontLoader:not(.for-ignore)').hide();
+                this.$('.fontLoader:not(.for-ignore)').removeClass('show');
                 this.$('.ellipsis,.pagination-box').show(); // only for first time
-                this.$('.tableOverlay').hide();
+                this.$('.tableOverlay').removeClass('show');
             },
             checkedValue: function(e) {
                 var guid = "",

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/tag/AddTagAttributeView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/AddTagAttributeView.js b/dashboardv2/public/js/views/tag/AddTagAttributeView.js
index 9b5e950..ba5103b 100644
--- a/dashboardv2/public/js/views/tag/AddTagAttributeView.js
+++ b/dashboardv2/public/js/views/tag/AddTagAttributeView.js
@@ -61,27 +61,17 @@ define(['require',
                 return events;
             },
             initialize: function(options) {
-                // this.parentView = options.parentView;
+                _.extend(this, _.pick(options, 'enumDefCollection'));
                 this.collection = new Backbone.Collection();
-                this.typeEnum = new VTagList();
-                this.typeEnum.url = UrlLinks.typedefsUrl().defs;
-                this.typeEnum.modelAttrName = "enumDefs";
+                this.collectionAttribute();
             },
             onRender: function() {
                 var that = this;
-                this.$('.fontLoader').show();
                 this.ui.addAttributeDiv.find('.closeInput').hide();
                 if (!('placeholder' in HTMLInputElement.prototype)) {
                     this.ui.addAttributeDiv.find('input,textarea').placeholder();
                 }
-                that.typeEnum.fetch({
-                    reset: true,
-                    complete: function(model, response) {
-                        that.collectionAttribute();
-                        that.$('.fontLoader').hide();
-                        that.$('.hide').removeClass('hide');
-                    }
-                });
+                that.$('.hide').removeClass('hide');
             },
             bindEvents: function() {},
             collectionAttribute: function() {
@@ -107,4 +97,4 @@ define(['require',
                 }
             }
         });
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/CreateTagLayoutView.js b/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
index 802397a..6f09f39 100644
--- a/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
@@ -74,7 +74,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'tagCollection', 'model', 'tag', 'termCollection', 'descriptionData'));
+                _.extend(this, _.pick(options, 'tagCollection', 'enumDefCollection', 'model', 'tag', 'termCollection', 'descriptionData', 'selectedTag'));
                 if (this.model) {
                     this.description = this.model.get('description');
                 } else if (this.termCollection) {
@@ -83,9 +83,6 @@ define(['require',
                     this.create = true;
                 }
                 this.collection = new Backbone.Collection();
-                this.typeEnum = new VTagList();
-                this.typeEnum.url = UrlLinks.typedefsUrl().defs;
-                this.typeEnum.modelAttrName = "enumDefs";
             },
             bindEvents: function() {},
             onRender: function() {
@@ -99,12 +96,7 @@ define(['require',
                 if (!('placeholder' in HTMLInputElement.prototype)) {
                     this.ui.createTagForm.find('input,textarea').placeholder();
                 }
-                that.typeEnum.fetch({
-                    reset: true,
-                    complete: function(model, response) {
-                        that.hideLoader();
-                    }
-                });
+                that.hideLoader();
             },
             tagCollectionList: function() {
                 var str = '',
@@ -114,7 +106,7 @@ define(['require',
                     var name = Utils.getName(val.toJSON()),
                         checkTagOrTerm = Utils.checkTagOrTerm(name);
                     if (checkTagOrTerm.tag) {
-                        str += '<option>' + (name) + '</option>';
+                        str += '<option ' + (name == that.selectedTag ? 'selected' : '') + '>' + (name) + '</option>';
                     }
                 });
                 that.ui.parentTag.html(str);
@@ -152,4 +144,4 @@ define(['require',
             }
         });
     return CreateTagLayoutView;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
index 35d8cd3..3d6b859 100644
--- a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
@@ -44,7 +44,9 @@ define(['require',
                 addAttribute: '[data-id="addAttribute"]',
                 description: '[data-id="description"]',
                 publishButton: '[data-id="publishButton"]',
-                showSuperType: "[data-id='showSuperType']"
+                superType: "[data-id='superType']",
+                subType: "[data-id='subType']",
+                entityType: "[data-id='entityType']"
             },
             /** ui events hash */
             events: function() {
@@ -58,7 +60,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'tag', 'collection'));
+                _.extend(this, _.pick(options, 'tag', 'collection', 'enumDefCollection'));
             },
             bindEvents: function() {
                 this.listenTo(this.collection, 'reset', function() {
@@ -98,10 +100,21 @@ define(['require',
                 this.ui.publishButton.prop('disabled', true);
             },
             renderTagDetail: function() {
-                var attributeData = "",
-                    supertypeData = "",
+                var that = this,
+                    attributeData = "",
                     attributeDefs = this.model.get("attributeDefs"),
-                    superTypeArr = this.model.get('superTypes');
+                    genrateType = function(options) {
+                        var data = options.data;
+                        _.each(data, function(value, key) {
+                            var str = "",
+                                el = that.ui[key];
+                            _.each(value, function(name) {
+                                el.parents("." + key).show();
+                                str += ' <a class="btn btn-action btn-sm" href="' + (key === "entityType" ? "javascript:void(0)" : "#!/tag/tagAttribute/" + name) + '">' + name + '</a>';
+                            });
+                            el.html(str);
+                        });
+                    }
                 this.ui.title.html('<span>' + (Utils.getName(this.model.toJSON())) + '</span>');
                 if (this.model.get("description")) {
                     this.ui.description.text(this.model.get("description"));
@@ -115,13 +128,14 @@ define(['require',
                     });
                     this.ui.showAttribute.html(attributeData);
                 }
-                if (superTypeArr.length > 0) {
-                    this.$(".superType").show();
-                    _.each(superTypeArr, function(value, key) {
-                        supertypeData += ' <a class="btn btn-action btn-sm" href="#!/tag/tagAttribute/' + value + '">' + value + '</a>';
-                    });
-                    this.ui.showSuperType.html(supertypeData);
-                }
+
+                genrateType({
+                    data: {
+                        superType: this.model.get('superTypes'),
+                        subType: this.model.get('subTypes'),
+                        entityType: this.model.get('entityTypes'),
+                    }
+                });
                 Utils.hideTitleLoader(this.$('.fontLoader'), this.$('.tagDetail'));
             },
             onSaveButton: function(saveObject, message) {
@@ -174,7 +188,9 @@ define(['require',
                         'modules/Modal'
                     ],
                     function(AddTagAttributeView, Modal) {
-                        var view = new AddTagAttributeView();
+                        var view = new AddTagAttributeView({
+                            "enumDefCollection": that.enumDefCollection
+                        });
                         that.modal = new Modal({
                             title: 'Add Attribute',
                             content: view,
@@ -274,7 +290,7 @@ define(['require',
                     'views/tag/CreateTagLayoutView',
                     'modules/Modal'
                 ], function(CreateTagLayoutView, Modal) {
-                    var view = new CreateTagLayoutView({ 'tagCollection': that.collection, 'model': that.model, 'tag': that.tag });
+                    var view = new CreateTagLayoutView({ 'tagCollection': that.collection, 'model': that.model, 'tag': that.tag, 'enumDefCollection': enumDefCollection });
                     that.modal = new Modal({
                         title: 'Edit Tag',
                         content: view,
@@ -296,4 +312,4 @@ define(['require',
             }
         });
     return TagAttributeDetailLayoutView;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/tag/TagAttributeItemView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagAttributeItemView.js b/dashboardv2/public/js/views/tag/TagAttributeItemView.js
index edfda12..3ce40e2 100644
--- a/dashboardv2/public/js/views/tag/TagAttributeItemView.js
+++ b/dashboardv2/public/js/views/tag/TagAttributeItemView.js
@@ -60,8 +60,8 @@ define(['require',
             },
             onRender: function() {
                 var that = this;
-                _.each(this.parentView.typeEnum.models, function(objValue) {
-                    that.ui.dataTypeSelector.append("<option>" + objValue.attributes.name + "</option>");
+                this.parentView.enumDefCollection.fullCollection.each(function(model) {
+                    that.ui.dataTypeSelector.append("<option>" + model.get('name') + "</option>");
                 });
             },
             onCloseButton: function() {
@@ -70,4 +70,4 @@ define(['require',
                 }
             }
         });
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagDetailLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
index 7b71388..27f76bc 100644
--- a/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailLayoutView.js
@@ -76,7 +76,8 @@ define(['require',
                     if (that.RTagAttributeDetailLayoutView) {
                         that.RTagAttributeDetailLayoutView.show(new TagAttributeDetailLayoutView({
                             tag: that.tag,
-                            collection: that.collection
+                            collection: that.collection,
+                            enumDefCollection: that.enumDefCollection
                         }));
                     }
                 });

http://git-wip-us.apache.org/repos/asf/atlas/blob/403139f3/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
index e07dd94..b3e645e 100644
--- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
@@ -185,6 +185,7 @@ define(['require',
                     var view = new AddTagModalView({
                         guid: that.guid,
                         modalCollection: that.collection,
+                        collection: that.classificationDefCollection,
                         enumDefCollection: that.enumDefCollection
                     });
                     // view.saveTagData = function() {
@@ -249,10 +250,11 @@ define(['require',
                 ], function(AddTagModalView) {
                     var view = new AddTagModalView({
                         'tagModel': tagModel,
-                        callback: function() {
+                        'callback': function() {
                             that.fetchCollection();
                         },
-                        guid: that.guid,
+                        'guid': that.guid,
+                        'collection': that.classificationDefCollection,
                         'enumDefCollection': that.enumDefCollection
                     });
                 });


[3/3] atlas git commit: ATLAS-2307: basic-search enhancement to optionally exclude sub-type entities and sub-classification-types (UI)

Posted by ma...@apache.org.
ATLAS-2307: basic-search enhancement to optionally exclude sub-type entities and sub-classification-types (UI)

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


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

Branch: refs/heads/branch-0.8
Commit: 549bfc77b201d91d0bac16f229aa9b21a45051cf
Parents: 403139f
Author: Keval Bhatt <kb...@hortonworks.com>
Authored: Wed Dec 13 20:45:44 2017 +0530
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Thu Dec 21 17:42:36 2017 -0800

----------------------------------------------------------------------
 dashboardv2/public/css/scss/search.scss         |  8 ++++
 .../search/SearchResultLayoutView_tmpl.html     | 18 ++++++--
 .../public/js/utils/CommonViewFunction.js       | 22 +++------
 dashboardv2/public/js/utils/Enums.js            |  2 +
 .../public/js/views/search/SearchLayoutView.js  | 20 ++++-----
 .../js/views/search/SearchResultLayoutView.js   | 47 +++++++++++++-------
 6 files changed, 70 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/549bfc77/dashboardv2/public/css/scss/search.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/search.scss b/dashboardv2/public/css/scss/search.scss
index ade4c33..d3df2b7 100644
--- a/dashboardv2/public/css/scss/search.scss
+++ b/dashboardv2/public/css/scss/search.scss
@@ -121,4 +121,12 @@ $color_celeste_approx: #1D1F2B;
     table {
         background: rgba(0, 0, 0, 0.18) !important;
     }
+}
+
+.filter-box {
+    .inline-content-fr {
+        .inline {
+            margin: 0px;
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/549bfc77/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index 66e780e..48e7b39 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -24,17 +24,27 @@
     </div>
     <div class="searchTable">
         <div class="row well">
-            <div class="row form-group pagination-box" style="display: none;">
-                <div class="col-sm-4">
+            <div class="row form-group pagination-box filter-box" style="display: none;">
+                <div class="col-sm-3">
                     <span class="labelShowRecord pull-left" data-id="pageRecordText"> </span>
                 </div>
-                <div class="col-sm-8 inline-content-fr">
+                <div class="col-sm-9 inline-content-fr no-padding-left">
                     <div class="inline" data-id="colManager"></div>
                     <div class="inline" data-id="containerCheckBox" style="display: none;">
                         <label class="checkbox-inline btn" for="inputLabel">
-                            <input type="checkbox" id="inputLabel" name="queryType" name="check" data-id="checkDeletedEntity" />
+                            <input type="checkbox" data-id="checkDeletedEntity" data-value="includeDE" />
                             <b>Show historical entities</b></label>
                     </div>
+                    <div class="inline" data-id="containerCheckBox" style="display: none;">
+                        <label class="checkbox-inline btn" for="inputLabel">
+                            <input type="checkbox" data-id="checkSubClassification" data-value="excludeSC"/>
+                            <b>Exclude sub-classification</b></label>
+                    </div>
+                    <div class="inline" data-id="containerCheckBox" style="display: none;">
+                        <label class="checkbox-inline btn" for="inputLabel">
+                            <input type="checkbox" data-id="checkSubType"  data-value="excludeST"/>
+                            <b>Exclude sub-type</b></label>
+                    </div>
                     <div class="inline">
                         {{#if taxonomy}}
                         <a href="javascript:void(0)" class=" multiSelectTerm btn btn-action btn-sm inline" style="display:none" data-id="addTerm"><i class="fa fa-plus"></i> Assign Term</a> {{/if}}

http://git-wip-us.apache.org/repos/asf/atlas/blob/549bfc77/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index 9558a55..1257bc1 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -457,19 +457,13 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                 if (!_.isUndefinedNull(val)) {
                     if (k == "attributes") {
                         val = val.split(',');
-                    } else if (k == "tagFilters") {
-                        val = CommonViewFunction.attributeFilter.generateAPIObj(val);
-                    } else if (k == "entityFilters") {
+                    } else if (_.contains(["tagFilters","entityFilters"],k)) {
                         val = CommonViewFunction.attributeFilter.generateAPIObj(val);
-                    } else if (k == "includeDE") {
-                        if (val) {
-                            val = false;
-                        } else {
-                            val = true;
-                        }
+                    } else if (_.contains(["includeDE","excludeST","excludeSC"],k)) {
+                        val = val ? false : true;
                     }
                 }
-                if (k == "includeDE") {
+                if (_.contains(["includeDE","excludeST","excludeSC"],k)) {
                     val = _.isUndefinedNull(val) ? true : val;
                 }
                 obj.searchParameters[v] = val;
@@ -522,12 +516,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                             });
                         }
                         val = CommonViewFunction.attributeFilter.generateUrl({ "value": val.criterion });
-                    } else if (k == "includeDE") {
-                        if (val) {
-                            val = false;
-                        } else {
-                            val = true;
-                        }
+                    } else if (_.contains(["includeDE","excludeST","excludeSC"],k)) {
+                        val = val ? false : true;
                     }
                 }
                 obj[k] = val;

http://git-wip-us.apache.org/repos/asf/atlas/blob/549bfc77/dashboardv2/public/js/utils/Enums.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Enums.js b/dashboardv2/public/js/utils/Enums.js
index 78445e1..94010ed 100644
--- a/dashboardv2/public/js/utils/Enums.js
+++ b/dashboardv2/public/js/utils/Enums.js
@@ -63,6 +63,8 @@ define(['require'], function(require) {
         "query": "query",
         "pageOffset": "offset",
         "includeDE": "excludeDeletedEntities",
+        "excludeST": "includeSubTypes",
+        "excludeSC": "includeSubClassifications",
         "tagFilters": "tagFilters",
         "entityFilters": "entityFilters",
         "attributes": "attributes"

http://git-wip-us.apache.org/repos/asf/atlas/blob/549bfc77/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 cfdb265..d921adb 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -105,7 +105,9 @@ define(['require',
                         pageOffset: null,
                         pageLimit: null,
                         entityFilters: null,
-                        includeDE: null
+                        includeDE: null,
+                        excludeST:null,
+                        excludeSC : null
                     }
                 };
                 if (!this.value) {
@@ -145,11 +147,9 @@ define(['require',
                                 urlObj = Utils.getUrlState.getQueryParams();
                             if (urlObj) {
                                 // includeDE value in because we need to send "true","false" to the server.
-                                if (urlObj.includeDE == "true") {
-                                    urlObj.includeDE = true;
-                                } else {
-                                    urlObj.includeDE = false;
-                                }
+                                urlObj.includeDE = urlObj.includeDE == "true" ? true : false;
+                                urlObj.excludeSC = urlObj.excludeSC == "true" ? true : false;
+                                urlObj.excludeST = urlObj.excludeST == "true" ? true : false;
                             }
                             return _.extend({}, queryObj, urlObj, {
                                 'entityFilters': entityObj ? entityObj[queryObj.type] : null,
@@ -504,11 +504,9 @@ define(['require',
                     if (columnList) {
                         params['attributes'] = columnList.join(',');
                     }
-                    if (_.isUndefinedNull(this.value.includeDE)) {
-                        params['includeDE'] = false;
-                    } else {
-                        params['includeDE'] = this.value.includeDE;
-                    }
+                    params['includeDE'] = _.isUndefinedNull(this.value.includeDE) ? false : this.value.includeDE;
+                    params['excludeST'] = _.isUndefinedNull(this.value.excludeST) ? false : this.value.excludeST;
+                    params['excludeSC'] = _.isUndefinedNull(this.value.excludeSC) ? false : this.value.excludeSC;
                 }
                 if (!_.isUndefinedNull(this.value.pageLimit)) {
                     params['pageLimit'] = this.value.pageLimit;

http://git-wip-us.apache.org/repos/asf/atlas/blob/549bfc77/dashboardv2/public/js/views/search/SearchResultLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 6bd92f7..7be0337 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -62,6 +62,8 @@ define(['require',
                 addAssignTag: "[data-id='addAssignTag']",
                 createEntity: "[data-id='createEntity']",
                 checkDeletedEntity: "[data-id='checkDeletedEntity']",
+                checkSubClassification: "[data-id='checkSubClassification']",
+                checkSubType: "[data-id='checkSubType']",
                 colManager: "[data-id='colManager']",
                 containerCheckBox: "[data-id='containerCheckBox']",
                 columnEmptyInfo: "[data-id='columnEmptyInfo']",
@@ -138,7 +140,9 @@ define(['require',
                 events["click " + this.ui.nextData] = "onClicknextData";
                 events["click " + this.ui.previousData] = "onClickpreviousData";
                 events["click " + this.ui.createEntity] = 'onClickCreateEntity';
-                events["click " + this.ui.checkDeletedEntity] = 'onCheckDeletedEntity';
+                events["click " + this.ui.checkDeletedEntity] = 'onCheckExcludeIncludeResult';
+                events["click " + this.ui.checkSubClassification] = 'onCheckExcludeIncludeResult';
+                events["click " + this.ui.checkSubType] = 'onCheckExcludeIncludeResult';
                 return events;
             },
             /**
@@ -268,7 +272,7 @@ define(['require',
                             saveState: false
                         },
                         visibilityControlOpts: {
-                            buttonTemplate: _.template("<button class='btn btn-action btn-md pull-right'>Columns&nbsp<i class='fa fa-caret-down'></i></button>")
+                            buttonTemplate: _.template("<button class='btn btn-action btn-sm pull-right'>Columns&nbsp<i class='fa fa-caret-down'></i></button>")
                         },
                         el: this.ui.colManager
                     },
@@ -287,6 +291,13 @@ define(['require',
                         if (value && value.includeDE) {
                             this.ui.checkDeletedEntity.prop('checked', true);
                         }
+                        if (value && value.excludeSC) {
+                            this.ui.checkSubClassification.prop('checked', true);
+                        }
+                        if (value && value.excludeST) {
+                            this.ui.checkSubType.prop('checked', true);
+                        }
+
                     } else {
                         value = {
                             'query': null,
@@ -389,7 +400,7 @@ define(['require',
                         }
 
                         if (!dataLength && that.offset >= that.limit && ((options && options.next) || goToPage) && (options && !options.fromUrl)) {
-                            /* User clicks on next button and server returns 
+                            /* User clicks on next button and server returns
                             empty response then disabled the next button without rendering table*/
 
                             that.hideLoader();
@@ -419,7 +430,7 @@ define(['require',
 
 
                         /*Next button check.
-                        It's outside of Previous button else condition 
+                        It's outside of Previous button else condition
                         because when user comes from 2 page to 1 page than we need to check next button.*/
                         if (dataLength < that.limit) {
                             that.ui.nextData.attr('disabled', true);
@@ -467,6 +478,13 @@ define(['require',
                     silent: true,
                     reset: true
                 }
+                if (this.value) {
+                    var checkBoxValue = {
+                        'excludeDeletedEntities': (this.value.includeDE ? false : true),
+                        'includeSubClassifications': (this.value.excludeSC ? false : true),
+                        'includeSubTypes': (this.value.excludeST ? false : true)
+                    }
+                }
                 if (value) {
                     if (value.searchType) {
                         this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType);
@@ -482,28 +500,24 @@ define(['require',
                     }
                     if (isPostMethod) {
                         this.searchCollection.filterObj = _.extend({}, filterObj);
-                        apiObj['data'] = _.extend({
-                            'excludeDeletedEntities': (this.value && this.value.includeDE ? false : true)
-                        }, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification'))
+                        apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification'))
                         Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
                     } else {
                         apiObj.data = null;
                         this.searchCollection.filterObj = null;
                         if (this.value.profileDBView) {
-                            _.extend(this.searchCollection.queryParams, { 'excludeDeletedEntities': (this.value && this.value.includeDE ? false : true) });
+                            _.extend(this.searchCollection.queryParams, checkBoxValue);
                         }
                         Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
                     }
                 } else {
                     if (isPostMethod) {
-                        apiObj['data'] = _.extend({
-                            'excludeDeletedEntities': (this.value && this.value.includeDE ? false : true)
-                        }, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification'));
+                        apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification'));
                         Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
                     } else {
                         apiObj.data = null;
                         if (this.value.profileDBView) {
-                            _.extend(this.searchCollection.queryParams, { 'excludeDeletedEntities': (this.value && this.value.includeDE ? false : true) });
+                            _.extend(this.searchCollection.queryParams, checkBoxValue);
                         }
                         Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
                     }
@@ -1023,13 +1037,14 @@ define(['require',
                     });
                 });
             },
-            onCheckDeletedEntity: function(e) {
-                var includeDE = false;
+            onCheckExcludeIncludeResult: function(e) {
+                var flag = false,
+                    val = $(e.currentTarget).attr('data-value');
                 if (e.target.checked) {
-                    includeDE = true;
+                    flag = true;
                 }
                 if (this.value) {
-                    this.value.includeDE = includeDE;
+                    this.value[val] = flag;
                     this.triggerUrl();
                 }
                 _.extend(this.searchCollection.queryParams, { limit: this.limit, offset: this.offset });