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

Allow cobrands to customise nearby lookup distances for duplicates #4456

Merged
merged 1 commit into from
May 23, 2023

Conversation

davea
Copy link
Member

@davea davea commented May 22, 2023

For UK councils this is picked up from cobrand feature config.

For FD-2997.

@davea davea requested a review from chrismytton May 22, 2023 20:04
@davea davea force-pushed the duplicate-distance-cobrand-feature branch 2 times, most recently from f65a1b2 to 3e0576a Compare May 22, 2023 20:06
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #4456 (3e0576a) into master (542178e) will decrease coverage by 0.01%.
The diff coverage is 80.00%.

❗ Current head 3e0576a differs from pull request most recent head 854323a. Consider uploading reports for the commit 854323a to get more accurate results

@@            Coverage Diff             @@
##           master    #4456      +/-   ##
==========================================
- Coverage   82.20%   82.19%   -0.01%     
==========================================
  Files         365      365              
  Lines       27647    27653       +6     
  Branches     4293     4294       +1     
==========================================
+ Hits        22727    22730       +3     
- Misses       3630     3633       +3     
  Partials     1290     1290              
Impacted Files Coverage Δ
perllib/FixMyStreet/Cobrand/Default.pm 88.58% <0.00%> (-0.25%) ⬇️
web/js/duplicates.js 61.85% <50.00%> (ø)
perllib/FixMyStreet/App/Controller/Report.pm 89.58% <100.00%> (+0.36%) ⬆️
perllib/FixMyStreet/Cobrand/UKCouncils.pm 92.95% <100.00%> (+0.04%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Member

@chrismytton chrismytton 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! Bonus points for remembering to update the config page HTML 🥇

@@ -679,10 +679,14 @@ sub _nearby_json :Private {
$c->stash->{page} = 'report';

# distance in metres
my $dist = $c->get_param('distance') || '';
my $dist;
if (my $mode = $c->get_param('mode')) {
Copy link
Member

Choose a reason for hiding this comment

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

Given there are two different endpoints for the two different modes, can we set 'mode' in the controllers that then call _nearby_json rather than a query parameter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Suppose we could, but there's currently nothing inspector- or suggestions-specific about the behaviour of the two different paths. I think I'd prefer to leave them as-is with the intention of each call made explicit rather than adding some subtle difference in behaviour of two very similarly named things that'd trip somebody up in the future (most likely me!)

For UK councils this is picked up from cobrand feature config.

For FD-2997.
@davea davea force-pushed the duplicate-distance-cobrand-feature branch from 3e0576a to 854323a Compare May 23, 2023 10:19
@davea davea merged commit 854323a into master May 23, 2023
@davea davea temporarily deployed to github-pages May 23, 2023 10:26 — with GitHub Pages Inactive
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.

3 participants