Commit 079ce35e by Shwetha GS

ATLAS-1004 Option to enable taxonomy feature (kevalbhatt18 via shwethags)

parent 80051c9e
...@@ -45,17 +45,6 @@ ...@@ -45,17 +45,6 @@
} }
} }
.loader {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
text-align: center;
z-index: 9;
background: $white_80 $url_0 no-repeat center center;
}
.fontLoader { .fontLoader {
top: 50%; top: 50%;
left: 50%; left: 50%;
......
...@@ -132,3 +132,6 @@ ...@@ -132,3 +132,6 @@
color: $color_jungle_green_approx; color: $color_jungle_green_approx;
} }
} }
.position-relative{
position:relative;
}
\ No newline at end of file
...@@ -155,8 +155,10 @@ require(['App', ...@@ -155,8 +155,10 @@ require(['App',
Globals.userLogedIn.status = true; Globals.userLogedIn.status = true;
Globals.userLogedIn.response = response; Globals.userLogedIn.response = response;
} }
if (response && response['atlas.feature.taxonomy.enable'] !== undefined) {
Globals.taxonomy = response['atlas.feature.taxonomy.enable']
}
App.start(); App.start();
} }
}); });
}); });
...@@ -104,22 +104,26 @@ define([ ...@@ -104,22 +104,26 @@ define([
'views/business_catalog/SideNavLayoutView', 'views/business_catalog/SideNavLayoutView',
'collection/VCatalogList' 'collection/VCatalogList'
], function(BusinessCatalogHeader, BusinessCatalogDetailLayoutView, SideNavLayoutView, VCatalogList) { ], function(BusinessCatalogHeader, BusinessCatalogDetailLayoutView, SideNavLayoutView, VCatalogList) {
var paramObj = Utils.getUrlState.getQueryParams(); if (Globals.taxonomy) {
this.collection = new VCatalogList(); var paramObj = Utils.getUrlState.getQueryParams();
this.collection.url = url; this.collection = new VCatalogList();
App.rNHeader.show(new BusinessCatalogHeader({ 'globalVent': that.globalVent, 'url': url, 'collection': this.collection })); this.collection.url = url;
if (!App.rSideNav.currentView) { App.rNHeader.show(new BusinessCatalogHeader({ 'globalVent': that.globalVent, 'url': url, 'collection': this.collection }));
App.rSideNav.show(new SideNavLayoutView({ 'globalVent': that.globalVent, 'url': url })); if (!App.rSideNav.currentView) {
App.rSideNav.show(new SideNavLayoutView({ 'globalVent': that.globalVent, 'url': url }));
} else {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender("/" + url);
App.rSideNav.currentView.selectTab();
}
App.rNContent.show(new BusinessCatalogDetailLayoutView({
'globalVent': that.globalVent,
'url': url,
'collection': this.collection
}));
this.collection.fetch({ reset: true });
} else { } else {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender("/" + url); that.defaultAction()
App.rSideNav.currentView.selectTab();
} }
App.rNContent.show(new BusinessCatalogDetailLayoutView({
'globalVent': that.globalVent,
'url': url,
'collection': this.collection
}));
this.collection.fetch({ reset: true });
}); });
}, },
detailPage: function(id) { detailPage: function(id) {
...@@ -228,14 +232,26 @@ define([ ...@@ -228,14 +232,26 @@ define([
}, },
defaultAction: function(actions) { defaultAction: function(actions) {
// We have no matching route, lets just log what the URL was // We have no matching route, lets just log what the URL was
Utils.setUrl({ if (Globals.taxonomy) {
url: '#!/taxonomy', Utils.setUrl({
mergeBrowserUrl: false, url: '#!/taxonomy',
updateTabState: function() { mergeBrowserUrl: false,
return { taxonomyUrl: this.url, stateChanged: false }; updateTabState: function() {
}, return { taxonomyUrl: this.url, stateChanged: false };
trigger: true },
}); trigger: true
});
} else {
Utils.setUrl({
url: '#!/tag',
mergeBrowserUrl: false,
updateTabState: function() {
return { tagUrl: this.url, stateChanged: false };
},
trigger: true
});
}
console.log('No route:', actions); console.log('No route:', actions);
} }
}); });
......
...@@ -19,16 +19,18 @@ ...@@ -19,16 +19,18 @@
<a href="index.html"><i class="fa fa-globe"></i> Apache Atlas</a> <a href="index.html"><i class="fa fa-globe"></i> Apache Atlas</a>
</li> </li>
<ul class="tabs" style="width: 100%;" role="tablist"> <ul class="tabs" style="width: 100%;" role="tablist">
<li role="presentation" class="tab col-sm-4"><a href="#tab-tag" aria-controls="tab-tag" data-name="tab-tag" role="tab" data-toggle="tab">Tags</a></li> <li role="presentation" class="{{tabClass}}"><a href="#tab-tag" aria-controls="tab-tag" data-name="tab-tag" role="tab" data-toggle="tab">Tags</a></li>
<li role="presentation" class="tab col-sm-4 active"><a href="#tab-taxonomy" aria-controls="tab-taxonomy" data-name="tab-taxonomy" role="tab" data-toggle="tab" class="">Taxonomy</a></li> {{#if taxonomy}}
<li role="presentation" class="tab col-sm-4"><a href="#tab-search" aria-controls="tab-search" data-name="tab-search" role="tab" data-toggle="tab" class=""><i class="fa fa-search"></i> Search</a></li> <li role="presentation" class="tab col-sm-4"><a href="#tab-taxonomy" aria-controls="tab-taxonomy" data-name="tab-taxonomy" role="tab" data-toggle="tab" class="">Taxonomy</a></li>
{{/if}}
<li role="presentation" class="{{tabClass}}"><a href="#tab-search" aria-controls="tab-search" data-name="tab-search" role="tab" data-toggle="tab" class=""><i class="fa fa-search"></i> Search</a></li>
</ul> </ul>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div role="tabpanel" class="tab-pane" id="tab-tag"> <div role="tabpanel" class="tab-pane" id="tab-tag">
<div id="r_tagLayoutView"></div> <div id="r_tagLayoutView"></div>
</div> </div>
<div role="tabpanel" class="tab-pane active" id="tab-taxonomy"> <div role="tabpanel" class="tab-pane" id="tab-taxonomy">
<div id="r_businessCatalogLayoutView"></div> <div id="r_businessCatalogLayoutView"></div>
</div> </div>
<div role="tabpanel" class="tab-pane" id="tab-search"> <div role="tabpanel" class="tab-pane" id="tab-search">
......
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
</div> </div>
<div class="position-relative thick-border"> <div class="position-relative thick-border">
<div data-id="r_tableList" class="table-responsive tableBorder"> </div> <div data-id="r_tableList" class="table-responsive tableBorder"> </div>
<div data-id="r_tableSpinner"></div> <div data-id="r_tableSpinner" class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div> </div>
<div class="row banded"> <div class="row banded">
<div data-id="r_footerRecords" class="col-sm-6 margin-top-10"></div> <div data-id="r_footerRecords" class="col-sm-6 margin-top-10"></div>
......
...@@ -33,13 +33,14 @@ ...@@ -33,13 +33,14 @@
<div class="addTagBase tagBox" data-id="addTagPlus"><i class="fa fa-plus"></i></div> <div class="addTagBase tagBox" data-id="addTagPlus"><i class="fa fa-plus"></i></div>
</div> </div>
</div> </div>
<hr class="termTagLine"> <hr class="termTagLine"> {{#if taxonomy}}
<span class="termSpan">Terms:</span> <span class="termSpan">Terms:</span>
<div class="" data-id="termList"> <div class="" data-id="termList">
<div class="addTag-dropdown" data-id="addTerm"> <div class="addTag-dropdown" data-id="addTerm">
<div class="addTagBase termBox" data-id="addTermPlus"><i class="fa fa-plus"></i></div> <div class="addTagBase termBox" data-id="addTermPlus"><i class="fa fa-plus"></i></div>
</div> </div>
</div> </div>
{{/if}}
</div> </div>
</div> </div>
<div class="container-fluid gray-bg"> <div class="container-fluid gray-bg">
...@@ -61,7 +62,9 @@ ...@@ -61,7 +62,9 @@
<li role="presentation" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li> <li role="presentation" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li>
<!-- <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Acceptable Use</a></li> --> <!-- <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Acceptable Use</a></li> -->
<li role="presentation"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li> <li role="presentation"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li>
{{#if taxonomy}}
<li role="presentation"><a href="#tab-termTable" aria-controls="tab-termTable" role="tab" data-toggle="tab">Terms</a></li> <li role="presentation"><a href="#tab-termTable" aria-controls="tab-termTable" role="tab" data-toggle="tab">Terms</a></li>
{{/if}}
<li role="presentation" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li> <li role="presentation" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="presentation" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li> <li role="presentation" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li>
</ul> </ul>
......
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<!-- <div class="panel-heading"> <!-- <div class="panel-heading">
<h3 class="panel-title">Lineage</h3> <h3 class="panel-title">Lineage</h3>
</div> --> </div> -->
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="panel-body graph-bg" align="center"> <div class="panel-body graph-bg" align="center">
<div class="graph" id="tree-container"> <div class="graph" id="tree-container">
</div> </div>
<div style="position:relative"> <div style="position:relative">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<svg width=100% height=350></svg> <svg width=100% height=350></svg>
<div class="zoomButtonGroup"> <div class="zoomButtonGroup">
<button class="zoomButton" id="zoom_in">+</button> <button class="zoomButton" id="zoom_in">+</button>
......
...@@ -14,8 +14,5 @@ ...@@ -14,8 +14,5 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
--> -->
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<a href="javascript:void(0)" class="inputAssignTag multiSelect" style="display:none" data-id="addTerm"><i class="fa fa-folder-o"> Assign Term</i></a> <a href="javascript:void(0)" class="inputAssignTag multiSelect" style="display:none" data-id="addTerm"><i class="fa fa-folder-o"> Assign Term</i></a>
<div id="r_tagLayoutView"></div> <div id="r_tagLayoutView"></div>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
/** /**
* @file This is the common View file for displaying Table/Grid to be used overall in the application. * @file This is the common View file for displaying Table/Grid to be used overall in the application.
*/ */
define(['require', define(['require',
...@@ -154,10 +154,10 @@ define(['require', ...@@ -154,10 +154,10 @@ define(['require',
/** all events binding here */ /** all events binding here */
bindEvents: function() { bindEvents: function() {
this.listenTo(this.collection, 'request', function() { this.listenTo(this.collection, 'request', function() {
this.$('div[data-id="r_tableSpinner"]').addClass('loading'); this.$('div[data-id="r_tableSpinner"]').addClass('show');
}, this); }, this);
this.listenTo(this.collection, 'sync error', function() { this.listenTo(this.collection, 'sync error', function() {
this.$('div[data-id="r_tableSpinner"]').removeClass('loading'); this.$('div[data-id="r_tableSpinner"]').removeClass('show');
}, this); }, this);
this.listenTo(this.collection, 'reset', function(collection, response) { this.listenTo(this.collection, 'reset', function(collection, response) {
......
...@@ -196,6 +196,9 @@ define(['require', 'utils/Globals'], function(require, Globals) { ...@@ -196,6 +196,9 @@ define(['require', 'utils/Globals'], function(require, Globals) {
isSearchTab: function() { isSearchTab: function() {
return this.getQueryUrl().firstValue == "search" ? true : false; return this.getQueryUrl().firstValue == "search" ? true : false;
}, },
isDetailPage: function() {
return this.getQueryUrl().firstValue == "detailPage" ? true : false;
},
getLastValue: function() { getLastValue: function() {
return this.getQueryUrl().lastValue; return this.getQueryUrl().lastValue;
}, },
......
...@@ -34,6 +34,12 @@ define(['require', ...@@ -34,6 +34,12 @@ define(['require',
ui: { ui: {
tabs: '.tabs li a', tabs: '.tabs li a',
}, },
templateHelpers: function() {
return {
taxonomy: Globals.taxonomy,
tabClass: this.tabClass
};
},
events: function() { events: function() {
var events = {}, var events = {},
that = this; that = this;
...@@ -61,12 +67,19 @@ define(['require', ...@@ -61,12 +67,19 @@ define(['require',
}, },
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'url', 'value', 'tag', 'selectFirst')); _.extend(this, _.pick(options, 'globalVent', 'url', 'value', 'tag', 'selectFirst'));
if (Globals.taxonomy) {
this.tabClass = "tab col-sm-4";
} else {
this.tabClass = "tab col-sm-6";
}
}, },
onRender: function() { onRender: function() {
this.bindEvent(); this.bindEvent();
this.renderTagLayoutView(); this.renderTagLayoutView();
this.renderSearchLayoutView(); this.renderSearchLayoutView();
this.rendeBusinessCatalogLayoutView(); if (Globals.taxonomy) {
this.rendeBusinessCatalogLayoutView();
}
this.selectTab(); this.selectTab();
}, },
...@@ -101,13 +114,13 @@ define(['require', ...@@ -101,13 +114,13 @@ define(['require',
}); });
}, },
selectTab: function() { selectTab: function() {
if (Utils.getUrlState.isTagTab()) { if (Utils.getUrlState.isTagTab() || (Utils.getUrlState.isInitial() && !Globals.taxonomy)) {
this.$('.tabs').find('li a[aria-controls="tab-tag"]').parents('li').addClass('active').siblings().removeClass('active'); this.$('.tabs').find('li a[aria-controls="tab-tag"]').parents('li').addClass('active').siblings().removeClass('active');
this.$('.tab-content').find('div#tab-tag').addClass('active').siblings().removeClass('active'); this.$('.tab-content').find('div#tab-tag').addClass('active').siblings().removeClass('active');
} else if (Utils.getUrlState.isTaxonomyTab()) { } else if (Utils.getUrlState.isTaxonomyTab() || (Utils.getUrlState.isInitial() && Globals.taxonomy)) {
this.$('.tabs').find('li a[aria-controls="tab-taxonomy"]').parents('li').addClass('active').siblings().removeClass('active'); this.$('.tabs').find('li a[aria-controls="tab-taxonomy"]').parents('li').addClass('active').siblings().removeClass('active');
this.$('.tab-content').find('div#tab-taxonomy').addClass('active').siblings().removeClass('active'); this.$('.tab-content').find('div#tab-taxonomy').addClass('active').siblings().removeClass('active');
} else if (Utils.getUrlState.isSearchTab()) { } else if (Utils.getUrlState.isSearchTab() || (Utils.getUrlState.isDetailPage())) {
this.$('.tabs').find('li a[aria-controls="tab-search"]').parents('li').addClass('active').siblings().removeClass('active'); this.$('.tabs').find('li a[aria-controls="tab-search"]').parents('li').addClass('active').siblings().removeClass('active');
this.$('.tab-content').find('div#tab-search').addClass('active').siblings().removeClass('active'); this.$('.tab-content').find('div#tab-search').addClass('active').siblings().removeClass('active');
} }
......
...@@ -65,6 +65,11 @@ define(['require', ...@@ -65,6 +65,11 @@ define(['require',
tagList: '[data-id="tagList"]', tagList: '[data-id="tagList"]',
termList: '[data-id="termList"]' termList: '[data-id="termList"]'
}, },
templateHelpers: function() {
return {
taxonomy: Globals.taxonomy
};
},
/** ui events hash */ /** ui events hash */
events: function() { events: function() {
var events = {}; var events = {};
......
...@@ -22,8 +22,9 @@ define(['require', ...@@ -22,8 +22,9 @@ define(['require',
'collection/VSchemaList', 'collection/VSchemaList',
'utils/Utils', 'utils/Utils',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'utils/Messages' 'utils/Messages',
], function(require, Backbone, SchemaTableLayoutViewTmpl, VSchemaList, Utils, CommonViewFunction, Messages) { 'utils/Globals'
], function(require, Backbone, SchemaTableLayoutViewTmpl, VSchemaList, Utils, CommonViewFunction, Messages, Globals) {
'use strict'; 'use strict';
var SchemaTableLayoutView = Backbone.Marionette.LayoutView.extend( var SchemaTableLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -225,13 +226,15 @@ define(['require', ...@@ -225,13 +226,15 @@ define(['require',
}) })
}; };
}); });
col['Check'] = { if (Globals.taxonomy) {
name: "selected", col['Check'] = {
label: "", name: "selected",
cell: "select-row", label: "",
headerCell: "select-all", cell: "select-row",
position: 1 headerCell: "select-all",
}; position: 1
};
}
col['tag'] = { col['tag'] = {
label: "Tags", label: "Tags",
cell: "Html", cell: "Html",
...@@ -244,23 +247,25 @@ define(['require', ...@@ -244,23 +247,25 @@ define(['require',
} }
}) })
}; };
col['terms'] = { if (Globals.taxonomy) {
label: "Terms", col['terms'] = {
cell: "Html", label: "Terms",
editable: false, cell: "Html",
sortable: false, editable: false,
orderable: true, sortable: false,
className: 'searchTerm', orderable: true,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { className: 'searchTerm',
fromRaw: function(rawValue, model) { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model, "schema"); fromRaw: function(rawValue, model) {
if (returnObject.object) { var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model, "schema");
that.bradCrumbList.push(returnObject.object); if (returnObject.object) {
that.bradCrumbList.push(returnObject.object);
}
return returnObject.html;
} }
return returnObject.html; })
} };
}) }
};
} }
return this.schemaCollection.constructor.getTableCols(col, this.schemaCollection); return this.schemaCollection.constructor.getTableCols(col, this.schemaCollection);
}, },
......
...@@ -189,7 +189,7 @@ define(['require', ...@@ -189,7 +189,7 @@ define(['require',
var that = this; var that = this;
this.$('.fontLoader').show(); this.$('.fontLoader').show();
this.$('.searchTable').hide(); this.$('.searchTable').hide();
this.$('.searchResult').html(''); that.$('.searchResult').hide();
if (Globals.searchApiCallRef) { if (Globals.searchApiCallRef) {
Globals.searchApiCallRef.abort(); Globals.searchApiCallRef.abort();
} }
...@@ -260,8 +260,10 @@ define(['require', ...@@ -260,8 +260,10 @@ define(['require',
}, },
checkTableFetch: function() { checkTableFetch: function() {
if (this.fetchList <= 0) { if (this.fetchList <= 0) {
this.$('div[data-id="r_tableSpinner"]').removeClass('show')
this.$('.fontLoader').hide(); this.$('.fontLoader').hide();
this.$('.searchTable').show(); this.$('.searchTable').show();
this.$('.searchResult').show();
} }
}, },
getEntityTableColumns: function() { getEntityTableColumns: function() {
...@@ -273,13 +275,15 @@ define(['require', ...@@ -273,13 +275,15 @@ define(['require',
if (responseData.dataType.attributeDefinitions.length == 2 && responseData.dataType.attributeDefinitions[1].name == "instanceInfo") { if (responseData.dataType.attributeDefinitions.length == 2 && responseData.dataType.attributeDefinitions[1].name == "instanceInfo") {
return this.getFixedColumn(); return this.getFixedColumn();
} else { } else {
col['Check'] = { if (Globals.taxonomy) {
name: "selected", col['Check'] = {
label: "", name: "selected",
cell: "select-row", label: "",
headerCell: "select-all", cell: "select-row",
position: 1 headerCell: "select-all",
}; position: 1
};
}
var modelJSON = this.searchCollection.toJSON()[0]; var modelJSON = this.searchCollection.toJSON()[0];
_.keys(modelJSON).map(function(key) { _.keys(modelJSON).map(function(key) {
if (key.indexOf("$") == -1 && typeof modelJSON[key] != "object") { if (key.indexOf("$") == -1 && typeof modelJSON[key] != "object") {
...@@ -342,27 +346,29 @@ define(['require', ...@@ -342,27 +346,29 @@ define(['require',
} }
}) })
}; };
col['terms'] = { if (Globals.taxonomy) {
label: "Terms", col['terms'] = {
cell: "Html", label: "Terms",
editable: false, cell: "Html",
sortable: false, editable: false,
orderable: true, sortable: false,
className: 'searchTerm', orderable: true,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { className: 'searchTerm',
fromRaw: function(rawValue, model) { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model); fromRaw: function(rawValue, model) {
if (returnObject.object) { var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model);
that.bradCrumbList.push(returnObject.object); if (returnObject.object) {
} that.bradCrumbList.push(returnObject.object);
if (Globals.entityStateReadOnly[model.get('$id$').state]) { }
return '<div class="readOnly">' + returnObject.html + '</div>'; if (Globals.entityStateReadOnly[model.get('$id$').state]) {
} else { return '<div class="readOnly">' + returnObject.html + '</div>';
return returnObject.html; } else {
return returnObject.html;
}
} }
} })
}) };
}; }
that.checkTableFetch(); that.checkTableFetch();
return this.searchCollection.constructor.getTableCols(col, this.searchCollection); return this.searchCollection.constructor.getTableCols(col, this.searchCollection);
} }
......
...@@ -22,8 +22,9 @@ define(['require', ...@@ -22,8 +22,9 @@ define(['require',
'collection/VTagList', 'collection/VTagList',
'collection/VEntityList', 'collection/VEntityList',
'utils/Utils', 'utils/Utils',
'utils/Messages' 'utils/Messages',
], function(require, Backbone, TagLayoutViewTmpl, VTagList, VEntityList, Utils, Messages) { 'utils/Globals'
], function(require, Backbone, TagLayoutViewTmpl, VTagList, VEntityList, Utils, Messages, Globals) {
'use strict'; 'use strict';
var TagLayoutView = Backbone.Marionette.LayoutView.extend( var TagLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -113,18 +114,20 @@ define(['require', ...@@ -113,18 +114,20 @@ define(['require',
} }
}, },
setValues: function(manual) { setValues: function(manual) {
if (Utils.getUrlState.isTagTab()) { if (Utils.getUrlState.isTagTab() || (Utils.getUrlState.isInitial() && !Globals.taxonomy)) {
if (!this.tag) { if (!this.tag) {
this.selectFirst = false; this.selectFirst = false;
this.ui.tagsParent.find('li').first().addClass('active'); this.ui.tagsParent.find('li').first().addClass('active');
Utils.setUrl({ if (this.ui.tagsParent.find('li a').first().length) {
url: this.ui.tagsParent.find('li a').first().attr("href"), Utils.setUrl({
mergeBrowserUrl: false, url: this.ui.tagsParent.find('li a').first().attr("href"),
trigger: true, mergeBrowserUrl: false,
updateTabState: function() { trigger: true,
return { tagUrl: this.url, stateChanged: true }; updateTabState: function() {
} return { tagUrl: this.url, stateChanged: true };
}); }
});
}
} else { } else {
Utils.setUrl({ Utils.setUrl({
url: Utils.getUrlState.getQueryUrl().hash, url: Utils.getUrlState.getQueryUrl().hash,
......
...@@ -186,3 +186,6 @@ atlas.rest-csrf.enabled=true ...@@ -186,3 +186,6 @@ atlas.rest-csrf.enabled=true
atlas.rest-csrf.browser-useragents-regex=^Mozilla.*,^Opera.*,^Chrome.* atlas.rest-csrf.browser-useragents-regex=^Mozilla.*,^Opera.*,^Chrome.*
atlas.rest-csrf.methods-to-ignore=GET,OPTIONS,HEAD,TRACE atlas.rest-csrf.methods-to-ignore=GET,OPTIONS,HEAD,TRACE
atlas.rest-csrf.custom-header=X-XSRF-HEADER atlas.rest-csrf.custom-header=X-XSRF-HEADER
######### Enable Taxonomy #########
atlas.feature.taxonomy.enable=true
...@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES: ...@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES: ALL CHANGES:
ATLAS-1004 Option to enable taxonomy feature (kevalbhatt18 via shwethags)
ATLAS-1003 DataSetLineageServiceTest, GraphBackedDiscoveryServiceTest, and GraphRepoMapperScaleTest failing in some environments (dkantor via shwethags) ATLAS-1003 DataSetLineageServiceTest, GraphBackedDiscoveryServiceTest, and GraphRepoMapperScaleTest failing in some environments (dkantor via shwethags)
ATLAS-1002 Create default user rangertagsync in atlas file authentication for Ranger tag sync module (nixonrodrigues via shwethags) ATLAS-1002 Create default user rangertagsync in atlas file authentication for Ranger tag sync module (nixonrodrigues via shwethags)
ATLAS-949 UI improvement for modal and tag styling in table (Kalyanikashikar via shwethags) ATLAS-949 UI improvement for modal and tag styling in table (Kalyanikashikar via shwethags)
......
...@@ -56,6 +56,7 @@ public class AdminResource { ...@@ -56,6 +56,7 @@ public class AdminResource {
private static final String BROWSER_USER_AGENT_PARAM = "atlas.rest-csrf.browser-useragents-regex"; private static final String BROWSER_USER_AGENT_PARAM = "atlas.rest-csrf.browser-useragents-regex";
private static final String CUSTOM_METHODS_TO_IGNORE_PARAM = "atlas.rest-csrf.methods-to-ignore"; private static final String CUSTOM_METHODS_TO_IGNORE_PARAM = "atlas.rest-csrf.methods-to-ignore";
private static final String CUSTOM_HEADER_PARAM = "atlas.rest-csrf.custom-header"; private static final String CUSTOM_HEADER_PARAM = "atlas.rest-csrf.custom-header";
private static final String isTaxonomyEnabled = "atlas.feature.taxonomy.enable";
private Response version; private Response version;
private ServiceState serviceState; private ServiceState serviceState;
...@@ -141,7 +142,10 @@ public class AdminResource { ...@@ -141,7 +142,10 @@ public class AdminResource {
@Produces(Servlets.JSON_MEDIA_TYPE) @Produces(Servlets.JSON_MEDIA_TYPE)
public Response getUserProfile() { public Response getUserProfile() {
JSONObject responseData = new JSONObject(); JSONObject responseData = new JSONObject();
Boolean enableTaxonomy = null;
try { try {
PropertiesConfiguration configProperties = new PropertiesConfiguration("atlas-application.properties");
enableTaxonomy = new Boolean(configProperties.getString(isTaxonomyEnabled, "false"));
Authentication auth = SecurityContextHolder.getContext().getAuthentication(); Authentication auth = SecurityContextHolder.getContext().getAuthentication();
String userName = null; String userName = null;
Set<String> groups = new HashSet<String>(); Set<String> groups = new HashSet<String>();
...@@ -158,11 +162,13 @@ public class AdminResource { ...@@ -158,11 +162,13 @@ public class AdminResource {
responseData.put(CUSTOM_METHODS_TO_IGNORE_PARAM, AtlasCSRFPreventionFilter.METHODS_TO_IGNORE_DEFAULT); responseData.put(CUSTOM_METHODS_TO_IGNORE_PARAM, AtlasCSRFPreventionFilter.METHODS_TO_IGNORE_DEFAULT);
responseData.put(CUSTOM_HEADER_PARAM, AtlasCSRFPreventionFilter.HEADER_DEFAULT); responseData.put(CUSTOM_HEADER_PARAM, AtlasCSRFPreventionFilter.HEADER_DEFAULT);
responseData.put(isTaxonomyEnabled, enableTaxonomy);
responseData.put("userName", userName); responseData.put("userName", userName);
responseData.put("groups", groups); responseData.put("groups", groups);
Response response = Response.ok(responseData).build(); Response response = Response.ok(responseData).build();
return response; return response;
} catch (JSONException e) { } catch (JSONException | ConfigurationException e) {
throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR)); throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR));
} }
} }
......
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