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

Replace legacy Mapbox component for Scrollytelling #992

Merged
merged 19 commits into from
Jun 14, 2024

Conversation

dzole0311
Copy link
Collaborator

@dzole0311 dzole0311 commented Jun 7, 2024

Related Ticket: 967

Description of Changes

This PR replaces the old Map component with the new Map component for the Scrollytelling block: https://deploy-preview-992--veda-ui.netlify.app/stories/air-quality-and-covid-19

Changes:

  1. Re-factored the Scrollytelling block component to work with the new Map and the <Layer /> components
  2. Deprecated useAsyncLayers in favor of using useReconcileWithStacMetadata
  3. Removed obsolete code and adjusted some of the types (ie. TimelineDatasetStatus became DatasetStatus as I feel we could keep this more generic, added aliases)

Notes & Questions About Changes

Validation / Testing

{Update with info on what can be manually validated in the Deploy Preview link for example "Validate style updates to selection modal do NOT affect cards"}

Copy link

netlify bot commented Jun 7, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit fd66207
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/666c545b3813190008df9d3f
😎 Deploy Preview https://deploy-preview-992--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dzole0311 dzole0311 marked this pull request as draft June 7, 2024 11:58
@dzole0311 dzole0311 changed the title WIP (pre-cleanup) - Replace legacy Mapbox component for Scrollytelling WIP - Replace legacy Mapbox component for Scrollytelling Jun 7, 2024
@dzole0311 dzole0311 changed the title WIP - Replace legacy Mapbox component for Scrollytelling Replace legacy Mapbox component for Scrollytelling Jun 10, 2024
@dzole0311 dzole0311 marked this pull request as ready for review June 10, 2024 13:29
skipCompare?: boolean;
}

export const useAsyncLayers = (referencedLayers: ReferencedLayer[]) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👏

[uniqueChapterLayers, asyncLayers]
);
const resolvedLayers = resolvedDatasetsWithStac.map((layer, index) => {
if (layer.status !== DatasetStatus.SUCCESS) return null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ : Curious to know if you had a reason to why you got rid of memoization here, if there are no benefits, can probably get rid of it in line 200 as well?

Copy link
Collaborator Author

@dzole0311 dzole0311 Jun 14, 2024

Choose a reason for hiding this comment

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

Good call, I intended to remove the caching only as I think was obsolete together with the useMemo, but looking at it again I think it's better to keep the memo part.

Updated.

@dzole0311 dzole0311 merged commit abba986 into main Jun 14, 2024
8 checks passed
@dzole0311 dzole0311 deleted the 967-replace-old-map-comp-in-scrollymap branch June 14, 2024 15:07
sandrahoang686 added a commit that referenced this pull request Jun 17, 2024
## What's Changed
Bump minor version as part of release cycle

## 🎉 Features
- Port the upgraded catalog view in the E&A dataset selector modal
#989

## 🚀 Improvements
- Replace legacy Mapbox component for Scrollytelling
#992
- Add Vizdataset type #993

## 🐛 Fixes
🦗
function Scrollytelling(props) {
const { children } = props;

const { isHeaderHidden, headerHeight, wrapperHeight } =
useSlidingStickyHeaderProps();

const mapContainer = useRef<HTMLDivElement>(null);
const mapRef = useRef<MapboxMap>(null);
const mapRef = useRef<MapRef>(null);
Copy link
Collaborator

Choose a reason for hiding this comment

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

My apologies that I am catching this error late, but I just noticed that the new scrolly-telling block could not perform setProjection - I thought it was just a type error as commented (https://github.com/NASA-IMPACT/veda-ui/pull/992/files#diff-af7791d70ec6eacf00bc029b1e7b44b287a9d2c6cc737a56acd4d1b20cda8f1cR306-R307), but mapRef actually is missing set projection method. I am not sure why, but flagging this issue first.

hanbyul-here added a commit that referenced this pull request Jun 25, 2024
**Related Ticket:** #1007 

### Description of Changes
- Fix projection change bug introduced by
#992

### Notes & Questions About Changes


### Validation / Testing
Check projection change on Sandbox Scrollytelling page:
https://deploy-preview-1011--veda-ui.netlify.app/sandbox/mdx-scrolly
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