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

Dupe suggestions can be disabled on a per-category basis in config #5162

Merged

Conversation

davea
Copy link
Member

@davea davea commented Sep 11, 2024

Setting a suggestions value to 0 within the nearby_distances cobrand feature disables the dupe suggestion feature for that group/category, eg:

COBRAND_FEATURES:
  nearby_distances:
    my_cobrand:
      suggestions:
        _fallback: 100
        Potholes: 0

@davea davea force-pushed the surrey-cobrand-category-disable-dupe-suggestions branch from d50a490 to 7fc9801 Compare September 11, 2024 20:14
@davea davea marked this pull request as ready for review September 11, 2024 20:14
@davea davea requested a review from dracos September 11, 2024 20:14
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.29%. Comparing base (28739dd) to head (e6931e7).
Report is 1 commits behind head on surrey-cobrand.

Files with missing lines Patch % Lines
perllib/FixMyStreet/App/Controller/Report.pm 90.47% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           surrey-cobrand    #5162      +/-   ##
==================================================
- Coverage           82.55%   82.29%   -0.27%     
==================================================
  Files                 408      408              
  Lines               31918    31920       +2     
  Branches             5090     5091       +1     
==================================================
- Hits                26349    26267      -82     
- Misses               4076     4164      +88     
+ Partials             1493     1489       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Looks good, feel free to return early instead, or leave :)

@@ -727,38 +727,42 @@ sub _nearby_json :Private {
# This is for the list template, this is a list on that page.
$c->stash->{page} = 'report';

my $dist = $self->_find_distance($c, $params);
$params->{distance} = $dist / 1000 unless $params->{distance}; # DB measures in km
if (my $dist = $self->_find_distance($c, $params)) { # distance of 0 means we can skip lookup entirely
Copy link
Member

Choose a reason for hiding this comment

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

Is fine, but could be done as an early return if not present, then don't need to indent everything further

Setting a `suggestions` value to 0 within the nearby_distances cobrand
feature disables the dupe suggestion feature for that group/category, eg:

COBRAND_FEATURES:
  nearby_distances:
    my_cobrand:
      suggestions:
        _fallback: 100
        Potholes: 0
@davea davea force-pushed the surrey-cobrand-category-disable-dupe-suggestions branch from 7fc9801 to e6931e7 Compare September 13, 2024 13:30
@davea davea merged commit e6931e7 into surrey-cobrand Sep 13, 2024
18 checks passed
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.

2 participants