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

🎁 Create transaction steps for anything custom in the actor stack #84

Closed
2 tasks
ShanaLMoore opened this issue Jan 3, 2024 · 1 comment
Closed
2 tasks
Labels

Comments

@ShanaLMoore
Copy link

ShanaLMoore commented Jan 3, 2024

Summary

Review any callbacks for the models/controllers. Make a custom transaction step equivalent so that the model's resource can implement the same actions.

ref:

Acceptance Criteria

  • model resources behave like the model proper.
    • For example, if creating a GenericWork requires a title, the GenericWorkResource should too

Testing Instructions

TBD

Notes

https://github.com/samvera/valkyrie/wiki/Defining-change-set-validations

https://docs.google.com/document/d/1WCB-5qIDCGhMQSuAzM70MDIuP4EQJhtnvgZt2x8MS4o/edit
https://drive.google.com/file/d/1oSLVhSF34JUgJBni9kN7FhPuOao5XSfz/view?usp=sharing

@ShanaLMoore ShanaLMoore changed the title Create transaction steps for anything custom in the actor stack 🎁 Create transaction steps for anything custom in the actor stack Jan 3, 2024
@ShanaLMoore
Copy link
Author

ShanaLMoore commented Jan 8, 2024

List of transactions we may need:

GenericWork && Image

  • validates :title, presence: { message: 'Your work must have a title.' }

when IiifPrint is enabled

Collections

ref: https://github.com/samvera/hyku/blob/main/app/models/collection.rb#L9-L10

  • after_update: remove_featured
  • after_destroy: remove_featured

ShanaLMoore pushed a commit to samvera/hyku that referenced this issue Jan 9, 2024
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 pushed a commit to samvera/hyku that referenced this issue Jan 9, 2024
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant