Skip to content

Commit

Permalink
[UK] Bypass ownership check on reports pages.
Browse files Browse the repository at this point in the history
On reports pages (and heatmap), we know all reports involved are owned
by the body, so do not need to perform this check. Copy of e4addf2
for other cobrands.
  • Loading branch information
dracos committed Dec 6, 2023
1 parent 51ace92 commit 7fbc166
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/Cobrand/Bromley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ sub geocode_postcode {
# Bromley pins always yellow
sub pin_colour {
my ( $self, $p, $context ) = @_;
return 'grey' if !$self->owns_problem( $p );
return 'grey' if ($context ne 'reports' && !$self->owns_problem($p));
return 'yellow';
}

Expand Down
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/Cobrand/CheshireEast.pm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sub send_questionnaires { 0 }

sub pin_colour {
my ( $self, $p, $context ) = @_;
return 'grey' if $p->state eq 'not responsible' || !$self->owns_problem( $p );
return 'grey' if $p->state eq 'not responsible' || ($context ne 'reports' && !$self->owns_problem($p));
return 'green' if $p->is_fixed || $p->is_closed;
return 'yellow' if $p->is_in_progress;
return 'red';
Expand Down
3 changes: 1 addition & 2 deletions perllib/FixMyStreet/Cobrand/Lincolnshire.pm
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ Lincolnshire uses the following pin colours:

sub pin_colour {
my ( $self, $p, $context ) = @_;
my $ext_status = $p->get_extra_metadata('external_status_code');

return 'grey'
if $p->state eq 'not responsible' || !$self->owns_problem($p);
if $p->state eq 'not responsible' || ($context ne 'reports' && !$self->owns_problem($p));
return 'orange'
if $p->state eq 'investigating' || $p->state eq 'for triage';
return 'yellow'
Expand Down
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/Cobrand/Oxfordshire.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sub reports_ordering {

sub pin_colour {
my ( $self, $p, $context ) = @_;
return 'grey' unless $self->owns_problem( $p );
return 'grey' if $context ne 'reports' && !$self->owns_problem($p);
return 'grey' if $p->is_closed;
return 'green' if $p->is_fixed;
return 'yellow' if $p->state eq 'confirmed';
Expand Down
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/Cobrand/UKCouncils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ sub owns_problem {
# then show pins for the other council as grey
sub pin_colour {
my ( $self, $p, $context ) = @_;
return 'grey' if !$self->owns_problem( $p );
return 'grey' if $context ne 'reports' && !$self->owns_problem($p);
return $self->next::method($p, $context);
}

Expand Down

0 comments on commit 7fbc166

Please sign in to comment.