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

Made edit metadata tab fields dynamic and added entity type support #3722

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

Conversation

alexandrevryghem
Copy link
Member

References

Description

Refactored the DsoEditMetadataValueComponent to make it easier to customize the edit behaviour of certain fields. By default there is a distinction between 3 types of fields:

  • DsoEditMetadataTextFieldComponent: Regular free text fields
  • DsoEditMetadataAuthorityFieldComponent: For authority controlled fields (this contains all the logic from Implement vocabulary value selectors in item’s metadata edit form #2653)
  • DsoEditMetadataEntityFieldComponent: For the dspace.entity.type field, this will ensure that no invalid entity types are submitted
    image

This separation will make it easy to introduce new types in the future like for example one for dates to ensure that they always follow the ISO 8601 standard.

Instructions for Reviewers

List of changes in this PR:

  • DsoEditMetadataValueFieldLoaderComponent: This is the dynamic component loader that is used to load one of the edit metadata value components (textarea/input/select)
  • DsoEditMetadataTextFieldComponent: The regular text area field
  • DsoEditMetadataAuthorityFieldComponent: Extracted all the code from Implement vocabulary value selectors in item’s metadata edit form #2653 into this new component, because it started to become too big to stay in the same file
  • DsoEditMetadataEntityFieldComponent: This is the field that contains a dropdown field with all the values that can be filled in for dspace.entity.type. This field is similar to the one in the edit/create collection form.
  • Context: 2 new contexts have been created to make it possible to differentiate between editing an existing field and adding a new field. Currently the same components are used for both

Guidance for how to test or review this PR:

  • Verify that you can still submit values for regular text fields
  • Verify that you can still submit values for authority controlled fields
  • Verify that dspace.entity.type fields forces you to select one of the configured types
  • Verify that the dspace.entity.type field also works when entities are disabled
  • Test it both for creating new fields and editing existing ones

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

…bute-7.6' into w2p-119915_made-edit-metadata-tab-fields-dynamic_contribute-main

# Conflicts:
#	src/app/core/shared/context.model.ts
#	src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts
#	src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.html
#	src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts
#	src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts
#	src/app/dso-shared/dso-shared.module.ts
#	src/app/shared/testing/entity-type-data.service.stub.ts
…oEditMetadataValueComponent

Also:
- Converted the code to the standalone structure
- Made DsoEditMetadataValueFieldLoaderComponent extend AbstractComponentLoaderComponent
@alexandrevryghem alexandrevryghem added component: configurable entities related to configurable entities new feature code task component: Item (Archived) Item display or editing component: authority control Related to internal authority control system labels Dec 7, 2024
@alexandrevryghem alexandrevryghem added this to the 9.0 milestone Dec 7, 2024
@alexandrevryghem alexandrevryghem self-assigned this Dec 7, 2024
@alexandrevryghem alexandrevryghem changed the title Made edit metadata tab fields dynamic an added entity type support Made edit metadata tab fields dynamic and added entity type support Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code task component: authority control Related to internal authority control system component: configurable entities related to configurable entities component: Item (Archived) Item display or editing new feature
Projects
Status: 🙋 Needs Reviewers Assigned
Development

Successfully merging this pull request may close these issues.

1 participant