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/10/03 17:58:22 UTC

[2/2] atlas git commit: ATLAS-2163: UI updates to handle Saved search query having deleted types

ATLAS-2163: UI updates to handle Saved search query having deleted types

Signed-off-by: Madhan Neethiraj <ma...@apache.org>
(cherry picked from commit 52848ab63449608d05367f959da007f562bccd5b)


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

Branch: refs/heads/branch-0.8
Commit: dae36e343c53ce087e91648e0b2da0bfbc39b7e8
Parents: 501ea92
Author: kevalbhatt <kb...@apache.org>
Authored: Tue Oct 3 14:44:30 2017 +0530
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Tue Oct 3 08:45:42 2017 -0700

----------------------------------------------------------------------
 dashboardv2/public/css/scss/theme.scss          |  1 +
 dashboardv2/public/js/router/Router.js          |  5 +++-
 dashboardv2/public/js/utils/Messages.js         |  3 ++-
 .../js/views/audit/AuditTableLayoutView.js      |  4 ++++
 .../views/audit/CreateAuditTableLayoutView.js   |  7 +++---
 .../js/views/search/SearchResultLayoutView.js   | 25 ++++++++++++--------
 .../js/views/search/save/SaveSearchItemView.js  |  2 +-
 7 files changed, 30 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/dae36e34/dashboardv2/public/css/scss/theme.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/theme.scss b/dashboardv2/public/css/scss/theme.scss
