Custom Monograph required fields not enforced
conorom opened this issue · 1 comments
conorom commented
We've decided that some of our custom fields should be required, but they are not being enforced by the JS that decides to allow the form to submit (represented by the green tick next to "Describe your work").
This is because the input elements in views/monographs/edit_fields
do not have required: true
or, pulling from the form, f.object.required?(key)
on them.
https://github.com/samvera/hyrax/blob/54b8692e2d77721f81c53a3b9552eb5e2f564c35/app/assets/javascripts/hyrax/save_work/required_fields.es6#L20
https://github.com/samvera/hyrax/blob/694ed1938fd95abeb39b33d0a301f7cf2c272a92/app/views/records/edit_fields/_description.html.erb#L2
required?
links to required_fields
set in MonographForm
- set the required values on the custom required elements
- (maybe) add tests for
views/monographs/edit_fields.rb
like Hyrax does (a simplified version of the spec from the link below with definite cardinality and required status for each custom edit field)