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

response to multiple section selections is inconsistent #77

Open
glw opened this issue Sep 22, 2021 · 7 comments
Open

response to multiple section selections is inconsistent #77

glw opened this issue Sep 22, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@glw
Copy link
Member

glw commented Sep 22, 2021

When selecting multiple "sections" results to not match actual sections clicked.

When selecting a "section" in area 22 (RED) a section in area 23 is highlighted (result in GREEN)
image

@glw glw added the bug Something isn't working label Sep 22, 2021
@smcalilly smcalilly self-assigned this May 23, 2023
@smcalilly
Copy link
Contributor

smcalilly commented May 25, 2023

this happens when two sections have the same number but exist in a different area, range, or township. right now, the javascript and haystack facets don't connect a section with an area, so it'll just treat the duplicate section number as the only one.

for example, here are two tooltips for two separate sections:
Image

Image

they have the same section number but are in different ranges. you can see the section in the second image isn't highlighted.

this might be a tricky bug to solve because the facets in the query string also don't have knowledge of the section/area relationship (and it looks like the query string is used to highlight the sections on the map). i don't think haystack has knowledge of this either.

there are a couple of things we need to do to fix this:

  • hook into django haystack facets to create a relationship between section and area (and maybe range and township?)
  • rework the javascript logic to work with that dependency

if only we could send some dictionary-like key/value pair through the query string. maybe like:

  • section_exact:31__area_exact:24__township_exact:37__range_exact:13
  • section_exact:31__area_exact:22__township_exact:11__range_exact:8

and then parse that on the backend to facet. and then when the page reloads, use the query params to highlight the correct geojson features (this page reload bit is how the js currently works).

@smcalilly
Copy link
Contributor

@fgregg can you take a look at my above comment and let me know if you have any good ideas to solve this?

@fgregg
Copy link
Collaborator

fgregg commented Jun 27, 2023

what about simply renaming sections to be like {township}-{range}-{section}.

if we felt like the longer names messed up the UI, we could process them to only show the section bit in the ui

@smcalilly
Copy link
Contributor

@fgregg that's a good idea. would we need to rename these sections in the database, or just rename them on the fly? i'm leaning toward the first option, which would require us to change the data in the database and then reindex, then figure out how to work with them in the searching / UI.

@fgregg
Copy link
Collaborator

fgregg commented Jul 6, 2023

yeah, it think renaming them in the db.

@smcalilly
Copy link
Contributor

@fgregg actually, I don't think we can rename the sections like that because the sections field are an IntegerRangeField type.

Since a section can be a range of integers, I'm not sure how we can create a range of concatenated {township}-{range}-{section} sections.

There might be a way to solve all of this in the javascript logic for the map but not sure yet — I'm still figuring out the code so I'll let you know.

@smcalilly
Copy link
Contributor

smcalilly commented Aug 15, 2023

@smcalilly double check this isn't a bug with the list view.

potential solution: limit the ability to search / enforce requirements. @jim-z to think more about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants