Skip to content

Fix missing hints and error messages for input-type list & tag#2133

Merged
tdonohue merged 3 commits intoDSpace:mainfrom
alexandrevryghem:fix-missing-hints-and-required-attributes-main
Apr 3, 2023
Merged

Fix missing hints and error messages for input-type list & tag#2133
tdonohue merged 3 commits intoDSpace:mainfrom
alexandrevryghem:fix-missing-hints-and-required-attributes-main

Conversation

@alexandrevryghem
Copy link
Copy Markdown
Member

References

Description

Fixed a problem causing the hints for input types list and tag to always be hidden.
Fixed some problems causing the error messages and the asterisk not being displayed for input type list.

Instructions for Reviewers

List of changes in this PR:

  • Input types which had array values (tag & list) could not display their hint property when they were marked as <repeatable>true</repeatable>. This was because repeatable fields normally show their hints not underneath each field but in a section underneath all the input fields of that group with the + Add more button, but for those 2 types of input types that whole section to add more input fields is hidden. So I added an exception in DsDynamicFormControlContainerComponent to also display the hint under repeatable dynamic array fields.
  • The required and hint property where also not serialised
  • The field validation for repeatable fields with input type list also checked if every checkbox was selected individually instead of checking if at least one was selected.

Guidance for how to test or review your PR:

  • Use the default submission-forms.xml ➜ check that the hint of the dc.subject field is visible
  • Set the input-type of dc.type & dc.language.iso to list
    • and provide an error message in the required tag:
      • Check that the asterisk is visible
      • Check that the error message is visible when you submit the item without filling out the fields
      • Check that the error message disappears when a value is selected and that you can submit the item
    • and leave the required tag empty:
      • Check that no asterisk is shown
      • Check that no error message is shown when submitting the item

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.

- Added mapping for required & hint properties
- Set the required type on the checkbox group instead of on each checkbox individually
@alexandrevryghem alexandrevryghem self-assigned this Mar 5, 2023
@alexandrevryghem alexandrevryghem added bug usability component: submission high priority claimed: Atmire Atmire team is working on this issue & will contribute back labels Mar 5, 2023
@alexandrevryghem alexandrevryghem changed the title Fix missing hints and required attributes main Fix missing hints and error messages for input-type list & tag Mar 5, 2023
…nd-required-attributes-main

# Conflicts:
#	src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts
#	src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list-checkbox-group.model.ts
@alexandrevryghem alexandrevryghem force-pushed the fix-missing-hints-and-required-attributes-main branch from 08c2394 to 441eac2 Compare March 5, 2023 16:57
@tdonohue tdonohue added this to the 7.6 milestone Mar 6, 2023
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Mar 6, 2023
@tdonohue tdonohue self-requested a review March 30, 2023 14:53
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.

👍 Thanks @alexandrevryghem ! Code looks good. Tested both tag and list and they now seem to work properly displaying hints and errors.

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 high priority usability

Projects

No open projects
Status: ✅ Done

2 participants