-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🎉 Replace Intercom with Zendesk (#7395)
- Loading branch information
Showing
30 changed files
with
119 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# Environment variables in this file will be passed along to the frontend code, but its content will not be available in the build script | ||
REACT_APP_SEGMENT_TOKEN=6cxNSmQyGSKcATLdJ2pL6WsawkzEMDAN | ||
REACT_APP_INTERCOM_APP_ID=nj1oam7s | ||
REACT_APP_OSANO=16A0CTTE7vE8m1Qif/67beec9b-e563-4736-bdb4-4fe4adc39d48 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
airbyte-webapp/src/packages/cloud/services/thirdParty/intercom/IntercomProvider.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
airbyte-webapp/src/packages/cloud/services/thirdParty/intercom/index.tsx
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
airbyte-webapp/src/packages/cloud/services/thirdParty/intercom/useIntercom.ts
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
airbyte-webapp/src/packages/cloud/services/thirdParty/zendesk/ZendeskProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { useEffect } from "react"; | ||
import { useEffectOnce } from "react-use"; | ||
|
||
import { config } from "config"; | ||
import { useCurrentWorkspaceId } from "services/workspaces/WorkspacesService"; | ||
|
||
import { useAuthService } from "../../auth/AuthService"; | ||
|
||
import "./zendesk.module.scss"; | ||
|
||
declare global { | ||
interface Window { | ||
zE?: (type: string, action: string, params?: unknown) => void; | ||
zESettings?: unknown; | ||
} | ||
} | ||
|
||
export const ZendeskProvider: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => { | ||
const { zendeskKey } = config; | ||
const { user } = useAuthService(); | ||
const workspaceId = useCurrentWorkspaceId(); | ||
|
||
useEffectOnce(() => { | ||
if (zendeskKey) { | ||
const script = document.createElement("script"); | ||
script.id = "ze-snippet"; | ||
script.src = `https://static.zdassets.com/ekr/snippet.js?key=${zendeskKey}`; | ||
document.body.appendChild(script); | ||
} | ||
}); | ||
|
||
useEffect(() => { | ||
window.zE?.("webWidget", "prefill", { | ||
name: { value: user?.name }, | ||
email: { value: user?.email }, | ||
}); | ||
}, [user]); | ||
|
||
useEffect(() => { | ||
window.zESettings = { | ||
webWidget: { | ||
contactForm: { | ||
// Only allow Cloud ticket form | ||
ticketForms: [{ id: "16332000182427" }], | ||
fields: [{ id: "16334185233691", prefill: { "*": `https://cloud.airbyte.com/workspaces/${workspaceId}` } }], | ||
}, | ||
}, | ||
}; | ||
}, [workspaceId]); | ||
|
||
return <>{children}</>; | ||
}; |
2 changes: 2 additions & 0 deletions
2
airbyte-webapp/src/packages/cloud/services/thirdParty/zendesk/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { ZendeskProvider } from "./ZendeskProvider"; | ||
export { useZendesk } from "./useZendesk"; |
17 changes: 17 additions & 0 deletions
17
airbyte-webapp/src/packages/cloud/services/thirdParty/zendesk/useZendesk.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useCallback, useMemo } from "react"; | ||
|
||
import { AppActionCodes, useAppMonitoringService } from "hooks/services/AppMonitoringService"; | ||
|
||
export const useZendesk = () => { | ||
const { trackAction } = useAppMonitoringService(); | ||
|
||
const openZendesk = useCallback(() => { | ||
if (window.zE) { | ||
window.zE("webWidget", "open"); | ||
} else { | ||
trackAction(AppActionCodes.ZENDESK_OPEN_FAILURE); | ||
} | ||
}, [trackAction]); | ||
|
||
return useMemo(() => ({ openZendesk }), [openZendesk]); | ||
}; |
4 changes: 4 additions & 0 deletions
4
airbyte-webapp/src/packages/cloud/services/thirdParty/zendesk/zendesk.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
:global(iframe#launcher) { | ||
// Hide the launcher icon. Unfortunately there is no setting in the API for this | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.