From f8200ab09feb0ebf5116e5bcaf8c66c22ddac1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Wed, 11 Jun 2025 13:44:34 +0200 Subject: [PATCH] pkp/pkp-lib#11437 Reviewers are always displayed on masthead --- .../UserInvitationUserGroupsTable.vue | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/pages/userInvitation/UserInvitationUserGroupsTable.vue b/src/pages/userInvitation/UserInvitationUserGroupsTable.vue index 9bf1c0b45..0072c4db5 100644 --- a/src/pages/userInvitation/UserInvitationUserGroupsTable.vue +++ b/src/pages/userInvitation/UserInvitationUserGroupsTable.vue @@ -103,10 +103,7 @@ :label="t('invitation.role.masthead')" :is-required="true" :value="userGroupToAdd.masthead" - :options="[ - {label: t('invitation.masthead.show'), value: true}, - {label: t('invitation.masthead.hidden'), value: false}, - ]" + :options="getMastheadOption(userGroupToAdd)" :all-errors="{ masthead: userGroupErrors['userGroupsToAdd.' + index + '.masthead'], @@ -196,6 +193,25 @@ const availableUserGroups = computed(() => { }); }); +/** + * Masthead options + */ +function getMastheadOption(userGroupToAdd) { + const roleId = props.userGroups.find( + (userGroup) => userGroup.value === userGroupToAdd.userGroupId, + )?.roleId; + + // Reviewer is always displayed on the masthead + if (roleId === pkp.const.ROLE_ID_REVIEWER) { + return [{label: t('invitation.masthead.show'), value: true}]; + } + + return [ + {label: t('invitation.masthead.show'), value: true}, + {label: t('invitation.masthead.hidden'), value: false}, + ]; +} + /** * check any values filled with userGroupsToAdd */