-
Notifications
You must be signed in to change notification settings - Fork 41
Don't trigger unload protect when setting LatLon plugin values #3959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
carlosmbe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not recreate issue with Lat Forms outside of sdnhmpaleo_3_31_23. PR Works great. Please advise on whether or not to approve
specifyweb/frontend/js_src/lib/components/FormPlugins/LatLongUi.tsx
Outdated
Show resolved
Hide resolved
bronwyncombs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as expected for me! Unload protect is still triggered if changes are made to the form.
Screen.Recording.2023-09-01.at.9.03.05.AM.mov
carlosmbe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue not fixed. Tested in NHMD_Test. Log in as petrifiedroadkill to NHMD Amber and open Jotaro Record Set.
Triggered by c41b86a on branch refs/heads/issue-3259-a
Triggered by 188a9ba on branch refs/heads/issue-3259-a
@specify/ux-testing |
emenslin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not recreate issue in edge, might've been fixed by something else?
emenslin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was able to recreate the issue this time but unload protect still triggered when it shouldn't be
2evXM0VPg8.mp4
This is fixed. Thus, the original issue should occur (that is, unload protect should only occur when the However, I would potentially like to discuss potential impacts and propose a 'better' solution. (Assuming unload protect is now only caused by the LatLongUI Plugin when
+-----------------+-------------------+
| lat1text | long1text |
+-----------------+-------------------+
| 32.810579° N | 117.2229226° W |
+-----------------+-------------------+
Although, I do admit that only setting unload protect in this instance is a less-than optimal solution. |
|
I agree with @melton-jason and that we should not silence the unload protect. Since Specify is changing the values the users should be made aware in some way that the values are no longer what they put in. Maybe if they are putting in the values through workbench there could be some kind of error on any cells with values that Specify would change (e.g. I also think that Jasons idea of showing the user excactly what changed and give them the option to edit or accept the change would also work. I'm not sure visually what you were thinking but it sounds like it could also be a good solution. |
|
Yes, I also agree with the two above--if there is a change happening then unload protect should be triggered. The suggested change idea be good, though maybe I'd put it as a preference (but make it default) if we go that route--otherwise, I think flagging those cases as errors like Elizabeth said would be good. |
|
|
probably shouldn't be an error, but maybe could be a warning |
Fixes #3259 (comment)
The issue occurred when setting the value for
lat1text,lat2text,long1text, andlong2textfor the LatLonUI Plugin.Which occured at this line:
specify7/specifyweb/frontend/js_src/lib/components/FormPlugins/LatLongUi.tsx
Line 109 in 312139a
To highlight the issue, I will use an example from the
sdnhmpaleo_3_31_23database.(https://sdnhmpaleo33123-v79-dev.test.specifysystems.org/specify/view/locality/24618/)
Specify tries to convert the value of in the database into a valid latitude/longitude value.
Here are the values in the database.
Specify trims lat1text and long1text to
32.810579 Nand117.2229226 W(respectively), and sets the value of the fields to the trimmed version, which triggers unload protect.I have made the setting of these values "silent" which means they will not trigger unload protect.
TO TEST:
Make sure the resource's unload protect is not triggered when being initialized, but ensure that manually editing every component still properly triggers unload protect.