Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

I102 valkyrie validations #2148

Closed
wants to merge 5 commits into from

Conversation

ShanaLMoore
Copy link
Collaborator

@ShanaLMoore ShanaLMoore commented Jan 9, 2024

Create change set for model resources and a TitleValidator.

Enforce the validator with generic_work_resource_cs = GenericWorkChangeSet.new(GenericWorkResource.new). 

generic_work_resource_cs.valid? => false

generic_work_resource_cs.errors.messages => => {:title=>["can't be blank", "Your work must have a title."]}

Issue:

Docs:

TODO

  • Confirm via rails console
  • Confirm via UI/manual work creation

Shana Moore added 3 commits January 9, 2024 10:31
Create change set for Generic Work and a TitleValidator.

Enforce the validator with generic_work_resource_cs = ChangeSet.new(GenericWorkResource.new).
generic_work_resource_cs.valid? => false
generic_work_resource_cs.errors.messages => => {:title=>["can't be blank", "Your work must have a title."]}

Issue:
- notch8/hykuup_knapsack#84

Docs:
- https://github.com/samvera/valkyrie/wiki/Persisting-changes-through-synchronization#successfully-change-and-save
@ShanaLMoore ShanaLMoore added the patch-ver for release notes label Jan 9, 2024
@ShanaLMoore
Copy link
Collaborator Author

consider making a default changeset

@ShanaLMoore ShanaLMoore marked this pull request as ready for review January 12, 2024 21:46
@ShanaLMoore
Copy link
Collaborator Author

ShanaLMoore commented Jan 16, 2024

As discussed with LaRita, we're holding off on this merge. Is this the right way to do this? Can validations be enforced using the yaml?

@ShanaLMoore ShanaLMoore marked this pull request as draft January 16, 2024 16:30
@ShanaLMoore
Copy link
Collaborator Author

ShanaLMoore commented Jan 16, 2024

When I made title not be a required field on the form, I can still successfully save a generic work resource from the ui, even with the validator. Perhaps it doesn't go through the changeset??

Update: it inherits from Hyrax::ChangeSet 🤔 which doesn't have a title validation. How do I make the resource forms use their respective changesets?

@orangewolf orangewolf deleted the i102-valkyrie-validations branch August 26, 2024 22:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
patch-ver for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants