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

Add 'open-not-in-progress' updates allowed setting. #5337

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions perllib/FixMyStreet/Cobrand/UK.pm
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
my $staff = $body_user || $superuser;
my $reporter = $c->user_exists && $c->user->id == $problem->user->id;
my $open = !($problem->is_fixed || $problem->is_closed);
my $in_progress = $problem->is_in_progress;

Check warning on line 469 in perllib/FixMyStreet/Cobrand/UK.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/UK.pm#L469

Added line #L469 was not covered by tests
my $body_comment_user = $self->body && $self->body->comment_user_id && $problem->user_id == $self->body->comment_user_id;

if ($cfg eq 'none') {
Expand All @@ -475,6 +476,8 @@
return $cfg unless $staff;
} elsif ($cfg eq 'open') {
return $cfg unless $open;
} elsif ($cfg eq 'open-not-in-progress') {
return $cfg unless $open && !$in_progress;
} elsif ($cfg eq 'reporter') {
return $cfg unless $reporter;
} elsif ($cfg eq 'reporter-open') {
Expand Down
2 changes: 2 additions & 0 deletions t/cobrand/councils.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ subtest "Test update shown/not shown appropriately" => sub {
{ type => 'reporter/staff-open', state => 'in progress', update => [0,1,1] },
{ type => 'open', state => 'closed', update => [0,0,0] },
{ type => 'open', state => 'in progress', update => [1,1,1] },
{ type => 'open-not-in-progress', state => 'in progress', update => [0,0,0] },
{ type => 'open-not-in-progress', update => [1,1,1] },
) {
FixMyStreet::override_config {
ALLOWED_COBRANDS => $cobrand,
Expand Down