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

Support for freetext values in submission for vocabulary controlled onebox and tag types #2602

Merged

Conversation

jensvannerum
Copy link
Contributor

@jensvannerum jensvannerum commented Nov 8, 2023

References

Description

This PR adds support for adding custom input in submission fields that are controlled by a vocabulary

Instructions for Reviewers

List of changes in this PR:

  • Altered the VocabularyTreeviewComponent class and html template to show an "Add" (i18n message) button. This button is disabled if the vocabulary is closed, or if no text is given.
  • Altered the DynamicTagComponent class so that custom user input is supported. If results are present from the vocabulary autofill, the custom user input is appended to the bottom of the list, this is done since a value from the vocabulary is preferred.

An in-depth "how-to-test" guide is included in the back end PR as these PR's can not be tested separately

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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 yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn 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.
  • 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.

@jensvannerum jensvannerum changed the title W2p 108055 freetext values in vocabulary Support for freetext values in submission for vocabulary controlled onebox and tag types Nov 8, 2023
@alanorth
Copy link
Contributor

alanorth commented Nov 8, 2023

Thanks @jensvannerum! I tested this patch on DSpace 7.6 with onebox and tag input types and it allows me to specify freetext values on fields that use controlled vocabularies. I also tested to make sure vocabularies with closed="false" (default) and closed="true" worked as expected.

@jensvannerum jensvannerum marked this pull request as ready for review November 9, 2023 10:54
@tdonohue tdonohue added bug component: submission 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Nov 9, 2023
@alanorth alanorth merged commit 642d577 into DSpace:main Nov 9, 2023
10 checks passed
@dspace-bot
Copy link
Contributor

@alanorth alanorth removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Nov 9, 2023
@alanorth alanorth added this to the 8.0 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug component: submission
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Unable to add freetext values with onebox or tag input types when field uses a vocabulary
4 participants