LF-4672 (1) - Rtk upgrade/locations rebase#4083
LF-4672 (1) - Rtk upgrade/locations rebase#4083Duncan-Brain wants to merge 84 commits intointegrationfrom
Conversation
…ter by...mirror in external locations to keep typescript errors away and add better typings
…t plans to rtk query
…include deleted locations
…ated prio in the fetch all saga, added to tasks grouping as it is needed for tasks
| filterSettings, | ||
| onFilterMenuClick, | ||
| onAddMenuClick, | ||
| availableFilterSettings = { |
There was a problem hiding this comment.
This was a duplicated part of a selector migration, also locationEnum should be phased out for typescript versions.
| icon: () => <Sensor style={{ transform: 'translate(-5px, 5px)' }} />, | ||
| key: locationEnum.sensor, | ||
| }, | ||
| { |
There was a problem hiding this comment.
Part of the sensors vs sensor array being filtered separately discussion with Loic.
| }), | ||
| })); | ||
|
|
||
| export default function LoadingMapModal({ isOpen }: { isOpen: boolean }) { |
There was a problem hiding this comment.
This temporary component will be deleted with part 2 where I implement Loic's loading design.
| ) | ||
| </> | ||
| )} | ||
| {isLocationsFetching && <LoadingMapModal isOpen={isLocationsFetching} />} |
There was a problem hiding this comment.
The desired behaviour for me is that this should be isLocationsLoading - block render if current data does not exist. And then isLocationsFetching is used to refresh/redraw the data if it changes.
There is a variety of rendering issues with this component that make this hard to implement right now. The old way the selector updates were instantaneous and now we wait for a round trip back from invalidating tags.
I tried a method similar to the method recently removed when redraw was needed here: 9944bf8 As noted in that PR we will need something like that again when we start adding locations in the new add location redesign. But this is a good compromise until that time.
There is a too many re-rendering problem with this component and I think if we can solve that in the future this component will look much simpler. But lets also wait until we update our drawing library.
| export const barnSelector = (location_id) => | ||
| createSelector(barnEntitiesSelector, (entities) => entities[location_id]); | ||
|
|
||
| export const barnStatusSelector = createSelector( |
There was a problem hiding this comment.
These are unused
Description
This is phase 1 of 3 of locations migration away from sagas to rtk-query.
Major changes:
Review Notes:
/Mapso that is why it is not top levelOther notes
refetchof sensors on/HomeisFetching blocker prevents case where data does not exist -- also it didn't work for me on integration.Jira link: LF-4672
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
pnpm i18nto help with this)