diff --git a/.github/workflows/auto-move-project-card.yml b/.github/workflows/auto-move-project-card.yml
deleted file mode 100644
index 34114971f1..0000000000
--- a/.github/workflows/auto-move-project-card.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-on:
- pull_request:
- types: [opened, edited, ready_for_review, synchronize]
-
-jobs:
- move-linked-issues:
- runs-on: ubuntu-latest
- name: Move linked issues to In Review column
- steps:
- - uses: rharter/github-move-linked-project-cards@v0.1.0
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- column: Reviewing 👀
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
deleted file mode 100644
index 3c01f7d14f..0000000000
--- a/.github/workflows/playwright.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: Playwright Tests
-
-on:
- deployment_status:
-
-jobs:
- test-builder:
- timeout-minutes: 60
- runs-on: ubuntu-latest
- if: ${{ github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.environment, 'builder')}}
- steps:
- - name: Log Info
- run: echo ${{ github.event.deployment_status.target_url }} && echo ${{ github.event.deployment }} && echo ${{ github.event.deployment_status.environment }}
- - uses: actions/checkout@v2
- - uses: pnpm/action-setup@v2.2.2
- - name: Install dependencies
- run: pnpm i --frozen-lockfile
- - name: Build dependencies
- run: pnpm turbo run build --filter="builder^..."
- - name: Install Playwright
- run: npx playwright install --with-deps
- - name: Run tests
- working-directory: ./apps/builder
- run: pnpm test
- env:
- PLAYWRIGHT_BUILDER_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
- DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
- SMTP_HOST: smtp.ethereal.email
- SMTP_PORT: 587
- SMTP_SECURE: false
- SMTP_USERNAME: tobin.tillman65@ethereal.email
- SMTP_PASSWORD: Ty9BcwCBrK6w8AG2hx
- STRIPE_TEST_PUBLIC_KEY: pk_test_fYwf5fyL66hiRIkFVcpStukl00K1MTPPmG
- STRIPE_TEST_SECRET_KEY: ${{ secrets.STRIPE_TEST_SECRET_KEY }}
- ENCRYPTION_SECRET: ${{ secrets.ENCRYPTION_SECRET }}
- - name: Upload test results
- if: always()
- uses: actions/upload-artifact@v2
- with:
- name: playwright-results
- path: ./apps/builder/playwright-report
diff --git a/.github/workflows/publish_docker_images.yml b/.github/workflows/publish_docker_images.yml
index 4375ebd25c..45a33b49e8 100644
--- a/.github/workflows/publish_docker_images.yml
+++ b/.github/workflows/publish_docker_images.yml
@@ -1,4 +1,4 @@
-name: Publish Docker images
+name: Build Docker images
on:
create:
@@ -9,32 +9,34 @@ on:
branches: [main]
jobs:
- push_builder:
- name: Builder
+ build:
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ app: ['builder', 'viewer']
steps:
- name: Check out the repo
uses: actions/checkout@v3
- - name: Extract Builder meta
- id: builder-meta
+ - name: Extract existing image metadata
+ id: ${{ matrix.app }}-meta
uses: docker/metadata-action@v4
with:
- images: baptistearno/typebot-builder
+ images: baptistearno/typebot-${{ matrix.app }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- - name: Log in to Docker Hub
- if: github.event_name != 'pull_request'
+ - if: github.event_name != 'pull_request'
+ name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Build and push builder image
+ - name: Build image
uses: docker/build-push-action@v3
with:
context: .
@@ -42,38 +44,4 @@ jobs:
tags: ${{ steps.builder-meta.outputs.tags }}
labels: ${{ steps.builder-meta.outputs.labels }}
build-args: |
- SCOPE=builder
- push_viewer:
- name: Viewer
- runs-on: ubuntu-latest
- steps:
- - name: Check out the repo
- uses: actions/checkout@v3
-
- - name: Extract Viewer meta
- id: viewer-meta
- uses: docker/metadata-action@v4
- with:
- images: baptistearno/typebot-viewer
- tags: |
- type=ref,event=branch
- type=semver,pattern={{version}}
- type=semver,pattern={{major}}.{{minor}}
- type=semver,pattern={{major}}
-
- - name: Log in to Docker Hub
- if: github.event_name != 'pull_request'
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - name: Build and push viewer image
- uses: docker/build-push-action@v3
- with:
- context: .
- push: ${{ github.event_name != 'pull_request' }}
- tags: ${{ steps.viewer-meta.outputs.tags }}
- labels: ${{ steps.viewer-meta.outputs.labels }}
- build-args: |
- SCOPE=viewer
+ SCOPE=${{ matrix.app }}
diff --git a/apps/builder/components/auth/AuthSwitcher.tsx b/apps/builder/components/auth/AuthSwitcher.tsx
index c090c01afc..b80e7ddd84 100644
--- a/apps/builder/components/auth/AuthSwitcher.tsx
+++ b/apps/builder/components/auth/AuthSwitcher.tsx
@@ -1,6 +1,6 @@
import React from 'react'
-import { NextChakraLink } from '../nextChakra/NextChakraLink'
import { Text } from '@chakra-ui/react'
+import { TextLink } from 'components/shared/TextLink'
type Props = {
type: 'register' | 'signin'
@@ -10,16 +10,11 @@ export const AuthSwitcher = ({ type }: Props) => (
{type === 'signin' ? (
Don't have an account?{' '}
-
- Sign up for free
-
+ Sign up for free
) : (
- Already have an account?{' '}
-
- Sign in
-
+ Already have an account? Sign in
)}
>
diff --git a/apps/builder/components/auth/SignInForm.tsx b/apps/builder/components/auth/SignInForm.tsx
index dc78eccf48..09ce6966a4 100644
--- a/apps/builder/components/auth/SignInForm.tsx
+++ b/apps/builder/components/auth/SignInForm.tsx
@@ -19,9 +19,9 @@ import {
import { DividerWithText } from './DividerWithText'
import { SocialLoginButtons } from './SocialLoginButtons'
import { useRouter } from 'next/router'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { BuiltInProviderType } from 'next-auth/providers'
import { useToast } from 'components/shared/hooks/useToast'
+import { TextLink } from 'components/shared/TextLink'
type Props = {
defaultEmail?: string
@@ -76,14 +76,12 @@ export const SignInForm = ({
return (
You need to{' '}
-
configure at least one auth provider
- {' '}
+ {' '}
(Email, Google, GitHub, Facebook or Azure AD).
)
diff --git a/apps/builder/components/dashboard/DashboardHeader.tsx b/apps/builder/components/dashboard/DashboardHeader.tsx
index f4800c509e..ba11a09d5c 100644
--- a/apps/builder/components/dashboard/DashboardHeader.tsx
+++ b/apps/builder/components/dashboard/DashboardHeader.tsx
@@ -12,7 +12,6 @@ import {
useDisclosure,
} from '@chakra-ui/react'
import { TypebotLogo } from 'assets/logos'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import {
ChevronLeftIcon,
HardDriveIcon,
@@ -27,6 +26,7 @@ import { EmojiOrImageIcon } from 'components/shared/EmojiOrImageIcon'
import { WorkspaceSettingsModal } from './WorkspaceSettingsModal'
import { isNotDefined } from 'utils'
import { PlanTag } from 'components/shared/PlanTag'
+import Link from 'next/link'
export const DashboardHeader = () => {
const { user } = useUser()
@@ -52,13 +52,9 @@ export const DashboardHeader = () => {
maxW="1000px"
flex="1"
>
-
+
-
+
{user && workspace && (
{
@@ -17,7 +17,7 @@ export const BackButton = ({ id }: { id: string | null }) => {
const handleMouseLeave = () => setMouseOverFolderId(undefined)
return (
}
variant={'outline'}
diff --git a/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/BillingContent.tsx b/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/BillingContent.tsx
index 4c4b8c082c..ba0564d078 100644
--- a/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/BillingContent.tsx
+++ b/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/BillingContent.tsx
@@ -1,7 +1,7 @@
import { HStack, Stack, Text } from '@chakra-ui/react'
import { StripeClimateLogo } from 'assets/logos/StripeClimateLogo'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { ChangePlanForm } from 'components/shared/ChangePlanForm'
+import { TextLink } from 'components/shared/TextLink'
import { useWorkspace } from 'contexts/WorkspaceContext'
import { Plan } from 'db'
import React from 'react'
@@ -33,13 +33,9 @@ export const BillingContent = () => {
Typebot is contributing 1% of your subscription to remove COâ‚‚ from
the atmosphere.{' '}
-
+
More info.
-
+
{workspace.plan !== Plan.CUSTOM &&
diff --git a/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/InvoicesList.tsx b/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/InvoicesList.tsx
index 1fa753cf61..0755d889ba 100644
--- a/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/InvoicesList.tsx
+++ b/apps/builder/components/dashboard/WorkspaceSettingsModal/BillingContent/InvoicesList.tsx
@@ -14,8 +14,8 @@ import {
Text,
} from '@chakra-ui/react'
import { DownloadIcon, FileIcon } from 'assets/icons'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { Workspace } from 'db'
+import Link from 'next/link'
import React from 'react'
import { useInvoicesQuery } from './queries/useInvoicesQuery'
@@ -54,12 +54,12 @@ export const InvoicesList = ({ workspace }: Props) => {
{getFormattedPrice(invoice.amount, invoice.currency)} |
}
variant="outline"
href={invoice.url}
- isExternal
+ target="_blank"
aria-label={'Download invoice'}
/>
|
diff --git a/apps/builder/components/nextChakra/NextChakraLink.tsx b/apps/builder/components/nextChakra/NextChakraLink.tsx
deleted file mode 100644
index 47f1aed696..0000000000
--- a/apps/builder/components/nextChakra/NextChakraLink.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { PropsWithChildren } from 'react'
-import NextLink from 'next/link'
-import { LinkProps as NextLinkProps } from 'next/dist/client/link'
-import {
- Link as ChakraLink,
- LinkProps as ChakraLinkProps,
-} from '@chakra-ui/react'
-import React from 'react'
-
-export type NextChakraLinkProps = PropsWithChildren<
- NextLinkProps & Omit
->
-
-export const NextChakraLink = React.forwardRef<
- HTMLAnchorElement,
- NextChakraLinkProps
->(
- (
- {
- href,
- replace,
- scroll,
- shallow,
- prefetch,
- children,
- locale,
- ...chakraProps
- },
- ref
- ) => {
- return (
-
-
- {children}
-
-
- )
- }
-)
diff --git a/apps/builder/components/results/ResultsTable/ResultsTable.tsx b/apps/builder/components/results/ResultsTable/ResultsTable.tsx
index 6a54d21d5c..978ea96f9f 100644
--- a/apps/builder/components/results/ResultsTable/ResultsTable.tsx
+++ b/apps/builder/components/results/ResultsTable/ResultsTable.tsx
@@ -248,10 +248,9 @@ const IndeterminateCheckbox = React.forwardRef(
const resolvedRef: any = ref || defaultRef
return (
-
+
diff --git a/apps/builder/components/shared/ChangePlanForm/ChangePlanForm.tsx b/apps/builder/components/shared/ChangePlanForm/ChangePlanForm.tsx
index 2c54f77b2c..c4dcc2399e 100644
--- a/apps/builder/components/shared/ChangePlanForm/ChangePlanForm.tsx
+++ b/apps/builder/components/shared/ChangePlanForm/ChangePlanForm.tsx
@@ -1,9 +1,9 @@
import { Stack, HStack, Text } from '@chakra-ui/react'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { useUser } from 'contexts/UserContext'
import { useWorkspace } from 'contexts/WorkspaceContext'
import { Plan } from 'db'
import { useToast } from '../hooks/useToast'
+import { TextLink } from '../TextLink'
import { ProPlanContent } from './ProPlanContent'
import { pay } from './queries/updatePlan'
import { useCurrentSubscriptionInfo } from './queries/useCurrentSubscriptionInfo'
@@ -89,13 +89,9 @@ export const ChangePlanForm = () => {
Need custom limits? Specific features?{' '}
-
+
Let's chat!
-
+
)
diff --git a/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/GoogleSheetsSettingsBody/GoogleSheetsConnectModal.tsx b/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/GoogleSheetsSettingsBody/GoogleSheetsConnectModal.tsx
index 7da7a77287..d7afc95f03 100644
--- a/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/GoogleSheetsSettingsBody/GoogleSheetsConnectModal.tsx
+++ b/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/GoogleSheetsSettingsBody/GoogleSheetsConnectModal.tsx
@@ -13,9 +13,9 @@ import {
Flex,
} from '@chakra-ui/react'
import { GoogleLogo } from 'assets/logos'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { Info } from 'components/shared/Info'
import { useWorkspace } from 'contexts/WorkspaceContext'
+import Link from 'next/link'
import React from 'react'
import { getGoogleSheetsConsentScreenUrl } from 'services/integrations'
@@ -53,7 +53,7 @@ export const GoogleSheetConnectModal = ({
/>
}
data-testid="google"
isLoading={['loading', 'authenticated'].includes(status)}
diff --git a/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/PaymentSettings/StripeConfigModal.tsx b/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/PaymentSettings/StripeConfigModal.tsx
index 8be263cf52..62df9a8fbf 100644
--- a/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/PaymentSettings/StripeConfigModal.tsx
+++ b/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/PaymentSettings/StripeConfigModal.tsx
@@ -18,12 +18,11 @@ import { CredentialsType, StripeCredentialsData } from 'models'
import React, { useState } from 'react'
import { useWorkspace } from 'contexts/WorkspaceContext'
import { Input } from 'components/shared/Textbox'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { MoreInfoTooltip } from 'components/shared/MoreInfoTooltip'
-import { ExternalLinkIcon } from 'assets/icons'
import { createCredentials } from 'services/credentials'
import { omit } from 'utils'
import { useToast } from 'components/shared/hooks/useToast'
+import { TextLink } from 'components/shared/TextLink'
type Props = {
isOpen: boolean
@@ -157,13 +156,9 @@ export const StripeConfigModal = ({
(You can find your keys{' '}
-
- here
-
+
+ here
+
)
diff --git a/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/TypebotLinkSettingsForm/TypebotsDropdown.tsx b/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/TypebotLinkSettingsForm/TypebotsDropdown.tsx
index 01760c6566..7317ebc88e 100644
--- a/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/TypebotLinkSettingsForm/TypebotsDropdown.tsx
+++ b/apps/builder/components/shared/Graph/Nodes/BlockNode/SettingsPopoverContent/bodies/TypebotLinkSettingsForm/TypebotsDropdown.tsx
@@ -1,8 +1,8 @@
import { HStack, IconButton, Input } from '@chakra-ui/react'
import { ExternalLinkIcon } from 'assets/icons'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { useToast } from 'components/shared/hooks/useToast'
import { SearchableDropdown } from 'components/shared/SearchableDropdown'
+import Link from 'next/link'
import { useRouter } from 'next/router'
import { useMemo } from 'react'
import { useTypebots } from 'services/typebots'
@@ -54,7 +54,7 @@ export const TypebotsDropdown = ({
}
- as={NextChakraLink}
+ as={Link}
href={`/typebots/${currentTypebot?.id}/edit?parentId=${query.typebotId}`}
/>
)}
diff --git a/apps/builder/components/shared/TextLink.tsx b/apps/builder/components/shared/TextLink.tsx
new file mode 100644
index 0000000000..ca4c48ec81
--- /dev/null
+++ b/apps/builder/components/shared/TextLink.tsx
@@ -0,0 +1,37 @@
+import Link, { LinkProps } from 'next/link'
+import React from 'react'
+import { chakra, HStack, TextProps } from '@chakra-ui/react'
+import { ExternalLinkIcon } from 'assets/icons'
+
+type TextLinkProps = LinkProps & TextProps & { isExternal?: boolean }
+
+export const TextLink = ({
+ children,
+ href,
+ shallow,
+ replace,
+ scroll,
+ prefetch,
+ isExternal,
+ ...textProps
+}: TextLinkProps) => (
+
+
+ {isExternal ? (
+
+ {children}
+
+
+ ) : (
+ children
+ )}
+
+
+)
diff --git a/apps/builder/components/shared/TypebotHeader/TypebotHeader.tsx b/apps/builder/components/shared/TypebotHeader/TypebotHeader.tsx
index d119e14796..df85f6cd77 100644
--- a/apps/builder/components/shared/TypebotHeader/TypebotHeader.tsx
+++ b/apps/builder/components/shared/TypebotHeader/TypebotHeader.tsx
@@ -8,7 +8,6 @@ import {
Text,
} from '@chakra-ui/react'
import { BuoyIcon, ChevronLeftIcon, RedoIcon, UndoIcon } from 'assets/icons'
-import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { RightPanel, useEditor } from 'contexts/EditorContext'
import { useTypebot } from 'contexts/TypebotContext/TypebotContext'
import { useRouter } from 'next/router'
@@ -20,6 +19,7 @@ import { CollaborationMenuButton } from './CollaborationMenuButton'
import { EditableTypebotName } from './EditableTypebotName'
import { getBubbleActions } from 'typebot-js'
import { isCloudProdInstance } from 'services/utils'
+import Link from 'next/link'
export const headerHeight = 56
@@ -71,7 +71,7 @@ export const TypebotHeader = () => {
right={{ base: 280, xl: 0 }}
>
{typebot?.publishedTypebotId && (