chore: support Zendesk widget (#25517)
This commit is contained in:
parent
af7f67dc9c
commit
07d067d828
8 changed files with 155 additions and 35 deletions
23
web/app/components/base/zendesk/utils.ts
Normal file
23
web/app/components/base/zendesk/utils.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { IS_CE_EDITION } from '@/config'
|
||||
|
||||
export type ConversationField = {
|
||||
id: string,
|
||||
value: any,
|
||||
}
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line ts/consistent-type-definitions
|
||||
interface Window {
|
||||
zE?: (
|
||||
command: string,
|
||||
value: string,
|
||||
payload?: ConversationField[] | string | string[] | (() => any),
|
||||
callback?: () => any,
|
||||
) => void;
|
||||
}
|
||||
}
|
||||
|
||||
export const setZendeskConversationFields = (fields: ConversationField[], callback?: () => any) => {
|
||||
if (!IS_CE_EDITION && window.zE)
|
||||
window.zE('messenger:set', 'conversationFields', fields, callback)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue