You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2020/10/14 12:24:35 UTC

[atlas] branch master updated: ATLAS-3990: UI: When user clicks to view hive-table details, shown some wrong tabs

This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new 94d43c6  ATLAS-3990: UI: When user clicks to view hive-table details, shown some wrong tabs
94d43c6 is described below

commit 94d43c63c6021450845ff17c5bd952dbf5f8958a
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Oct 14 17:44:46 2020 +0530

    ATLAS-3990: UI: When user clicks to view hive-table details, shown some wrong tabs
---
 .../js/views/detail_page/DetailPageLayoutView.js   | 59 +++++++++++++++-------
 .../js/views/detail_page/DetailPageLayoutView.js   | 59 +++++++++++++++-------
 2 files changed, 84 insertions(+), 34 deletions(-)

diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index b87d138..a6fcd8c 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -326,6 +326,9 @@ define(['require',
                             typeName: collectionJSON.typeName,
                             value: that.value
                         }));
+                    } else {
+                        this.$('.profileTab').hide();
+                        this.redirectToDefaultTab("profile");
                     }
 
                     if (this.activeEntityDef) {
@@ -333,6 +336,9 @@ define(['require',
                         if (collectionJSON && collectionJSON.typeName === "AtlasServer") {
                             this.$('.replicationTab').show();
                             this.renderReplicationAuditTableLayoutView(obj);
+                        } else {
+                            this.$('.replicationTab').hide();
+                            this.redirectToDefaultTab("raudits");
                         }
                         // To render Schema check attribute "schemaElementsAttribute"
                         var schemaOptions = this.activeEntityDef.get('options');
@@ -342,14 +348,9 @@ define(['require',
                             this.renderSchemaLayoutView(_.extend({}, obj, {
                                 attribute: collectionJSON.relationshipAttributes[schemaElementsAttribute] || collectionJSON.attributes[schemaElementsAttribute]
                             }));
-                        } else if (this.value && this.value.tabActive == "schema") {
-                            Utils.setUrl({
-                                url: Utils.getUrlState.getQueryUrl().queyParams[0],
-                                urlParams: { tabActive: 'properties' },
-                                mergeBrowserUrl: false,
-                                trigger: true,
-                                updateTabState: true
-                            });
+                        } else {
+                            this.$('.schemaTable').hide();
+                            this.redirectToDefaultTab("schema");
                         }
 
                         if (isLineageRender) {
@@ -358,18 +359,12 @@ define(['require',
                                 processCheck: isProcess,
                                 fetchCollection: this.fetchCollection.bind(this),
                             }));
-                        } else if (this.value && this.value.tabActive == "lineage") {
-                            Utils.setUrl({
-                                url: Utils.getUrlState.getQueryUrl().queyParams[0],
-                                urlParams: { tabActive: 'properties' },
-                                mergeBrowserUrl: false,
-                                trigger: true,
-                                updateTabState: true
-                            });
+                        } else {
+                            this.$('.lineageGraph').hide();
+                            this.redirectToDefaultTab("lineage");
                         }
                     }
 
-
                 }, this);
                 this.listenTo(this.collection, 'error', function(model, response) {
                     this.$('.fontLoader-relative').removeClass('show');
@@ -386,6 +381,36 @@ define(['require',
                 Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail'));
                 this.$('.fontLoader-relative').addClass('show'); // to show tab loader
             },
+            redirectToDefaultTab: function(tabName) {
+                var regionRef = null;
+                switch (tabName) {
+                    case "schema":
+                        regionRef = this.RSchemaTableLayoutView;
+                        break;
+                    case "lineage":
+                        regionRef = this.RLineageLayoutView;
+                        break;
+                    case "raudits":
+                        regionRef = this.RReplicationAuditTableLayoutView;
+                        break;
+                     case "profile":
+                        regionRef = this.RProfileLayoutView;
+                        break;
+                }
+                if (regionRef) {
+                    regionRef.destroy();
+                    regionRef.$el.empty();
+                }
+                if (this.value && this.value.tabActive == tabName || this.$(".tab-content .tab-pane.active").attr("role") === tabName) {
+                    Utils.setUrl({
+                        url: Utils.getUrlState.getQueryUrl().queyParams[0],
+                        urlParams: { tabActive: 'properties' },
+                        mergeBrowserUrl: false,
+                        trigger: true,
+                        updateTabState: true
+                    });
+                }
+            },
             manualRender: function(options) {
                 if (options) {
                     var oldId = this.id;
diff --git a/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
index bc213d5..4a7cc3a 100644
--- a/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
@@ -330,6 +330,9 @@ define(['require',
                             typeName: collectionJSON.typeName,
                             value: that.value
                         }));
+                    } else {
+                        this.$('.profileTab').hide();
+                        this.redirectToDefaultTab("profile");
                     }
 
                     if (this.activeEntityDef) {
@@ -337,6 +340,9 @@ define(['require',
                         if (collectionJSON && collectionJSON.typeName === "AtlasServer") {
                             this.$('.replicationTab').show();
                             this.renderReplicationAuditTableLayoutView(obj);
+                        } else {
+                            this.$('.replicationTab').hide();
+                            this.redirectToDefaultTab("raudits");
                         }
                         // To render Schema check attribute "schemaElementsAttribute"
                         var schemaOptions = this.activeEntityDef.get('options');
@@ -346,14 +352,9 @@ define(['require',
                             this.renderSchemaLayoutView(_.extend({}, obj, {
                                 attribute: collectionJSON.relationshipAttributes[schemaElementsAttribute] || collectionJSON.attributes[schemaElementsAttribute]
                             }));
-                        } else if (this.value && this.value.tabActive == "schema") {
-                            Utils.setUrl({
-                                url: Utils.getUrlState.getQueryUrl().queyParams[0],
-                                urlParams: { tabActive: 'properties' },
-                                mergeBrowserUrl: false,
-                                trigger: true,
-                                updateTabState: true
-                            });
+                        } else {
+                            this.$('.schemaTable').hide();
+                            this.redirectToDefaultTab("schema");
                         }
 
                         if (isLineageRender) {
@@ -362,18 +363,12 @@ define(['require',
                                 processCheck: isProcess,
                                 fetchCollection: this.fetchCollection.bind(this),
                             }));
-                        } else if (this.value && this.value.tabActive == "lineage") {
-                            Utils.setUrl({
-                                url: Utils.getUrlState.getQueryUrl().queyParams[0],
-                                urlParams: { tabActive: 'properties' },
-                                mergeBrowserUrl: false,
-                                trigger: true,
-                                updateTabState: true
-                            });
+                        } else {
+                            this.$('.lineageGraph').hide();
+                            this.redirectToDefaultTab("lineage");
                         }
                     }
 
-
                 }, this);
                 this.listenTo(this.collection, 'error', function(model, response) {
                     this.$('.fontLoader-relative').removeClass('show');
@@ -390,6 +385,36 @@ define(['require',
                 Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail'));
                 this.$('.fontLoader-relative').addClass('show'); // to show tab loader
             },
+            redirectToDefaultTab: function(tabName) {
+                var regionRef = null;
+                switch (tabName) {
+                    case "schema":
+                        regionRef = this.RSchemaTableLayoutView;
+                        break;
+                    case "lineage":
+                        regionRef = this.RLineageLayoutView;
+                        break;
+                    case "raudits":
+                        regionRef = this.RReplicationAuditTableLayoutView;
+                        break;
+                     case "profile":
+                        regionRef = this.RProfileLayoutView;
+                        break;
+                }
+                if (regionRef) {
+                    regionRef.destroy();
+                    regionRef.$el.empty();
+                }
+                if (this.value && this.value.tabActive == tabName || this.$(".tab-content .tab-pane.active").attr("role") === tabName) {
+                    Utils.setUrl({
+                        url: Utils.getUrlState.getQueryUrl().queyParams[0],
+                        urlParams: { tabActive: 'properties' },
+                        mergeBrowserUrl: false,
+                        trigger: true,
+                        updateTabState: true
+                    });
+                }
+            },
             manualRender: function(options) {
                 if (options) {
                     var oldId = this.id;