Made edit metadata tab fields dynamic and added entity type support #3722
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 fieldsDsoEditMetadataAuthorityFieldComponent
: For authority controlled fields (this contains all the logic from Implement vocabulary value selectors in item’s metadata edit form #2653)DsoEditMetadataEntityFieldComponent
: For thedspace.entity.type
field, this will ensure that no invalid entity types are submittedThis 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 fieldDsoEditMetadataAuthorityFieldComponent
: 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 fileDsoEditMetadataEntityFieldComponent
: This is the field that contains a dropdown field with all the values that can be filled in fordspace.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 bothGuidance for how to test or review this PR:
dspace.entity.type
fields forces you to select one of the configured typesdspace.entity.type
field also works when entities are disabledChecklist
main
branch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lint
npm run check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.