Skip to content

Adds settings to control the visibility of comment and invited comment features#4365

Merged
StephDriver merged 10 commits into
masterfrom
3097-preprint-comment-visibility
Mar 14, 2025
Merged

Adds settings to control the visibility of comment and invited comment features#4365
StephDriver merged 10 commits into
masterfrom
3097-preprint-comment-visibility

Conversation

@ajrbyers

Copy link
Copy Markdown
Member

This PR closes #3097

  • Adds two new settings to control visibility of comment and invited comment features
  • Adds a new decorator (with tests) that can check if a repository setting is enabled
  • Adds logic to the repository_preprint view to block comments when the feature is disabled

Comments block removed:
image

Manage Reviewers Removed:
image

Comments Controls Removed:
Screenshot 2024-08-13 at 15 27 24

@ajrbyers ajrbyers changed the title 3097 preprint comment visibility Adds settings to control the visibility of comment and invited comment features Aug 16, 2024
@ajrbyers

ajrbyers commented Aug 19, 2024

Copy link
Copy Markdown
Member Author

@ajrbyers ajrbyers self-assigned this Aug 19, 2024
@ajrbyers ajrbyers force-pushed the 3097-preprint-comment-visibility branch from cda4866 to cf80a8b Compare November 6, 2024 11:23
@ajrbyers ajrbyers requested a review from mauromsl November 6, 2024 11:24
@ajrbyers ajrbyers removed their assignment Dec 2, 2024

@mauromsl mauromsl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely work

@mauromsl mauromsl requested a review from joemull December 5, 2024 09:29
@mauromsl mauromsl self-requested a review December 5, 2024 09:29
@mauromsl mauromsl removed their assignment Dec 5, 2024

@joemull joemull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting conflicting migrations:

CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0045_historicalrepository_display_public_metrics_and_more, 0045_historicalrepository_enable_comments_and_more in repository).

@joemull joemull assigned ajrbyers and unassigned joemull Dec 6, 2024
@mauromsl mauromsl added this to the v1.8.0 Tracker milestone Feb 6, 2025
@ajrbyers ajrbyers force-pushed the 3097-preprint-comment-visibility branch from cf80a8b to 1d6af40 Compare February 12, 2025 17:09
@ajrbyers ajrbyers requested a review from joemull February 12, 2025 17:11
@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Feb 12, 2025

@joemull joemull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting to finish reviewing this until #4626 is merged.

@joemull joemull self-requested a review February 20, 2025 17:01
@joemull

joemull commented Mar 6, 2025

Copy link
Copy Markdown
Member

Picking up on this @ajrbyers, it has a migration graph error:

CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0082_article_abstract_es_article_title_es_section_name_es_and_more, 0084_remove_article_jats_article_type_and_more in submission)

But we can now rebase it on master and the migrations should run. I'll then test it and approve it.

@joemull joemull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above on migration graph error; should be possible to fix with rebase.

@joemull joemull assigned ajrbyers and unassigned joemull Mar 6, 2025
@ajrbyers ajrbyers force-pushed the 3097-preprint-comment-visibility branch from 1d6af40 to 1789cea Compare March 11, 2025 11:11
@ajrbyers ajrbyers requested a review from joemull March 11, 2025 11:13
@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Mar 11, 2025
@ajrbyers ajrbyers requested review from StephDriver and removed request for joemull March 13, 2025 08:39
@ajrbyers ajrbyers assigned StephDriver and unassigned joemull Mar 13, 2025
@StephDriver

Copy link
Copy Markdown
Member

Change required - when comments are disabled, invited comments also do not show. When comments are enabled both comments and invited comments both show.

Currently
if comments -> show comments and show invited comments
if not comments -> hide comments and hide invited comments

So the logic of the filters needs to change.

if comments -> show comments
if invited comments -> show invited comments

they need to be independent.

@StephDriver StephDriver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments Invited comments Test Results
0 0
1 0
1 1
0 1

Text Box to add non-invited comments appears when only invited comments are switched on. On entering a comment, then a toast appears stating the comment feature is disabled. But only after writing it and clicking to add it.
image

When both sets of comments are off, the comment box does not show at all, and I think that should be the same for all times when non-invited comments are off.

@StephDriver StephDriver assigned ajrbyers and unassigned StephDriver Mar 13, 2025
@ajrbyers ajrbyers requested a review from StephDriver March 13, 2025 12:42
@ajrbyers ajrbyers assigned StephDriver and unassigned ajrbyers Mar 13, 2025
@StephDriver

Copy link
Copy Markdown
Member
Comments Invited comments Test Results
0 0
1 0
1 1
0 1

😄

@StephDriver StephDriver merged commit 3587451 into master Mar 14, 2025
@StephDriver StephDriver deleted the 3097-preprint-comment-visibility branch March 14, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preprints: Add toggle setting for Comments, Invited Comments, and Registered Reviewers

4 participants