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

Sort featured stories based on publication date in descending order #907

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

sandesh-sp
Copy link
Contributor

@sandesh-sp sandesh-sp commented Mar 29, 2024

Description of Changes

Sorted the featuredItems on function FeaturedSliderSection based on their publication date so that featured stories are ordered from most recent to oldest

Issue

Closes #894

@sandesh-sp sandesh-sp linked an issue Mar 29, 2024 that may be closed by this pull request
Copy link

netlify bot commented Mar 29, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit ffeee5e
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/660df705e3c27f0007b847bb
😎 Deploy Preview https://deploy-preview-907--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.

@sandesh-sp sandesh-sp requested review from j08lue and slesaad March 29, 2024 19:19
@j08lue j08lue requested review from hanbyul-here and removed request for j08lue and slesaad April 2, 2024 08:48
@sandesh-sp
Copy link
Contributor Author

Thank you for the clarification @hanbyul-here. I will keep this is mind while making future changes.

After passing the new sortedFeaturedItems array, bunch of type mismatch errors got introduced on ts-check. I believe this is because not all properties of StoryData is present on DatasetData. But, I am unsure why these errors are only there when using sortedFeaturedItems. Shouldn't sortedFeaturedItems has similar properties as featuredItems?

Error: app/scripts/components/common/featured-slider-section.tsx(109,33): error TS2339: Property 'asLink' does not exist on type 'StoryData | DatasetData'. Property 'asLink' does not exist on type 'DatasetData'. Error: app/scripts/components/common/featured-slider-section.tsx([10](https://github.com/NASA-IMPACT/veda-ui/actions/runs/8527131627/job/23357882763?pr=907#step:6:11)9,60): error TS2345: Argument of type 'StoryData | DatasetData' is not assignable to parameter of type '(string | StoryData) & (string | DatasetData)'. Type 'StoryData' is not assignable to type '(string | StoryData) & (string | DatasetData)'. Type 'StoryData' is not assignable to type 'StoryData & DatasetData'. Property 'layers' is missing in type 'StoryData' but required in type 'DatasetData'. Error: app/scripts/components/common/featured-slider-section.tsx([11](https://github.com/NASA-IMPACT/veda-ui/actions/runs/8527131627/job/23357882763?pr=907#step:6:12)4,52): error TS2322: Type 'StoryData | DatasetData' is not assignable to type 'DatasetData'. Type 'StoryData' is not assignable to type 'DatasetData'. Error: app/scripts/components/common/featured-slider-section.tsx(141,42): error TS2322: Type 'StoryData | DatasetData' is not assignable to type 'DatasetData'. Property 'layers' is missing in type 'StoryData' but required in type 'DatasetData'. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Process completed with exit code 2.

Copy link
Collaborator

@hanbyul-here hanbyul-here left a comment

Choose a reason for hiding this comment

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

TS error was mainly because TS is confused if sorted array is a mix of StoryData and DatasetData or not. Thanks for picking up the issue.

@j08lue j08lue merged commit d8950b9 into main Apr 4, 2024
8 checks passed
@j08lue j08lue deleted the sort-featured-stories-by-date-published branch April 4, 2024 07:33
hanbyul-here added a commit that referenced this pull request May 1, 2024
## 🎉 Features
- Zoom in AOI, TOI when analysis is run in
#906
- Add custom javascript injection
#846
- ADR for V2 Refactor: #875
- Open all external links in a new tab in
#870
- Include dataset id to filter layers in
#910
- Some datasets can only be analyzed with layers from the same source in
#913
- Create minimal partial data layer scaffold starting off with Data
Catalog for VEDA2 Refactor in
#893
- Add analysis preset in #921

## 🚀 Improvements
- Chart style improvement in
#903
- Data Catalog enhancement with floating filter sidebar in
#918
- Sum as statistics option in
#925
-
## 🐛 Fixes
- Sort featured stories based on publication date in descending order in
#907
- Replace latency with temporalResolution in layer info in
#898
- Add a workaround for Safari scroll problem in
#909
- Handle empty result in #922
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.

Sort featured stories based on publication date
3 participants