File tree Expand file tree Collapse file tree
dashboard/src/components/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868 <RoleMembers
6969 v-if =" tab === ' members' "
7070 :users =" role .doc ?.users "
71+ @add ="
72+ (id : string ) => {
73+ role .add_user .submit ({
74+ user: id ,
75+ });
76+ }
77+ "
7178 @remove ="
7279 (id : string ) => {
7380 role .remove_user .submit ({
Original file line number Diff line number Diff line change 4545 >
4646 No members to show
4747 </div >
48+
49+ <div >
50+ <Button label="Invite" icon-left="user" @click =" open = ! open " />
51+ </div >
52+ <Dialog
53+ v-model =" open "
54+ :options =" {
55+ title: ' Invite' ,
56+ size: ' lg' ,
57+ actions: [
58+ {
59+ label: ' Submit' ,
60+ variant: ' solid' ,
61+ onClick : () => {
62+ $emit (' add' , userForInvite );
63+ open = false ;
64+ },
65+ },
66+ ],
67+ } "
68+ >
69+ <template #body-content >
70+ <div class =" mb-2 text-base" >Invite a team member to this role.</div >
71+ <Select
72+ :options =" usersForInvite "
73+ v-model =" userForInvite "
74+ placeholder="User"
75+ />
76+ </template >
77+ </Dialog >
4878 </div >
4979</template >
5080
5181<script setup lang="ts">
52- import { Button } from ' frappe-ui'
82+ import { Button , Dialog , Select } from ' frappe-ui'
83+ import { computed , ref } from ' vue'
5384import { dayjsLocal } from ' ../../utils/dayjs'
85+ import { teamMembers } from ' ./data'
5486
55- withDefaults (
87+ const props = withDefaults (
5688 defineProps <{
5789 users? : Array <any >
5890 }>(),
@@ -62,6 +94,13 @@ withDefaults(
6294)
6395
6496defineEmits <{
97+ add: [id : string ]
6598 remove: [id : string ]
6699}>()
100+
101+ const open = ref (false )
102+ const userForInvite = ref <string >(' ' )
103+ const usersForInvite = computed (() =>
104+ teamMembers (props .users .map ((u ) => u .user )),
105+ )
67106 </script >
You can’t perform that action at this time.
0 commit comments