chore: update support channels (#27188)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -10,11 +10,21 @@ const Zendesk = () => {
|
|||||||
const nonce = process.env.NODE_ENV === 'production' ? (headers() as unknown as UnsafeUnwrappedHeaders).get('x-nonce') ?? '' : ''
|
const nonce = process.env.NODE_ENV === 'production' ? (headers() as unknown as UnsafeUnwrappedHeaders).get('x-nonce') ?? '' : ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Script
|
<>
|
||||||
nonce={nonce ?? undefined}
|
<Script
|
||||||
id="ze-snippet"
|
nonce={nonce ?? undefined}
|
||||||
src={`https://static.zdassets.com/ekr/snippet.js?key=${ZENDESK_WIDGET_KEY}`}
|
id="ze-snippet"
|
||||||
/>
|
src={`https://static.zdassets.com/ekr/snippet.js?key=${ZENDESK_WIDGET_KEY}`}
|
||||||
|
/>
|
||||||
|
<Script nonce={nonce ?? undefined} id="ze-init">{`
|
||||||
|
(function () {
|
||||||
|
window.addEventListener('load', function () {
|
||||||
|
if (window.zE)
|
||||||
|
window.zE('messenger', 'hide')
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
`}</Script>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,3 +21,13 @@ export const setZendeskConversationFields = (fields: ConversationField[], callba
|
|||||||
if (!IS_CE_EDITION && window.zE)
|
if (!IS_CE_EDITION && window.zE)
|
||||||
window.zE('messenger:set', 'conversationFields', fields, callback)
|
window.zE('messenger:set', 'conversationFields', fields, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const setZendeskWidgetVisibility = (visible: boolean) => {
|
||||||
|
if (!IS_CE_EDITION && window.zE)
|
||||||
|
window.zE('messenger', visible ? 'show' : 'hide')
|
||||||
|
}
|
||||||
|
|
||||||
|
export const toggleZendeskWindow = (open: boolean) => {
|
||||||
|
if (!IS_CE_EDITION && window.zE)
|
||||||
|
window.zE('messenger', open ? 'open' : 'close')
|
||||||
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function AppSelector() {
|
|||||||
<div className="">
|
<div className="">
|
||||||
<Menu as="div" className="relative inline-block text-left">
|
<Menu as="div" className="relative inline-block text-left">
|
||||||
{
|
{
|
||||||
({ open }) => (
|
({ open, close }) => (
|
||||||
<>
|
<>
|
||||||
<MenuButton className={cn('inline-flex items-center rounded-[20px] p-0.5 hover:bg-background-default-dodge', open && 'bg-background-default-dodge')}>
|
<MenuButton className={cn('inline-flex items-center rounded-[20px] p-0.5 hover:bg-background-default-dodge', open && 'bg-background-default-dodge')}>
|
||||||
<Avatar avatar={userProfile.avatar_url} name={userProfile.name} size={36} />
|
<Avatar avatar={userProfile.avatar_url} name={userProfile.name} size={36} />
|
||||||
@@ -142,7 +142,7 @@ export default function AppSelector() {
|
|||||||
<RiArrowRightUpLine className='size-[14px] shrink-0 text-text-tertiary' />
|
<RiArrowRightUpLine className='size-[14px] shrink-0 text-text-tertiary' />
|
||||||
</Link>
|
</Link>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Support />
|
<Support closeAccountDropdown={close} />
|
||||||
{IS_CLOUD_EDITION && isCurrentWorkspaceOwner && <Compliance />}
|
{IS_CLOUD_EDITION && isCurrentWorkspaceOwner && <Compliance />}
|
||||||
</div>
|
</div>
|
||||||
<div className='p-1'>
|
<div className='p-1'>
|
||||||
|
|||||||
@@ -1,23 +1,25 @@
|
|||||||
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
|
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
|
||||||
import { RiArrowRightSLine, RiArrowRightUpLine, RiDiscordLine, RiFeedbackLine, RiMailSendLine, RiQuestionLine } from '@remixicon/react'
|
import { RiArrowRightSLine, RiArrowRightUpLine, RiChatSmile2Line, RiDiscordLine, RiFeedbackLine, RiQuestionLine } from '@remixicon/react'
|
||||||
import { Fragment } from 'react'
|
import { Fragment } from 'react'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { mailToSupport } from '../utils/util'
|
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
import { useProviderContext } from '@/context/provider-context'
|
import { useProviderContext } from '@/context/provider-context'
|
||||||
import { Plan } from '@/app/components/billing/type'
|
import { Plan } from '@/app/components/billing/type'
|
||||||
import { useAppContext } from '@/context/app-context'
|
import { toggleZendeskWindow } from '@/app/components/base/zendesk/utils'
|
||||||
|
|
||||||
export default function Support() {
|
type SupportProps = {
|
||||||
|
closeAccountDropdown: () => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Support({ closeAccountDropdown }: SupportProps) {
|
||||||
const itemClassName = `
|
const itemClassName = `
|
||||||
flex items-center w-full h-9 pl-3 pr-2 text-text-secondary system-md-regular
|
flex items-center w-full h-9 pl-3 pr-2 text-text-secondary system-md-regular
|
||||||
rounded-lg hover:bg-state-base-hover cursor-pointer gap-1
|
rounded-lg hover:bg-state-base-hover cursor-pointer gap-1
|
||||||
`
|
`
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { plan } = useProviderContext()
|
const { plan } = useProviderContext()
|
||||||
const { userProfile, langGeniusVersionInfo } = useAppContext()
|
const hasDedicatedChannel = plan.type !== Plan.sandbox
|
||||||
const canEmailSupport = plan.type === Plan.professional || plan.type === Plan.team || plan.type === Plan.enterprise
|
|
||||||
|
|
||||||
return <Menu as="div" className="relative h-full w-full">
|
return <Menu as="div" className="relative h-full w-full">
|
||||||
{
|
{
|
||||||
@@ -48,17 +50,17 @@ export default function Support() {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="px-1 py-1">
|
<div className="px-1 py-1">
|
||||||
{canEmailSupport && <MenuItem>
|
{hasDedicatedChannel && <MenuItem>
|
||||||
<a
|
<button
|
||||||
className={cn(itemClassName, 'group justify-between',
|
className={cn(itemClassName, 'group justify-between text-left data-[active]:bg-state-base-hover')}
|
||||||
'data-[active]:bg-state-base-hover',
|
onClick={() => {
|
||||||
)}
|
toggleZendeskWindow(true)
|
||||||
href={mailToSupport(userProfile.email, plan.type, langGeniusVersionInfo.current_version)}
|
closeAccountDropdown()
|
||||||
target='_blank' rel='noopener noreferrer'>
|
}}
|
||||||
<RiMailSendLine className='size-4 shrink-0 text-text-tertiary' />
|
>
|
||||||
<div className='system-md-regular grow px-1 text-text-secondary'>{t('common.userProfile.emailSupport')}</div>
|
<RiChatSmile2Line className='size-4 shrink-0 text-text-tertiary' />
|
||||||
<RiArrowRightUpLine className='size-[14px] shrink-0 text-text-tertiary' />
|
<div className='system-md-regular grow px-1 text-text-secondary'>{t('common.userProfile.contactUs')}</div>
|
||||||
</a>
|
</button>
|
||||||
</MenuItem>}
|
</MenuItem>}
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
<Link
|
<Link
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const translation = {
|
|||||||
compliance: 'Einhaltung',
|
compliance: 'Einhaltung',
|
||||||
support: 'Unterstützung',
|
support: 'Unterstützung',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
|
contactUs: 'Kontaktieren Sie uns',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'KONTO',
|
accountGroup: 'KONTO',
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ const translation = {
|
|||||||
},
|
},
|
||||||
userProfile: {
|
userProfile: {
|
||||||
settings: 'Settings',
|
settings: 'Settings',
|
||||||
|
contactUs: 'Contact Us',
|
||||||
emailSupport: 'Email Support',
|
emailSupport: 'Email Support',
|
||||||
workspace: 'Workspace',
|
workspace: 'Workspace',
|
||||||
createWorkspace: 'Create Workspace',
|
createWorkspace: 'Create Workspace',
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ const translation = {
|
|||||||
support: 'Apoyo',
|
support: 'Apoyo',
|
||||||
compliance: 'Cumplimiento',
|
compliance: 'Cumplimiento',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
|
contactUs: 'Contáctenos',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'CUENTA',
|
accountGroup: 'CUENTA',
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ const translation = {
|
|||||||
github: 'گیتهاب',
|
github: 'گیتهاب',
|
||||||
compliance: 'انطباق',
|
compliance: 'انطباق',
|
||||||
support: 'پشتیبانی',
|
support: 'پشتیبانی',
|
||||||
|
contactUs: 'با ما تماس بگیرید',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'حساب کاربری',
|
accountGroup: 'حساب کاربری',
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const translation = {
|
|||||||
support: 'Soutien',
|
support: 'Soutien',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
compliance: 'Conformité',
|
compliance: 'Conformité',
|
||||||
|
contactUs: 'Contactez-nous',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'COMPTE',
|
accountGroup: 'COMPTE',
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ const translation = {
|
|||||||
compliance: 'अनुपालन',
|
compliance: 'अनुपालन',
|
||||||
github: 'गिटहब',
|
github: 'गिटहब',
|
||||||
support: 'समर्थन',
|
support: 'समर्थन',
|
||||||
|
contactUs: 'संपर्क करें',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'खाता',
|
accountGroup: 'खाता',
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ const translation = {
|
|||||||
about: 'Tentang',
|
about: 'Tentang',
|
||||||
workspace: 'Workspace',
|
workspace: 'Workspace',
|
||||||
createWorkspace: 'Membuat Ruang Kerja',
|
createWorkspace: 'Membuat Ruang Kerja',
|
||||||
|
contactUs: 'Hubungi Kami',
|
||||||
},
|
},
|
||||||
compliance: {
|
compliance: {
|
||||||
soc2Type2: 'Laporan SOC 2 Tipe II',
|
soc2Type2: 'Laporan SOC 2 Tipe II',
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ const translation = {
|
|||||||
support: 'Supporto',
|
support: 'Supporto',
|
||||||
compliance: 'Conformità',
|
compliance: 'Conformità',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
|
contactUs: 'Contattaci',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'ACCOUNT',
|
accountGroup: 'ACCOUNT',
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ const translation = {
|
|||||||
about: 'Dify について',
|
about: 'Dify について',
|
||||||
logout: 'ログアウト',
|
logout: 'ログアウト',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
|
contactUs: 'お問い合わせ',
|
||||||
},
|
},
|
||||||
compliance: {
|
compliance: {
|
||||||
soc2Type1: 'SOC 2 Type I 報告書',
|
soc2Type1: 'SOC 2 Type I 報告書',
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ const translation = {
|
|||||||
github: '깃허브',
|
github: '깃허브',
|
||||||
compliance: '컴플라이언스',
|
compliance: '컴플라이언스',
|
||||||
support: '지원',
|
support: '지원',
|
||||||
|
contactUs: '문의하기',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: '계정',
|
accountGroup: '계정',
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ const translation = {
|
|||||||
support: 'Wsparcie',
|
support: 'Wsparcie',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
compliance: 'Zgodność',
|
compliance: 'Zgodność',
|
||||||
|
contactUs: 'Skontaktuj się z nami',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'KONTO',
|
accountGroup: 'KONTO',
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const translation = {
|
|||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
support: 'Suporte',
|
support: 'Suporte',
|
||||||
compliance: 'Conformidade',
|
compliance: 'Conformidade',
|
||||||
|
contactUs: 'Contate-Nos',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'CONTA',
|
accountGroup: 'CONTA',
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const translation = {
|
|||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
support: 'Suport',
|
support: 'Suport',
|
||||||
compliance: 'Conformitate',
|
compliance: 'Conformitate',
|
||||||
|
contactUs: 'Contactați-ne',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'CONT',
|
accountGroup: 'CONT',
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ const translation = {
|
|||||||
github: 'ГитХаб',
|
github: 'ГитХаб',
|
||||||
compliance: 'Соблюдение',
|
compliance: 'Соблюдение',
|
||||||
support: 'Поддержка',
|
support: 'Поддержка',
|
||||||
|
contactUs: 'Свяжитесь с нами',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'АККАУНТ',
|
accountGroup: 'АККАУНТ',
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ const translation = {
|
|||||||
support: 'Podpora',
|
support: 'Podpora',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
compliance: 'Skladnost',
|
compliance: 'Skladnost',
|
||||||
|
contactUs: 'Kontaktirajte nas',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'SPLOŠNO',
|
accountGroup: 'SPLOŠNO',
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ const translation = {
|
|||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
compliance: 'การปฏิบัติตามข้อกำหนด',
|
compliance: 'การปฏิบัติตามข้อกำหนด',
|
||||||
support: 'การสนับสนุน',
|
support: 'การสนับสนุน',
|
||||||
|
contactUs: 'ติดต่อเรา',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'ทั่วไป',
|
accountGroup: 'ทั่วไป',
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ const translation = {
|
|||||||
support: 'Destek',
|
support: 'Destek',
|
||||||
compliance: 'Uygunluk',
|
compliance: 'Uygunluk',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
|
contactUs: 'Bize Ulaşın',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'HESAP',
|
accountGroup: 'HESAP',
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const translation = {
|
|||||||
compliance: 'Відповідність',
|
compliance: 'Відповідність',
|
||||||
support: 'Підтримка',
|
support: 'Підтримка',
|
||||||
github: 'Гітхаб',
|
github: 'Гітхаб',
|
||||||
|
contactUs: 'Зв’яжіться з нами',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'ОБЛІКОВИЙ ЗАПИС',
|
accountGroup: 'ОБЛІКОВИЙ ЗАПИС',
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const translation = {
|
|||||||
compliance: 'Tuân thủ',
|
compliance: 'Tuân thủ',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
support: 'Hỗ trợ',
|
support: 'Hỗ trợ',
|
||||||
|
contactUs: 'Liên hệ với chúng tôi',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: 'TÀI KHOẢN',
|
accountGroup: 'TÀI KHOẢN',
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ const translation = {
|
|||||||
community: '社区',
|
community: '社区',
|
||||||
about: '关于',
|
about: '关于',
|
||||||
logout: '登出',
|
logout: '登出',
|
||||||
|
contactUs: '联系我们',
|
||||||
},
|
},
|
||||||
compliance: {
|
compliance: {
|
||||||
soc2Type1: 'SOC 2 Type I Report',
|
soc2Type1: 'SOC 2 Type I Report',
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const translation = {
|
|||||||
support: '支持',
|
support: '支持',
|
||||||
github: 'GitHub',
|
github: 'GitHub',
|
||||||
compliance: '合規',
|
compliance: '合規',
|
||||||
|
contactUs: '聯絡我們',
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
accountGroup: '賬戶',
|
accountGroup: '賬戶',
|
||||||
|
|||||||
@@ -115,10 +115,10 @@ export type IOtherOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function jumpTo(url: string) {
|
function jumpTo(url: string) {
|
||||||
if(!url)
|
if (!url)
|
||||||
return
|
return
|
||||||
const targetPath = new URL(url, globalThis.location.origin).pathname
|
const targetPath = new URL(url, globalThis.location.origin).pathname
|
||||||
if(targetPath === globalThis.location.pathname)
|
if (targetPath === globalThis.location.pathname)
|
||||||
return
|
return
|
||||||
globalThis.location.href = url
|
globalThis.location.href = url
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ const WBB_APP_LOGIN_PATH = '/webapp-signin'
|
|||||||
function requiredWebSSOLogin(message?: string, code?: number) {
|
function requiredWebSSOLogin(message?: string, code?: number) {
|
||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
// prevent redirect loop
|
// prevent redirect loop
|
||||||
if(globalThis.location.pathname === WBB_APP_LOGIN_PATH)
|
if (globalThis.location.pathname === WBB_APP_LOGIN_PATH)
|
||||||
return
|
return
|
||||||
|
|
||||||
params.append('redirect_url', encodeURIComponent(`${globalThis.location.pathname}${globalThis.location.search}`))
|
params.append('redirect_url', encodeURIComponent(`${globalThis.location.pathname}${globalThis.location.search}`))
|
||||||
|
|||||||
Reference in New Issue
Block a user