Canadian-Geospatial-Platform / app.geo.ca

The Geocore application found at app.geo.ca is an open source react application created to explore the geocore geospatial library. | L'application Geocore disponible sur app.geo.ca est une application de réaction open source créée pour explorer la bibliothèque géospatiale geocore.
https://canadian-geospatial-platform.github.io/app.geo.ca/
Other
1 stars 8 forks source link

Ravi/dashboard 1 #28

Closed raviinder closed 1 day ago

raviinder commented 1 year ago

Code to add

  1. user Dashboard code
  2. Add User Saved Searches.
  3. Delete User Saved Searches.
  4. Add User Saved Records.
  5. Delete User Saved Records.
johnweng001 commented 1 year ago

Here is some comments:

  1. Line 16 in dashboard.ts, switch(+dc), + is not necessary for enum
  2. Duplicate api calls is observed when dashboard component is first time rendered. The reason is both userID and language changes triggered. As a workaround, the language can be moved outside the component an pass in thru props (from dashboard-panel). Or we can use locale context (but I don't see context used in general app). So we don't need two useEffect hooks.
  3. In dashboard component, the function inside useEffect (both getAnnouncement and getCommunityAndSavedRecords) has dependency in both userID and language. In that sense, the function itself should be in the useEffect dependency list as well. That means, the function needs to be wrapped in useCallback. (this is recommended by eslint rule: react-hooks/exhaustive-deps)
jvanulde commented 1 year ago

We should list the issues that this PR addresses. You can select them in the right column in the Development panel.