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

Input type list doesn't work correctly if multiple value-pairs have the same pair value #2434

Conversation

alexandrevryghem
Copy link
Member

References

Description

When you have 2 fields with input-type list which use value pairs which contains a same value for one of their <pair>s, you cannot select that value in the second field.

Instructions for Reviewers

List of changes in this PR:

  • In DsDynamicListComponent I updated the checkboxes/radio buttons id attribute and prefixed it with the metadata fiel

Guidance for how to test & review this PR:

  1. Create a submission form with 2 fields with input-type list
  2. Link both fields to a <value-pairs> which contains this <pair>:
    <pair>
       <displayed-value>Other</displayed-value>
       <stored-value>other</stored-value>
    </pair>
  3. In the submission form try selecting the Other value from the second field, it should select the correct field and not the one from the first field

Checklist

  • 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.

…s unique for each metadata field to prevent other value-pairs having the same id
…pe-list_contribute-7.2' into w2p-105221_fix-value-pair-ids-not-being-unique-input-type-list_contribute-7.6
@alexandrevryghem alexandrevryghem self-assigned this Aug 14, 2023
@alexandrevryghem alexandrevryghem added bug component: submission claimed: Atmire Atmire team is working on this issue & will contribute back labels Aug 14, 2023
@alanorth alanorth added quick win Pull request is small in size & should be easy to review and/or merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Aug 14, 2023
@alanorth
Copy link
Contributor

I verified the bug by creating two list input elements with <value-pairs> which contain an identical value. During submission, after selecting the value in the first input element, I am unable to select the value in the second input element.

I tested the patch on DSpace 7.6 and verified that it allows me to select both of the values, and the metadata is correct after submission.

@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Aug 16, 2023
@tdonohue tdonohue added this to the 7.6.1 milestone Aug 16, 2023
@alanorth alanorth self-requested a review August 25, 2023 06:16
@alanorth alanorth merged commit 25febb1 into DSpace:main Aug 25, 2023
10 checks passed
@dspace-bot
Copy link
Contributor

@tdonohue tdonohue modified the milestones: 7.6.1, 8.0 Aug 25, 2023
@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Aug 28, 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 claimed: Atmire Atmire team is working on this issue & will contribute back component: submission quick win Pull request is small in size & should be easy to review and/or merge
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Input type list doesn't work correctly if multiple value-pairs have the same pair value
4 participants