diff --git a/client/src/views/fields/link-multiple-with-role.js b/client/src/views/fields/link-multiple-with-role.js index 2470ea83cb..1e99a20f63 100644 --- a/client/src/views/fields/link-multiple-with-role.js +++ b/client/src/views/fields/link-multiple-with-role.js @@ -94,6 +94,11 @@ class LinkMultipleWithRoleFieldView extends LinkMultipleFieldView { this.skipRoles = true; } } + + if (this.roleType === this.ROLE_TYPE_ENUM) { + this.styleMap = /** @type {Record}*/ this.getMetadata() + .get(['entityDefs', this.model.entityType, 'fields', this.roleField, 'style']) || {}; + } } getAttributeList() { @@ -136,8 +141,7 @@ class LinkMultipleWithRoleFieldView extends LinkMultipleFieldView { } if (role) { - let style = this.getMetadata() - .get(['entityDefs', this.model.entityType, 'fields', this.roleField, 'style', role]); + let style = this.styleMap[role]; let className = 'text'; @@ -242,6 +246,12 @@ class LinkMultipleWithRoleFieldView extends LinkMultipleFieldView { $option.attr('selected', 'selected'); } + const style = this.styleMap[role]; + + if (style) { + $option.addClass('text-' + style) + } + $role.append($option); });