2
0

build: 👷 New compose file and entrypoints

This commit is contained in:
Baptiste Arnaud
2022-05-25 08:13:35 -07:00
parent 4a5a92b973
commit 5d786f59cc
44 changed files with 288 additions and 113 deletions

View File

@@ -9,6 +9,7 @@ import { useDebouncedCallback } from 'use-debounce'
import { linter } from '@codemirror/lint'
import { VariablesButton } from './buttons/VariablesButton'
import { Variable } from 'models'
import { isEmpty } from 'utils'
const linterExtension = linter(jsonParseLinter())
@@ -40,7 +41,7 @@ export const CodeEditor = ({
setPlainTextValue(value)
onChange && onChange(value)
},
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
)
useEffect(

View File

@@ -16,6 +16,7 @@ import { useTypebot } from 'contexts/TypebotContext'
import { BaseEmoji, emojiIndex } from 'emoji-mart'
import { emojis } from './emojis'
import { Input } from '../Textbox/Input'
import { isEmpty } from 'utils'
type Props = {
url?: string
@@ -182,7 +183,7 @@ const EmojiContent = ({
}
const GiphyContent = ({ onNewUrl }: ContentProps) => {
if (!process.env.NEXT_PUBLIC_GIPHY_API_KEY)
if (isEmpty(process.env.NEXT_PUBLIC_GIPHY_API_KEY))
return <Text>NEXT_PUBLIC_GIPHY_API_KEY is missing in environment</Text>
return (
<SearchContextManager

View File

@@ -11,6 +11,7 @@ import {
} from '@chakra-ui/react'
import { useState, useRef, useEffect, ChangeEvent } from 'react'
import { useDebouncedCallback } from 'use-debounce'
import { isEmpty } from 'utils'
type Props = {
selectedItem?: string
@@ -31,7 +32,7 @@ export const SearchableDropdown = ({
const debounced = useDebouncedCallback(
// eslint-disable-next-line @typescript-eslint/no-empty-function
onValueChange ? onValueChange : () => {},
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
)
const [filteredItems, setFilteredItems] = useState([
...items

View File

@@ -8,6 +8,7 @@ import {
} from '@chakra-ui/react'
import { useEffect, useState } from 'react'
import { useDebouncedCallback } from 'use-debounce'
import { isEmpty } from 'utils'
export const SmartNumberInput = ({
value,
@@ -22,7 +23,7 @@ export const SmartNumberInput = ({
const [currentValue, setCurrentValue] = useState(value?.toString() ?? '')
const debounced = useDebouncedCallback(
onValueChange,
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
)
useEffect(

View File

@@ -5,6 +5,7 @@ import React, { useEffect, useState } from 'react'
import { isCloudProdInstance } from 'services/utils'
import { planToReadable } from 'services/workspace'
import { initBubble } from 'typebot-js'
import { isEmpty } from 'utils'
export const SupportBubble = () => {
const { typebot } = useTypebot()
@@ -22,8 +23,9 @@ export const SupportBubble = () => {
setLocalUserId(user?.id)
initBubble({
url: `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
process.env.NEXT_PUBLIC_VIEWER_URL
isEmpty(process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL)
? process.env.NEXT_PUBLIC_VIEWER_URL
: process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL
}/typebot-support`,
backgroundColor: '#ffffff',
button: {

View File

@@ -7,6 +7,7 @@ import {
import { Variable } from 'models'
import React, { ChangeEvent, useEffect, useRef, useState } from 'react'
import { useDebouncedCallback } from 'use-debounce'
import { isEmpty } from 'utils'
import { VariablesButton } from '../buttons/VariablesButton'
export type TextBoxProps = {
@@ -35,7 +36,7 @@ export const TextBox = ({
(value) => {
onChange(value)
},
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
)
useEffect(() => {

View File

@@ -17,7 +17,7 @@ import cuid from 'cuid'
import { Variable } from 'models'
import React, { useState, useRef, ChangeEvent, useEffect } from 'react'
import { useDebouncedCallback } from 'use-debounce'
import { byId, isNotDefined } from 'utils'
import { byId, isEmpty, isNotDefined } from 'utils'
type Props = {
initialVariableId?: string
@@ -47,7 +47,7 @@ export const VariableSearchInput = ({
const variable = variables.find((v) => v.name === value)
if (variable) onSelectVariable(variable)
},
process.env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
isEmpty(process.env.NEXT_PUBLIC_E2E_TEST) ? debounceTimeout : 0
)
const [filteredItems, setFilteredItems] = useState<Variable[]>(
variables ?? []