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] : Handle non geospatial ogc services #889

Merged
merged 10 commits into from
Jun 6, 2024

Conversation

cmoinier
Copy link
Collaborator

@cmoinier cmoinier commented May 29, 2024

Description

This PR fixes a bug found in MEL datahub, where the OGC API services that are non geospatial were wrongfully displayed on the map component.
In this PR, we test if one of the features of the service has or not a geometry. Depending on that, if it's the only service, the map will or will not be displayed. If there are other services viewable in the map, the OGC service will be removed from the dropdown list if not geospatial.

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

This work is sponsored by MEL.

Copy link
Contributor

github-actions bot commented May 29, 2024

Affected libs: common-fixtures, api-metadata-converter, feature-editor, feature-search, feature-router, feature-map, feature-dataviz, feature-record, api-repository, feature-catalog, feature-auth, ui-search, ui-elements, feature-notifications, ui-catalog, util-shared, ui-widgets, ui-inputs, ui-layout, ui-map,
Affected apps: datahub, metadata-converter, metadata-editor, demo, webcomponents, map-viewer, search, datafeeder,

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

Copy link
Contributor

github-actions bot commented May 29, 2024

📷 Screenshots are here!

@coveralls
Copy link

coveralls commented May 29, 2024

Coverage Status

coverage: 83.29% (-1.0%) from 84.292%
when pulling d89a1b0 on handle-non-geospatial-ogc-services
into cd1164a on main.

Copy link
Collaborator

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Thanks, @cmoinier, this works really well! I'm just noticing that the map tab is still clickable when there is a problem with the OGC API calls. This can easily be reproduced in dev by not using a CORS plugin in the browser. It's not directly related to this PR as it also causes an uncaught error on main I think. I propose to take a look if you can solve it here, and otherwise we'll solve it in a separate PR. Note there is GSMEL-542 that seems related.

@cmoinier cmoinier force-pushed the handle-non-geospatial-ogc-services branch from ab83987 to 8a57ff9 Compare May 31, 2024 09:44
Copy link
Collaborator

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Thanks for the additional fix @cmoinier, which works well on my side!

Do you think you could reflect your changes for this in the unit tests of the map-utils.service.ts, data.service.ts and mdview.facade.ts by adapting fixtures for the fixed case and adding tests for new methods?

@cmoinier cmoinier force-pushed the handle-non-geospatial-ogc-services branch from b5f3a28 to 28e7a73 Compare June 5, 2024 13:44
@cmoinier cmoinier force-pushed the handle-non-geospatial-ogc-services branch from 28e7a73 to d89a1b0 Compare June 5, 2024 13:46
Copy link
Collaborator

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the added tests and the falsy start 🤩

@cmoinier cmoinier merged commit aef4372 into main Jun 6, 2024
9 checks passed
@cmoinier cmoinier deleted the handle-non-geospatial-ogc-services branch June 6, 2024 07:20
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