🚸 (variables) Allow null values in variable list
This commit is contained in:
@@ -13,7 +13,7 @@ import { Plan, Workspace } from '@typebot.io/prisma'
|
||||
import React from 'react'
|
||||
import { parseNumberWithCommas } from '@typebot.io/lib'
|
||||
import { getChatsLimit, getStorageLimit } from '@typebot.io/lib/pricing'
|
||||
import { trpc } from '@/lib/trpc'
|
||||
import { defaultQueryOptions, trpc } from '@/lib/trpc'
|
||||
import { storageToReadable } from '../helpers/storageToReadable'
|
||||
|
||||
type Props = {
|
||||
@@ -21,9 +21,12 @@ type Props = {
|
||||
}
|
||||
|
||||
export const UsageProgressBars = ({ workspace }: Props) => {
|
||||
const { data, isLoading } = trpc.billing.getUsage.useQuery({
|
||||
workspaceId: workspace.id,
|
||||
})
|
||||
const { data, isLoading } = trpc.billing.getUsage.useQuery(
|
||||
{
|
||||
workspaceId: workspace.id,
|
||||
},
|
||||
defaultQueryOptions
|
||||
)
|
||||
const totalChatsUsed = data?.totalChatsUsed ?? 0
|
||||
const totalStorageUsed = data?.totalStorageUsed ?? 0
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ test.describe.parallel('Google sheets integration', () => {
|
||||
.press('Enter')
|
||||
await expect(
|
||||
page.locator('typebot-standard').locator('text=Your name is:')
|
||||
).toHaveText(`Your name is: Georges Smith`)
|
||||
).toHaveText(`Your name is: Georges2 Smith2`)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@ test('should be able to connect custom domain', async ({ page }) => {
|
||||
await expect(page.locator('text=sub.yolozeeer.com')).toBeHidden()
|
||||
await page.click('button >> text=Add my domain')
|
||||
await page.click('[aria-label="Remove domain"]')
|
||||
await expect(page.locator('[aria-label="Remove domain"]')).toBeHidden()
|
||||
await expect(page.locator('[aria-label="Remove domain"]')).toBeHidden({
|
||||
timeout: 10000,
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Starter workspace', () => {
|
||||
|
||||
@@ -34,7 +34,11 @@ test('folders navigation should work', async ({ page }) => {
|
||||
|
||||
test('folders and typebots should be deletable', async ({ page }) => {
|
||||
await createFolders([{ name: 'Folder #1' }, { name: 'Folder #2' }])
|
||||
await createTypebots([{ id: 'deletable-typebot', name: 'Typebot #1' }])
|
||||
const tomorrow = new Date()
|
||||
tomorrow.setDate(tomorrow.getDate() + 1)
|
||||
await createTypebots([
|
||||
{ id: 'deletable-typebot', name: 'Typebot #1', createdAt: tomorrow },
|
||||
])
|
||||
await page.goto('/typebots')
|
||||
await page.click('button[aria-label="Show Folder #1 menu"]')
|
||||
await page.click('li:has-text("Folder #1") >> button:has-text("Delete")')
|
||||
|
||||
@@ -92,6 +92,7 @@ export const WorkspaceProvider = ({
|
||||
onError: (error) => showToast({ description: error.message }),
|
||||
onSuccess: async () => {
|
||||
trpcContext.workspace.listWorkspaces.invalidate()
|
||||
setWorkspaceId(undefined)
|
||||
},
|
||||
})
|
||||
|
||||
@@ -154,7 +155,6 @@ export const WorkspaceProvider = ({
|
||||
const deleteCurrentWorkspace = async () => {
|
||||
if (!workspaceId || !workspaces || workspaces.length < 2) return
|
||||
await deleteWorkspaceMutation.mutateAsync({ workspaceId })
|
||||
setWorkspaceId(workspaces[0].id)
|
||||
}
|
||||
|
||||
const refreshWorkspace = () => {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { httpBatchLink, loggerLink } from '@trpc/client'
|
||||
import { createTRPCNext } from '@trpc/next'
|
||||
import type { AppRouter } from '../helpers/server/routers/v1/trpcRouter'
|
||||
import superjson from 'superjson'
|
||||
import { env } from '@typebot.io/lib'
|
||||
|
||||
const getBaseUrl = () =>
|
||||
typeof window !== 'undefined' ? '' : process.env.NEXTAUTH_URL
|
||||
@@ -24,3 +25,7 @@ export const trpc = createTRPCNext<AppRouter>({
|
||||
},
|
||||
ssr: false,
|
||||
})
|
||||
|
||||
export const defaultQueryOptions = {
|
||||
refetchOnMount: env('E2E_TEST') === 'true',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user