Skip to content

Commit

Permalink
#3417: Configured default visibility for review (#3418)
Browse files Browse the repository at this point in the history
Configured setting for default visibility of review. It can be set as
**private** or **reviewers**.

- Private: Visible only to staff.
- Reviewers: Visible to other reviewers and staff.

**Setting to consider:**

- ```REVIEW_VISIBILITY_DEFAULT ```

Closes #3417

---------

Co-authored-by: Fredrik Jonsson <[email protected]>
  • Loading branch information
gmurtaza00 and frjo authored Dec 18, 2023
1 parent c6ffaae commit f790dc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/setup/administrators/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ Possible values are: fund, round, status, lead, reviewers, screening_statuses, c

SUBMISSIONS_TABLE_EXCLUDED_FIELDS = env.list('SUBMISSIONS_TABLE_EXCLUDED_FIELDS', [])

### Default visibility for reviews.

Possible values are: 'reviewers' or 'private'.
Private: Visible only to staff.
Reviewers: Visible to other reviewers and staff.

REVIEW_VISIBILITY_DEFAULT = env.str('REVIEW_VISIBILITY_DEFAULT', 'private')

### Should submission automatically transition after all reviewer roles are assigned.

TRANSITION_AFTER_ASSIGNED = env.bool('TRANSITION_AFTER_ASSIGNED', False)
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/review/blocks.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import json

from django import forms
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from wagtail.blocks import RichTextBlock

from hypha.apply.review.fields import ScoredAnswerField
from hypha.apply.review.options import (
NA,
PRIVATE,
RATE_CHOICE_NA,
RATE_CHOICES,
RATE_CHOICES_DICT,
Expand Down Expand Up @@ -152,7 +152,7 @@ class Meta:
def get_field_kwargs(self, struct_value):
kwargs = super(VisibilityBlock, self).get_field_kwargs(struct_value)
kwargs["choices"] = VISIBILITY.items()
kwargs["initial"] = PRIVATE
kwargs["initial"] = settings.REVIEW_VISIBILITY_DEFAULT
kwargs["help_text"] = mark_safe(
"<br>".join(
[
Expand Down
3 changes: 3 additions & 0 deletions hypha/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@
# Possible values are: False, 1,2,3,…
TRANSITION_AFTER_REVIEWS = env.bool("TRANSITION_AFTER_REVIEWS", False)

# Default visibility for reviews.
REVIEW_VISIBILITY_DEFAULT = env.str("REVIEW_VISIBILITY_DEFAULT", "private")


# Project settings.

Expand Down

0 comments on commit f790dc8

Please sign in to comment.