-
Notifications
You must be signed in to change notification settings - Fork 124
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
Setting lease with date in the past has error messaging problems #4845
Comments
is this different from #4758 |
I think this might be an update on #4758. The behavior described in that issue is not occurring anymore. Safari on Mac doesn't provide a calendar picker so dates are entered manually. Entering a date in the past manually was producing a stack trace error but now is giving this empty flash error message along with the message with the date field that it must be a future date. The behavior described here is happening across all browsers now (also tried Chrome and Firefox, both of those have calendar pickers for this field). I can't track down what actually changed to address the stack trace error but it looks like #4758 can be closed. |
Testing this requires #4833 |
Work log with #4833, when I add a lease date that is a past date, I get the following:
We are invoking |
Fixes #4845 Prior to this fix, if we had a new record that either set an embargo or a lease, we would narrow our rendering of the visibility component to only a partial related to the embargo or lease. ```gherkin Given a form that set an embargo (or release date) And that form had invalid data When I submitted the form Then the response form would inidicate there was invalid data And would render only the portion of the visibility related to embargo (or release date if set) ``` With this change, the form renders the entire visibility component, letting the user change their visibility options (e.g., go from with Lease to Public or what have you). However, the error messaging is not providing insight into the problem; That is to say there's a red flash error, but the content is empty; and there is no indicator on the lease field that there existed an error. This warrants further work, and will be a commit that builds on this change.
Prior to this commit, the `form_visibility_error` partial did not include the errors for the `:lease_expiration_date` nor the `:visibility_after_lease`. Per convention of Hyrax, we place the error messages on the form and not in close DOM proximity to the HTML field in which we encountered the error. This relates to #4845
Prior to this commit, the `form_visibility_error` partial did not include the errors for the `:lease_expiration_date` nor the `:visibility_after_lease`. Per convention of Hyrax, we place the error messages on the form and not in close DOM proximity to the HTML field in which we encountered the error. This relates to #4845
Prior to this commit, the `form_visibility_error` partial did not include the errors for the `:lease_expiration_date` nor the `:visibility_after_lease`. Per convention of Hyrax, we place the error messages on the form and not in close DOM proximity to the HTML field in which we encountered the error. This relates to #4845
Fixes #4845 Prior to this fix, if we had a new record that either set an embargo or a lease, we would narrow our rendering of the visibility component to only a partial related to the embargo or lease. ```gherkin Given a form that set an embargo (or release date) And that form had invalid data When I submitted the form Then the response form would inidicate there was invalid data And would render only the portion of the visibility related to embargo (or release date if set) ``` With this change, the form renders the entire visibility component, letting the user change their visibility options (e.g., go from with Lease to Public or what have you). However, the error messaging is not providing insight into the problem; That is to say there's a red flash error, but the content is empty; and there is no indicator on the lease field that there existed an error. This warrants further work, and will be a commit that builds on this change.
Prior to this commit, the `form_visibility_error` partial did not include the errors for the `:lease_expiration_date` nor the `:visibility_after_lease`. Per convention of Hyrax, we place the error messages on the form and not in close DOM proximity to the HTML field in which we encountered the error. This relates to #4845
Fixes #4845 Prior to this fix, if we had a new record that either set an embargo or a lease, we would narrow our rendering of the visibility component to only a partial related to the embargo or lease. ```gherkin Given a form that set an embargo (or release date) And that form had invalid data When I submitted the form Then the response form would inidicate there was invalid data And would render only the portion of the visibility related to embargo (or release date if set) ``` With this change, the form renders the entire visibility component, letting the user change their visibility options (e.g., go from with Lease to Public or what have you). However, the error messaging is not providing insight into the problem; That is to say there's a red flash error, but the content is empty; and there is no indicator on the lease field that there existed an error. This warrants further work, and will be a commit that builds on this change.
Prior to this commit, the `form_visibility_error` partial did not include the errors for the `:lease_expiration_date` nor the `:visibility_after_lease`. Per convention of Hyrax, we place the error messages on the form and not in close DOM proximity to the HTML field in which we encountered the error. This relates to #4845
This reflects moving the change from e1fd224 — "Fixing rendering logic for visibility component" into the helper method. This suggestion comes from [no_reply's review comment][1], and makes sense. I don't think we want to push the logic further down the stack, as there's a case statement that would add complexity, as well as it may have unintended consequences. The change at this level (e.g., a helper method) makes it more clear that this is for rendering UI components. Related to #4845. [1]:https://github.com/samvera/hyrax/pull/4889/files#r625466486
Fixes #4845 Prior to this fix, if we had a new record that either set an embargo or a lease, we would narrow our rendering of the visibility component to only a partial related to the embargo or lease. ```gherkin Given a form that set an embargo (or release date) And that form had invalid data When I submitted the form Then the response form would inidicate there was invalid data And would render only the portion of the visibility related to embargo (or release date if set) ``` With this change, the form renders the entire visibility component, letting the user change their visibility options (e.g., go from with Lease to Public or what have you). However, the error messaging is not providing insight into the problem; That is to say there's a red flash error, but the content is empty; and there is no indicator on the lease field that there existed an error. This warrants further work, and will be a commit that builds on this change.
Prior to this commit, the `form_visibility_error` partial did not include the errors for the `:lease_expiration_date` nor the `:visibility_after_lease`. Per convention of Hyrax, we place the error messages on the form and not in close DOM proximity to the HTML field in which we encountered the error. This relates to #4845
This reflects moving the change from e1fd224 — "Fixing rendering logic for visibility component" into the helper method. This suggestion comes from [no_reply's review comment][1], and makes sense. I don't think we want to push the logic further down the stack, as there's a case statement that would add complexity, as well as it may have unintended consequences. The change at this level (e.g., a helper method) makes it more clear that this is for rendering UI components. Related to #4845. [1]:https://github.com/samvera/hyrax/pull/4889/files#r625466486
Testing this locally shows this is fixed when trying to use a past date in the Lease field on a new work or for editing an existing work. Nurax-dev is giving the above described response when editing an existing work and a stack trace error when using a past date in the Lease field on a new work. These changes do not seem to have made it to nurax-dev yet. |
All changes have now made it to nurax-dev and this is fixed. A helpful error message appears that the Lease date must be in the future when editing a work or creating a new work and entering a Lease date that is in the past. This is done! |
Descriptive summary
Setting the Visibility of a Work with a Lease that has a date in the past does not work, which is correct. However, the error messaging that shows is not helpful and ends up leaving you somewhat stuck in the Work edit form.
Rationale
If it does not work to set a lease date in the past (which is correct, it should not work that way), the other visibility options (Public, Embargo, Private) should still be available while the error message inside Lease shows that the date must be a future date. It should be possible to either correct the Lease date and then save to apply the lease or select another visibility option and continue editing the work.
Expected behavior
If a Lease date is in the past, the lease is not applied and the other Visibility options are still available while the error message inside Lease shows that the date must be a future date. The flash error message at the top contains text to explain that the Lease date needs to be a date in the future (or the date value is not valid).
Actual behavior
Empty flash error message appears at the top and the Visibility looks like a Lease has been applied (no other visibility options show) and there is an error message that the date must be a future date. User can either correct the date and continue applying the Lease or they have to exit the Work edit form (using menu options or something similar to abandon the edit form without saving) and come back into the Work edit form, where the visibility options are all available, set as they were before editing, and the invalid Lease has not been applied.
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: