-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(results): ✨ Brand new Results table
- Resizable columns - Hide / Show columns - Reorganize columns - Expand result
- Loading branch information
1 parent
cf6e8a2
commit d84f990
Showing
34 changed files
with
1,422 additions
and
733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { | ||
Modal, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalCloseButton, | ||
ModalBody, | ||
Stack, | ||
Heading, | ||
Text, | ||
HStack, | ||
} from '@chakra-ui/react' | ||
import { useResults } from 'contexts/ResultsProvider' | ||
import React from 'react' | ||
import { isDefined } from 'utils' | ||
import { HeaderIcon } from './ResultsTable/ResultsTable' | ||
|
||
type Props = { | ||
resultIdx: number | null | ||
onClose: () => void | ||
} | ||
|
||
export const ResultModal = ({ resultIdx, onClose }: Props) => { | ||
const { tableData, resultHeader } = useResults() | ||
const result = isDefined(resultIdx) ? tableData[resultIdx] : undefined | ||
|
||
const getHeaderValue = ( | ||
val: string | { plainText: string; element?: JSX.Element | undefined } | ||
) => (typeof val === 'string' ? val : val.element ?? val.plainText) | ||
|
||
return ( | ||
<Modal isOpen={isDefined(result)} onClose={onClose} size="2xl"> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalCloseButton /> | ||
<ModalBody as={Stack} p="10" spacing="10"> | ||
{resultHeader.map((header) => | ||
result && result[header.label] ? ( | ||
<Stack key={header.id} spacing="4"> | ||
<HStack> | ||
<HeaderIcon header={header} /> | ||
<Heading fontSize="md">{header.label}</Heading> | ||
</HStack> | ||
<Text whiteSpace="pre-wrap" textAlign="justify"> | ||
{getHeaderValue(result[header.label])} | ||
</Text> | ||
</Stack> | ||
) : ( | ||
<></> | ||
) | ||
)} | ||
</ModalBody> | ||
</ModalContent> | ||
</Modal> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { Stack } from '@chakra-ui/react' | ||
import { SubmissionsTable } from 'components/results/ResultsTable' | ||
import React, { useState } from 'react' | ||
import { UnlockPlanInfo } from 'components/shared/Info' | ||
import { LogsModal } from './LogsModal' | ||
import { useTypebot } from 'contexts/TypebotContext' | ||
import { Plan } from 'db' | ||
import { useResults } from 'contexts/ResultsProvider' | ||
import { ResultModal } from './ResultModal' | ||
|
||
export const ResultsContent = () => { | ||
const { | ||
flatResults: results, | ||
fetchMore, | ||
hasMore, | ||
resultHeader, | ||
totalHiddenResults, | ||
tableData, | ||
} = useResults() | ||
const { typebot, publishedTypebot } = useTypebot() | ||
const [inspectingLogsResultId, setInspectingLogsResultId] = useState< | ||
string | null | ||
>(null) | ||
const [expandedResultIndex, setExpandedResultIndex] = useState<number | null>( | ||
null | ||
) | ||
|
||
const handleLogsModalClose = () => setInspectingLogsResultId(null) | ||
|
||
const handleResultModalClose = () => setExpandedResultIndex(null) | ||
|
||
const handleLogOpenIndex = (index: number) => () => { | ||
if (!results) return | ||
setInspectingLogsResultId(results[index].id) | ||
} | ||
|
||
const handleResultExpandIndex = (index: number) => () => | ||
setExpandedResultIndex(index) | ||
|
||
return ( | ||
<Stack | ||
pb="28" | ||
px={['4', '0']} | ||
spacing="4" | ||
maxW="1600px" | ||
overflow="scroll" | ||
w="full" | ||
> | ||
{totalHiddenResults && ( | ||
<UnlockPlanInfo | ||
buttonLabel={`Unlock ${totalHiddenResults} results`} | ||
contentLabel="You are seeing complete submissions only." | ||
plan={Plan.PRO} | ||
/> | ||
)} | ||
{publishedTypebot && ( | ||
<LogsModal | ||
typebotId={publishedTypebot?.typebotId} | ||
resultId={inspectingLogsResultId} | ||
onClose={handleLogsModalClose} | ||
/> | ||
)} | ||
<ResultModal | ||
resultIdx={expandedResultIndex} | ||
onClose={handleResultModalClose} | ||
/> | ||
|
||
{typebot && ( | ||
<SubmissionsTable | ||
preferences={typebot.resultsTablePreferences} | ||
resultHeader={resultHeader} | ||
data={tableData} | ||
onScrollToBottom={fetchMore} | ||
hasMore={hasMore} | ||
onLogOpenIndex={handleLogOpenIndex} | ||
onResultExpandIndex={handleResultExpandIndex} | ||
/> | ||
)} | ||
</Stack> | ||
) | ||
} |
Oops, something went wrong.
d84f990
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./apps/docs
docs-typebot-io.vercel.app
docs.typebot.io
docs-git-main-typebot-io.vercel.app
d84f990
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2-alpha – ./apps/viewer
apr.nigerias.io
sat.cr8.ai
an.nigerias.io
aso.nigerias.io
vhpage.cr8.ai
ar.nigerias.io
bt.id8rs.com
bot.aws.bj
apo.nigerias.io
am.nigerias.io
bot.upfunnel.art
eventhub.com.au
chat.sureb4.com
clo.closeer.work
faqs.nigerias.io
games.klujo.com
feedback.ofx.one
bot.piccinato.co
sakuranembro.it
stan.vselise.com
bot.agfunnel.tech
app.chatforms.net
ov2.wpwakanda.com
bot.maitempah.com
gentleman-shop.fr
voicehelp.cr8.ai
ov1.wpwakanda.com
ov3.wpwakanda.com
admin.applepie.pro
sell.applepie.pro
this-is-a-test.com
zap.techadviser.in
goalsettingbot.com
forms.webisharp.com
order.maitempah.com
bot.eventhub.com.au
typebot.stillio.com
bot.ansuraniphone.my
chat.hayurihijab.com
bot.cotemeuplano.com
get.freebotoffer.xyz
bbutton.wpwakanda.com
abutton.wpwakanda.com
bot.incusservices.com
bot.meuesocial.com.br
cdd.searchcube.com.sg
sbutton.wpwakanda.com
bbutton.wpwwakanda.com
apply.ansuraniphone.my
chat.missarkansas.org
c23111azqw.nigerias.io
felipewelington.com.br
info.clickasuransi.com
form.searchcube.com.sg
gcase.barrettamario.it
83242573.actualizar.xyz
view.onlinebotdemo.xyz
bot.upgradesolutions.eu
kodawariab736.skeep.it
mainmenu.diddancing.com
subfooter.wpwakanda.com
form.sergiolimajr.com.br
hunterbot.saleshunter.ai
91181264.your-access.one
type.opaulovieira.com.br
aibot.angrybranding.co.uk
type.dericsoncalari.com.br
designguide.techyscouts.com
bot.cabinrentalagency.com
boyfriend-breakup.riku.ai
presente.empresarias.com.mx
piazzatorre.barrettamario.it
type.talitasouzamarques.com.br
onboarding.libertydreamcare.ie
agendamento.sergiolimajr.com.br
bot.comercializadoraomicron.com
studiotecnicoimmobiliaremerelli.it
personal-trainer.barrettamario.it
bookings.littlepartymonkeys.com
preagendamento.sergiolimajr.com.br
viewer-v2-alpha-typebot-io.vercel.app
viewer-v2-alpha-git-main-typebot-io.vercel.app
d84f990
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
bot.joof.it
bot.jesopizz.it
bergamo.store
app.yvon.earth
bot.tvbeat.it
gollum.riku.ai
bots.bridge.ai
talk.gocare.io
chat.hayuri.id
yoda.riku.ai
fitness.riku.ai
zap.fundviser.in
bot.contakit.com
viewer.typebot.io
bot.rihabilita.it
bot.dsignagency.com
chatbot.matthesv.de
bot.danyservice.it
demo.wemakebots.xyz
88584434.therpm.club
92109660.therpm.club
bot.coachayongzul.com
bot.digitalpointer.id
bot.barrettamario.it
hello.advergreen.com
bot.eikju.photography
bot.outstandbrand.com
bot.robertohairlab.it
bot.ilmuseoaiborghi.it
criar.somaperuzzo.com
bot.pratikmandalia.com
form.bridesquadapp.com
michaeljackson.riku.ai
87656003.actualizar.xyz
88152257.actualizar.xyz
arrivalx2.wpwakanda.com
bot.hotelplayarimini.it
invite.bridesquadapp.com
91375310.actualizar.xyz
link.venturasuceder.com
bot.amicidisanfaustino.it
chat.thehomebuyersusa.com
forms.hiabhaykulkarni.com
typebot-viewer.vercel.app
casestudyemb.wpwakanda.com
bot.adventureconsulting.hu
chat.atlasoutfittersk9.com
herbalife.barrettamario.it
homepageonly.wpwakanda.com
liveconvert.kandalearn.com
tarian.theiofoundation.org
mainmenu1one.wpwakanda.com
bot.pinpointinteractive.com
bot.polychromes-project.com
bot.seidinembroseanchetu.it
liveconvert2.kandalearn.com
bot.seidibergamoseanchetu.it
viewer-v2-typebot-io.vercel.app
forms.escoladeautomacao.com.br
bot.studiotecnicoimmobiliaremerelli.it
viewer-v2-git-main-typebot-io.vercel.app
d84f990
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io
builder-v2-typebot-io.vercel.app