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