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

[ME] Attached resources field #967

Merged
merged 21 commits into from
Sep 4, 2024
Merged

[ME] Attached resources field #967

merged 21 commits into from
Sep 4, 2024

Conversation

jahow
Copy link
Collaborator

@jahow jahow commented Aug 23, 2024

Description

This PR introduces the "attached resources" field in the editor. This brought several changes:

  • the distributions field originally used for online resources in the DatasetRecord model has been renamed to onlineResources; this is now the same as for ServiceRecord, which will make things easier in the future (hopefully)
  • editor fields can now specify a "modelSpecifier", which lets us change what component we want to see for a given model; this is required because the onlineResources will be used both for attached resources and distributions, endpoints etc; and we don't want to have a separate field for each in the model
  • an "online-resource-card" component was introduced; the "contact-card-component" was reworked so that both were similar and closer to the mockup
  • the "form-field-overview" component was reworked to work similarly to the form-field-attached-resources one, including handling upload progress and upload cancel; the intermediary "overview-upload" component was removed for the sake of simplicity
  • the SortableList component now takes a template as input, instead of a component class for each item; the components relying on it were adapted accordingly; this will allow more easily to bind outputs of each item in the list because we have direct access to their template
  • introduced a ModalDialog component similar to ConfirmationDialog, except that it allows for any kind of template to be given as a body

Remaining to do:

  • allow modifying resources through a modal
  • save file size and mime type in uploaded resources
  • write e2e tests

Architectural changes

The platform service now handles reading a record's attachments as well as uploading new files.

The SortableList component was moved to the ui/layout lib.

Screenshots

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

This work is sponsored by Organization ABC.

Copy link
Contributor

github-actions bot commented Aug 23, 2024

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

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

@jahow jahow force-pushed the ME-attached-resources branch from ec6ddb9 to 5b090ac Compare August 23, 2024 11:03
Copy link
Contributor

github-actions bot commented Aug 23, 2024

📷 Screenshots are here!

@jahow jahow force-pushed the ME-attached-resources branch 5 times, most recently from 47c6139 to 7304c54 Compare August 29, 2024 08:24
@coveralls
Copy link

coveralls commented Aug 29, 2024

Coverage Status

coverage: 82.999% (-0.6%) from 83.568%
when pulling 6bf675c on ME-attached-resources
into d000fb8 on main.

@jahow jahow force-pushed the ME-attached-resources branch 6 times, most recently from 27f5a42 to e074ac0 Compare September 1, 2024 10:24
Copy link
Collaborator

@LHBruneton-C2C LHBruneton-C2C left a comment

Choose a reason for hiding this comment

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

Amazing rework!
Tested the attached resources, it's working great. I just saw that when dropping a file you don't get a mime-type, but when giving an URL you do. Is it obtainable only through the http protocol?

@@ -0,0 +1,12 @@
<gn-ui-file-input
[maxSizeMB]="10"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Didn't we say this should be read from the server configuration?

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 forgot that... I'll do it in another PR as it also applies to the overviews

jahow added 14 commits September 4, 2024 09:03
… records

This change renames the "distributions" field to "onlineResources" on
dataset records, similarly to the service records
This way, both kinds of records have the same property name, which makes sense
because this property contains a mix of online resources

The type of the online resources is different for datasets and services, but
having the property named the same should simplify things down the line
nx g component online-resource-card --project feature-editor --style=css --changeDetection=OnPush --standalone --path=libs/feature/editor/src/lib/components
The attachedResources field is not preset yet in the model and is
simply read from the facade. Eventually it might be put in its own field
for simplicity

Also adjusts the sortable list to use a proper gn-ui-button
The overview form field works similarly to the attached resources one.
The intermediary "overview-upload" component was removed and everything is done
in form-field-overviews component.
Reading the attachments on overview change has been removed as we don't delete
the attachments anymore.
…omponentOutlet

This should simplify usage and allow binding output events to the sortable
items more easily
This includes: attached-resources, temporal-extents and contacts
@jahow jahow force-pushed the ME-attached-resources branch from 5d2233c to 25cf5fe Compare September 4, 2024 07:03
@jahow jahow force-pushed the ME-attached-resources branch from 25cf5fe to 6bf675c Compare September 4, 2024 07:31
@jahow jahow merged commit aa68983 into main Sep 4, 2024
14 checks passed
@jahow jahow deleted the ME-attached-resources branch September 4, 2024 07:43
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