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

Metadata Editor: constraints fields #1032

Merged
merged 11 commits into from
Nov 17, 2024
Merged

Metadata Editor: constraints fields #1032

merged 11 commits into from
Nov 17, 2024

Conversation

Angi-Kinas
Copy link
Collaborator

@Angi-Kinas Angi-Kinas commented Oct 28, 2024

Description

This PR introduces the possibility to add legal/security/other constraints to a record in the Metadata-Editor.

TODO:

  • toggling one of the conditions toggle and then untoggling the same one, will create a "glitch" (expected behaviour: see all constraint sections that contain data, actual: all constraint sections are hidden until you click somewhere outside)
  • the saving of the url is only being triggered if you press Enter (should be triggered on each key stroke) + saving the url is only possible if it is a valid url
  • testing

Architectural changes

Changes have been made in the way we use the EditorFieldin order to be able to have two components, one that actually represents the data that will be saved and the other one to show and hide this component.
If the EditorField has no model but instead a componentName this component will be displayed. This is the component that toggles the visibility of the other component.

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

@jahow jahow force-pushed the ME-record-field-contraints branch from f1c6829 to 2493b54 Compare November 1, 2024 15:28
Copy link
Contributor

github-actions bot commented Nov 1, 2024

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

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

@jahow
Copy link
Collaborator

jahow commented Nov 1, 2024

@Angi-Kinas I rebased the branch and added some commits to handle the missing cases. The constraints-shortcuts was reworked quite a bit, hopefully it still makes sense to you. I also introduced separate utilities to check whether a constraint matches the "no applicable constraint" or "no known constraint" type, but this is not yet finished.

What's also missing is proper styling of the buttons and maybe improve the layout a bit.

Copy link
Contributor

github-actions bot commented Nov 1, 2024

📷 Screenshots are here!

@jahow jahow force-pushed the ME-record-field-contraints branch from 2493b54 to 0574472 Compare November 4, 2024 08:49
@jahow jahow marked this pull request as ready for review November 4, 2024 09:52
@jahow jahow force-pushed the ME-record-field-contraints branch 2 times, most recently from b7fe7ba to 8ab6c5f Compare November 4, 2024 12:51
@coveralls
Copy link

coveralls commented Nov 4, 2024

Coverage Status

coverage: 83.556% (+0.3%) from 83.209%
when pulling d95bd18 on ME-record-field-contraints
into 89e0d3b on main.

@jahow jahow force-pushed the ME-record-field-contraints branch 2 times, most recently from a2e96ae to 54f20e7 Compare November 7, 2024 21:55
@jahow jahow changed the title Me record field contraints Metadata Editor: constraints fields Nov 7, 2024
Angi-Kinas and others added 8 commits November 14, 2024 09:58
feat(ui-inputs): add possibility to hide the
upload arrow in the url input component

WIP

chore: Divide open data license and
available licenses,
feat: preselect license if already present in
the record, toggle based on presence in the record

chore: Visually contain constraints list

chore: simplify the form-field-open-data logic

WIP: split license and constraints into separate components, add constraints to fields.config

WIP: changing editor fields configuration to
allow for (helper) components, introduce new
editor action that will later help with show/hide
components,
first working version for constraints shortcuts
toggle and displaying existing list of constraints

feat(editor): handle constraints text and url
change in constraint-card

feat(editor): save, update and delete constraints
in the record, add attach-button for more
constraints

chore: Remove sticky title from each constraint
(withouWrapper)

feat(editor): add logic to constraints shortcuts,
handle all three different constraint types,
enable/disable buttons based on existing
constraints

chore: Remove console.log

chore: update translations

chore(style): add line above each constraint card

chore: remove unused ng-onchanges

chore: Add header for each constraint,
add translations

chore: add unit tests for form field constraints

feat(editor): add new action to EditorFacade which
can set the visibility of a field

chore: Make translations work

feat(converter): support urls on constraints in ISO schemas

feat(constraints): show/hide fuctionality

chore: Add icon to button "add constraint"

chore: Refactor, add TODO
valueChange now emits whenever the url is changed
uploadClick was added to handle click on the upload button
accepts nullish input value

also adjusted consumers of the component
Also adds utilities for determining whether a constraint falls into the
"noKnownConstraint" or "noApplicableConstraint" case
…n/no applicable

Also addresses review comments
@jahow jahow force-pushed the ME-record-field-contraints branch from c66740b to a944d3f Compare November 14, 2024 08:59
@jahow jahow added this to the 2.4.0 milestone Nov 14, 2024
Also fix an issue with the ISO converter not saving constraints properly
@jahow jahow force-pushed the ME-record-field-contraints branch from a944d3f to e9b7366 Compare November 14, 2024 09:20
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, @Angi-Kinas and @jahow ! I only tested the PR as you already paired on it. I had the feeling I saw an error on an angular hook in the console once, but I cannot reproduce it. Was maybe just due to switching branches. Everything works fine besides that. You just forgot to extract and translate the hint translation key editor.record.form.constraint.markdown.placeholder I think.

@jahow
Copy link
Collaborator

jahow commented Nov 17, 2024

Thank you for the review!

@jahow jahow merged commit 1aab0c3 into main Nov 17, 2024
13 checks passed
@jahow jahow deleted the ME-record-field-contraints branch November 17, 2024 15:22
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.

4 participants