FIX: prevents error when loading tag groups (#8983)

This commit is contained in:
Joffrey JAFFEUX 2020-02-17 10:39:04 +01:00 committed by GitHub
parent d827430ea6
commit 9feace3388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -2,12 +2,14 @@
<label for="category-allowed-tags">{{i18n 'category.tags_allowed_tags'}}</label> <label for="category-allowed-tags">{{i18n 'category.tags_allowed_tags'}}</label>
{{tag-chooser {{tag-chooser
id="category-allowed-tags" id="category-allowed-tags"
filterPlaceholder="category.tags_placeholder"
tags=category.allowed_tags tags=category.allowed_tags
everyTag=true everyTag=true
excludeSynonyms=true excludeSynonyms=true
unlimitedTagCount=true unlimitedTagCount=true
onChange=(action (mut category.allowed_tags)) onChange=(action (mut category.allowed_tags))
options=(hash
filterPlaceholder="category.tags_placeholder"
)
}} }}
</section> </section>
@ -45,8 +47,10 @@
{{tag-group-chooser {{tag-group-chooser
id="category-required-tag-group" id="category-required-tag-group"
tagGroups=category.required_tag_groups tagGroups=category.required_tag_groups
options=(hash
maximum=1 maximum=1
filterPlaceholder="category.tag_group_selector_placeholder" filterPlaceholder="category.tag_group_selector_placeholder"
)
}} }}
</section> </section>
</section> </section>

View File

@ -47,7 +47,7 @@ export default MultiSelectComponent.extend(TagsMixin, {
).then(results => { ).then(results => {
if (results && results.length) { if (results && results.length) {
return results.filter(r => { return results.filter(r => {
return !this.tagGroups.includes(this.getValue(r)); return !makeArray(this.tagGroups).includes(this.getValue(r));
}); });
} }
}); });