From acdaa53b3fea417a75dc92a6493a7d1ad2d2e9d2 Mon Sep 17 00:00:00 2001 From: Beamanator Date: Tue, 5 Jun 2018 13:25:32 +0200 Subject: [PATCH] Fixed #29 - Upgrade to 1.1.0 - high priority push --- js/DeleteSubmitSkip.js | 44 ++++++++++++++++++++++++++++++++++++++++++ manifest.json | 5 +++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 js/DeleteSubmitSkip.js diff --git a/js/DeleteSubmitSkip.js b/js/DeleteSubmitSkip.js new file mode 100644 index 0000000..37c4363 --- /dev/null +++ b/js/DeleteSubmitSkip.js @@ -0,0 +1,44 @@ +/** + * I just found a problem with RIPS regarding clients being deleted + * without warning. If you ever update a client's basic information + * (on the Client Basic Information page), please make sure you save + * the client by clicking the "Save" button in the top-left corner + * of the page. DO NOT PRESS [ENTER] ON THE PAGE!! It seems that by + * pressing enter, it's possible to see a popup that looks like this: + * + * [image] + * + * If you click "Ok", YOU WILL DELETE THE CLIENT!!! If you ever see + * this popup, click "Cancel" or press the [Esc] key on your keyboard. + * + * If you accidentally press "Ok" or if you have done this in the + * past, please send me the client details you were working on, as + * your client was probably deleted. + * + * I am already sending this bug report to the developers, so I will + * send an "all clear" once this has been fixed. Until then, PLEASE + * DO NOT PRESS THE [ENTER] KEY ON THE CLIENT BASIC INFORMATION PAGE!!! + * + * Thank you very much, please let me know if there are any questions. + */ +console.log( + '[DeleteSubmitSkip]: Note - remove code once devs fix bug!' +); + +// on keydown, handle key code +document.addEventListener("keydown", function (e) { + // + switch (e.key) { + case 'Enter': + console.log('[DeleteSubmitSkip]: pressed [Enter]' + + ' - prevent default', e); + // temporarily fix bug by not allowing 'enter' to trigger + // form submit + e.preventDefault(); + break; + + default: + // don't care about anything else + break; + } +}); \ No newline at end of file diff --git a/manifest.json b/manifest.json index 57f187c..2c21fff 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "RIPS Extension - Validation", - "version": "1.0.0", + "version": "1.1.0", "description": "RIPS Extension - Adds validation on UNHCR #, Phone #, and DOB", @@ -40,7 +40,8 @@ ] }, { "matches": [ "http://rips.247lib.com/Stars/ClientDetails/ClientDetails" ], - "css": [ "css/overrides/styles_CBI.css" ] + "css": [ "css/overrides/styles_CBI.css" ], + "js": [ "js/DeleteSubmitSkip.js" ] }, { "matches": [ "http://rips.247lib.com/Stars/Registration/Registration" ], "css": [ "css/overrides/styles_REG.css" ]