Commit fa712590 by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2676 : UI fix to address basic-search handling of term input in IE

parent f756e9b3
......@@ -27,7 +27,7 @@
overflow: hidden;
text-overflow: ellipsis;
}
.jstree-children {
.jstree-children.jstree-children>li>a {
max-width: 500px;
}
.jstree-clicked,
......
......@@ -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() {
......
......@@ -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>
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
......@@ -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;
......
......@@ -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 {
......
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