fix: show error if no email,phone or website set
This commit is contained in:
parent
35cc734bce
commit
4ebd56b417
@ -72,19 +72,35 @@
|
|||||||
<Tooltip text="Make a call...">
|
<Tooltip text="Make a call...">
|
||||||
<Button
|
<Button
|
||||||
class="h-7 w-7"
|
class="h-7 w-7"
|
||||||
@click="() => makeCall(deal.data.mobile_no)"
|
@click="
|
||||||
|
() =>
|
||||||
|
deal.data.mobile_no
|
||||||
|
? makeCall(deal.data.mobile_no)
|
||||||
|
: errorMessage('No mobile number set')
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<PhoneIcon class="h-4 w-4" />
|
<PhoneIcon class="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Button class="h-7 w-7">
|
<Button class="h-7 w-7">
|
||||||
<EmailIcon class="h-4 w-4" @click="openEmailBox()" />
|
<EmailIcon
|
||||||
|
class="h-4 w-4"
|
||||||
|
@click="
|
||||||
|
deal.data.email
|
||||||
|
? openEmailBox()
|
||||||
|
: errorMessage('No email set')
|
||||||
|
"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Tooltip v-if="deal.data.website" text="Go to website...">
|
<Tooltip text="Go to website...">
|
||||||
<Button class="h-7 w-7">
|
<Button class="h-7 w-7">
|
||||||
<LinkIcon
|
<LinkIcon
|
||||||
class="h-4 w-4"
|
class="h-4 w-4"
|
||||||
@click="deal.data.website && openWebsite(deal.data.website)"
|
@click="
|
||||||
|
deal.data.website
|
||||||
|
? openWebsite(deal.data.website)
|
||||||
|
: errorMessage('No website set')
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -294,6 +310,7 @@ import {
|
|||||||
createToast,
|
createToast,
|
||||||
setupAssignees,
|
setupAssignees,
|
||||||
setupCustomActions,
|
setupCustomActions,
|
||||||
|
errorMessage,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
|
|||||||
@ -113,19 +113,35 @@
|
|||||||
<Tooltip text="Make a call...">
|
<Tooltip text="Make a call...">
|
||||||
<Button
|
<Button
|
||||||
class="h-7 w-7"
|
class="h-7 w-7"
|
||||||
@click="() => makeCall(lead.data.mobile_no)"
|
@click="
|
||||||
|
() =>
|
||||||
|
lead.data.mobile_no
|
||||||
|
? makeCall(lead.data.mobile_no)
|
||||||
|
: errorMessage('No phone number set')
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<PhoneIcon class="h-4 w-4" />
|
<PhoneIcon class="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Button class="h-7 w-7">
|
<Button class="h-7 w-7">
|
||||||
<EmailIcon class="h-4 w-4" @click="openEmailBox()" />
|
<EmailIcon
|
||||||
|
class="h-4 w-4"
|
||||||
|
@click="
|
||||||
|
lead.data.email
|
||||||
|
? openEmailBox()
|
||||||
|
: errorMessage('No email set')
|
||||||
|
"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Tooltip v-if="lead.data.website" text="Go to website...">
|
<Tooltip text="Go to website...">
|
||||||
<Button class="h-7 w-7">
|
<Button class="h-7 w-7">
|
||||||
<LinkIcon
|
<LinkIcon
|
||||||
class="h-4 w-4"
|
class="h-4 w-4"
|
||||||
@click="openWebsite(lead.data.website)"
|
@click="
|
||||||
|
lead.data.website
|
||||||
|
? openWebsite(lead.data.website)
|
||||||
|
: errorMessage('No website set')
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -257,6 +273,7 @@ import {
|
|||||||
createToast,
|
createToast,
|
||||||
setupAssignees,
|
setupAssignees,
|
||||||
setupCustomActions,
|
setupCustomActions,
|
||||||
|
errorMessage,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
|
|||||||
@ -129,4 +129,13 @@ export function setupCustomActions(data, obj) {
|
|||||||
let script = new Function(data._form_script + '\nreturn setupForm')()
|
let script = new Function(data._form_script + '\nreturn setupForm')()
|
||||||
let formScript = script(obj)
|
let formScript = script(obj)
|
||||||
data._customActions = formScript?.actions || []
|
data._customActions = formScript?.actions || []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function errorMessage(title, message) {
|
||||||
|
createToast({
|
||||||
|
title: title || 'Error',
|
||||||
|
text: message,
|
||||||
|
icon: 'x',
|
||||||
|
iconClasses: 'text-red-600',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user