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

chore: Move basemap and selectedbasemap to redux #294

Merged

Conversation

unclFedor
Copy link
Collaborator

No description provided.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-294.d3nof3l3x2sso4.amplifyapp.com

@unclFedor
Copy link
Collaborator Author

Test cases execution result:

Test Suites: 105 passed, 105 total
Tests: 488 passed, 488 total
Snapshots: 0 total
Time: 45.518 s
Ran all test suites.
warning ../package.json: No license field
$ jest --testPathPattern=e2e.*.spec.ts$ --collectCoverage=false
Determining test suites to run...warning ../package.json: No license field
PASS src/pages/dashboard/e2e.dashboard.spec.ts (63.516 s)
PASS src/pages/comparison/e2e.comparison.spec.ts (57.296 s)
PASS src/pages/debug-app/e2e.debug-app.spec.ts (32.774 s)
PASS src/pages/viewer-app/e2e.viewer-app.spec.ts (25.17 s)

Test Suites: 4 passed, 4 total
Tests: 1 skipped, 83 passed, 84 total
Snapshots: 0 total
Time: 179.717 s, estimated 185 s
Ran all test suites matching /e2e.*.spec.ts$/i.
Done in 236.16s.

src/redux/store.ts Outdated Show resolved Hide resolved
src/redux/slices/base-maps-slice.ts Outdated Show resolved Hide resolved
src/redux/slices/base-maps-slice.ts Outdated Show resolved Hide resolved
src/components/layers-panel/layers-panel.spec.tsx Outdated Show resolved Hide resolved
src/components/layers-panel/map-options-panel.spec.tsx Outdated Show resolved Hide resolved
src/redux/slices/base-maps-slice.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@maxkuznetsov-actionengine maxkuznetsov-actionengine left a comment

Choose a reason for hiding this comment

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

Looks good to me

Comment on lines 136 to 137
const selectedBaseMapId = useAppSelector(selectSelectedBaseMapId);
const selectedBaseMap = baseMaps.find((map) => map.id === selectedBaseMapId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could select necessary values in DeckGlWrapper as it already depens on Redux

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  1. Removed props and selectors from comparison-side.tsx, debug-app.tsx, viewer-app.tsx:
    const baseMaps = useAppSelector(selectBaseMaps);
    const selectedBaseMapId = useAppSelector(selectSelectedBaseMapId);
    const selectedBaseMap = baseMaps.find((map) => map.id === selectedBaseMapId);
    ...
    showTerrain={selectedBaseMap?.id === "Terrain"}
    mapStyle={selectedBaseMap?.mapUrl}
  2. Added selectors to the deck-gl-wrapper.tsx:
    const baseMaps = useAppSelector(selectBaseMaps);
    const selectedBaseMapId = useAppSelector(selectSelectedBaseMapId);
    const selectedBaseMap = baseMaps.find((map) => map.id === selectedBaseMapId);
    const showTerrain=selectedBaseMap?.id === "Terrain";
    const mapStyle=selectedBaseMap?.mapUrl;
  3. Fixed 2 tests in the deck-gl-wrapper.spec.tsx

@maxkuznetsov-actionengine maxkuznetsov-actionengine merged commit d3475c6 into visgl:master Aug 16, 2023
3 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
Development

Successfully merging this pull request may close these issues.

3 participants