community-platform
community-platform copied to clipboard
feat: load map pins from API endpoint
PR Checklist
- [ ] - Commit messages are descriptive, it will be used in our Release Notes
PR Type
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Developer experience (improves developer workflows for contributing to the project)
Description
What this PR does
Git Issues
Closes #
Screenshots/Videos
If useful, provide screenshot or capture to highlight main changes
What happens next?
Thanks for the contribution! We try to make sure all PRs are reviewed ahead of our monthly maintainers call (first Monday of the month)
If the PR is working as intended it'll be merged and included in the next platform release, if not changes will be requested and re-reviewed once updated.
If you need more immediate feedback you can try reaching out on Discord in the Community Platform development
channel.
1 flaky test on run #5500 ↗︎
![]() |
![]() |
![]() |
![]() |
![]() |
Details:
test: remove high level tests in favour of unit tests | |||
Project: onearmy-community-platform | Commit: 481ebf89e7 |
||
Status: Passed | Duration: 04:19 💡 | ||
Started: May 5, 2024 8:43 PM | Ended: May 5, 2024 8:47 PM |
src/integration/profile.spec.ts • 1 flaky test • ci-chrome
Test | Artifacts | |
---|---|---|
[Profile] > [By User] > [Can contact profiles by default] |
Test Replay
Screenshots
Video
|
Review all test suite changes for PR #3480 ↗︎
We can improve the Maps
component logic if we simply use the url hash to manage the loaded pin state (we already do it on showPinFromURL
).
MapView
would navigate to the hash when a pin is clicked, and not export onPinClicked
anymore.
Just to make sure... the pin list we get from the API doesn't have all the info, so we need to load them individually on click?
@mariojsnunes we are currently loading the map pin details from the user profile https://github.com/ONEARMY/community-platform/blob/156674420491c15f70d000ee9d5ea9a239bb0f44/src/stores/Maps/maps.store.ts#L142
Historically we used to store the information on the map pin under the detail
property but at some point we dropped that in favour of having a single source of truth.
We can improve the
Maps
component logic if we simply use the url hash to manage the loaded pin state (we already do it onshowPinFromURL
).MapView
would navigate to the hash when a pin is clicked, and not exportonPinClicked
anymore.
I've done some refactoring here so that we now use the onPinClicked
method for mutating state. As a result the only component that knows we are using the location.hash to manage state is Maps
. The aim of this change was to simplify MapView and centralise state in one place.
Generally across the application we use MobX or React for state management so we should aim to isolate deviation from this pattern (here it was using window.location
) to a single component (Maps.tsx) in an effort to reduce maintenance costs. Before location.hash
introduced non-obvious coupling between the two components.
Codecov Report
Attention: Patch coverage is 75.55556%
with 22 lines
in your changes are missing coverage. Please review.
Project coverage is 66.80%. Comparing base (
4363d69
) to head (481ebf8
).
Additional details and impacted files
@@ Coverage Diff @@
## master #3480 +/- ##
==========================================
+ Coverage 66.65% 66.80% +0.15%
==========================================
Files 427 428 +1
Lines 13466 13513 +47
Branches 2431 2437 +6
==========================================
+ Hits 8976 9028 +52
+ Misses 4444 4439 -5
Partials 46 46
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Visit the preview URL for this PR (updated for commit 481ebf8):
https://onearmy-next--pr3480-feat-load-mappins-fr-fyvrmw26.web.app
(expires Fri, 07 Jun 2024 13:26:19 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: 6d65e4f8fee2f6ab2da0c1c3b85b8797d66afa59
:tada: This PR is included in version 1.177.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 1.179.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: