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/04/23 06:07:40 UTC

[atlas] branch branch-2.0 updated (eb5c21f -> 3b8ff17)

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

kbhatt pushed a change to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.


    from eb5c21f  ATLAS-3747: Atlas Admin Purge API will take list of guids as query param instead of body
     new 0a52129  ATLAS-3750 : UI: Disable "Propagated from" button inside classification tab if entity status is purged
     new c1a1a50  ATLAS-3696 : [Business Metadata] No option to check/uncheck Business Metadata attributes in search results
     new 4fd74aa  ATLAS-3752 : UI: Login js improvment
     new d10a559  ATLAS-3685 :- UI Bulk import Business Metadata attribute assignment to entities
     new 3b8ff17  ATLAS-3744 : [Beta UI] Long entity type filter load time

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dashboardv2/public/index.html.tpl                  | 11 +++
 dashboardv2/public/js/modules/atlasLogin.js        | 27 ++------
 .../detail_page/DetailPageLayoutView_tmpl.html     |  2 +-
 .../entity/EntityDetailTableLayoutView_tmpl.html   |  2 +-
 dashboardv2/public/js/utils/Enums.js               | 10 ++-
 .../js/views/tag/TagDetailTableLayoutView.js       |  8 ++-
 dashboardv3/public/css/scss/leftsidebar.scss       |  2 +-
 dashboardv3/public/css/scss/table.scss             |  4 ++
 dashboardv3/public/index.html.tpl                  | 11 +++
 dashboardv3/public/js/modules/atlasLogin.js        | 27 ++------
 .../audit/AdminAuditTableLayoutView_tmpl.html      |  2 +-
 .../detail_page/DetailPageLayoutView_tmpl.html     |  2 +-
 .../entity/EntityDetailTableLayoutView_tmpl.html   |  2 +-
 .../glossary/ImportGlossaryLayoutView_tmpl.html    | 17 -----
 .../ImportLayoutView_tmpl.html}                    |  4 +-
 .../search/SearchDefaultLayoutView_tmpl.html       |  4 +-
 .../tree/BusinessMetadataTreeLayoutView_tmpl.html  |  2 -
 .../search/tree/EntityTreeLayoutView_tmpl.html     |  7 +-
 .../search/tree/GlossaryTreeLayoutView_tmpl.html   |  2 +-
 dashboardv3/public/js/utils/Enums.js               |  5 ++
 dashboardv3/public/js/utils/Overrides.js           |  1 +
 dashboardv3/public/js/utils/UrlLinks.js            |  6 ++
 .../js/views/entity/EntityDetailTableLayoutView.js |  3 +
 .../ImportLayoutView.js}                           | 46 +++++++------
 .../js/views/search/SearchDefaultLayoutView.js     |  8 +--
 .../js/views/search/SearchResultLayoutView.js      | 78 +++++++++-------------
 .../js/views/search/tree/EntityTreeLayoutView.js   | 23 ++++++-
 .../js/views/search/tree/GlossaryTreeLayoutView.js |  9 +--
 .../js/views/tag/TagDetailTableLayoutView.js       |  8 ++-
 29 files changed, 172 insertions(+), 161 deletions(-)
 delete mode 100644 dashboardv3/public/js/templates/glossary/ImportGlossaryLayoutView_tmpl.html
 copy dashboardv3/public/js/templates/{glossary/TermRelationAttributeLayoutView_tmpl.html => import/ImportLayoutView_tmpl.html} (92%)
 rename dashboardv3/public/js/views/{glossary/ImportGlossaryLayoutView.js => import/ImportLayoutView.js} (73%)


[atlas] 01/05: ATLAS-3750 : UI: Disable "Propagated from" button inside classification tab if entity status is purged

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0a5212941fb05a209d205122a5332521f75c6a94
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Apr 22 20:00:00 2020 +0530

    ATLAS-3750 : UI: Disable "Propagated from" button inside classification tab if entity status is purged
    
    (cherry picked from commit 7b650f7ab8c67a34c4f577dbd8ead6fcf78d13a6)
---
 dashboardv2/public/js/utils/Enums.js                        | 10 ++++++++--
 dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js |  8 +++++---
 dashboardv3/public/js/utils/Enums.js                        |  5 +++++
 dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js |  8 +++++---
 4 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/dashboardv2/public/js/utils/Enums.js b/dashboardv2/public/js/utils/Enums.js
