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

Fix number of asset changing confusions #3157

Merged
merged 4 commits into from Aug 24, 2020
Merged

Conversation

dracos
Copy link
Member

@dracos dracos commented Aug 18, 2020

To see these issues on live, go to https://report.peterborough.gov.uk/report/new?longitude=-0.247059&latitude=52.556479 - click middle of St Margarets Road then select Street Lighting, then Trees, then Street Lighting, then Trees. You'll see there are now two green pins (fixed by 80d47db and 919cb2b) and it says "You can pick a light from the map" (fixed by 4b659c6).

Then click a different tree asset (up to the left there are plenty) and change category to Street lighting, you'll see there are now two selected assets (fixed by 2f7ce01).

Fixes https://github.com/mysociety/fixmystreet-commercial/issues/1888

@dracos dracos requested a review from davea August 18, 2020 10:45
@codecov
Copy link

codecov bot commented Aug 18, 2020

Codecov Report

Merging #3157 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3157   +/-   ##
=======================================
  Coverage   83.55%   83.55%           
=======================================
  Files         250      250           
  Lines       15722    15722           
  Branches     2939     2939           
=======================================
  Hits        13137    13137           
  Misses       1652     1652           
  Partials      933      933           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5430338...51252c8. Read the comment docs.

Copy link
Member

@davea davea left a comment

Choose a reason for hiding this comment

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

💡 🌳 ✅

If multiple layers are being shown (e.g. Peterborough trees) then the
number of visible layers could go 1 -> 2 -> 3 -> 2, and this code would
get confused and reshow the marker pin even though an asset had been
selected.
If a new asset layer is shown before an old one is removed, the removal
could cause the newly selected asset to be unselected, leaving visibly
an asset selected but nothing recorded as being selected behind the
scenes.
Otherwise, if you switch category and the new asset layer is added
before the old is removed, the old (still visible) layer asset found
would fire but change the meta message of the new layer.
@dracos dracos merged commit 51252c8 into master Aug 24, 2020
@github-pages github-pages bot temporarily deployed to github-pages August 24, 2020 12:42 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.

None yet

2 participants