(s3) Improve storage management and type safety

Closes #756
This commit is contained in:
Baptiste Arnaud
2023-09-08 15:28:11 +02:00
parent 43be38cf50
commit fbb198af9d
47 changed files with 790 additions and 128 deletions

View File

@@ -16,6 +16,7 @@ import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'
import { TextInput, Textarea } from '@/components/inputs'
type Props = {
workspaceId: string
typebotId: string
typebotName: string
metadata: Metadata
@@ -23,6 +24,7 @@ type Props = {
}
export const MetadataForm = ({
workspaceId,
typebotId,
typebotName,
metadata,
@@ -61,7 +63,11 @@ export const MetadataForm = ({
</PopoverTrigger>
<PopoverContent p="4" w="400px">
<ImageUploadContent
filePath={`typebots/${typebotId}/favIcon`}
uploadFileProps={{
workspaceId,
typebotId,
fileName: 'favIcon',
}}
defaultUrl={metadata.favIconUrl ?? ''}
onSubmit={handleFavIconSubmit}
excludedTabs={['giphy', 'unsplash', 'emoji']}
@@ -87,7 +93,11 @@ export const MetadataForm = ({
</PopoverTrigger>
<PopoverContent p="4" w="500px">
<ImageUploadContent
filePath={`typebots/${typebotId}/ogImage`}
uploadFileProps={{
workspaceId,
typebotId,
fileName: 'ogImage',
}}
defaultUrl={metadata.imageUrl}
onSubmit={handleImageSubmit}
excludedTabs={['giphy', 'icon', 'emoji']}

View File

@@ -94,6 +94,7 @@ export const SettingsSideMenu = () => {
<AccordionPanel pb={4} px="6">
{typebot && (
<MetadataForm
workspaceId={typebot.workspaceId}
typebotId={typebot.id}
typebotName={typebot.name}
metadata={typebot.settings.metadata}