index 780dad2..3b86450 100644
--- a/dashboardv2/public/js/utils/Enums.js
+++ b/dashboardv2/public/js/utils/Enums.js
@@ -39,7 +39,9 @@ define(['require'], function(require) {
         LABEL_ADD: "Label(s) Added",
         LABEL_DELETE: "Label(s) Deleted",
         ENTITY_PURGE: "Entity Purged",
-        BUSINESS_ATTRIBUTE_UPDATE: "Business Attribute(s) Updated"
+        BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added",
+        BUSINESS_ATTRIBUTE_UPDATE: "Business Attribute(s) Updated",
+        BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted"
     }
 
     Enums.entityStateReadOnly = {
@@ -49,6 +51,10 @@ define(['require'], function(require) {
         STATUS_DELETED: true
     }
 
+    Enums.isEntityPurged = {
+        PURGED: true
+    }
+
     Enums.lineageUrlType = {
         INPUT: 'inputs',
         OUTPUT: 'outputs',
@@ -213,4 +219,4 @@ define(['require'], function(require) {
         1: "true"
     };
     return Enums;
-});
+});
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
index 6207b42..c018274 100644
--- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
@@ -22,8 +22,9 @@ define(['require',
     'utils/CommonViewFunction',
     'utils/Utils',
     'collection/VTagList',
-    'utils/Messages'
-], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages) {
+    'utils/Messages',
+    'utils/Enums'
+], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages, Enums) {
     'use strict';
 
     var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -123,7 +124,8 @@ define(['require',
                             formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
                                 fromRaw: function(rawValue, model) {
                                     if (that.guid !== model.get('entityGuid')) {
-                                        var propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" title="Propagated From" data-guid=' + model.get('entityGuid') + ' data-id="propagatedFromClick"><span> Propagated From </span></span>';
+                                        var purgeEntityBtn = (Enums.isEntityPurged[model.get('entityStatus')]) ? ' title="Entity not available" disabled' : ' title="Propagated From" data-id="propagatedFromClick"',
+                                            propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" data-guid=' + model.get('entityGuid') + purgeEntityBtn + '><span> Propagated From </span></span>';
                                         return '<a title="" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>' + propagtedFrom;
                                     } else {
                                         return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>';
diff --git a/dashboardv3/public/js/utils/Enums.js b/dashboardv3/public/js/utils/Enums.js
index e2d8cd2..3b86450 100644
--- a/dashboardv3/public/js/utils/Enums.js
+++ b/dashboardv3/public/js/utils/Enums.js
@@ -40,6 +40,7 @@ define(['require'], function(require) {
         LABEL_DELETE: "Label(s) Deleted",
         ENTITY_PURGE: "Entity Purged",
         BUSINESS_ATTRIBUTE_ADD: "Business Attribute(s) Added",
+        BUSINESS_ATTRIBUTE_UPDATE: "Business Attribute(s) Updated",
         BUSINESS_ATTRIBUTE_DELETE: "Business Attribute(s) Deleted"
     }
 
@@ -50,6 +51,10 @@ define(['require'], function(require) {
         STATUS_DELETED: true
     }
 
+    Enums.isEntityPurged = {
+        PURGED: true
+    }
+
     Enums.lineageUrlType = {
         INPUT: 'inputs',
         OUTPUT: 'outputs',
diff --git a/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js
index 210b435..1545a65 100644
--- a/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js
@@ -22,8 +22,9 @@ define(['require',
     'utils/CommonViewFunction',
     'utils/Utils',
     'collection/VTagList',
-    'utils/Messages'
-], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages) {
+    'utils/Messages',
+    'utils/Enums'
+], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList, Messages, Enums) {
     'use strict';
 
     var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -123,7 +124,8 @@ define(['require',
                             formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
                                 fromRaw: function(rawValue, model) {
                                     if (that.guid !== model.get('entityGuid')) {
-                                        var propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" title="Propagated From" data-guid=' + model.get('entityGuid') + ' data-id="propagatedFromClick"><span> Propagated From </span></span>';
+                                        var purgeEntityBtn = (Enums.isEntityPurged[model.get('entityStatus')]) ? ' title="Entity not available" disabled' : ' title="Propagated From" data-id="propagatedFromClick"',
+                                            propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" data-guid=' + model.get('entityGuid') + purgeEntityBtn + '><span> Propagated From </span></span>';
                                         return '<a title="" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>' + propagtedFrom;
                                     } else {
                                         return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>';


[atlas] 04/05: ATLAS-3685 :- UI Bulk import Business Metadata attribute assignment to entities

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d10a559aa9d06618f9d680d6021af0cbaed0b520
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Sat Mar 28 16:20:27 2020 +0530

    ATLAS-3685 :- UI Bulk import Business Metadata attribute assignment to entities
    
    (cherry picked from commit 8baade2486b5ee5d41f8a00c19011a9484bf63be)
---
 dashboardv3/public/css/scss/leftsidebar.scss       |  2 +-
 .../ImportLayoutView_tmpl.html}                    |  2 +-
 .../tree/BusinessMetadataTreeLayoutView_tmpl.html  |  2 -
 .../search/tree/EntityTreeLayoutView_tmpl.html     |  7 +++-
 .../search/tree/GlossaryTreeLayoutView_tmpl.html   |  2 +-
 dashboardv3/public/js/utils/UrlLinks.js            |  6 +++
 .../ImportLayoutView.js}                           | 46 +++++++++++-----------
 .../js/views/search/tree/EntityTreeLayoutView.js   | 23 +++++++++--
 .../js/views/search/tree/GlossaryTreeLayoutView.js |  9 +++--
 9 files changed, 64 insertions(+), 35 deletions(-)

diff --git a/dashboardv3/public/css/scss/leftsidebar.scss b/dashboardv3/public/css/scss/leftsidebar.scss
index 9c5475c..d547f39 100644
--- a/dashboardv3/public/css/scss/leftsidebar.scss
+++ b/dashboardv3/public/css/scss/leftsidebar.scss
@@ -427,7 +427,7 @@ span.tree-tooltip {
     }
 }
 
-.glossary-dropdown {
+.tree-droupdown {
     left: -190px !important;
 
     span a {
diff --git a/dashboardv3/public/js/templates/glossary/ImportGlossaryLayoutView_tmpl.html b/dashboardv3/public/js/templates/import/ImportLayoutView_tmpl.html
similarity index 89%
rename from dashboardv3/public/js/templates/glossary/ImportGlossaryLayoutView_tmpl.html
rename to dashboardv3/public/js/templates/import/ImportLayoutView_tmpl.html
index abf11b7..5bb9ab5 100644
--- a/dashboardv3/public/js/templates/glossary/ImportGlossaryLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/import/ImportLayoutView_tmpl.html
@@ -14,4 +14,4 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<form action={{importUrl}} id="importGlossary" class="dropzone single-file-center"></form>
\ No newline at end of file
+<form id="importGlossary" class="dropzone single-file-center"></form>
\ No newline at end of file
diff --git a/dashboardv3/public/js/templates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html
index 757a1ed..d7d2679 100644
--- a/dashboardv3/public/js/templates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/tree/BusinessMetadataTreeLayoutView_tmpl.html
@@ -25,8 +25,6 @@
             <button type="button" class="typeRefresh drop-down-menu-view" data-id="createBusinessMetadata" title="Open Business Metadata">
                 <i class="fa fa-external-link"></i>
             </button>
-            </ul>
-            </button>
         </div>
     </div>
     <div id="businessMetadataTree" class="panel-collapse collapse jstree-with-action in">
diff --git a/dashboardv3/public/js/templates/search/tree/EntityTreeLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/tree/EntityTreeLayoutView_tmpl.html
index 4966a8c..2f286dc 100644
--- a/dashboardv3/public/js/templates/search/tree/EntityTreeLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/tree/EntityTreeLayoutView_tmpl.html
@@ -29,11 +29,16 @@
                 <div class=" btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                     <i class="fa fa-ellipsis-v"></i>
                 </div>
-                <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+                <ul class="dropdown-menu tree-droupdown" aria-labelledby="dropdownMenuButton">
                     <li data-id="groupOrFlatTreeView" data-type="entity"> <i class="fa fa-list-ul"></i><span>Show flat tree</span>
                     </li>
+                    <li data-id="downloadBusinessMetadata"><i class="fa fa-download"></i> <span><a href="{{importTmplUrl}}"><span>Download Import template</span></a></span>
+                    </li>
+                    <li data-id="importBusinessMetadata"> <i class="fa fa-upload"></i><a href="javascript:void(0)"><span>Import Business Metadata</span></a>
+                    </li>
                 </ul>
             </button>
+            </button>
         </div>
     </div>
     <div id="c_entity" class="panel-collapse collapse jstree-with-action in">
diff --git a/dashboardv3/public/js/templates/search/tree/GlossaryTreeLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/tree/GlossaryTreeLayoutView_tmpl.html
index ffafa60..0d9994e 100644
--- a/dashboardv3/public/js/templates/search/tree/GlossaryTreeLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/tree/GlossaryTreeLayoutView_tmpl.html
@@ -27,7 +27,7 @@
                 <div class=" btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                     <i class="fa fa-ellipsis-v"></i>
                 </div>
-                <ul class="dropdown-menu glossary-dropdown" aria-labelledby="dropdownMenuButton">
+                <ul class="dropdown-menu tree-droupdown" aria-labelledby="dropdownMenuButton">
                     <li data-id="createGlossary" data-type="term"> <i class="fa fa-plus"></i><span>Create Glossary</span>
                     </li>
                     <li data-id="downloadTemplate" data-type="term"><i class="fa fa-download"></i> <span><a href="{{importTmplUrl}}"><span>Download Import template</span></a></span>
diff --git a/dashboardv3/public/js/utils/UrlLinks.js b/dashboardv3/public/js/utils/UrlLinks.js
index 7793aaa..69e5274 100644
--- a/dashboardv3/public/js/utils/UrlLinks.js
+++ b/dashboardv3/public/js/utils/UrlLinks.js
@@ -191,6 +191,12 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
         glossaryImportUrl: function() {
             return this.glossaryApiUrl() + '/import';
         },
+        businessMetadataImportTempUrl: function() {
+            return this.entitiesApiUrl() + '/businessmetadata/import/template';
+        },
+        businessMetadataImportUrl: function() {
+            return this.entitiesApiUrl() + '/businessmetadata/import';
+        },
         categoryApiUrl: function(options) {
             var guid = options && options.guid,
                 list = options && options.list,
diff --git a/dashboardv3/public/js/views/glossary/ImportGlossaryLayoutView.js b/dashboardv3/public/js/views/import/ImportLayoutView.js
similarity index 73%
rename from dashboardv3/public/js/views/glossary/ImportGlossaryLayoutView.js
rename to dashboardv3/public/js/views/import/ImportLayoutView.js
index 23b0ef7..d04847e 100644
--- a/dashboardv3/public/js/views/glossary/ImportGlossaryLayoutView.js
+++ b/dashboardv3/public/js/views/import/ImportLayoutView.js
@@ -19,25 +19,19 @@
 define([
     "require",
     "backbone",
-    "hbs!tmpl/glossary/ImportGlossaryLayoutView_tmpl",
+    "hbs!tmpl/import/ImportLayoutView_tmpl",
     "modules/Modal",
     'utils/CommonViewFunction',
     "utils/Utils",
     "utils/UrlLinks",
     "dropzone"
-], function(require, Backbone, ImportGlossaryLayoutViewTmpl, Modal, CommonViewFunction, Utils, UrlLinks, dropzone) {
-    var ImportGlossaryLayoutView = Backbone.Marionette.LayoutView.extend(
-        /** @lends ImportGlossaryLayoutView */
+], function(require, Backbone, ImportLayoutViewTmpl, Modal, CommonViewFunction, Utils, UrlLinks, dropzone) {
+    var ImportLayoutView = Backbone.Marionette.LayoutView.extend(
+        /** @lends ImportLayoutView */
         {
-            _viewName: "ImportGlossaryLayoutView",
+            _viewName: "ImportLayoutView",
 
-            template: ImportGlossaryLayoutViewTmpl,
-
-            templateHelpers: function() {
-                return {
-                    importUrl: UrlLinks.glossaryImportUrl()
-                };
-            },
+            template: ImportLayoutViewTmpl,
 
             /** Layout sub regions */
             regions: {},
@@ -50,14 +44,14 @@ define([
                 return events;
             },
             /**
-             * intialize a new ImportGlossaryLayoutView Layout
+             * intialize a new ImportLayoutView Layout
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, "callback"));
+                _.extend(this, _.pick(options, "callback", "isGlossary"));
                 var that = this;
                 this.modal = new Modal({
-                    title: "Import Glossary",
+                    title: this.isGlossary ? "Import Glossary" : "Import Business Metadata",
                     content: this,
                     cancelText: "Cancel",
                     okText: "upload",
@@ -88,7 +82,7 @@ define([
                 var headers = {};
                 headers[CommonViewFunction.restCsrfCustomHeader] = '""';
                 this.$("#importGlossary").dropzone({
-                    url: UrlLinks.glossaryImportUrl(),
+                    url: that.isGlossary ? UrlLinks.glossaryImportUrl() : UrlLinks.businessMetadataImportUrl(),
                     clickable: true,
                     acceptedFiles: ".csv,.xls,.xlsx",
                     autoProcessQueue: false,
@@ -108,11 +102,19 @@ define([
                         this.addFile(file);
                     },
                     success: function(file, response) {
-                        that.modal.trigger("cancel");
-                        Utils.notifySuccess({
-                            content: "File: " + file.name + " added successfully"
-                        });
-                        that.callback();
+                        if (response.successImportInfoList.length && response.failedImportInfoList.length === 0) {
+                            that.modal.trigger("cancel");
+                            Utils.notifySuccess({
+                                content: "File: " + file.name + " imported successfully"
+                            });
+                        } else if (response.failedImportInfoList.length) {
+                            Utils.notifyError({
+                                content: response.failedImportInfoList[0].remarks
+                            });
+                        }
+                        if (that.callback) {
+                            that.callback();
+                        }
                     },
                     error: function(file, response, responseObj) {
                         Utils.defaultErrorHandler(null, responseObj, { defaultErrorMessage: (response.errorMessage) || response });
@@ -124,5 +126,5 @@ define([
             }
         }
     );
-    return ImportGlossaryLayoutView;
+    return ImportLayoutView;
 });
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
index e136d36..a42ecfd 100644
--- a/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/EntityTreeLayoutView.js
@@ -43,11 +43,14 @@ define([
 
             // Show/hide empty values in tree
             showEmptyServiceType: '[data-id="showEmptyServiceType"]',
-            entityTreeLoader: '[data-id="entityTreeLoader"]'
+            entityTreeLoader: '[data-id="entityTreeLoader"]',
+            importBusinessMetadata: "[data-id='importBusinessMetadata']",
+            downloadBusinessMetadata: "[data-id='downloadBusinessMetadata']"
         },
         templateHelpers: function() {
             return {
-                apiBaseUrl: UrlLinks.apiBaseUrl
+                apiBaseUrl: UrlLinks.apiBaseUrl,
+                importTmplUrl: UrlLinks.businessMetadataImportTempUrl()
             };
         },
         events: function() {
@@ -79,6 +82,13 @@ define([
                 that.ui[type + "SearchTree"].jstree(true).destroy();
                 that.renderEntityTree();
             };
+            events["click " + this.ui.importBusinessMetadata] = function(e) {
+                e.stopPropagation();
+                that.onClickImportBusinessMetadata();
+            };
+            events["click " + this.ui.downloadBusinessMetadata] = function(e) {
+                e.stopPropagation();
+            };
 
             return events;
         },
@@ -558,7 +568,14 @@ define([
                     renderTree();
                 }
             });
-
+        },
+        onClickImportBusinessMetadata: function() {
+            var that = this;
+            require([
+                'views/import/ImportLayoutView'
+            ], function(ImportLayoutView) {
+                var view = new ImportLayoutView({});
+            });
         }
     });
     return EntityTreeLayoutview;
diff --git a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
index d068b8c..0f10607 100644
--- a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
@@ -711,12 +711,13 @@ define([
         onClickImportGlossary: function() {
             var that = this;
             require([
-                'views/glossary/ImportGlossaryLayoutView'
-            ], function(ImportGlossaryLayoutView) {
-                var view = new ImportGlossaryLayoutView({
+                'views/import/ImportLayoutView'
+            ], function(ImportLayoutView) {
+                var view = new ImportLayoutView({
                     callback: function() {
                         that.refresh();
-                    }
+                    },
+                    isGlossary: true
                 });
             });
         }


[atlas] 02/05: ATLAS-3696 : [Business Metadata] No option to check/uncheck Business Metadata attributes in search results

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c1a1a50b27a7539e02d0b7c98ca274fad9da568f
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Apr 22 17:27:54 2020 +0530

    ATLAS-3696 : [Business Metadata] No option to check/uncheck Business Metadata attributes in search results
    
    (cherry picked from commit 21e9f2f9f43edfdbb3ce1b550a81e721f6453ccd)
---
 .../detail_page/DetailPageLayoutView_tmpl.html     |  2 +-
 .../entity/EntityDetailTableLayoutView_tmpl.html   |  2 +-
 dashboardv3/public/css/scss/table.scss             |  4 ++
 .../detail_page/DetailPageLayoutView_tmpl.html     |  2 +-
 .../entity/EntityDetailTableLayoutView_tmpl.html   |  2 +-
 dashboardv3/public/js/utils/Overrides.js           |  1 +
 .../js/views/entity/EntityDetailTableLayoutView.js |  3 +
 .../js/views/search/SearchDefaultLayoutView.js     |  8 +--
 .../js/views/search/SearchResultLayoutView.js      | 78 +++++++++-------------
 9 files changed, 46 insertions(+), 56 deletions(-)

diff --git a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
index 8e269b4..afff90d 100644
--- a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
@@ -34,7 +34,7 @@
             </div>
         </div>
         <div class="form-group termBox">
-            <span class="control-label-sm-pr pull-left">Term:</span>
+            <span class="control-label-sm-pr pull-left">Terms:</span>
             <div class="pull-left" data-id="termList">
                 <button class="btn btn-action btn-sm" title="Add Term" data-id="addTerm">
                     <i class="fa fa-plus"> </i>
diff --git a/dashboardv2/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html
index 1ca4949..cdceb77 100644
--- a/dashboardv2/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html
@@ -26,7 +26,7 @@
         </div>
         <div class="panel-actions">
             <div class="pretty p-switch p-fill" style="margin-right: 20px">
-                <input type="checkbox" data-id="noValueToggle" title="Show Empty Values" />
+                <input type="checkbox" data-id="noValueToggle" title="Show empty values" />
                 <div class="state p-primary">
                     <label></label>
                 </div>
diff --git a/dashboardv3/public/css/scss/table.scss b/dashboardv3/public/css/scss/table.scss
index a294102..bed6eef 100644
--- a/dashboardv3/public/css/scss/table.scss
+++ b/dashboardv3/public/css/scss/table.scss
@@ -199,6 +199,10 @@ tr.empty {
             font-size: 14px;
             letter-spacing: 0.25px;
             color: #6a6a6a;
+
+            &.no-capitalize {
+                text-transform: none !important;
+            }
         }
 
         >td {
diff --git a/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html b/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
index acdcbc5..0e838f5 100644
--- a/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
@@ -37,7 +37,7 @@
             </div>
         </div>
         <div class="form-group termBox col-md-12">
-            <span class="control-label-sm-pr pull-left">Term:</span>
+            <span class="control-label-sm-pr pull-left">Terms:</span>
             <div class="pull-left" data-id="termList">
                 <button class="btn btn-action btn-sm" title="Add Term" data-id="addTerm">
                     <i class="fa fa-plus"> </i>
diff --git a/dashboardv3/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html b/dashboardv3/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html
index 09c0496..cdceb77 100644
--- a/dashboardv3/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/entity/EntityDetailTableLayoutView_tmpl.html
@@ -26,7 +26,7 @@
         </div>
         <div class="panel-actions">
             <div class="pretty p-switch p-fill" style="margin-right: 20px">
-                <input type="checkbox" data-id="noValueToggle" />
+                <input type="checkbox" data-id="noValueToggle" title="Show empty values" />
                 <div class="state p-primary">
                     <label></label>
                 </div>
diff --git a/dashboardv3/public/js/utils/Overrides.js b/dashboardv3/public/js/utils/Overrides.js
index 44ed62b..33328f0 100644
--- a/dashboardv3/public/js/utils/Overrides.js
+++ b/dashboardv3/public/js/utils/Overrides.js
@@ -98,6 +98,7 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
                 if (modelValue.get('width')) that.$el.find('.' + modelValue.get('name')).css('min-width', modelValue.get('width') + 'px');
                 if (modelValue.get('fixWidth')) that.$el.find('.' + modelValue.get('name')).css('width', modelValue.get('fixWidth') + 'px');
                 if (modelValue.get('toolTip')) that.$el.find('.' + modelValue.get('name')).attr('title', modelValue.get('toolTip'));
+                if (modelValue.get('headerClassName')) that.$el.find('.' + modelValue.get('name').replace(".", "\\.")).addClass(modelValue.get('headerClassName'));
             });
             return this;
         }
diff --git a/dashboardv3/public/js/views/entity/EntityDetailTableLayoutView.js b/dashboardv3/public/js/views/entity/EntityDetailTableLayoutView.js
index 9a40593..0a7d51a 100644
--- a/dashboardv3/public/js/views/entity/EntityDetailTableLayoutView.js
+++ b/dashboardv3/public/js/views/entity/EntityDetailTableLayoutView.js
@@ -51,6 +51,8 @@ define(['require',
             events: function() {
                 var events = {};
                 events["click " + this.ui.noValueToggle] = function() {
+                    this.showAllProperties = !this.showAllProperties;
+                    this.ui.noValueToggle.attr("data-original-title", (this.showAllProperties ? "Hide" : "Show") + " empty values");
                     Utils.togglePropertyRelationshipTableEmptyValues({
                         "inputType": this.ui.noValueToggle,
                         "tableEl": this.ui.detailValue
@@ -66,6 +68,7 @@ define(['require',
             initialize: function(options) {
                 _.extend(this, _.pick(options, 'entity', 'typeHeaders', 'attributeDefs', 'attributes', 'editEntity', 'guid', 'entityDefCollection', 'searchVent', 'fetchCollection'));
                 this.entityModel = new VEntity({});
+                this.showAllProperties = false;
             },
             bindEvents: function() {},
             onRender: function() {
diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index d0946c4..21b1f55 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -365,11 +365,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                     if (_.has(obj, "condition")) {
                         return that.getIdFromRuleObj(obj);
                     } else {
-                        if ((obj && obj.data && obj.data.entityType === "businessMetadata") || obj.id.indexOf(".") > -1) {
-                            return col.add("businessMetadata");
-                        } else {
-                            return col.add(obj.id);
-                        }
+                        return col.add(obj.id);
                     }
                 });
                 return Array.from(col);
@@ -382,7 +378,7 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                     if (!this.options.searchTableColumns[this.options.value.type]) {
                         this.options.searchTableColumns[this.options.value.type] = ["selected", "name", "description", "typeName", "owner", "tag", "term"];
                     }
-                    this.options.searchTableColumns[this.options.value.type] = _.sortBy(_.union(_.without(this.options.searchTableColumns[this.options.value.type], "businessMetadata"), this.getIdFromRuleObj(rule)));
+                    this.options.searchTableColumns[this.options.value.type] = _.sortBy(_.union(_.without(this.options.searchTableColumns[this.options.value.type]), this.getIdFromRuleObj(rule)));
                 }
             },
             renderQueryBuilder: function(obj, rQueryBuilder) {
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index 4a24c9d..d2eadfb 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -153,7 +153,7 @@ define(['require',
              * @constructs
              */
             initialize: function(options) {
-                _.extend(this, _.pick(options, 'value', 'guid', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns', 'isTableDropDisable', 'fromView', 'glossaryCollection', 'termName'));
+                _.extend(this, _.pick(options, 'value', 'guid', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns', 'isTableDropDisable', 'fromView', 'glossaryCollection', 'termName', 'businessMetadataDefCollection'));
                 this.entityModel = new VEntity();
                 this.searchCollection = new VSearchList();
                 this.limit = 25;
@@ -368,7 +368,7 @@ define(['require',
                         this.searchTableColumns[this.value.type] = listOfColumns.length ? listOfColumns : null;
                     }
                 } else if (this.value && this.value.type && this.searchTableColumns && this.value.attributes) {
-                    this.searchTableColumns[this.value.type] = this.value.entityFilters ? this.value.attributes.split(",") : this.value.attributes.replace("businessMetadata,", "").split(",");
+                    this.searchTableColumns[this.value.type] = this.value.attributes.split(",");
                 }
             },
             fetchCollection: function(value, options) {
@@ -740,8 +740,6 @@ define(['require',
                         }
                     })
                 };
-
-
                 if (this.value && this.value.profileDBView) {
                     col['createTime'] = {
                         label: "Date Created",
@@ -760,7 +758,6 @@ define(['require',
                     }
                 }
                 if (this.value && !this.value.profileDBView) {
-
                     col['description'] = {
                         label: "Description",
                         cell: "String",
@@ -777,8 +774,6 @@ define(['require',
                             }
                         })
                     };
-
-
                     col['typeName'] = {
                         label: "Type",
                         cell: "Html",
@@ -795,43 +790,6 @@ define(['require',
                             }
                         })
                     };
-                    col['businessMetadata'] = {
-                        label: "Business Metadata",
-                        cell: "Html",
-                        editable: false,
-                        resizeable: true,
-                        orderable: true,
-                        alwaysVisible: true, //Backgrid.ColumnManager.js -> render() to hide the name in dropdownlist
-                        renderable: _.contains(columnToShow, 'businessMetadata'),
-                        formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
-                            fromRaw: function(rawValue, model) {
-                                var obj = model.toJSON(),
-                                    businessMetadataStr = '';
-                                if (obj && obj.attributes) {
-                                    _.each(obj.attributes, function(businessMetadataValue, attributeName) {
-                                        if (attributeName.indexOf('.') != -1) {
-                                            var isDate = false,
-                                                businessMetadata = that.options.businessMetadataDefCollection.fullCollection.find({ "name": attributeName.split('.')[0] });
-                                            if (businessMetadata) {
-                                                var getAttributes = businessMetadata.get('attributeDefs');
-                                                getAttributes.every(function(attrTypeCheck) {
-                                                    if (attributeName.split('.')[1] === attrTypeCheck.name && attrTypeCheck.typeName.indexOf("date") > -1) {
-                                                        isDate = true;
-                                                    }
-                                                    return !isDate;
-                                                });
-                                            }
-                                            if (isDate) {
-                                                businessMetadataValue = moment(businessMetadataValue).format("MM/DD/YYYY")
-                                            }
-                                            businessMetadataStr += '<label class="btn btn-action btn-xs btn-blue no-pointer">' + attributeName + ': ' + businessMetadataValue + '</label>';
-                                        }
-                                    })
-                                    return businessMetadataStr;
-                                }
-                            }
-                        })
-                    };
                     this.getTagCol({ 'col': col, 'columnToShow': columnToShow });
                     if ((!_.contains(["glossary"], this.fromView))) {
                         this.getTermCol({ 'col': col, 'columnToShow': columnToShow });
@@ -839,7 +797,23 @@ define(['require',
 
                     if (this.value && this.value.searchType === "basic") {
                         var def = this.entityDefCollection.fullCollection.find({ name: this.value.type }),
-                            systemAttr = [];
+                            systemAttr = [],
+                            businessMetadataAttr = [],
+                            businessAttributes = {};
+                        if (this.value.type == "_ALL_ENTITY_TYPES") {
+                            this.businessMetadataDefCollection.each(function(model) {
+                                var sortedAttributes = model.get('attributeDefs') || null,
+                                    name = model.get('name');
+                                if (sortedAttributes) {
+                                    sortedAttributes = _.sortBy(sortedAttributes, function(obj) {
+                                        return obj.name;
+                                    });
+                                    businessAttributes[name] = $.extend(true, {}, sortedAttributes);
+                                }
+                            })
+                        } else {
+                            businessAttributes = def ? ($.extend(true, {}, def.get('businessAttributeDefs')) || null) : null;
+                        }
                         if (def || Globals[this.value.type] || (
                                 this.value.tag ?
                                 Globals[this.value.tag] ?
@@ -854,6 +828,17 @@ define(['require',
                                 systemAttr = (Globals[this.value.tag] || Globals[Enums.addOnClassification[0]]).attributeDefs;
                             }
                             attrObj = attrObj.concat(systemAttr);
+                            if (businessAttributes) {
+                                _.each(businessAttributes, function(businessMetadata, businessMetadataName) {
+                                    _.each(businessMetadata, function(attr, index) {
+                                        var attribute = attr;
+                                        attribute.isBusinessAttributes = true;
+                                        attribute.name = businessMetadataName + '.' + attribute.name;
+                                        businessMetadataAttr.push(attribute);
+                                    })
+                                })
+                            }
+                            attrObj = attrObj.concat(businessMetadataAttr);
                             _.each(attrObj, function(obj, key) {
                                 var key = obj.name,
                                     isRenderable = _.contains(columnToShow, key),
@@ -868,7 +853,7 @@ define(['require',
                                     return;
                                 }
                                 col[obj.name] = {
-                                    label: Enums.systemAttributes[obj.name] ? Enums.systemAttributes[obj.name] : _.escape(obj.name).capitalize(),
+                                    label: Enums.systemAttributes[obj.name] ? Enums.systemAttributes[obj.name] : (_.escape(obj.isBusinessAttributes ? obj.name : obj.name.capitalize())),
                                     cell: "Html",
                                     headerCell: Backgrid.HeaderHTMLDecodeCell,
                                     editable: false,
@@ -876,6 +861,7 @@ define(['require',
                                     orderable: true,
                                     sortable: isSortable,
                                     renderable: isRenderable,
+                                    headerClassName: obj.isBusinessAttributes ? "no-capitalize" : "",
                                     formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
                                         fromRaw: function(rawValue, model) {
                                             var modelObj = model.toJSON();


[atlas] 05/05: ATLAS-3744 : [Beta UI] Long entity type filter load time

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3b8ff17e22bc6e95317d9f92c18ee4d2b5332acd
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Apr 22 20:57:02 2020 +0530

    ATLAS-3744 : [Beta UI] Long entity type filter load time
    
    (cherry picked from commit 16621dfc0ba93ab0b5e59d88b01165fab321834d)
---
 .../public/js/templates/audit/AdminAuditTableLayoutView_tmpl.html     | 2 +-
 .../public/js/templates/search/SearchDefaultLayoutView_tmpl.html      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dashboardv3/public/js/templates/audit/AdminAuditTableLayoutView_tmpl.html b/dashboardv3/public/js/templates/audit/AdminAuditTableLayoutView_tmpl.html
index 5e5f897..f1dc256 100644
--- a/dashboardv3/public/js/templates/audit/AdminAuditTableLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/audit/AdminAuditTableLayoutView_tmpl.html
@@ -41,7 +41,7 @@
                             <div id="collapseAdmin" class="panel-collapse collapse in">
                                 <div class="panel-body">
                                     <div id='r_attributeQueryBuilderAdmin' class='attribute-querybuilder'>
-                                        <div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></div>
+                                        <div class='fontLoader-relative show'><i class='fa fa-refresh fa-spin-custom'></i></div>
                                     </div>
                                 </div>
                             </div>
diff --git a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
index 647a691..23ad9a8 100644
--- a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
@@ -82,7 +82,7 @@
                 <div id="collapseEntity" class="panel-collapse collapse in">
                     <div class="panel-body">
                         <div id='r_attributeQueryBuilderEntity' class='attribute-querybuilder'>
-                            <div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></div>
+                            <div class='fontLoader-relative show'><i class='fa fa-refresh fa-spin-custom'></i></div>
                         </div>
                     </div>
                 </div>
@@ -99,7 +99,7 @@
                 <div id="collapseClassification" class="panel-collapse collapse in">
                     <div class="panel-body">
                         <div id='r_attributeQueryBuilderClassification' class='attribute-querybuilder'>
-                            <div class='fontLoader'><i class='fa fa-refresh fa-spin-custom'></i></div>
+                            <div class='fontLoader-relative show'><i class='fa fa-refresh fa-spin-custom'></i></div>
                         </div>
                     </div>
                 </div>


[atlas] 03/05: ATLAS-3752 : UI: Login js improvment

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4fd74aa76143c4a19bbde910db64bce5ec93eaca
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Apr 22 19:53:55 2020 +0530

    ATLAS-3752 : UI: Login js improvment
    
    (cherry picked from commit c5464da3d53a8ad9cc73dd83bf27240cecedd4f1)
---
 dashboardv2/public/index.html.tpl           | 11 +++++++++++
 dashboardv2/public/js/modules/atlasLogin.js | 27 +++++++--------------------
 dashboardv3/public/index.html.tpl           | 11 +++++++++++
 dashboardv3/public/js/modules/atlasLogin.js | 27 +++++++--------------------
 4 files changed, 36 insertions(+), 40 deletions(-)

diff --git a/dashboardv2/public/index.html.tpl b/dashboardv2/public/index.html.tpl
index 5335d39..ba1ccf0 100644
--- a/dashboardv2/public/index.html.tpl
+++ b/dashboardv2/public/index.html.tpl
@@ -33,6 +33,17 @@
     <title>Atlas</title>
     <meta name="description" content="" />
     <meta name="viewport" content="width=device-width" />
+    <script type="text/javascript">
+    var isHtmlInPath = window.location.pathname.indexOf("index.html");
+    if (isHtmlInPath === -1) {
+        var pathname = window.location.pathname.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, ''),
+            indexpath = pathname + "/index.html";
+        if (location.hash.length > 2) {
+            indexpath += location.hash;
+        }
+        window.location.replace(indexpath);
+    }
+    </script>
     <link rel="shortcut icon" href="img/favicon.ico?bust=<%- bust %>" type="image/x-icon" />
     <link rel="icon" href="img/favicon.ico?bust=<%- bust %>" type="image/x-icon" />
     <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
diff --git a/dashboardv2/public/js/modules/atlasLogin.js b/dashboardv2/public/js/modules/atlasLogin.js
index d2d19d1..d5ad854 100644
--- a/dashboardv2/public/js/modules/atlasLogin.js
+++ b/dashboardv2/public/js/modules/atlasLogin.js
@@ -57,7 +57,7 @@ function doLogin() {
             j_username: userName,
             j_password: passwd
         },
-        url: baseUrl + "j_spring_security_check",
+        url: baseUrl + "/j_spring_security_check",
         type: "POST",
         headers: {
             "cache-control": "no-cache"
@@ -103,18 +103,18 @@ function redirect(baseUrl) {
                 PRIMARY_UI = data["atlas.ui.default.version"];
             }
             if (PRIMARY_UI !== "v2") {
-                indexpath = "index.html";
+                indexpath = "/index.html";
             }
             if (window.localStorage.last_ui_load === "v1") {
-                indexpath = "index.html";
+                indexpath = "/index.html";
             } else if (window.localStorage.last_ui_load === "v2") {
                 indexpath = "/n/index.html";
             }
+            indexpath = baseUrl + indexpath;
             if (location.hash.length > 2) {
-                window.location.replace(indexpath + location.hash);
-            } else {
-                window.location.replace(indexpath);
+                indexpath += location.hash;
             }
+            window.location.replace(indexpath);
         },
         error: function() {
             window.location.replace("index.html");
@@ -123,20 +123,7 @@ function redirect(baseUrl) {
 }
 
 function getBaseUrl() {
-    if (!window.location.origin) {
-        window.location.origin =
-            window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
-    }
-    var baseUrl = window.location.origin + window.location.pathname.substring(window.location.pathname.indexOf("/", 2) + 1, 0);
-
-    if (baseUrl.lastIndexOf("/") != baseUrl.length - 1) {
-        if (baseUrl) {
-            baseUrl = baseUrl + "/";
-        } else {
-            baseUrl = "/";
-        }
-    }
-    return baseUrl;
+    return window.location.pathname.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, '')
 }
 
 $(function() {
diff --git a/dashboardv3/public/index.html.tpl b/dashboardv3/public/index.html.tpl
index a272a8d..07e5bd3 100644
--- a/dashboardv3/public/index.html.tpl
+++ b/dashboardv3/public/index.html.tpl
@@ -33,6 +33,17 @@
     <title>Atlas</title>
     <meta name="description" content="" />
     <meta name="viewport" content="width=device-width" />
+    <script type="text/javascript">
+    var isHtmlInPath = window.location.pathname.indexOf("index.html");
+    if (isHtmlInPath === -1) {
+        var pathname = window.location.pathname.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, ''),
+            indexpath = pathname + "/index.html";
+        if (location.hash.length > 2) {
+            indexpath += location.hash;
+        }
+        window.location.replace(indexpath);
+    }
+    </script>
     <link rel="shortcut icon" href="img/favicon.ico?bust=<%- bust %>" type="image/x-icon" />
     <link rel="icon" href="img/favicon.ico?bust=<%- bust %>" type="image/x-icon" />
     <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
diff --git a/dashboardv3/public/js/modules/atlasLogin.js b/dashboardv3/public/js/modules/atlasLogin.js
index d2d19d1..d5ad854 100644
--- a/dashboardv3/public/js/modules/atlasLogin.js
+++ b/dashboardv3/public/js/modules/atlasLogin.js
@@ -57,7 +57,7 @@ function doLogin() {
             j_username: userName,
             j_password: passwd
         },
-        url: baseUrl + "j_spring_security_check",
+        url: baseUrl + "/j_spring_security_check",
         type: "POST",
         headers: {
             "cache-control": "no-cache"
@@ -103,18 +103,18 @@ function redirect(baseUrl) {
                 PRIMARY_UI = data["atlas.ui.default.version"];
             }
             if (PRIMARY_UI !== "v2") {
-                indexpath = "index.html";
+                indexpath = "/index.html";
             }
             if (window.localStorage.last_ui_load === "v1") {
-                indexpath = "index.html";
+                indexpath = "/index.html";
             } else if (window.localStorage.last_ui_load === "v2") {
                 indexpath = "/n/index.html";
             }
+            indexpath = baseUrl + indexpath;
             if (location.hash.length > 2) {
-                window.location.replace(indexpath + location.hash);
-            } else {
-                window.location.replace(indexpath);
+                indexpath += location.hash;
             }
+            window.location.replace(indexpath);
         },
         error: function() {
             window.location.replace("index.html");
@@ -123,20 +123,7 @@ function redirect(baseUrl) {
 }
 
 function getBaseUrl() {
-    if (!window.location.origin) {
-        window.location.origin =
-            window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
-    }
-    var baseUrl = window.location.origin + window.location.pathname.substring(window.location.pathname.indexOf("/", 2) + 1, 0);
-
-    if (baseUrl.lastIndexOf("/") != baseUrl.length - 1) {
-        if (baseUrl) {
-            baseUrl = baseUrl + "/";
-        } else {
-            baseUrl = "/";
-        }
-    }
-    return baseUrl;
+    return window.location.pathname.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, '')
 }
 
 $(function() {