Skip to content

Fix issue with repeatable scrollable dropdowns in the submission#830

Merged
tdonohue merged 3 commits intoDSpace:mainfrom
atmire:submission-repeatable-issue
Aug 6, 2020
Merged

Fix issue with repeatable scrollable dropdowns in the submission#830
tdonohue merged 3 commits intoDSpace:mainfrom
atmire:submission-repeatable-issue

Conversation

@artlowel
Copy link
Copy Markdown
Member

@artlowel artlowel commented Aug 5, 2020

References

Description

The reason for the error was that the value returned for scrollable dropdowns was bound to the field, and therefore readonly. So cloning it before trying to modify it fixed the exception.

Afterwards I found another issue with scrollable dropdowns where if the field is empty, and you add multiple values before the first (auto)save, only the last would be saved. This was because when a field was added, the formControl wasn't updated like it was for other fields because the values had a different format compared to all the other fields. I added a section to update the formcontrol value in the correct format.

Instructions for Reviewers

To test this PR verify that repeatable scrollable dropdowns work as they should, and that no new issues have been introduced.

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 TSLint validation using yarn run lint
  • 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 for any bug fixes, improvements or new features.
    • Existing tests pass, but writing tests for these specific issues would be several orders of magnitude more complicated than the fix
  • If my PR includes new, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

@artlowel artlowel changed the title Submission repeatable issue Fix issue with repeatable scrollable dropdowns in the submission Aug 5, 2020
@tdonohue tdonohue added 1 APPROVAL pull request only requires a single approval to merge bug labels Aug 6, 2020
@tdonohue tdonohue self-requested a review August 6, 2020 14:48
Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Tested and this fixes the issues with repeatable dropdown fields. The default Type field now works properly, including drag & drop reordering. I tested other fields as well and found no new problems.

@tdonohue tdonohue merged commit 9c83cd9 into DSpace:main Aug 6, 2020
@tdonohue tdonohue added this to the 7.0beta4 milestone Oct 5, 2020
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with submission form's repeatable fields

2 participants