Repository: atlas Updated Branches: refs/heads/master f756e9b36 -> fa712590e
ATLAS-2676 : UI fix to address basic-search handling of term input in IE Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/fa712590 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/fa712590 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/fa712590 Branch: refs/heads/master Commit: fa712590e929d0c8c3ee7c048687bd1fe4ddd59e Parents: f756e9b Author: kevalbhatt <[email protected]> Authored: Tue May 15 17:47:02 2018 +0530 Committer: Madhan Neethiraj <[email protected]> Committed: Tue May 15 08:09:47 2018 -0700 ---------------------------------------------------------------------- dashboardv2/public/css/scss/glossary.scss | 2 +- dashboardv2/public/js/modules/atlasLogin.js | 7 ++++++- .../public/js/templates/glossary/GlossaryLayoutView_tmpl.html | 4 ++-- dashboardv2/public/js/utils/CommonViewFunction.js | 1 - dashboardv2/public/js/utils/Overrides.js | 7 +++++++ .../public/js/views/detail_page/DetailPageLayoutView.js | 2 +- dashboardv2/public/js/views/glossary/GlossaryLayoutView.js | 4 ++-- dashboardv2/public/js/views/search/SearchLayoutView.js | 5 +++-- dashboardv2/public/js/views/search/SearchResultLayoutView.js | 2 +- 9 files changed, 23 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/css/scss/glossary.scss ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/scss/glossary.scss b/dashboardv2/public/css/scss/glossary.scss index 98c977d..760711f 100644 --- a/dashboardv2/public/css/scss/glossary.scss +++ b/dashboardv2/public/css/scss/glossary.scss @@ -27,7 +27,7 @@ overflow: hidden; text-overflow: ellipsis; } - .jstree-children { + .jstree-children.jstree-children>li>a { max-width: 500px; } .jstree-clicked, http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/modules/atlasLogin.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/modules/atlasLogin.js b/dashboardv2/public/js/modules/atlasLogin.js index 0aa59e0..5206288 100644 --- a/dashboardv2/public/js/modules/atlasLogin.js +++ b/dashboardv2/public/js/modules/atlasLogin.js @@ -18,7 +18,7 @@ //Define indexOf for IE -if (!Array.indexOf) { +if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(obj, start) { for (var i = (start || 0); i < this.length; i++) { if (this[i] == obj) { @@ -29,6 +29,11 @@ if (!Array.indexOf) { }; } +if (!String.prototype.startsWith) { + String.prototype.startsWith = function(str, matchStr) { + return str.lastIndexOf(matchStr, 0) === 0 + } +} function doLogin() { http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/templates/glossary/GlossaryLayoutView_tmpl.html ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/templates/glossary/GlossaryLayoutView_tmpl.html b/dashboardv2/public/js/templates/glossary/GlossaryLayoutView_tmpl.html index b870e6b..1fa1e35 100644 --- a/dashboardv2/public/js/templates/glossary/GlossaryLayoutView_tmpl.html +++ b/dashboardv2/public/js/templates/glossary/GlossaryLayoutView_tmpl.html @@ -38,14 +38,14 @@ <div> <input type="text" class="form-control" data-id="searchTerm" placeholder="{{#if isAssignView}}Search Term{{else}}Search Glossary, Term{{/if}}"> </div> - <div data-id="termTree" style="margin-top: 5px;overflow-x: auto;"> + <div data-id="termTree" style="margin-top: 5px;padding-bottom: 25px;overflow-x: auto;overflow-y:hidden;"> </div> </div> <div class="col-sm-12 no-padding category-view" style="display: none;"> <div> <input type="text" class="form-control" data-id="searchCategory" placeholder="{{#if isAssignView}}Search Catalog{{else}}Search Glossary, Category{{/if}}"> </div> - <div data-id="categoryTree" style="margin-top: 5px;overflow-x: auto;"> + <div data-id="categoryTree" style="margin-top: 5px;padding-bottom: 25px;overflow-x: auto;overflow-y: hidden;"> </div> </div> </div> http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/utils/CommonViewFunction.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js index 3ee7609..bcff5e4 100644 --- a/dashboardv2/public/js/utils/CommonViewFunction.js +++ b/dashboardv2/public/js/utils/CommonViewFunction.js @@ -763,7 +763,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum } } CommonViewFunction.addRestCsrfCustomHeader = function(xhr, settings) { - // if (settings.url == null || !settings.url.startsWith('/webhdfs/')) { if (settings.url == null) { return; } http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/utils/Overrides.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/Overrides.js b/dashboardv2/public/js/utils/Overrides.js index efd5e40..a96fc2c 100644 --- a/dashboardv2/public/js/utils/Overrides.js +++ b/dashboardv2/public/js/utils/Overrides.js @@ -48,6 +48,13 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq return false; } }, + startsWith: function(str, matchStr) { + if (str && matchStr && _.isString(str) && _.isString(matchStr)) { + return str.lastIndexOf(matchStr, 0) === 0 + } else { + return; + } + }, isUndefinedNull: function(val) { if (_.isUndefined(val) || _.isNull(val)) { return true http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js index 6fc8ce2..d5ee538 100644 --- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js +++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js @@ -126,7 +126,7 @@ define(['require', this.entityObject = this.collection.first().toJSON(); var collectionJSON = this.entityObject.entity; - if (collectionJSON && collectionJSON.typeName.startsWith("AtlasGlossary")) { + if (collectionJSON && _.startsWith(collectionJSON.typeName, "AtlasGlossary")) { this.$(".termBox").hide(); } // MergerRefEntity. http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js index d36afe0..cda2ea5 100644 --- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js +++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js @@ -268,7 +268,7 @@ define(['require', if (index == 0 && selectedItem.guid == objGuid) { that.glossary.selectedItem = selectedItem; that.query[that.viewType].model = selectedItem.model; - that.query[that.viewType].type = selectedItem.gType; + that.query[that.viewType].type = selectedItem.type; return { 'opened': true, 'selected': true @@ -279,7 +279,7 @@ define(['require', that.query[that.viewType].isNodeNotFoundAtLoad = false; that.glossary.selectedItem = node that.query[that.viewType].model = node.model; - that.query[that.viewType].type = node.gType; + that.query[that.viewType].type = node.type; return { 'opened': true, 'selected': true http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/views/search/SearchLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js index 69fd036..bc4cc43 100644 --- a/dashboardv2/public/js/views/search/SearchLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchLayoutView.js @@ -549,8 +549,9 @@ define(['require', this.ui.tagLov.trigger("change", { 'manual': true }); } } - - this.ui.termLov.append('<option value="' + this.value.term + '" selected="selected">' + this.value.term + '</option>'); + if (this.value.term) { + this.ui.termLov.append('<option value="' + this.value.term + '" selected="selected">' + this.value.term + '</option>'); + } if (this.ui.termLov.data('select2')) { if (this.ui.termLov.val() !== this.value.term) { this.value.term = null; http://git-wip-us.apache.org/repos/asf/atlas/blob/fa712590/dashboardv2/public/js/views/search/SearchResultLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js index 9eb1954..1cb2075 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -854,7 +854,7 @@ define(['require', formatter: _.extend({}, Backgrid.CellFormatter.prototype, { fromRaw: function(rawValue, model) { var obj = model.toJSON(); - if (obj.typeName && !(obj.typeName.startsWith("AtlasGlossary"))) { + if (obj.typeName && !(_.startsWith(obj.typeName, "AtlasGlossary"))) { if (obj.status && Enums.entityStateReadOnly[obj.status]) { return '<div class="readOnly">' + CommonViewFunction.termForTable(obj); + '</div>'; } else {
