-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Enable admins answer to closed comments #13027
base: develop
Are you sure you want to change the base?
Enable admins answer to closed comments #13027
Conversation
This is done mainly because some modules (such as Initiatives) don't have the feature for blocking the comments in the steps (as they don't have steps as a Participatory Process)
…answers_close_comments
It seems like you did not give us much information about what you are trying to do here. We would appreciate it if you could provide us with more info about this issue/PR! |
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.
This pull request does not contain a valid label. Please add one of the following labels: ['type: feature', 'type: change', 'type: fix', 'type: removal', 'target: developer-experience', 'type: internal']
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.
This works well and as expected 👌. Thank you @ElviaBth!
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.
Nice job @ElviaBth, I've just left you a couple of aestic comments.
However there one thing that needs to be completed, a couple of tests.
We should add all the cases that the new condition checks in the comments_examples.rb
decidim-admin/app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb
Outdated
Show resolved
Hide resolved
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.
I left you some comments, we need to add some cases!
decidim-core/lib/decidim/core/test/shared_examples/comments_examples.rb
Outdated
Show resolved
Hide resolved
decidim-core/lib/decidim/core/test/shared_examples/comments_examples.rb
Outdated
Show resolved
Hide resolved
decidim-core/lib/decidim/core/test/shared_examples/comments_examples.rb
Outdated
Show resolved
Hide resolved
decidim-core/lib/decidim/core/test/shared_examples/comments_examples.rb
Outdated
Show resolved
Hide resolved
decidim-core/lib/decidim/core/test/shared_examples/comments_examples.rb
Outdated
Show resolved
Hide resolved
let!(:component) { create(:component, organization:) } | ||
let(:body) { "This is a new comment" } | ||
let(:alignment) { 1 } | ||
let(:user_group) { create(:user_group, :verified) } | ||
let(:user_group_id) { user_group.id } | ||
|
||
let(:commentable) { create(:dummy_resource) } | ||
let(:commentable) { create(:dummy_resource, accepts_new_comments?: false) } |
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.
By default, the resource should allow comments, so this should stay as it was.
Then, check that a normal user can make comments.
After that create a context where the commentable does not accepts comments (with this let
entry in there). Then check that a normal user cannot create a comment but admins can
🎩 What? Why?
This PR enables administrators to answer comments or post new ones even after they are closed to participants.
📌 Related Issues
Link your PR to an issue
Testing
📷 Screenshots
warning message for blocked comments