Skip to content

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

Open
wants to merge 1 commit into
base: implementation/62363-adapt-attachment-uploads-on-comments-so-that-they-are-attached-to-the-container-on-submit
Choose a base branch
from

Conversation

akabiru
Copy link
Member

@akabiru akabiru commented Apr 15, 2025

When a comment is updated, replace attachments.

https://community.openproject.org/wp/63384

@akabiru akabiru changed the title Set comment attachment replacements on edit implementation/63384 On work package comment edit set attachment replacements Apr 15, 2025
@akabiru akabiru force-pushed the implementation/63384-on-edit-set-attachment-replacements branch from ae054fa to 9b195c2 Compare April 15, 2025 14:46
@akabiru akabiru marked this pull request as ready for review April 15, 2025 14:47
@akabiru akabiru requested review from brunopagno and Copilot April 15, 2025 14:48
Copy link

@Copilot Copilot AI left a 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)

@akabiru akabiru force-pushed the implementation/63384-on-edit-set-attachment-replacements branch 2 times, most recently from e1b8ea2 to e9d9f92 Compare April 15, 2025 15:18
@akabiru akabiru self-assigned this Apr 15, 2025
@akabiru akabiru force-pushed the implementation/63384-on-edit-set-attachment-replacements branch from e9d9f92 to 8ad1276 Compare April 15, 2025 15:32
Copy link
Contributor

@brunopagno brunopagno left a 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 👍

@akabiru
Copy link
Member Author

akabiru commented Apr 16, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants