1
0
forked from test/crm

fix: added invite member page in settings modal

This commit is contained in:
Shariq Ansari 2024-09-03 12:17:13 +05:30
parent 5e254880a6
commit cfbb1e5b34
2 changed files with 53 additions and 5 deletions

View File

@ -0,0 +1,42 @@
<template>
<div class="flex h-full flex-col gap-8 p-8">
<h2 class="flex gap-2 text-xl font-semibold leading-none h-5">
{{ __('Send Invites To') }}
</h2>
<div class="flex-1 overflow-y-auto">
<MultiValueInput
v-model="invitees"
:validate="validateEmail"
:error-message="
(value) => __('{0} is an invalid email address', [value])
"
/>
<FormControl
type="select"
class="mt-4"
v-model="role"
variant="outline"
:label="__('Invite as')"
:options="[
{ label: __('Regular Access'), value: 'Sales User' },
{ label: __('Manager Access'), value: 'Sales Manager' },
{ label: __('Admin Access'), value: 'Administrator' },
]"
/>
<ErrorMessage class="mt-2" v-if="error" :message="error" />
</div>
<div class="flex flex-row-reverse">
<Button :label="__('Send Invites')" variant="solid" @click="update" />
</div>
</div>
</template>
<script setup>
import MultiValueInput from '@/components/Controls/MultiValueInput.vue'
import { validateEmail } from '@/utils'
import { FormControl } from 'frappe-ui'
import { ref } from 'vue'
const invitees = ref([])
const role = ref('Sales User')
const error = ref(null)
</script>

View File

@ -40,6 +40,7 @@
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
import InviteMemberPage from '@/components/Settings/InviteMemberPage.vue'
import ProfileSettings from '@/components/Settings/ProfileSettings.vue'
import WhatsAppSettings from '@/components/Settings/WhatsAppSettings.vue'
import TwilioSettings from '@/components/Settings/TwilioSettings.vue'
@ -53,26 +54,31 @@ const show = defineModel()
const tabs = computed(() => {
let _tabs = [
{
label: 'Settings',
label: __('Settings'),
hideLabel: true,
items: [
{
label: 'Profile',
label: __('Profile'),
icon: ContactsIcon,
component: markRaw(ProfileSettings),
},
{
label: __('Invite Members'),
icon: 'user-plus',
component: markRaw(InviteMemberPage),
},
],
},
{
label: 'Integrations',
label: __('Integrations'),
items: [
{
label: 'Twilio',
label: __('Twilio'),
icon: PhoneIcon,
component: markRaw(TwilioSettings),
},
{
label: 'WhatsApp',
label: __('WhatsApp'),
icon: WhatsAppIcon,
component: markRaw(WhatsAppSettings),
condition: () => isWhatsappInstalled.value,