-
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 9f1bb49
Showing
4 changed files
with
89 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
62 changes: 62 additions & 0 deletions
62
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,62 @@ | ||
<template> | ||
<div> | ||
<FormFieldLabel :label="label" /> | ||
<template v-for="group in assignableUserGroups" :key="group.id"> | ||
<span class="flex gap-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, | ||
default: () => [], | ||
}, | ||
assignableUserGroups: { | ||
type: Array, | ||
required: true, | ||
default: () => [], | ||
}, | ||
}, | ||
data() { | ||
return { | ||
userGroupIds: [], | ||
}; | ||
}, | ||
computed: {}, | ||
created() {}, | ||
mounted() { | ||
this.userGroupIds = this.assignedUserGroupIds; | ||
this.currentValue = this.assignedUserGroupIds; | ||
}, | ||
methods: { | ||
updateCurrentValue(group) { | ||
this.currentValue = this.userGroupIds; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="less"> | ||
@import '../../../styles/_import'; | ||
</style> |
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