Skip to content

Conversation

@tamu-sad-iii
Copy link
Contributor

@tamu-sad-iii tamu-sad-iii commented Jan 26, 2024

References

Description

The condition within the onBlur event handler method for the tag input field has an error when the model.hasAuthority is falsy.

This causes the text entered to not be converted to a subject "chip" and is not added to the form for patch submission.

Instructions for Reviewers

Check the view template for whether an element reference will be rendered or not. Minimizing cyclomatic complexity helps avoid this but still requires mental mapping between the component and template when using conditions in the template and referencing elements from the component logic.

List of changes in this PR:

  • amend condition whether to addTagsToChips to check if model.hasAuthority before invoking the ViewChild decorated class member instance isPopupOpen method.

In submission-forms.xml define a form field with input type tag without a control vocabulary. Then during a item submission type in the tag input field and tab or click away. The value will remain a free form text and there will be an error in the console log.

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.

@tamu-sad-iii tamu-sad-iii changed the title NgbTypeahead instance is only defined when model has authority Element reference for typeahead directive is only defined when model has authority Jan 27, 2024
@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 Jan 29, 2024
@tdonohue tdonohue requested a review from artlowel February 29, 2024 15:59
@alanorth
Copy link
Contributor

alanorth commented Mar 8, 2024

Thanks @WWelling. I tested on DSpace 7.6.2-SNAPSHOT and this patch resolves the issue with tag inputs not working when they don't use an authority. I also tested a tag input with an authority and it's working as expected.

I don't think main and dspace-7_x have diverged enough in this area to require testing on each branch so I will merge this now.

@dspace-bot
Copy link
Contributor

@tdonohue tdonohue added this to the 8.0 milestone Mar 8, 2024
@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 Mar 8, 2024
@tamu-sad-iii tamu-sad-iii deleted the dynamic-tag-on-blur branch April 2, 2024 12:55
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.

4 participants