2
0

fix(docker): 🐛 Runtime public environment

This commit is contained in:
Baptiste Arnaud
2022-06-22 07:36:11 +02:00
parent 3e47b37c2e
commit f801a29539
55 changed files with 358 additions and 167 deletions

View File

@ -11,7 +11,7 @@ import { PopupEmbedSettings } from 'components/share/codeSnippets/Popup/EmbedSet
import { CodeEditor } from 'components/shared/CodeEditor'
import { useState } from 'react'
import { BubbleParams } from 'typebot-js'
import { isEmpty } from 'utils'
import { env, isEmpty } from 'utils'
import { ModalProps } from '../../EmbedButton'
type GtmInstructionsProps = {
@ -41,9 +41,9 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
const jsCode = parseInitContainerCode({
url: `${
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
? process.env.NEXT_PUBLIC_VIEWER_URL
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
isEmpty(env('VIEWER_INTERNAL_URL'))
? env('VIEWER_URL')
: env('VIEWER_INTERNAL_URL')
}/${publicId}`,
})
const headCode = `${typebotJsHtml}

View File

@ -16,7 +16,7 @@ import {
} from '@chakra-ui/react'
import { CopyButton } from 'components/shared/buttons/CopyButton'
import { PublishFirstInfo } from 'components/shared/Info'
import { isEmpty } from 'utils'
import { env, isEmpty } from 'utils'
import { ModalProps } from '../EmbedButton'
export const NotionModal = ({
@ -46,17 +46,17 @@ export const NotionModal = ({
pr="4.5rem"
type={'text'}
defaultValue={`${
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
? process.env.NEXT_PUBLIC_VIEWER_URL
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
isEmpty(env('VIEWER_INTERNAL_URL'))
? env('VIEWER_URL')
: env('VIEWER_INTERNAL_URL')
}/${publicId}`}
/>
<InputRightElement width="4.5rem">
<CopyButton
textToCopy={`${
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
? process.env.NEXT_PUBLIC_VIEWER_URL
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
isEmpty(env('VIEWER_INTERNAL_URL'))
? env('VIEWER_URL')
: env('VIEWER_INTERNAL_URL')
}/${publicId}`}
/>
</InputRightElement>

View File

@ -14,7 +14,7 @@ import { BubbleParams } from 'typebot-js'
import { ModalProps } from '../../EmbedButton'
import parserHtml from 'prettier/parser-html'
import prettier from 'prettier/standalone'
import { isEmpty } from 'utils'
import { env, isEmpty } from 'utils'
type ShopifyInstructionsProps = {
type: 'standard' | 'popup' | 'bubble'
@ -46,9 +46,9 @@ const StandardInstructions = ({ publicId }: Pick<ModalProps, 'publicId'>) => {
const jsCode = parseInitContainerCode({
url: `${
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
? process.env.NEXT_PUBLIC_VIEWER_URL
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
isEmpty(env('VIEWER_INTERNAL_URL'))
? env('VIEWER_URL')
: env('VIEWER_INTERNAL_URL')
}/${publicId}`,
})
const headCode = prettier.format(

View File

@ -17,7 +17,7 @@ import {
import { ExternalLinkIcon } from 'assets/icons'
import { CopyButton } from 'components/shared/buttons/CopyButton'
import { PublishFirstInfo } from 'components/shared/Info'
import { isEmpty } from 'utils'
import { env, isEmpty } from 'utils'
import { ModalProps } from '../EmbedButton'
export const WordpressModal = ({
@ -55,17 +55,17 @@ export const WordpressModal = ({
pr="4.5rem"
type={'text'}
defaultValue={`${
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
? process.env.NEXT_PUBLIC_VIEWER_URL
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
isEmpty(env('VIEWER_INTERNAL_URL'))
? env('VIEWER_URL')
: env('VIEWER_INTERNAL_URL')
}/${publicId}`}
/>
<InputRightElement width="4.5rem">
<CopyButton
textToCopy={`${
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
? process.env.NEXT_PUBLIC_VIEWER_URL
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
isEmpty(env('VIEWER_INTERNAL_URL'))
? env('VIEWER_URL')
: env('VIEWER_INTERNAL_URL')
}/${publicId}`}
/>
</InputRightElement>