From cbfee2317d009660ffdc63d7f330653f8cf4b7dd Mon Sep 17 00:00:00 2001 From: bbaer Date: Fri, 18 Aug 2017 16:25:51 +0200 Subject: [PATCH 1/2] Changing buttons for the dirty Events depending on status --- javascript/src/QfqForm.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/javascript/src/QfqForm.js b/javascript/src/QfqForm.js index ec71d250..73cda09b 100644 --- a/javascript/src/QfqForm.js +++ b/javascript/src/QfqForm.js @@ -172,23 +172,31 @@ var QfqNS = QfqNS || {}; n.QfqForm.prototype.dirtyRenewalDenied = function (obj) { var that = this; + var messageButtons = [{ + label: "Reload", + eventName: 'reload' + }]; + if (obj.data.status == "conflict_allow_force") { + messageButtons.push({ + label: "Ignore", + eventName: 'ignore' + }); + } var alert = new n.Alert( { type: "error", message: obj.data.message, modal: true, - buttons: [ - { - label: "Reload", - eventName: 'reload' - } - ] + buttons: messageButtons } ); alert.on('alert.reload', function () { that.eventEmitter.emitEvent('qfqform.close-intentional', n.EventEmitter.makePayload(that, null)); window.location.reload(true); }); + alert.on('alert.ignore', function() { + console.log("Ignored Recordlock"); + }); alert.show(); }; -- GitLab From 7da56956f73c97a095cbb82d6ee5253683b4c91e Mon Sep 17 00:00:00 2001 From: bbaer Date: Fri, 18 Aug 2017 16:38:59 +0200 Subject: [PATCH 2/2] Changing buttons for the dirty Events depending on status, no an ignore option should be displayed for the user. --- javascript/src/QfqForm.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/javascript/src/QfqForm.js b/javascript/src/QfqForm.js index 73cda09b..18dcd9a5 100644 --- a/javascript/src/QfqForm.js +++ b/javascript/src/QfqForm.js @@ -224,19 +224,17 @@ var QfqNS = QfqNS || {}; n.QfqForm.prototype.dirtyNotifyDenied = function (obj) { var messageType; - var isModal = false; - var messageButtons = []; + var isModal = true; + var messageButtons = [{ + label: "Reload", + eventName: 'reload' + }]; var message; var that = this; switch (obj.data.status) { case "conflict": messageType = "error"; - isModal = true; - messageButtons.push({ - label: "Reload", - eventName: 'reload' - }); this.setButtonEnabled(this.getSaveButton(), false); this.getSaveButton().removeClass(this.getSaveButtonAttentionClass()); this.setButtonEnabled(this.getDeleteButton(), false); @@ -245,6 +243,10 @@ var QfqNS = QfqNS || {}; break; case "conflict_allow_force": messageType = "warning"; + messageButtons.push({ + label: "Ignore", + eventName: 'ignore' + }); break; case "error": messageType = "error"; -- GitLab