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

Editor: Service as resource layer suggestion #1114

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

AlitaBernachot
Copy link
Collaborator

@AlitaBernachot AlitaBernachot commented Feb 10, 2025

Description

This PR improves the service as resource form by adding layer suggestion as a dropdown list.
OGC, WMS,WMTS, WFS are supported. For other protocol, a simple input text is displayed in place of the dropdown.

You can find some services here: https://camptocamp.github.io/ogc-client/#/ or https://geoservices.ign.fr/documentation/services/services-geoplateforme/diffusion#70064

Architectural changes

None

Screenshots

image

image

image

Also added a use case: custom validate icon in storybook for url-input-component

image

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

@AlitaBernachot AlitaBernachot changed the title Editor: Service layer suggestion Editor: Service as resource layer suggestion Feb 10, 2025
Copy link
Contributor

github-actions bot commented Feb 10, 2025

Affected libs: feature-editor,
Affected apps: metadata-editor,

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

Copy link
Contributor

github-actions bot commented Feb 10, 2025

📷 Screenshots are here!

@AlitaBernachot AlitaBernachot force-pushed the service-layer-suggestion branch 5 times, most recently from 10ad151 to 86a745a Compare February 10, 2025 13:27
Copy link
Collaborator

@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! Made a few comments to hopefully help you improve the PR, let me know when you need another look, thanks!

libs/ui/inputs/src/lib/url-input/url-input.component.ts Outdated Show resolved Hide resolved
libs/util/shared/src/lib/links/link-utils.model.ts Outdated Show resolved Hide resolved
libs/util/shared/src/lib/links/link-utils.ts Outdated Show resolved Hide resolved
Comment on lines 51 to 61
function wmsLayerFlatten(layerFull) {
const layer = {
title: layerFull.title,
name: layerFull.name,
abstract: layerFull.abstract,
}

return 'children' in layerFull && Array.isArray(layerFull.children)
? [layer, ...layerFull.children.flatMap(wmsLayerFlatten)]
: [layer]
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

One day it'd be great to have this in ogc-client, but this can wait 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New PR in ogc-client: camptocamp/ogc-client#89

@AlitaBernachot AlitaBernachot force-pushed the service-layer-suggestion branch 3 times, most recently from 0d6132f to 53e59ad Compare February 10, 2025 17:45
@AlitaBernachot AlitaBernachot marked this pull request as ready for review February 11, 2025 08:09
@AlitaBernachot AlitaBernachot force-pushed the service-layer-suggestion branch from 53e59ad to e1b60d7 Compare February 11, 2025 08:18
@AlitaBernachot AlitaBernachot force-pushed the service-layer-suggestion branch from e1b60d7 to 82df975 Compare February 11, 2025 08:23
@AlitaBernachot AlitaBernachot requested a review from jahow February 11, 2025 08:23
@AlitaBernachot AlitaBernachot force-pushed the service-layer-suggestion branch from fa4b19a to c9f4177 Compare February 11, 2025 09:13
Copy link
Collaborator

@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 well and the code looks good :)

Comment on lines +274 to +275
const endpointWmts = new WmtsEndpoint(url)
await endpointWmts.isReady()
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI you can also do const endpoint = await new WmtsEndpoints(url).isReady()

No need to change it here, just for next time ;)

@AlitaBernachot AlitaBernachot merged commit 89bb09d into main Feb 11, 2025
12 checks passed
@AlitaBernachot AlitaBernachot deleted the service-layer-suggestion branch February 11, 2025 11:06
@coveralls
Copy link

coveralls commented Feb 13, 2025

Coverage Status

coverage: 82.534% (-1.5%) from 84.008%
when pulling 82df975 on service-layer-suggestion
into bf3be28 on main.

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