-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#10571 WIP: Allow admins and managers to assign user group…
…s to email templates within a mailable
- Loading branch information
1 parent
f6a05ec
commit c46d9cc
Showing
4 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/components/Form/fields/FieldEmailTemplateUserGroupSettings.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<div> | ||
<FormFieldLabel :label="label" /> | ||
<template v-for="group in assignableUserGroups" :key="group.id"> | ||
<span class="grid grid-cols-2"> | ||
<input | ||
ref="input" | ||
v-model="userGroupIds" | ||
:value="group.id" | ||
class="col-span-1" | ||
name="userGroupIds" | ||
type="checkbox" | ||
@change="updateCurrentValue(group)" | ||
/> | ||
|
||
<label :for="group.id" class="col-span-1">{{ group.name }}</label> | ||
</span> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import FieldBase from '@/components/Form/fields/FieldBase.vue'; | ||
import FormFieldLabel from '@/components/Form/FormFieldLabel.vue'; | ||
export default { | ||
name: 'UserGroupIds', | ||
components: {FormFieldLabel}, | ||
extends: FieldBase, | ||
props: { | ||
assignedUserGroupIds: { | ||
type: Array, | ||
required: true, | ||
}, | ||
assignableUserGroups: { | ||
type: Array, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
userGroupIds: [], | ||
}; | ||
}, | ||
computed: {}, | ||
watch: { | ||
userGroupIds(newValue) { | ||
this.currentValue = newValue; // Update currentValue whenever userGroupIds changes | ||
}, | ||
}, | ||
mounted() { | ||
this.userGroupIds = this.assignedUserGroupIds; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters