Commit 94d43c63 by kevalbhatt

ATLAS-3990: UI: When user clicks to view hive-table details, shown some wrong tabs

parent 080e4843
...@@ -326,6 +326,9 @@ define(['require', ...@@ -326,6 +326,9 @@ define(['require',
typeName: collectionJSON.typeName, typeName: collectionJSON.typeName,
value: that.value value: that.value
})); }));
} else {
this.$('.profileTab').hide();
this.redirectToDefaultTab("profile");
} }
if (this.activeEntityDef) { if (this.activeEntityDef) {
...@@ -333,6 +336,9 @@ define(['require', ...@@ -333,6 +336,9 @@ define(['require',
if (collectionJSON && collectionJSON.typeName === "AtlasServer") { if (collectionJSON && collectionJSON.typeName === "AtlasServer") {
this.$('.replicationTab').show(); this.$('.replicationTab').show();
this.renderReplicationAuditTableLayoutView(obj); this.renderReplicationAuditTableLayoutView(obj);
} else {
this.$('.replicationTab').hide();
this.redirectToDefaultTab("raudits");
} }
// To render Schema check attribute "schemaElementsAttribute" // To render Schema check attribute "schemaElementsAttribute"
var schemaOptions = this.activeEntityDef.get('options'); var schemaOptions = this.activeEntityDef.get('options');
...@@ -342,14 +348,9 @@ define(['require', ...@@ -342,14 +348,9 @@ define(['require',
this.renderSchemaLayoutView(_.extend({}, obj, { this.renderSchemaLayoutView(_.extend({}, obj, {
attribute: collectionJSON.relationshipAttributes[schemaElementsAttribute] || collectionJSON.attributes[schemaElementsAttribute] attribute: collectionJSON.relationshipAttributes[schemaElementsAttribute] || collectionJSON.attributes[schemaElementsAttribute]
})); }));
} else if (this.value && this.value.tabActive == "schema") { } else {
Utils.setUrl({ this.$('.schemaTable').hide();
url: Utils.getUrlState.getQueryUrl().queyParams[0], this.redirectToDefaultTab("schema");
urlParams: { tabActive: 'properties' },
mergeBrowserUrl: false,
trigger: true,
updateTabState: true
});
} }
if (isLineageRender) { if (isLineageRender) {
...@@ -358,18 +359,12 @@ define(['require', ...@@ -358,18 +359,12 @@ define(['require',
processCheck: isProcess, processCheck: isProcess,
fetchCollection: this.fetchCollection.bind(this), fetchCollection: this.fetchCollection.bind(this),
})); }));
} else if (this.value && this.value.tabActive == "lineage") { } else {
Utils.setUrl({ this.$('.lineageGraph').hide();
url: Utils.getUrlState.getQueryUrl().queyParams[0], this.redirectToDefaultTab("lineage");
urlParams: { tabActive: 'properties' },
mergeBrowserUrl: false,
trigger: true,
updateTabState: true
});
} }
} }
}, this); }, this);
this.listenTo(this.collection, 'error', function(model, response) { this.listenTo(this.collection, 'error', function(model, response) {
this.$('.fontLoader-relative').removeClass('show'); this.$('.fontLoader-relative').removeClass('show');
...@@ -386,6 +381,36 @@ define(['require', ...@@ -386,6 +381,36 @@ define(['require',
Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail')); Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail'));
this.$('.fontLoader-relative').addClass('show'); // to show tab loader 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) { manualRender: function(options) {
if (options) { if (options) {
var oldId = this.id; var oldId = this.id;
......
...@@ -330,6 +330,9 @@ define(['require', ...@@ -330,6 +330,9 @@ define(['require',
typeName: collectionJSON.typeName, typeName: collectionJSON.typeName,
value: that.value value: that.value
})); }));
} else {
this.$('.profileTab').hide();
this.redirectToDefaultTab("profile");
} }
if (this.activeEntityDef) { if (this.activeEntityDef) {
...@@ -337,6 +340,9 @@ define(['require', ...@@ -337,6 +340,9 @@ define(['require',
if (collectionJSON && collectionJSON.typeName === "AtlasServer") { if (collectionJSON && collectionJSON.typeName === "AtlasServer") {
this.$('.replicationTab').show(); this.$('.replicationTab').show();
this.renderReplicationAuditTableLayoutView(obj); this.renderReplicationAuditTableLayoutView(obj);
} else {
this.$('.replicationTab').hide();
this.redirectToDefaultTab("raudits");
} }
// To render Schema check attribute "schemaElementsAttribute" // To render Schema check attribute "schemaElementsAttribute"
var schemaOptions = this.activeEntityDef.get('options'); var schemaOptions = this.activeEntityDef.get('options');
...@@ -346,14 +352,9 @@ define(['require', ...@@ -346,14 +352,9 @@ define(['require',
this.renderSchemaLayoutView(_.extend({}, obj, { this.renderSchemaLayoutView(_.extend({}, obj, {
attribute: collectionJSON.relationshipAttributes[schemaElementsAttribute] || collectionJSON.attributes[schemaElementsAttribute] attribute: collectionJSON.relationshipAttributes[schemaElementsAttribute] || collectionJSON.attributes[schemaElementsAttribute]
})); }));
} else if (this.value && this.value.tabActive == "schema") { } else {
Utils.setUrl({ this.$('.schemaTable').hide();
url: Utils.getUrlState.getQueryUrl().queyParams[0], this.redirectToDefaultTab("schema");
urlParams: { tabActive: 'properties' },
mergeBrowserUrl: false,
trigger: true,
updateTabState: true
});
} }
if (isLineageRender) { if (isLineageRender) {
...@@ -362,18 +363,12 @@ define(['require', ...@@ -362,18 +363,12 @@ define(['require',
processCheck: isProcess, processCheck: isProcess,
fetchCollection: this.fetchCollection.bind(this), fetchCollection: this.fetchCollection.bind(this),
})); }));
} else if (this.value && this.value.tabActive == "lineage") { } else {
Utils.setUrl({ this.$('.lineageGraph').hide();
url: Utils.getUrlState.getQueryUrl().queyParams[0], this.redirectToDefaultTab("lineage");
urlParams: { tabActive: 'properties' },
mergeBrowserUrl: false,
trigger: true,
updateTabState: true
});
} }
} }
}, this); }, this);
this.listenTo(this.collection, 'error', function(model, response) { this.listenTo(this.collection, 'error', function(model, response) {
this.$('.fontLoader-relative').removeClass('show'); this.$('.fontLoader-relative').removeClass('show');
...@@ -390,6 +385,36 @@ define(['require', ...@@ -390,6 +385,36 @@ define(['require',
Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail')); Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail'));
this.$('.fontLoader-relative').addClass('show'); // to show tab loader 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) { manualRender: function(options) {
if (options) { if (options) {
var oldId = this.id; var oldId = this.id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment