[fix] Unsaved changes js trigger when device have location defined #388#405
[fix] Unsaved changes js trigger when device have location defined #388#405jalajcodes wants to merge 1 commit intoopenwisp:masterfrom
Conversation
unsaved changes js is triggered when device have geographic location defined, fixed it by ignoring the input field for device location Fixes openwisp#388
nemesifier
left a comment
There was a problem hiding this comment.
Thanks @jalajcodes, see my comment below.
| name.indexOf('root') === 0) { | ||
| name.indexOf('root') === 0 || | ||
| // ignore device location field | ||
| name.substr(0, 14) == 'devicelocation') { |
There was a problem hiding this comment.
this partially solves the issue, but what if the user changes the device location and forgets to save?
Can you find a way to make that case work as well?
nemesifier
left a comment
There was a problem hiding this comment.
@jalajcodes any update on this? If you can't finish it let me know, I need to get this done soonish because it's a very annoying bug for our users.
For some reason, I am now unable to reproduce the issue, I deleted the repo and started fresh but still unable to reproduce it |
nemesifier
left a comment
There was a problem hiding this comment.
@jalajcodes any update on this? If you can't finish it let me know, I need to get this done soonish because it's a very annoying bug for our users.
For some reason, I am now unable to reproduce the issue, I deleted the repo and started fresh but still unable to reproduce it
Try creating two locations in the system.
Then create a device, assign it an existing location, save and reopen the same page.
Now change the location of the device but do not save, just click any other link to exit the device page, we expect to get the unsaved changes alert in this case, but it's not triggering because the code you provided excluded the devicelocation attribute from the check, while instead we have to understand why when the devicelocation is present it is interpreted as always different by the JS code.
|
Superseded by #411. |
Unsaved changes js is triggered when device have geographic location defined,
fixed it by ignoring the input field for device location inside
unsaved_changes.jsFixes #388