Skip to content
Snippets Groups Projects

feat: add global query manager

Merged Adrian Orłów requested to merge feature/global-query-manager into development
1 unresolved thread

Objective:

As a user I would like to have ability to open map, zoom to some place and refresh page with seeing the same place as before. The same should work for someone else if I send them my link.

What has been done:

  • Added transferring query params data to redux store
  • Added transferring redux store data to query params with debounce time
  • Done improvements of map config management: utils has been divided into separate hooks (cleanup) and number of rerenders has been minimized (optimization)
  • Added map instance listeners in which there is a map position listener. In the future it will be also used for plugins and global event bus

What has been done additionally:

  • Done improvements of user map position management. Position has been divided into initial and last. Initial is used only on initialization of the map and last is constantly following a real used position in the map instance with debounce. Redux can’t handle large amounts of actions so this value is only a reference and can’t be exactly the same as the real one in the map instance, right now used only in the query manager.
  • Done improvements for initMapData action, in the new version it is handling also additional checks of model/background id existence Added latLngToPoint util which is an universal util for transforming lat/lng position to cartesian coordinates
  • BREAKING: middleware is no longer listening for initMapData action due to changes in use of getUpdatedMapData util - it is now used directly in the action so middleware is not needed.

Important information

  • There are a lot of test files lacking in the DRAFT version
  • This PR is very big. IMO amount of changes here are probably were too big than expected BUT its superb important to remember most of these changes are reusable: utils, middleware, data, event listeners - and so we would need implement them in the future

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 import { setMapData } from '@/redux/map/map.slice';
2 import { MapSize } from '@/redux/map/map.types';
3 import { AppDispatch } from '@/redux/store';
4 import { Point } from '@/types/map';
5 import { latLngToPoint } from '@/utils/map/latLngToPoint';
6 import { toLonLat } from 'ol/proj';
7 import { ObjectEvent } from 'openlayers';
8
9 /* prettier-ignore */
10 export const onMapPositionChange =
11 (mapSize: MapSize, mapPosition: Point, dispatch: AppDispatch) =>
  • Tadeusz Miesiąc
  • Tadeusz Miesiąc
  • Tadeusz Miesiąc
  • Tadeusz Miesiąc
  • Idea looks ok to me. We need to discuss structure of the map in the store and storing position - this is RFC from my side

  • Adrian Orłów added 1 commit

    added 1 commit

    • 1e12d9c1 - test: add global query manager tests

    Compare with previous version

  • Adrian Orłów added 1 commit

    added 1 commit

    • 087f0a7d - feat: extract set map position action from the set map data action

    Compare with previous version

  • Adrian Orłów added 9 commits

    added 9 commits

    • 087f0a7d...9515488f - 8 commits from branch development
    • 87ff1616 - Merge remote-tracking branch 'origin/development' into feature/global-query-manager

    Compare with previous version

  • Tadeusz Miesiąc approved this merge request

    approved this merge request

  • Adrian Orłów marked this merge request as ready

    marked this merge request as ready

  • Adrian Orłów mentioned in commit 8260206f

    mentioned in commit 8260206f

  • merged

  • Adrian Orłów mentioned in merge request !146 (merged)

    mentioned in merge request !146 (merged)

  • Please register or sign in to reply
    Loading