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/02/29 04:06:25 UTC
[atlas] branch branch-2.0 updated: ATLAS-3634:Betal UI: Add refresh
button for basic search / Advance Search
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
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 4228ce1 ATLAS-3634:Betal UI: Add refresh button for basic search / Advance Search
4228ce1 is described below
commit 4228ce1fe4082cf21a89cf65becf96eeab331f31
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Tue Feb 25 17:23:16 2020 +0530
ATLAS-3634:Betal UI: Add refresh button for basic search / Advance Search
(cherry picked from commit 43c134ddf859d7c06be18937d9daf3b26089968f)
---
dashboardv2/public/js/utils/Helper.js | 165 +++++++++++----------
.../js/views/search/SearchResultLayoutView.js | 32 ++--
dashboardv2/public/js/views/tag/TagLayoutView.js | 2 +-
dashboardv3/public/css/scss/override.scss | 6 +
dashboardv3/public/css/scss/search.scss | 10 +-
.../search/SearchDefaultLayoutView_tmpl.html | 1 +
dashboardv3/public/js/utils/Helper.js | 12 +-
.../js/views/search/GlobalSearchLayoutView.js | 4 +-
.../js/views/search/SearchDefaultLayoutView.js | 11 +-
.../public/js/views/search/SearchLayoutView.js | 1 +
.../js/views/search/SearchResultLayoutView.js | 34 +++--
.../js/views/search/save/SaveModalLayoutView.js | 8 +-
12 files changed, 170 insertions(+), 116 deletions(-)
diff --git a/dashboardv2/public/js/utils/Helper.js b/dashboardv2/public/js/utils/Helper.js
index 0ce8783..dc06e8d 100644
--- a/dashboardv2/public/js/utils/Helper.js
+++ b/dashboardv2/public/js/utils/Helper.js
@@ -114,94 +114,101 @@ define(['require',
$(this).blur();
});
- $.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
- "select2/utils",
- "select2/dropdown",
- "select2/dropdown/attachBody",
- "select2/dropdown/attachContainer",
- "select2/dropdown/search",
- "select2/dropdown/minimumResultsForSearch",
- "select2/dropdown/closeOnSelect",
- ],
- function(Utils, Dropdown, AttachBody, AttachContainer, Search, MinimumResultsForSearch, CloseOnSelect) {
+ if ($.fn.select2) {
+ $.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
+ "select2/utils",
+ "select2/dropdown",
+ "select2/dropdown/attachBody",
+ "select2/dropdown/attachContainer",
+ "select2/dropdown/search",
+ "select2/dropdown/minimumResultsForSearch",
+ "select2/dropdown/closeOnSelect",
+ ],
+ function(Utils, Dropdown, AttachBody, AttachContainer, Search, MinimumResultsForSearch, CloseOnSelect) {
- // Decorate Dropdown with Search functionalities
- var dropdownWithSearch = Utils.Decorate(Utils.Decorate(Dropdown, CloseOnSelect), Search);
+ // Decorate Dropdown with Search functionalities
+ var dropdownWithSearch = Utils.Decorate(Utils.Decorate(Dropdown, CloseOnSelect), Search);
- dropdownWithSearch.prototype.render = function() {
- // Copy and modify default search render method
- var $rendered = Dropdown.prototype.render.call(this);
+ dropdownWithSearch.prototype.render = function() {
+ // Copy and modify default search render method
+ var $rendered = Dropdown.prototype.render.call(this),
+ dropdownCssClass = this.options.get("dropdownCssClass")
+ if (dropdownCssClass) {
+ $rendered.addClass(dropdownCssClass);
+ }
- // Add ability for a placeholder in the search box
- var placeholder = this.options.get("placeholderForSearch") || "";
- var $search = $(
- '<span class="select2-search select2-search--dropdown"><div class="row">' +
- '<div class="col-md-10"><input class="select2-search__field" placeholder="' + placeholder + '" type="search"' +
- ' tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off"' +
- ' spellcheck="false" role="textbox" /></div>' +
- '<div class="col-md-2"><button type="button" style="margin-left: -20px" class="btn btn-action btn-sm filter " title="Type Filter"><i class="fa fa-filter"></i></button></div>' +
- '</div></span>'
- );
- if (!this.options.options.getFilterBox) {
- throw "In order to render the filter options adapter needed getFilterBox function"
- }
- var $Filter = $('<ul class="type-filter-ul"></ul>');
- this.$Filter = $Filter;
- this.$Filter.append(this.options.options.getFilterBox());
- this.$Filter.hide();
+ // Add ability for a placeholder in the search box
+ var placeholder = this.options.get("placeholderForSearch") || "";
+ var $search = $(
+ '<span class="select2-search select2-search--dropdown"><div class="clearfix">' +
+ '<div class="col-md-10 no-padding" style="width: calc(100% - 30px);"><input class="select2-search__field" placeholder="' + placeholder + '" type="search"' +
+ ' tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off"' +
+ ' spellcheck="false" role="textbox" /></div>' +
+ '<div class="col-md-2 no-padding" style="width: 30px;"><button type="button" style="padding: 3px 6px;margin: 0px 4px;" class="btn btn-action btn-sm filter " title="Type Filter"><i class="fa fa-filter"></i></button></div>' +
+ '</div></span>'
+ );
+ if (!this.options.options.getFilterBox) {
+ throw "In order to render the filter options adapter needed getFilterBox function"
+ }
+ var $Filter = $('<ul class="type-filter-ul"></ul>');
+ this.$Filter = $Filter;
+ this.$Filter.append(this.options.options.getFilterBox());
+ this.$Filter.hide();
- this.$searchContainer = $search;
- if ($Filter.find('input[type="checkbox"]:checked').length) {
- $search.find('button.filter').addClass('active');
- } else {
- $search.find('button.filter').removeClass('active');
- }
- this.$search = $search.find('input');
+ this.$searchContainer = $search;
+ if ($Filter.find('input[type="checkbox"]:checked').length) {
+ $search.find('button.filter').addClass('active');
+ } else {
+ $search.find('button.filter').removeClass('active');
+ }
+ this.$search = $search.find('input');
- $rendered.prepend($search);
- $rendered.append($Filter);
- return $rendered;
- };
- var oldDropdownWithSearchBindRef = dropdownWithSearch.prototype.bind;
- dropdownWithSearch.prototype.bind = function(container, $container) {
- var self = this;
- oldDropdownWithSearchBindRef.call(this, container, $container);
- var self = this;
- this.$Filter.on('click', 'li', function() {
- var itemCallback = self.options.options.onFilterItemSelect;
- itemCallback && itemCallback(this);
- })
+ $rendered.prepend($search);
+ $rendered.append($Filter);
+ return $rendered;
+ };
+ var oldDropdownWithSearchBindRef = dropdownWithSearch.prototype.bind;
+ dropdownWithSearch.prototype.bind = function(container, $container) {
+ var self = this;
+ oldDropdownWithSearchBindRef.call(this, container, $container);
+ var self = this;
+ this.$Filter.on('click', 'li', function() {
+ var itemCallback = self.options.options.onFilterItemSelect;
+ itemCallback && itemCallback(this);
+ })
- this.$searchContainer.find('button.filter').click(function() {
- container.$dropdown.find('.select2-search').hide(150);
- container.$dropdown.find('.select2-results').hide(150);
- self.$Filter.html(self.options.options.getFilterBox());
- self.$Filter.show();
- });
- this.$Filter.on('click', 'button.filterDone', function() {
- container.$dropdown.find('.select2-search').show(150);
- container.$dropdown.find('.select2-results').show(150);
- self.$Filter.hide();
- var filterSubmitCallback = self.options.options.onFilterSubmit;
- filterSubmitCallback && filterSubmitCallback({
- filterVal: _.map(self.$Filter.find('input[type="checkbox"]:checked'), function(item) {
- return $(item).data('value')
- })
+ this.$searchContainer.find('button.filter').click(function() {
+ container.$dropdown.find('.select2-search').hide(150);
+ container.$dropdown.find('.select2-results').hide(150);
+ self.$Filter.html(self.options.options.getFilterBox());
+ self.$Filter.show();
+ });
+ this.$Filter.on('click', 'button.filterDone', function() {
+ container.$dropdown.find('.select2-search').show(150);
+ container.$dropdown.find('.select2-results').show(150);
+ self.$Filter.hide();
+ var filterSubmitCallback = self.options.options.onFilterSubmit;
+ filterSubmitCallback && filterSubmitCallback({
+ filterVal: _.map(self.$Filter.find('input[type="checkbox"]:checked'), function(item) {
+ return $(item).data('value')
+ })
+ });
+ });
+ container.$element.on('hideFilter', function() {
+ container.$dropdown.find('.select2-search').show();
+ container.$dropdown.find('.select2-results').show();
+ self.$Filter.hide();
});
- });
- container.$element.on('hideFilter', function() {
- container.$dropdown.find('.select2-search').show();
- container.$dropdown.find('.select2-results').show();
- self.$Filter.hide();
- });
- }
- // Decorate the dropdown+search with necessary containers
- var adapter = Utils.Decorate(dropdownWithSearch, AttachContainer);
- adapter = Utils.Decorate(adapter, AttachBody);
+ }
+ // Decorate the dropdown+search with necessary containers
+ var adapter = Utils.Decorate(dropdownWithSearch, AttachContainer);
+ adapter = Utils.Decorate(adapter, AttachBody);
+
+ return adapter;
+ });
+ }
- return adapter;
- });
$.widget("custom.atlasAutoComplete", $.ui.autocomplete, {
_create: function() {
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 2bd829b..1d8b4ed 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -203,12 +203,7 @@ define(['require',
});
}
});
-
- if (this.multiSelectEntity.length > 0) {
- this.$('.multiSelectTag,.multiSelectTerm').show();
- } else {
- this.$('.multiSelectTag,.multiSelectTerm').hide();
- }
+ this.updateMultiSelect();
});
this.listenTo(this.searchCollection, "error", function(model, response) {
this.hideLoader({ type: 'error' });
@@ -339,6 +334,13 @@ define(['require',
updateTabState: true
}, options));
},
+ updateMultiSelect: function() {
+ if (this.multiSelectEntity.length > 0) {
+ this.$('.multiSelectTag,.multiSelectTerm').show();
+ } else {
+ this.$('.multiSelectTag,.multiSelectTerm').hide();
+ }
+ },
updateColumnList: function(updatedList) {
if (updatedList) {
var listOfColumns = [];
@@ -388,13 +390,13 @@ define(['require',
if (that.isDestroyed) {
return;
}
- that.ui.gotoPage.val('');
- that.ui.gotoPage.parent().removeClass('has-error');
- that.ui.gotoPagebtn.prop("disabled", true);
Globals.searchApiCallRef = undefined;
var isFirstPage = that.offset === 0,
dataLength = 0,
goToPage = that.ui.gotoPage.val();
+ that.ui.gotoPage.val('');
+ that.ui.gotoPage.parent().removeClass('has-error');
+ that.ui.gotoPagebtn.prop("disabled", true);
if (!(that.ui.pageRecordText instanceof jQuery)) {
return;
}
@@ -414,6 +416,7 @@ define(['require',
pageNumber = goToPage;
that.offset = (that.activePage - 1) * that.limit;
} else {
+ that.finalPage = that.activePage;
that.ui.nextData.attr('disabled', true);
that.offset = that.offset - that.limit;
}
@@ -475,6 +478,9 @@ define(['require',
that.ui.activePage.attr('title', "Page " + that.activePage);
that.ui.activePage.text(that.activePage);
that.renderTableLayoutView();
+ that.multiSelectEntity = [];
+ that.updateMultiSelect();
+
if (dataLength > 0) {
that.$('.searchTable').removeClass('noData')
}
@@ -523,6 +529,7 @@ define(['require',
Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
}
} else {
+ _.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset });
if (isPostMethod) {
apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification', 'termName'));
Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
@@ -1214,6 +1221,13 @@ define(['require',
var that = this;
var goToPage = parseInt(this.ui.gotoPage.val());
if (!(_.isNaN(goToPage) || goToPage <= -1)) {
+ if (this.finalPage && this.finalPage < goToPage) {
+ Utils.notifyInfo({
+ html: true,
+ content: Messages.search.noRecordForPage + '<b>' + Utils.getNumberSuffix({ number: goToPage, sup: true }) + '</b> page'
+ });
+ return;
+ }
this.offset = (goToPage - 1) * this.limit;
if (this.offset <= -1) {
this.offset = 0;
diff --git a/dashboardv2/public/js/views/tag/TagLayoutView.js b/dashboardv2/public/js/views/tag/TagLayoutView.js
index aeb487a..5d5be18 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -276,7 +276,7 @@ define(['require',
return '<li class="parent-node" data-id="tags">' +
'<div><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div>' +
(hasChild ? '<i class="fa toggleArrow fa-angle-right" data-id="expandArrow" data-name="' + name + '"></i>' : '') +
- '<a href="#!/tag/tagAttribute/' + name + '?viewType=' + (isTree ? 'tree' : 'flat') + '" data-name="' + name + '">' + name + '</a></div>' +
+ '<a href="#!/tag/tagAttribute/' + name + '?viewType=' + (isTree ? 'tree' : 'flat') + '&searchType=basic" data-name="' + name + '">' + name + '</a></div>' +
(isTree && hasChild ? '<ul class="child hide">' + that.generateTree({ 'data': options.children, 'isTree': isTree }) + '</ul>' : '') + '</li>';
};
if (isTree) {
diff --git a/dashboardv3/public/css/scss/override.scss b/dashboardv3/public/css/scss/override.scss
index 62c129f..eb7e8a9 100644
--- a/dashboardv3/public/css/scss/override.scss
+++ b/dashboardv3/public/css/scss/override.scss
@@ -494,4 +494,10 @@ div.columnmanager-dropdown-container {
.table-hover>tbody>tr:hover {
background-color: #fafafa;
+}
+
+.input-group {
+ .form-control {
+ z-index: 1;
+ }
}
\ No newline at end of file
diff --git a/dashboardv3/public/css/scss/search.scss b/dashboardv3/public/css/scss/search.scss
index 3ac2769..b438486 100644
--- a/dashboardv3/public/css/scss/search.scss
+++ b/dashboardv3/public/css/scss/search.scss
@@ -398,18 +398,22 @@ hr.hr-filter {
height: 100%;
width: 100%;
opacity: 0.5;
- z-index: 1;
+ z-index: 2;
background: white;
}
+.searchResultContainer {
+ z-index: 1;
+}
+
.attributeResultContainer {
&.overlay {
- z-index: 2;
+ z-index: 3;
}
.attribute-filter-container {
position: absolute;
- z-index: 1;
+ z-index: 3;
left: 21px;
width: 75%;
right: 0;
diff --git a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
index d4de739..647a691 100644
--- a/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/SearchDefaultLayoutView_tmpl.html
@@ -26,6 +26,7 @@
</div>
</div>
<div class="col-sm-12 attributeResultContainer form-group">
+ <button title="Refresh Search Result" class="btn-action btn-sm" data-id="refreshSearchResult" data-original-title="Refresh Search Result"><i class="fa fa-refresh"></i></button>
<button class="btn-action btn-sm attribute-filter-text" data-id='attrFilter'> <i class="fa fa-angle-right"></i> Filters</button>
<button class='btn-action btn-sm' data-id='clearQuerySearch'>Clear</button>
<div class="attribute-filter-container hide">
diff --git a/dashboardv3/public/js/utils/Helper.js b/dashboardv3/public/js/utils/Helper.js
index 74716f1..9c4bc73 100644
--- a/dashboardv3/public/js/utils/Helper.js
+++ b/dashboardv3/public/js/utils/Helper.js
@@ -212,16 +212,20 @@ define(['require',
dropdownWithSearch.prototype.render = function() {
// Copy and modify default search render method
- var $rendered = Dropdown.prototype.render.call(this);
+ var $rendered = Dropdown.prototype.render.call(this),
+ dropdownCssClass = this.options.get("dropdownCssClass")
+ if (dropdownCssClass) {
+ $rendered.addClass(dropdownCssClass);
+ }
// Add ability for a placeholder in the search box
var placeholder = this.options.get("placeholderForSearch") || "";
var $search = $(
- '<span class="select2-search select2-search--dropdown"><div class="row">' +
- '<div class="col-md-10"><input class="select2-search__field" placeholder="' + placeholder + '" type="search"' +
+ '<span class="select2-search select2-search--dropdown"><div class="clearfix">' +
+ '<div class="col-md-10 no-padding" style="width: calc(100% - 30px);"><input class="select2-search__field" placeholder="' + placeholder + '" type="search"' +
' tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off"' +
' spellcheck="false" role="textbox" /></div>' +
- '<div class="col-md-2"><button type="button" style="margin-left: -20px" class="btn btn-action btn-sm filter " title="Type Filter"><i class="fa fa-filter"></i></button></div>' +
+ '<div class="col-md-2 no-padding" style="width: 30px;"><button type="button" style="padding: 3px 6px;margin: 0px 4px;" class="btn btn-action btn-sm filter " title="Type Filter"><i class="fa fa-filter"></i></button></div>' +
'</div></span>'
);
if (!this.options.options.getFilterBox) {
diff --git a/dashboardv3/public/js/views/search/GlobalSearchLayoutView.js b/dashboardv3/public/js/views/search/GlobalSearchLayoutView.js
index 60a942a..2096e02 100644
--- a/dashboardv3/public/js/views/search/GlobalSearchLayoutView.js
+++ b/dashboardv3/public/js/views/search/GlobalSearchLayoutView.js
@@ -88,9 +88,7 @@ define(["require",
var that = this;
$("body").on("click", function(e) {
if (!that.isDestroyed && that.$(e.target).data("id") !== "detailSearch") {
- if ($(e.target).hasClass("modal") || $(e.target).parents(".modal-backdrop").length != 0 || $(e.target).parents(".modal").length != 0) {
- // console.log("modal");
- } else if ($(e.target).parents(".searchLayoutView").length === 0 && that.ui.searchLayoutView.hasClass("open")) {
+ if ($(e.target).parents(".searchLayoutView").length === 0 && that.ui.searchLayoutView.hasClass("open")) {
that.ui.searchLayoutView.removeClass("open");
}
}
diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index 1f66331..25c36a2 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -48,7 +48,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
entityName: ".entityName",
classificationName: ".classificationName",
createNewEntity: '[data-id="createNewEntity"]',
- clearQuerySearch: "[data-id='clearQuerySearch']"
+ clearQuerySearch: "[data-id='clearQuerySearch']",
+ refreshSearchQuery: "[data-id='refreshSearchResult']"
},
/** ui events hash */
events: function() {
@@ -65,6 +66,10 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
this.$('.attribute-filter-container, .attr-filter-overlay').toggleClass('hide');
};
+ events["click " + this.ui.refreshSearchQuery] = function(e) {
+ this.options.searchVent.trigger('search:refresh');
+ };
+
events["click " + this.ui.attrApply] = function(e) {
that.okAttrFilterButton(e);
};
@@ -360,7 +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 === "namespace") {
+ if ((obj && obj.data && obj.data.entityType === "namespace") || obj.id.indexOf(".") > -1) {
return col.add("namespace");
} else {
return col.add(obj.id);
@@ -377,7 +382,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(this.options.searchTableColumns[this.options.value.type], this.getIdFromRuleObj(rule)));
+ this.options.searchTableColumns[this.options.value.type] = _.sortBy(_.union(_.without(this.options.searchTableColumns[this.options.value.type], "namespace"), this.getIdFromRuleObj(rule)));
}
},
renderQueryBuilder: function(obj, rQueryBuilder) {
diff --git a/dashboardv3/public/js/views/search/SearchLayoutView.js b/dashboardv3/public/js/views/search/SearchLayoutView.js
index f3c15e3..0c4eb40 100644
--- a/dashboardv3/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchLayoutView.js
@@ -487,6 +487,7 @@ define(['require',
placeholder: "Select Type",
dropdownAdapter: $.fn.select2.amd.require("ServiceTypeFilterDropdownAdapter"),
allowClear: true,
+ dropdownCssClass: "searchLayoutView",
getFilterBox: this.getFilterBox.bind(this),
onFilterSubmit: function(options) {
that.filterTypeSelected = options.filterVal;
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index 9854bd4..e45c5b5 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -209,12 +209,7 @@ define(['require',
});
}
});
-
- if (this.multiSelectEntity.length > 0) {
- this.$('.multiSelectTag,.multiSelectTerm').show();
- } else {
- this.$('.multiSelectTag,.multiSelectTerm').hide();
- }
+ this.updateMultiSelect();
});
this.listenTo(this.searchCollection, "error", function(model, response) {
this.hideLoader({ type: 'error' });
@@ -348,6 +343,13 @@ define(['require',
updateTabState: true
}, options));
},
+ updateMultiSelect: function() {
+ if (this.multiSelectEntity.length > 0) {
+ this.$('.multiSelectTag,.multiSelectTerm').show();
+ } else {
+ this.$('.multiSelectTag,.multiSelectTerm').hide();
+ }
+ },
updateColumnList: function(updatedList) {
if (updatedList) {
var listOfColumns = [];
@@ -363,7 +365,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.attributes.split(",");
+ this.searchTableColumns[this.value.type] = this.value.entityFilters ? this.value.attributes.split(",") : this.value.attributes.replace("namespace,", "").split(",");
}
},
fetchCollection: function(value, options) {
@@ -397,13 +399,13 @@ define(['require',
if (that.isDestroyed) {
return;
}
- that.ui.gotoPage.val('');
- that.ui.gotoPage.parent().removeClass('has-error');
- that.ui.gotoPagebtn.prop("disabled", true);
Globals.searchApiCallRef = undefined;
var isFirstPage = that.offset === 0,
dataLength = 0,
goToPage = that.ui.gotoPage.val();
+ that.ui.gotoPage.val('');
+ that.ui.gotoPage.parent().removeClass('has-error');
+ that.ui.gotoPagebtn.prop("disabled", true);
if (!(that.ui.pageRecordText instanceof jQuery)) {
return;
}
@@ -423,6 +425,7 @@ define(['require',
pageNumber = goToPage;
that.offset = (that.activePage - 1) * that.limit;
} else {
+ that.finalPage = that.activePage;
that.ui.nextData.attr('disabled', true);
that.offset = that.offset - that.limit;
}
@@ -484,6 +487,8 @@ define(['require',
that.ui.activePage.attr('title', "Page " + that.activePage);
that.ui.activePage.text(that.activePage);
that.renderTableLayoutView();
+ that.multiSelectEntity = [];
+ that.updateMultiSelect();
if (dataLength > 0) {
that.$('.searchTable').removeClass('noData')
@@ -536,6 +541,7 @@ define(['require',
Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
}
} else {
+ _.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset });
if (isPostMethod) {
apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification', 'termName'));
Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
@@ -794,6 +800,7 @@ define(['require',
editable: false,
resizeable: true,
orderable: true,
+ alwaysVisible: true, //Backgrid.ColumnManager.js -> render() to hide the name in dropdownlist
renderable: _.contains(columnToShow, 'namespace'),
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
@@ -1271,6 +1278,13 @@ define(['require',
var that = this;
var goToPage = parseInt(this.ui.gotoPage.val());
if (!(_.isNaN(goToPage) || goToPage <= -1)) {
+ if (this.finalPage && this.finalPage < goToPage) {
+ Utils.notifyInfo({
+ html: true,
+ content: Messages.search.noRecordForPage + '<b>' + Utils.getNumberSuffix({ number: goToPage, sup: true }) + '</b> page'
+ });
+ return;
+ }
this.offset = (goToPage - 1) * this.limit;
if (this.offset <= -1) {
this.offset = 0;
diff --git a/dashboardv3/public/js/views/search/save/SaveModalLayoutView.js b/dashboardv3/public/js/views/search/save/SaveModalLayoutView.js
index 9d8c8c1..dde233a 100644
--- a/dashboardv3/public/js/views/search/save/SaveModalLayoutView.js
+++ b/dashboardv3/public/js/views/search/save/SaveModalLayoutView.js
@@ -67,7 +67,7 @@ define(['require',
} else {
this.modal = modal = new Modal({
titleHtml: true,
- title: '<span>' + (this.selectedModel && this.rename ? 'Rename' : 'Save/Save As..') + (this.isBasic ? " Basic" : " Advanced") + ' Custom Filter</span>',
+ title: '<span>' + (this.selectedModel && this.rename ? 'Rename' : 'Save') + (this.isBasic ? " Basic" : " Advanced") + ' Custom Filter</span>',
content: this,
cancelText: "Cancel",
okCloses: false,
@@ -112,7 +112,7 @@ define(['require',
that.ui.saveAsName.append(options);
that.ui.saveAsName.val("");
that.ui.saveAsName.select2({
- placeholder: "Save/Save As.. filter",
+ placeholder: "Enter filter name ",
allowClear: false,
tags: true,
multiple: false,
@@ -121,9 +121,9 @@ define(['require',
return state.text;
}
if (!state.element) {
- return $("<span><span class='option-title-light'>Save:</span> <strong> " + _.escape(state.text) + "</strong></span>");
+ return $("<span><span class='option-title-light'>New:</span> <strong>" + _.escape(state.text) + "</strong></span>");
} else {
- return $("<span><span class='option-title-light'>Save As:</span> <strong>" + _.escape(state.text) + "</strong></span>");
+ return $("<span><span class='option-title-light'>Update:</span> <strong>" + _.escape(state.text) + "</strong></span>");
}
}
}).on("change", function() {