Commit 52848ab6 by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2163: UI updates to handle Saved search query having deleted types

parent 70f2ee3a
......@@ -22,6 +22,7 @@
body {
font-family: $font_0, $font_1;
color: $color_ironside_gray_approx;
overflow-x: hidden;
}
header {
......
......@@ -276,6 +276,9 @@ define([
'views/search/SearchDetailLayoutView'
], function(Header, BusinessCatalogLayoutView, SideNavLayoutView, SearchDetailLayoutView) {
var paramObj = Utils.getUrlState.getQueryParams();
var isinitialView = true,
isTypeTagNotExists = false,
tempParam = _.extend({}, paramObj);
App.rNHeader.show(new Header());
if (!App.rSideNav.currentView) {
App.rSideNav.show(new SideNavLayoutView(
......@@ -288,7 +291,6 @@ define([
App.rSideNav.currentView.RSearchLayoutView.currentView.manualRender(paramObj);
}
App.rSideNav.currentView.selectTab();
var isinitialView = true;
if (paramObj) {
isinitialView = (paramObj.type || (paramObj.dslChecked == "true" ? "" : paramObj.tag) || (paramObj.query ? paramObj.query.trim() : "")).length === 0;
}
......@@ -297,6 +299,7 @@ define([
'value': paramObj,
'searchVent': that.searchVent,
'initialView': isinitialView,
'isTypeTagNotExists': ((paramObj.type != tempParam.type) || (tempParam.tag != paramObj.tag))
}, that.preFetchedCollectionLists, that.sharedObj)
));
});
......
......@@ -39,10 +39,11 @@ define(['require'], function(require) {
search: {
noRecordForPage: "No record found at ",
onSamePage: "You are on the same page!",
notExists: "Invalid Expression or Tag/Type has been deleted.",
favoriteSearch: {
save: "Do you want to overwrite ",
notSelectedFavoriteElement: "Please select any one favorite search",
notSelectedSearchFilter:"Please select at least one filter"
notSelectedSearchFilter: "Please select at least one filter"
}
},
tag: {
......
......@@ -232,6 +232,7 @@ define(['require',
'views/audit/CreateAuditTableLayoutView',
], function(Modal, CreateAuditTableLayoutView) {
that.action = $(e.target).data("action");
$(e.target).attr('disabled', true);
var eventModel = that.entityCollection.fullCollection.findWhere({ 'eventKey': $(e.currentTarget).data('modalid') }).toJSON(),
collectionModel = new that.entityCollection.model(eventModel),
view = new CreateAuditTableLayoutView({ guid: that.guid, entityModel: collectionModel, action: that.action, entity: that.entity, entityName: that.entityName, attributeDefs: that.attributeDefs });
......@@ -247,6 +248,9 @@ define(['require',
view.$el.on('click', 'td a', function() {
modal.trigger('cancel');
});
view.on('hidden.bs.modal', function() {
that.$('.btn-action[data-id="auditCreate"]').attr('disabled', false);
});
});
},
onClickNextAuditData: function() {
......
......@@ -80,9 +80,9 @@ define(['require',
}
}
var values = parseDetailsObject.values;
var name = ((name ? name : this.entityName));
this.ui.name.text(name);
if (parseDetailsObject && parseDetailsObject.values) {
var name = ((name ? name : this.entityName));
this.ui.name.text(name);
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
table = CommonViewFunction.propertyTable({ scope: this, valueObject: values, attributeDefs: this.attributeDefs, extractJSON: { extractKey: 'value' } });
if (table.length) {
......@@ -94,8 +94,7 @@ define(['require',
this.ui.tableAudit.hide();
}
} else {
this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
this.ui.auditValue.html("<tr><td>" + (name ? name : this.entityName) + "</td></tr>");
this.ui.noData.show();
}
} else if (detailObj == "Deleted entity") {
this.ui.name.text(this.entityName);
......
......@@ -145,7 +145,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'initialView', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns'));
_.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns'));
this.entityModel = new VEntity();
this.searchCollection = new VSearchList();
this.limit = 25;
......@@ -298,19 +298,24 @@ define(['require',
this.ui.columnEmptyInfo.hide();
}
this.fetchCollection(value, _.extend({ 'fromUrl': true }, (this.value && this.value.pageOffset ? { 'next': true } : null)));
this.ui.showPage.select2({
data: _.sortBy(_.union([25, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500], [this.limit])),
tags: true,
dropdownCssClass: "number-input",
multiple: false
});
if (this.value && this.value.pageLimit) {
this.ui.showPage.val(this.limit).trigger('change', { "skipViewChange": true });
}
} else {
if (Globals.entityTypeConfList) {
this.$(".entityLink").show();
}
}
this.ui.showPage.select2({
data: _.sortBy(_.union([25, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500], [this.limit])),
tags: true,
dropdownCssClass: "number-input",
multiple: false
});
if (this.value && this.value.pageLimit) {
this.ui.showPage.val(this.limit).trigger('change', { "skipViewChange": true });
if (this.isTypeTagNotExists) {
Utils.notifyError({
content: Messages.search.notExists
});
}
}
},
triggerUrl: function(options) {
......
......@@ -93,7 +93,7 @@ define(['require',
});
Utils.setUrl({
url: '#!/search/searchResult',
urlParams: _.extend(params, this.searchTypeObj),
urlParams: _.extend({}, this.searchTypeObj, params),
mergeBrowserUrl: false,
trigger: true,
updateTabState: true
......
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