@@ -1,10 +1,10 @@
|
||||
import test, { expect } from '@playwright/test'
|
||||
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
|
||||
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
|
||||
import { BubbleBlockType, defaultAudioBubbleContent } from '@typebot.io/schemas'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import { getTestAsset } from '@/test/utils/playwright'
|
||||
import { proWorkspaceId } from '@typebot.io/lib/playwright/databaseSetup'
|
||||
import { BubbleBlockType } from '@typebot.io/schemas/features/blocks/bubbles/constants'
|
||||
|
||||
const audioSampleUrl =
|
||||
'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3'
|
||||
@@ -16,7 +16,6 @@ test('should work as expected', async ({ page }) => {
|
||||
id: typebotId,
|
||||
...parseDefaultGroupWithBlock({
|
||||
type: BubbleBlockType.AUDIO,
|
||||
content: defaultAudioBubbleContent,
|
||||
}),
|
||||
},
|
||||
])
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { Button, Flex, HStack, Stack, Text } from '@chakra-ui/react'
|
||||
import { AudioBubbleContent } from '@typebot.io/schemas'
|
||||
import { TextInput } from '@/components/inputs'
|
||||
import { useState } from 'react'
|
||||
import { UploadButton } from '@/components/ImageUploadContent/UploadButton'
|
||||
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
|
||||
import { useTranslate } from '@tolgee/react'
|
||||
import { FilePathUploadProps } from '@/features/upload/api/generateUploadUrl'
|
||||
import { AudioBubbleBlock } from '@typebot.io/schemas'
|
||||
import { defaultAudioBubbleContent } from '@typebot.io/schemas/features/blocks/bubbles/audio/constants'
|
||||
|
||||
type Props = {
|
||||
uploadFileProps: FilePathUploadProps
|
||||
content: AudioBubbleContent
|
||||
onContentChange: (content: AudioBubbleContent) => void
|
||||
content: AudioBubbleBlock['content']
|
||||
onContentChange: (content: AudioBubbleBlock['content']) => void
|
||||
}
|
||||
|
||||
export const AudioBubbleForm = ({
|
||||
@@ -64,7 +65,7 @@ export const AudioBubbleForm = ({
|
||||
placeholder={t(
|
||||
'editor.blocks.bubbles.audio.settings.worksWith.placeholder'
|
||||
)}
|
||||
defaultValue={content.url ?? ''}
|
||||
defaultValue={content?.url ?? ''}
|
||||
onChange={updateUrl}
|
||||
/>
|
||||
<Text fontSize="sm" color="gray.400" textAlign="center">
|
||||
@@ -75,7 +76,10 @@ export const AudioBubbleForm = ({
|
||||
</Stack>
|
||||
<SwitchWithLabel
|
||||
label={t('editor.blocks.bubbles.audio.settings.autoplay.label')}
|
||||
initialValue={content.isAutoplayEnabled ?? true}
|
||||
initialValue={
|
||||
content?.isAutoplayEnabled ??
|
||||
defaultAudioBubbleContent.isAutoplayEnabled
|
||||
}
|
||||
onCheckChange={updateAutoPlay}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Text } from '@chakra-ui/react'
|
||||
import { AudioBubbleContent } from '@typebot.io/schemas'
|
||||
import { isDefined } from '@typebot.io/lib'
|
||||
import { useTranslate } from '@tolgee/react'
|
||||
import { AudioBubbleBlock } from '@typebot.io/schemas'
|
||||
|
||||
type Props = {
|
||||
url: AudioBubbleContent['url']
|
||||
url: NonNullable<AudioBubbleBlock['content']>['url']
|
||||
}
|
||||
|
||||
export const AudioBubbleNode = ({ url }: Props) => {
|
||||
|
||||
Reference in New Issue
Block a user