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

fix duplicated links OGC API #1134

Merged
merged 3 commits into from
Feb 27, 2025
Merged

Conversation

Guillaume-d-o
Copy link
Collaborator

@Guillaume-d-o Guillaume-d-o commented Feb 26, 2025

Description

This PR is about a bug encontred at MEL. The OGC and WFS links where duplicated because the OGC api does not have a name property linkd to the dataset. So to avoid this, in both OGCApi and WFS services, i reset the collection name. Now both OGC and WFS collection will have the same name, and the duplication remover works.

Architectural changes

The following library now depends on [...]

Screenshots

[...]

Quality Assurance Checklist

  • Commit history is devoid of any merge commits and readable to facilitate reviews
  • If new logic ⚙️ is introduced: unit tests were added
  • If new user stories 🤏 are introduced: E2E tests were added
  • If new UI components 🕹️ are introduced: corresponding stories in Storybook were created
  • If breaking changes 🪚 are introduced: add the breaking change label
  • If bugs 🐞 are fixed: add the backport <release branch> label
  • The documentation website 📚 has received the love it deserves

Copy link
Contributor

github-actions bot commented Feb 26, 2025

Affected libs: feature-dataviz,
Affected apps: datahub,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

Copy link
Contributor

github-actions bot commented Feb 26, 2025

📷 Screenshots are here!

@coveralls
Copy link

coveralls commented Feb 26, 2025

Coverage Status

coverage: 83.899% (-0.9%) from 84.811%
when pulling c321646 on GSMEL-680-OGC-API-links-duplicated
into b51c2cb on main.

@jahow jahow changed the title GSMEL-680-fix duplicated links OGC API fix duplicated links OGC API Feb 26, 2025
Copy link
Member

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Thank you! I added a few comments, I think we're using the wrong field from the collection info. Let me know what you think

@@ -187,6 +188,7 @@ export class DataService {
return Object.keys(collectionInfo.bulkDownloadLinks).map((downloadLink) => {
return {
...ogcApiLink,
name: collectionInfo.title,
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't you need to use id here? I think title is the human readable label, so it won't match with the WFS feature type

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed to id, both works

Comment on lines 76 to 87
getDownloadUrlsFromOgcApi = jest.fn((url: string) =>
url.indexOf('error') > -1
? Promise.reject(new Error('ogc.unreachable.unknown'))
: Promise.resolve({
name: 'collection1',
title: 'Collection 1',
bulkDownloadLinks: {
'application/geo+json': 'http://example.com/collection1.geojson',
'application/json': 'http://example.com/collection1.json',
},
})
)
Copy link
Member

Choose a reason for hiding this comment

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

Why did you need to add this change to the test? Is this an improvement to the existing test or was thee a failure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i make the mock in the wrong test and i forgot to delete I think. The goal is to see the forcing of the collection name... in the data service spec not this one.

Copy link
Member

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Thank you! it works :)

@Guillaume-d-o Guillaume-d-o merged commit bd37f68 into main Feb 27, 2025
12 of 14 checks passed
@Guillaume-d-o Guillaume-d-o deleted the GSMEL-680-OGC-API-links-duplicated branch February 27, 2025 12:40
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