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

[INV-3685][INV-3732][INV-3678] Show Map Markers with Cached Recordsets, hide default recordsets from caching #3738

Merged
merged 33 commits into from
Dec 12, 2024

Conversation

LocalNewsTV
Copy link
Collaborator

@LocalNewsTV LocalNewsTV commented Dec 11, 2024

Overview

This PR includes the following proposed change(s):

[INV-3685]

  • Cached recordsets now show on Map when user is offline, Label functionality also enabled

    • Cached Recordsets now contain GeoJSON column on iOS
    • cachedMetadata (redux state) now holds a persisted FeatureCollection object to avoid costly recalculations of filtering the local db to recreate layers
  • When using Offline User Force them into offline mode

    • Previously offline users couldn't have the correct map context, and map layers would not render, this starts to bridge that gap.
    • Forcing user offline lets us access greater map context, and skips a bunch of unauthorized API calls.
    • Map.tsx modified to differentiate between an authenticated user from a loggedIn user.
  • Added functionality to strip layers off the map when going from online -> offline context to populate Caches

  • Reworked recordset-layers.tsx to be more DRY by turning layer declarations into modifiable functions, promoting reusability

    • Lifted some lambda functions into their own, for re use
  • Closes Mobile: Cached recordsets not visible on map #3685

[INV-3732][INV-3678] Disable Default Recordsets from being eligible for Caching

Misc

  • Add Refresh button to the error page (mobile users had to Force restart the app or clear their cache. Refresh was not an option)
  • Cleaned up several SonarCloud highlighted code smells
    • Things like using forEach instead of map, simplifying logic flows

@LocalNewsTV LocalNewsTV marked this pull request as ready for review December 11, 2024 21:49
@@ -51,7 +52,7 @@ export const Map = ({ children }) => {

const [draw, setDraw] = useState(null);
const [mapReady, setMapReady] = useState(false);

const [loggedIn, setLoggedIn] = useState<boolean>(false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we put this in the redux store -- something like loggedInOrWorkingOffline. We probably use this in multiple places.

@LocalNewsTV LocalNewsTV force-pushed the 3685-offline-map-recordset-markers-2 branch from 51d3a2f to 0969b13 Compare December 12, 2024 16:27
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@plasticviking plasticviking merged commit 72386cc into dev Dec 12, 2024
5 of 9 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
2 participants