Skip to content

Commit

Permalink
Fixing rendering logic for visibility component
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeremyf committed May 4, 2021
1 parent 34a258a commit e1fd224
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/hyrax/base/_form_visibility_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if embargo_enforced?(f.object) %>
<% if embargo_enforced?(f.object) && !f.object.new_record? %>
<%= render 'form_permission_under_embargo', f: f %>
<% elsif lease_enforced?(f.object) %>
<% elsif lease_enforced?(f.object) && !f.object.new_record? %>
<%= render 'form_permission_under_lease', f: f %>
<% else %>
<fieldset>
Expand Down

0 comments on commit e1fd224

Please sign in to comment.