Skip to content
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

Draft
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

ElviaBth
Copy link
Contributor

@ElviaBth ElviaBth commented Jun 19, 2024

🎩 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

  1. Log in as administrator.
  2. Enter the admin panel and navigate to a process that have a proposals/debates component with comments enabled.
  3. Block comments in that component in the steps settings.
  4. Navigate to a proposal/debates on the frontend where comments have been blocked.
  5. See that no comments can be submitted or reply unless you're an administrator and there is a warning message indicating that comments have been disabled

📷 Screenshots

image
warning message for blocked comments

♥️ Thank you!

Copy link

request-info bot commented Jun 19, 2024

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!

Copy link

@github-actions github-actions bot left a 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']

carolromero
carolromero previously approved these changes Jun 20, 2024
Copy link
Member

@carolromero carolromero left a 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!

@andreslucena andreslucena added the contract: 2024-developments Barcelona City Council contract label Jun 20, 2024
@microstudi microstudi self-requested a review June 20, 2024 12:51
Copy link
Contributor

@microstudi microstudi left a 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

Copy link
Contributor

@microstudi microstudi left a 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!

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) }
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

Administrators answers to closed comments
4 participants