2
0

feat(editor): Restore published version button

Had to migrate webhooks into a standalone table
This commit is contained in:
Baptiste Arnaud
2022-03-01 07:13:09 +01:00
parent 0df719d531
commit e17a1a0869
46 changed files with 578 additions and 348 deletions

View File

@ -3,7 +3,6 @@ import { TransitionGroup, CSSTransition } from 'react-transition-group'
import { ChatStep } from './ChatStep'
import { AvatarSideContainer } from './AvatarSideContainer'
import { HostAvatarsContext } from '../../contexts/HostAvatarsContext'
import { PublicStep } from 'models'
import { useTypebot } from '../../contexts/TypebotContext'
import {
isBubbleStep,
@ -17,9 +16,10 @@ import { executeIntegration } from 'services/integration'
import { parseRetryStep, stepCanBeRetried } from 'services/inputs'
import { parseVariables } from 'index'
import { useAnswers } from 'contexts/AnswersContext'
import { Step } from 'models'
type ChatBlockProps = {
steps: PublicStep[]
steps: Step[]
startStepIndex: number
onScroll: () => void
onBlockEnd: (edgeId?: string) => void
@ -34,7 +34,7 @@ export const ChatBlock = ({
const { typebot, updateVariableValue, createEdge, apiHost, isPreview } =
useTypebot()
const { resultValues } = useAnswers()
const [displayedSteps, setDisplayedSteps] = useState<PublicStep[]>([])
const [displayedSteps, setDisplayedSteps] = useState<Step[]>([])
useEffect(() => {
const nextStep = steps[startStepIndex]

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react'
import { useAnswers } from '../../../contexts/AnswersContext'
import { useHostAvatars } from '../../../contexts/HostAvatarsContext'
import { InputStep, InputStepType, PublicStep } from 'models'
import { InputStep, InputStepType, Step } from 'models'
import { GuestBubble } from './bubbles/GuestBubble'
import { TextForm } from './inputs/TextForm'
import { byId, isBubbleStep, isInputStep } from 'utils'
@ -16,7 +16,7 @@ export const ChatStep = ({
step,
onTransitionEnd,
}: {
step: PublicStep
step: Step
onTransitionEnd: (answerContent?: string, isRetry?: boolean) => void
}) => {
const { addAnswer } = useAnswers()

View File

@ -5,7 +5,7 @@ import { useFrame } from 'react-frame-component'
import { setCssVariablesValue } from '../services/theme'
import { useAnswers } from '../contexts/AnswersContext'
import { deepEqual } from 'fast-equals'
import { Answer, Edge, PublicBlock, Theme, VariableWithValue } from 'models'
import { Answer, Block, Edge, Theme, VariableWithValue } from 'models'
import { byId, isNotDefined } from 'utils'
import { animateScroll as scroll } from 'react-scroll'
import { useTypebot } from 'contexts/TypebotContext'
@ -27,7 +27,7 @@ export const ConversationContainer = ({
const { typebot, updateVariableValue } = useTypebot()
const { document: frameDocument } = useFrame()
const [displayedBlocks, setDisplayedBlocks] = useState<
{ block: PublicBlock; startStepIndex: number }[]
{ block: Block; startStepIndex: number }[]
>([])
const [localAnswer, setLocalAnswer] = useState<Answer | undefined>()
const {