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

[Datahub] Feature catalog - Load attributes description from a linked record if present #1137

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

AlitaBernachot
Copy link
Collaborator

@AlitaBernachot AlitaBernachot commented Feb 26, 2025

Description

This PR introduces feature catalog. It is a first technical step to load a feature catalog in the record before displaying it in a record page.
Attributes from a feature catalog can be retrieve in two different ways:

  • Case 1: the feature catalog is already embedded in the record definition returned by Elastic Search, it will appear in the featureTypes property
  • Case 2: the feature catalog is present, but in a linked record, in this case the linked record will appear in the related.fcats property: in this case we will store the linked record uuid as property (featureCatalogIdentifier) and will load (getRecord()) its definition to get its own featureTypes

Thanks @Guillaume-d-o for your work on this PR.

💡 Example of a record with a linked feature catalog (for Case 2)

curl -X POST "https://geonetwork-ui.labs.camptocamp.com/geonetwork/srv/api/search/records/_search?bucket=bucket&relatedType=fcats" -H "accept: application/json" -H "Content-Type: application/json" -H "X-XSRF-TOKEN: b8a9b3ae-fe1c-466a-bb9f-9aff3a959b7e" -d "{\"query\":{\"ids\":{\"values\":[\"IGNF_BD-TOPO\"]}}}"

Architectural changes

New mappers were added to load featureTypes and get the featureCatalogIdentifier.

Screenshots

No UI

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:
api-metadata-converter,api-repository,feature-catalog,feature-record,feature-router,feature-editor,feature-search,feature-map,feature-auth,ui-search,common-domain,common-fixtures,feature-dataviz,ui-elements,feature-notifications,ui-catalog,util-shared,ui-widgets,ui-dataviz,ui-inputs,ui-layout,ui-map

Affected apps:
metadata-converter,metadata-editor,datahub,demo,webcomponents,map-viewer,search,datafeeder,data-platform

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

@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-38-feat-cat-linked-record branch from 0451715 to e54e85e Compare February 27, 2025 14:16
Copy link
Contributor

github-actions bot commented Feb 27, 2025

📷 Screenshots are here!

@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-38-feat-cat-linked-record branch 8 times, most recently from 97caf72 to 6909b57 Compare February 27, 2025 17:45
@@ -28,6 +29,21 @@ export const loadFullMetadataFailure = createAction(
props<{ otherError?: string; notFound?: boolean }>()
)

export const loadFeatureCatalog = createAction(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jahow says : need to be tested

@@ -2642,6 +2643,7 @@ describe('Gn4Converter', () => {
extras: {
catalogUuid: 'metawal.wallonie.be',
favoriteCount: 0,
featureTypes: [],
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jahow says : is there a way to get a test to show that this takes in the correct value? e.g. by changing the mock values used as input?

@AlitaBernachot AlitaBernachot marked this pull request as ready for review March 4, 2025 08:35
@coveralls
Copy link

coveralls commented Mar 4, 2025

Coverage Status

coverage: 83.898% (-0.5%) from 84.348%
when pulling f98e22f on GSIGNGPF-38-feat-cat-linked-record
into 80a8304 on main.

@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-38-feat-cat-linked-record branch from d9bdc0a to f98e22f Compare March 4, 2025 15:13
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