Commit 2ed39cce by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2171: Atlas UI fix when accessed via Knox proxy without / at the end

parent e406603a
......@@ -71,11 +71,17 @@
}
.initialLoading {
display: block;
position: absolute;
margin-top: 30%;
right: 50%;
height: 60px;
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: url("../img/ring.gif") no-repeat;
background-position: 50% 50%;
background-size: 60px;
@media (min-width: 768px) {
left: 350px;
}
}
.tableOverlay {
......
......@@ -66,7 +66,7 @@
<header id="new-header" class="clearfix"></header>
<div id="new-page-wrapper">
<div>
<img class="initialLoading" src="img/ring.gif">
<div class="initialLoading"></div>
</div>
</div>
</div>
......
......@@ -16,7 +16,7 @@
-->
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="index.html"><i class="fa fa-globe"></i> Apache Atlas</a>
<a href="{{apiBaseUrl}}/index.html"><i class="fa fa-globe"></i> Apache Atlas</a>
</li>
<ul class="tabs" style="width: 100%;" role="tablist">
<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>
......
......@@ -16,12 +16,15 @@
* limitations under the License.
*/
define(['require', 'utils/Enums'], function(require, Enums) {
define(['require', 'utils/Enums', 'utils/Utils'], function(require, Enums, Utils) {
'use strict';
var UrlLinks = {
baseUrl: 'api/atlas',
baseUrlV2: 'api/atlas/v2',
apiBaseUrl: Utils.getBaseUrl(window.location.pathname)
};
_.extend(UrlLinks, {
baseUrl: UrlLinks.apiBaseUrl + '/api/atlas',
baseUrlV2: UrlLinks.apiBaseUrl + '/api/atlas/v2',
typedefsUrl: function() {
return {
defs: this.baseUrlV2 + '/types/typedefs',
......@@ -122,7 +125,7 @@ define(['require', 'utils/Enums'], function(require, Enums) {
return this.baseUrl + '/admin/session';
}
};
});
return UrlLinks;
});
\ No newline at end of file
......@@ -69,6 +69,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
});
return uuid;
};
Utils.getBaseUrl = function(url) {
return url.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, '');
};
pnotify.prototype.options.styling = "bootstrap3";
var notify = function(options) {
return new pnotify(_.extend({
......
......@@ -20,7 +20,8 @@ define(['require',
'hbs!tmpl/business_catalog/SideNavLayoutView_tmpl',
'utils/Utils',
'utils/Globals',
], function(require, tmpl, Utils, Globals) {
'utils/UrlLinks'
], function(require, tmpl, Utils, Globals, UrlLinks) {
'use strict';
var SideNavLayoutView = Marionette.LayoutView.extend({
......@@ -37,7 +38,8 @@ define(['require',
templateHelpers: function() {
return {
taxonomy: Globals.taxonomy,
tabClass: this.tabClass
tabClass: this.tabClass,
apiBaseUrl: UrlLinks.apiBaseUrl
};
},
events: function() {
......
......@@ -254,19 +254,19 @@ define(['require',
if (node) {
if (node.isProcess) {
if (Enums.entityStateReadOnly[node.status]) {
return 'img/icon-gear-delete.png';
return UrlLinks.apiBaseUrl + '/img/icon-gear-delete.png';
} else if (node.id == that.guid) {
return 'img/icon-gear-active.png';
return UrlLinks.apiBaseUrl + '/img/icon-gear-active.png';
} else {
return 'img/icon-gear.png';
return UrlLinks.apiBaseUrl + '/img/icon-gear.png';
}
} else {
if (Enums.entityStateReadOnly[node.status]) {
return 'img/icon-table-delete.png';
return UrlLinks.apiBaseUrl + '/img/icon-table-delete.png';
} else if (node.id == that.guid) {
return 'img/icon-table-active.png';
return UrlLinks.apiBaseUrl + '/img/icon-table-active.png';
} else {
return 'img/icon-table.png';
return UrlLinks.apiBaseUrl + '/img/icon-table.png';
}
}
}
......@@ -423,4 +423,4 @@ define(['require',
}
});
return LineageLayoutView;
});
});
\ No newline at end of file
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