From 55c0d1aea4e6cc0567e989085c7f0a4a3435e0b3 Mon Sep 17 00:00:00 2001 From: Taslan Graham Date: Wed, 6 Nov 2024 16:01:00 -0500 Subject: [PATCH] pkp/pkp-lib#10571 Allow admins and managers to assign user groups to email templates within a mailable --- src/components/Container/ManageEmailsPage.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/Container/ManageEmailsPage.vue b/src/components/Container/ManageEmailsPage.vue index 86cdfb11e..628ffb79f 100644 --- a/src/components/Container/ManageEmailsPage.vue +++ b/src/components/Container/ManageEmailsPage.vue @@ -408,6 +408,14 @@ export default { }); } + // Remove user group fields if current mailable does not support specifying user group access + if (!this.currentMailable.canAssignUserGroupToTemplates) { + templateForm.fields = templateForm.fields.filter( + (field) => + !['assignedUserGroupIds', 'isUnrestricted'].includes(field.name), + ); + } + templateForm.fields = templateForm.fields.map((field) => { if (field.name === 'body') { field.preparedContent = Object.keys(