♻️ Re-organize workspace folders

This commit is contained in:
Baptiste Arnaud
2023-03-15 08:35:16 +01:00
parent 25c367901f
commit cbc8194f19
987 changed files with 2716 additions and 2770 deletions

View File

@@ -1,7 +1,7 @@
import { useToast } from '@/hooks/useToast'
import { ResultHeaderCell, ResultWithAnswers } from 'models'
import { ResultHeaderCell, ResultWithAnswers } from '@typebot.io/schemas'
import { createContext, ReactNode, useContext, useMemo } from 'react'
import { parseResultHeader } from 'utils/results'
import { parseResultHeader } from '@typebot.io/lib/results'
import { useTypebot } from '../editor/providers/TypebotProvider'
import { useResultsQuery } from './hooks/useResultsQuery'
import { TableData } from './types'

View File

@@ -1,7 +1,7 @@
import prisma from '@/lib/prisma'
import { deleteFiles } from '@/utils/api/storage'
import { Prisma } from 'db'
import { InputBlockType, Typebot } from 'models'
import { Prisma } from '@typebot.io/prisma'
import { InputBlockType, Typebot } from '@typebot.io/schemas'
const batchSize = 100

View File

@@ -1,7 +1,7 @@
import { getTypebot } from '@/features/typebot/api/utils/getTypebot'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { Typebot } from 'models'
import { Typebot } from '@typebot.io/schemas'
import { z } from 'zod'
import { archiveResults } from '../archiveResults'

View File

@@ -1,7 +1,7 @@
import { getTypebot } from '@/features/typebot/api/utils/getTypebot'
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { logSchema } from 'models'
import { logSchema } from '@typebot.io/schemas'
import { z } from 'zod'
export const getResultLogsProcedure = authenticatedProcedure

View File

@@ -2,7 +2,7 @@ import { getTypebot } from '@/features/typebot/api/utils/getTypebot'
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { ResultWithAnswers, resultWithAnswersSchema } from 'models'
import { ResultWithAnswers, resultWithAnswersSchema } from '@typebot.io/schemas'
import { z } from 'zod'
const maxLimit = 200

View File

@@ -17,8 +17,8 @@ import {
Text,
Tag,
} from '@chakra-ui/react'
import { Log } from 'db'
import { isDefined } from 'utils'
import { Log } from '@typebot.io/prisma'
import { isDefined } from '@typebot.io/lib'
import { useLogs } from '../hooks/useLogs'
type Props = {

View File

@@ -11,7 +11,7 @@ import {
} from '@chakra-ui/react'
import { useResults } from '../ResultsProvider'
import React from 'react'
import { isDefined } from 'utils'
import { isDefined } from '@typebot.io/lib'
import { HeaderIcon } from '../utils'
type Props = {

View File

@@ -19,7 +19,7 @@ import {
arrayMove,
} from '@dnd-kit/sortable'
import { Text } from '@chakra-ui/react'
import { ResultHeaderCell } from 'models'
import { ResultHeaderCell } from '@typebot.io/schemas'
import { HeaderIcon } from '../../utils'
import { useState } from 'react'
import { CSS } from '@dnd-kit/utilities'

View File

@@ -18,7 +18,7 @@ import {
import { TRPCError } from '@trpc/server'
import { unparse } from 'papaparse'
import { useState } from 'react'
import { parseResultHeader } from 'utils/results'
import { parseResultHeader } from '@typebot.io/lib/results'
import { useResults } from '../../ResultsProvider'
import { convertResultsToTableData, parseAccessor } from '../../utils'
import { parseColumnOrder } from '../../utils/parseColumnsOrder'

View File

@@ -8,7 +8,7 @@ import {
useColorModeValue,
} from '@chakra-ui/react'
import { AlignLeftTextIcon } from '@/components/icons'
import { ResultHeaderCell, ResultsTablePreferences } from 'models'
import { ResultHeaderCell, ResultsTablePreferences } from '@typebot.io/schemas'
import React, { useEffect, useRef, useState } from 'react'
import { LoadingRows } from './LoadingRows'
import {

View File

@@ -17,7 +17,7 @@ import {
ListIcon,
MoreHorizontalIcon,
} from '@/components/icons'
import { ResultHeaderCell } from 'models'
import { ResultHeaderCell } from '@typebot.io/schemas'
import React, { useState } from 'react'
import { ColumnSettings } from './ColumnSettings'
import { ExportAllResultsModal } from './ExportAllResultsModal'

View File

@@ -1,9 +1,9 @@
import { UnlockPlanAlertInfo } from '@/components/UnlockPlanAlertInfo'
import { trpc } from '@/lib/trpc'
import { Flex } from '@chakra-ui/react'
import { Workspace } from 'models'
import { Workspace } from '@typebot.io/schemas'
import { useMemo } from 'react'
import { getChatsLimit, getStorageLimit } from 'utils/pricing'
import { getChatsLimit, getStorageLimit } from '@typebot.io/lib/pricing'
const ALERT_CHATS_PERCENT_THRESHOLD = 80
const ALERT_STORAGE_PERCENT_THRESHOLD = 80

View File

@@ -1,4 +1,4 @@
import { Stats } from 'models'
import { Stats } from '@typebot.io/schemas'
import { fetcher } from '@/utils/helpers'
import useSWR from 'swr'

View File

@@ -7,7 +7,7 @@ import { parse } from 'papaparse'
import {
importTypebotInDatabase,
injectFakeResults,
} from 'utils/playwright/databaseActions'
} from '@typebot.io/lib/playwright/databaseActions'
const typebotId = createId()

View File

@@ -3,9 +3,9 @@ import {
VariableWithValue,
ResultHeaderCell,
InputBlockType,
} from 'models'
import { Answer } from 'db'
import { isDefined } from 'utils'
} from '@typebot.io/schemas'
import { Answer } from '@typebot.io/prisma'
import { isDefined } from '@typebot.io/lib'
import { HStack, Wrap, WrapItem, Text } from '@chakra-ui/react'
import { BlockIcon } from '@/features/editor'
import { HeaderCell, TableData } from './types'

View File

@@ -1,4 +1,4 @@
import { ResultHeaderCell } from 'models'
import { ResultHeaderCell } from '@typebot.io/schemas'
export const parseColumnOrder = (
existingOrder: string[] | undefined,