index 7196702..c183a25 100644
--- a/dashboardv2/public/css/scss/theme.scss
+++ b/dashboardv2/public/css/scss/theme.scss
@@ -22,6 +22,7 @@
 body {
     font-family: $font_0, $font_1;
     color: $color_ironside_gray_approx;
+    overflow-x: hidden;
 }
 
 header {

http://git-wip-us.apache.org/repos/asf/atlas/blob/dae36e34/dashboardv2/public/js/router/Router.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/router/Router.js b/dashboardv2/public/js/router/Router.js
index 59d22c9..7790aef 100644
--- a/dashboardv2/public/js/router/Router.js
+++ b/dashboardv2/public/js/router/Router.js
@@ -276,6 +276,9 @@ define([
                 'views/search/SearchDetailLayoutView'
             ], function(Header, BusinessCatalogLayoutView, SideNavLayoutView, SearchDetailLayoutView) {
                 var paramObj = Utils.getUrlState.getQueryParams();
+                var isinitialView = true,
+                    isTypeTagNotExists = false,
+                    tempParam = _.extend({}, paramObj);
                 App.rNHeader.show(new Header());
                 if (!App.rSideNav.currentView) {
                     App.rSideNav.show(new SideNavLayoutView(
@@ -288,7 +291,6 @@ define([
                     App.rSideNav.currentView.RSearchLayoutView.currentView.manualRender(paramObj);
                 }
                 App.rSideNav.currentView.selectTab();
-                var isinitialView = true;
                 if (paramObj) {
                     isinitialView = (paramObj.type || (paramObj.dslChecked == "true" ? "" : paramObj.tag) || (paramObj.query ? paramObj.query.trim() : "")).length === 0;
                 }
@@ -297,6 +299,7 @@ define([
                         'value': paramObj,
                         'searchVent': that.searchVent,
                         'initialView': isinitialView,
+                        'isTypeTagNotExists': ((paramObj.type != tempParam.type) || (tempParam.tag != paramObj.tag))
                     }, that.preFetchedCollectionLists, that.sharedObj)
                 ));
             });

http://git-wip-us.apache.org/repos/asf/atlas/blob/dae36e34/dashboardv2/public/js/utils/Messages.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Messages.js b/dashboardv2/public/js/utils/Messages.js
index feccdc0..73d58a2 100644
--- a/dashboardv2/public/js/utils/Messages.js
+++ b/dashboardv2/public/js/utils/Messages.js
@@ -39,10 +39,11 @@ define(['require'], function(require) {
         search: {
             noRecordForPage: "No record found at ",
             onSamePage: "You are on the same page!",
+            notExists: "Invalid Expression or Tag/Type has been deleted.",
             favoriteSearch: {
                 save: "Do you want to overwrite ",
                 notSelectedFavoriteElement: "Please select any one favorite search",
-                notSelectedSearchFilter:"Please select at least one filter"
+                notSelectedSearchFilter: "Please select at least one filter"
             }
         },
         tag: {

http://git-wip-us.apache.org/repos/asf/atlas/blob/dae36e34/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
index e8483e4..a30158c 100644
--- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
@@ -232,6 +232,7 @@ define(['require',
                     'views/audit/CreateAuditTableLayoutView',
                 ], function(Modal, CreateAuditTableLayoutView) {
                     that.action = $(e.target).data("action");
+                    $(e.target).attr('disabled', true);
                     var eventModel = that.entityCollection.fullCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }).toJSON(),
                         collectionModel = new that.entityCollection.model(eventModel),
                         view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action, entity: that.entity, entityName: that.entityName, attributeDefs: that.attributeDefs });
@@ -247,6 +248,9 @@ define(['require',
                     view.$el.on('click', 'td a', function() {
                         modal.trigger('cancel');
                     });
+                    view.on('hidden.bs.modal', function() {
+                        that.$('.btn-action[data-id="auditCreate"]').attr('disabled', false);
+                    });
                 });
             },
             onClickNextAuditData: function() {

http://git-wip-us.apache.org/repos/asf/atlas/blob/dae36e34/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
index ebc0021..cbd6b0d 100644
--- a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -80,9 +80,9 @@ define(['require',
                         }
                     }
                     var values = parseDetailsObject.values;
+                    var name = ((name ? name : this.entityName));
+                    this.ui.name.text(name);
                     if (parseDetailsObject && parseDetailsObject.values) {
-                        var name = ((name ? name : this.entityName));
-                        this.ui.name.text(name);
                         this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
                         table = CommonViewFunction.propertyTable({ scope: this, valueObject: values, attributeDefs: this.attributeDefs, extractJSON: { extractKey: 'value' } });
                         if (table.length) {
@@ -94,8 +94,7 @@ define(['require',
                             this.ui.tableAudit.hide();
                         }
                     } else {
-                        this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
-                        this.ui.auditValue.html("<tr><td>" + (name ? name : this.entityName) + "</td></tr>");
+                        this.ui.noData.show();
                     }
                 } else if (detailObj == "Deleted entity") {
                     this.ui.name.text(this.entityName);

http://git-wip-us.apache.org/repos/asf/atlas/blob/dae36e34/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 e8151fd..0e9838f 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -145,7 +145,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'value', 'initialView', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns'));
+                _.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns'));
                 this.entityModel = new VEntity();
                 this.searchCollection = new VSearchList();
                 this.limit = 25;
@@ -298,19 +298,24 @@ define(['require',
                         this.ui.columnEmptyInfo.hide();
                     }
                     this.fetchCollection(value, _.extend({ 'fromUrl': true }, (this.value && this.value.pageOffset ? { 'next': true } : null)));
+                    this.ui.showPage.select2({
+                        data: _.sortBy(_.union([25, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500], [this.limit])),
+                        tags: true,
+                        dropdownCssClass: "number-input",
+                        multiple: false
+                    });
+                    if (this.value && this.value.pageLimit) {
+                        this.ui.showPage.val(this.limit).trigger('change', { "skipViewChange": true });
+                    }
                 } else {
                     if (Globals.entityTypeConfList) {
                         this.$(".entityLink").show();
                     }
-                }
-                this.ui.showPage.select2({
-                    data: _.sortBy(_.union([25, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500], [this.limit])),
-                    tags: true,
-                    dropdownCssClass: "number-input",
-                    multiple: false
-                });
-                if (this.value && this.value.pageLimit) {
-                    this.ui.showPage.val(this.limit).trigger('change', { "skipViewChange": true });
+                    if (this.isTypeTagNotExists) {
+                        Utils.notifyError({
+                            content: Messages.search.notExists
+                        });
+                    }
                 }
             },
             triggerUrl: function(options) {

http://git-wip-us.apache.org/repos/asf/atlas/blob/dae36e34/dashboardv2/public/js/views/search/save/SaveSearchItemView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/save/SaveSearchItemView.js b/dashboardv2/public/js/views/search/save/SaveSearchItemView.js
index 07d8df7..a2af4b3 100644
--- a/dashboardv2/public/js/views/search/save/SaveSearchItemView.js
+++ b/dashboardv2/public/js/views/search/save/SaveSearchItemView.js
@@ -93,7 +93,7 @@ define(['require',
                 });
             Utils.setUrl({
                 url: '#!/search/searchResult',
-                urlParams: _.extend(params, this.searchTypeObj),
+                urlParams: _.extend({}, this.searchTypeObj, params),
                 mergeBrowserUrl: false,
                 trigger: true,
                 updateTabState: true