-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Refresh Warning After Saving Polygon (Geospatial) #34842
Conversation
@zandre-eng Would you mind explaining this part a bit more, please?
What do you mean with "the one given in initialPageData"? I would've thought we push all the saved polygons in initialPageData? |
@Charl1996 We send the list of saved polygons here which then gets loaded into the template here. After changing report filters or loading the page, we fetch the list of saved polygons from Since But talking through this, I'm wondering if this can actually be changed slightly so that we only fetch from |
@zandre-eng Thanks for the explanation. Also, your idea sounds like a good thing to explore. |
@Charl1996 Unfortunately, it seems this doesn't work. When reapplying the case filters we lose the KO binding and so the existing list of saved polygons is lost as well and we have to retrieve the list again from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change seems good to me
Product Description
An info banner is shown on the page when the user saves a new polygon, requesting a page refresh:
Technical Summary
Link to ticket here.
After saving a new polygon in the UI, an info banner will be shown asking the user to refresh the page. Currently, when a user saves a new polygon and applies new report filters, we fetch and replace the list of saved polygons with the one given in
initialPageData
. This becomes outdated after saving a new polygon sinceinitialPageData
is only loaded on page load, and not when report filters are changed. Getting the user to refresh the page ensures that the latest list of saved polygons can be retrieved from the back-end.As an alternative, I looked into using the
select2
component to fetch the latest list of saved polygons on demand. This would avoid requiring a refresh, however it will end up making the code more complex. This is because we also store and keep track of unsaved polygons drawn on the map, so that they can be added back to the map on a page refresh. Fetching saved polygons on demand using aselect2
widget would mean keeping track of two arrays, one for saved polygons and one for unsaved polygons.Feature Flag
GEOSPATIAL
Safety Assurance
Safety story
This change will only affect domains that have the Geospatial feature flag enabled.
Automated test coverage
N/A as changes are mostly limited to HTML templates.
QA Plan
No QA planned.
Rollback instructions
Labels & Review