-
Notifications
You must be signed in to change notification settings - Fork 2.6k
implementation/63384 On work package comment edit set attachment replacements #18648
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
base: implementation/62363-adapt-attachment-uploads-on-comments-so-that-they-are-attached-to-the-container-on-submit
Are you sure you want to change the base?
Conversation
ae054fa
to
9b195c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
spec/features/activities/work_package/activity_tab_comment_editor_spec.rb:176
- [nitpick] For clarity, consider assigning Attachment.where(author: admin).last to a descriptive variable rather than using it inline.
expect(comment.reload.attachments).to contain_exactly(Attachment.where(author: admin).last)
spec/services/work_packages/activities_tab/comment_attachments_claims/claims_service_spec.rb
Outdated
Show resolved
Hide resolved
e1b8ea2
to
e9d9f92
Compare
When a comment is updated, replace attachments. https://community.openproject.org/wp/63384
e9d9f92
to
8ad1276
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. And so straightforward 👏👏👏
One thing to think about, though, is if these checks should be part of the journal contracts instead of living in the controller.
These should become more clear and easier to handle when we extract comments from journals. But at this point the line looks a bit blurry on where the responsibility of each action lies.
In any case, just food for thought, no changes necessary. The PR looks good 👍
Good eye, I considered baking the claims service as a dependent service to Journals{Create,Update}Service but unfortunately those services don't extend the BaseService implementation that allows for this behaviour, and since this should be soon moved to comments- perhaps it's good to keep it decoupled from journals. |
When a comment is updated, replace attachments.
https://community.openproject.org/wp/63384