2
0

🐛 Fix board menu placement when suspected typebot banner is displayed

This commit is contained in:
Baptiste Arnaud
2024-03-11 11:07:27 +01:00
parent bbeb12cad2
commit 4a7d10f578
3 changed files with 18 additions and 5 deletions

View File

@ -28,15 +28,15 @@ export const EditorPage = () => {
) )
const bgColor = useColorModeValue('#f4f5f8', 'gray.850') const bgColor = useColorModeValue('#f4f5f8', 'gray.850')
const isSuspicious = typebot?.riskLevel === 100 && !workspace?.isVerified
if (is404) return <TypebotNotFoundPage /> if (is404) return <TypebotNotFoundPage />
return ( return (
<EditorProvider> <EditorProvider>
<Seo title={typebot?.name ? `${typebot.name} | Editor` : 'Editor'} /> <Seo title={typebot?.name ? `${typebot.name} | Editor` : 'Editor'} />
<Flex overflow="clip" h="100vh" flexDir="column" id="editor-container"> <Flex overflow="clip" h="100vh" flexDir="column" id="editor-container">
<GettingStartedModal /> <GettingStartedModal />
{typebot?.riskLevel === 100 && !workspace?.isVerified && ( {isSuspicious && <SuspectedTypebotBanner typebotId={typebot.id} />}
<SuspectedTypebotBanner typebotId={typebot.id} />
)}
<TypebotHeader /> <TypebotHeader />
<Flex <Flex
flex="1" flex="1"
@ -57,7 +57,11 @@ export const EditorPage = () => {
> >
<EventsCoordinatesProvider events={typebot.events}> <EventsCoordinatesProvider events={typebot.events}>
<Graph flex="1" typebot={typebot} key={typebot.id} /> <Graph flex="1" typebot={typebot} key={typebot.id} />
<BoardMenuButton pos="absolute" right="40px" top="20px" /> <BoardMenuButton
pos="absolute"
right="40px"
top={`calc(20px + ${isSuspicious ? '70px' : '0'})`}
/>
<RightPanel /> <RightPanel />
</EventsCoordinatesProvider> </EventsCoordinatesProvider>
</GraphProvider> </GraphProvider>

View File

@ -77,6 +77,11 @@ export const PublishButton = ({
title: t('publish.error.label'), title: t('publish.error.label'),
description: error.message, description: error.message,
}) })
if (error.data?.httpStatus === 403) {
setTimeout(() => {
window.location.reload()
}, 3000)
}
}, },
onSuccess: () => { onSuccess: () => {
refetchPublishedTypebot({ refetchPublishedTypebot({

View File

@ -98,7 +98,11 @@ export const publishTypebot = authenticatedProcedure
'Radar detected a potential malicious typebot. This bot is being manually reviewed by Fraud Prevention team.', 'Radar detected a potential malicious typebot. This bot is being manually reviewed by Fraud Prevention team.',
}) })
const riskLevel = typebotWasVerified ? 0 : computeRiskLevel(existingTypebot) const riskLevel = typebotWasVerified
? 0
: computeRiskLevel(existingTypebot, {
debug: env.NODE_ENV === 'development',
})
if (riskLevel > 0 && riskLevel !== existingTypebot.riskLevel) { if (riskLevel > 0 && riskLevel !== existingTypebot.riskLevel) {
if (env.MESSAGE_WEBHOOK_URL && riskLevel !== 100 && riskLevel > 60) if (env.MESSAGE_WEBHOOK_URL && riskLevel !== 100 && riskLevel > 60)