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] Add reuse metadata support #1086

Merged
merged 12 commits into from
Jan 28, 2025

Conversation

AlitaBernachot
Copy link
Collaborator

@AlitaBernachot AlitaBernachot commented Jan 22, 2025

Description

This PR adds the support of the new type of metadata: Reuse metadata, for:

  • gn4 (read),
  • iso19139 (read/write)
  • and iso19115-3 (read-write).

Architectural changes

The new ReuseRecord Metadata Model has been added

export interface ReuseRecord extends BaseRecord {
  kind: 'reuse'
  lineage: string // Explanation of the origin of this record (e.g: how, why)"
  onlineResources: Array<OnlineLinkResource>
  reuseType: ReuseType
  spatialExtents: Array<DatasetSpatialExtent>
  temporalExtents: Array<DatasetTemporalExtent>
}

along with with ReuseType

export type ReuseType = 'application' | 'map' | 'other'

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 Jan 22, 2025

Affected libs: api-metadata-converter,
Affected apps: metadata-converter,

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

@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-49-reuse-metadata-support branch from 1a68f1d to b3f9cda Compare January 23, 2025 11:42
@AlitaBernachot AlitaBernachot marked this pull request as ready for review January 24, 2025 10:34
@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-49-reuse-metadata-support branch from 16853b8 to d880b52 Compare January 24, 2025 11:08
Copy link
Contributor

github-actions bot commented Jan 24, 2025

📷 Screenshots are here!

@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-49-reuse-metadata-support branch 2 times, most recently from 713f62b to ede3740 Compare January 24, 2025 14:12
@coveralls
Copy link

coveralls commented Jan 24, 2025

Coverage Status

coverage: 84.324% (-1.3%) from 85.592%
when pulling 7b3d945 on GSIGNGPF-49-reuse-metadata-support
into 8d1c028 on main.

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.

That looks really good, great work! I added a couple of comments to make a few things a little bit clearer, but apart from that it's all good. Please merge once you've addressed the comments as you see fit :)

return {
...output,
kind,
reuseType,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
reuseType,
...(reuseType || { reuseType }),

We should not write this key if the reuseType is undefined

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right! I updated the gn4 field mapper and added a ut for this specific use case.

@@ -339,6 +340,7 @@ export class Iso19139Converter extends BaseConverter<string> {

fieldChanged('uniqueIdentifier') &&
this.writers['uniqueIdentifier'](record, rootEl)
fieldChanged('reuseType') && this.writers['kind'](record, rootEl)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks potentially confusing; maybe we can still have a "reuseType" writer and simply call the "kind" writer inside? At least we would have a homogeneous logic everywhere, even if it's an unnecessary step

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok I have added a new writer for reuseType that is calling the kind writer.

@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-49-reuse-metadata-support branch from dc2734b to ea83ce2 Compare January 28, 2025 14:20
@AlitaBernachot AlitaBernachot force-pushed the GSIGNGPF-49-reuse-metadata-support branch from 528199c to 7b3d945 Compare January 28, 2025 15:58
@AlitaBernachot AlitaBernachot merged commit 2faf1ec into main Jan 28, 2025
14 checks passed
@AlitaBernachot AlitaBernachot deleted the GSIGNGPF-49-reuse-metadata-support branch January 28, 2025 16: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