Element reference for typeahead directive is only defined when model has authority #2777
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Description
The condition within the
onBlurevent 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:
addTagsToChipsto check ifmodel.hasAuthoritybefore invoking theViewChilddecorated class memberinstanceisPopupOpenmethod.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
yarn lintyarn check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.