2
0

refactor(editor): ♻️ Undo / Redo buttons + structure refacto

Yet another huge refacto... While implementing undo and redo features I understood that I updated the stored typebot too many times (i.e. on each key input) so I had to rethink it entirely. I also moved around some files.
This commit is contained in:
Baptiste Arnaud
2022-02-02 08:05:02 +01:00
parent fc1d654772
commit 8a350eee6c
153 changed files with 1512 additions and 1352 deletions

View File

@ -6,6 +6,7 @@ import {
import { BubbleStepType, defaultImageBubbleContent } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import path from 'path'
import { generate } from 'short-uuid'
const unsplashImageSrc =
'https://images.unsplash.com/photo-1504297050568-910d24c426d3?ixlib=rb-1.2.1&ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1287&q=80'
@ -13,7 +14,7 @@ const unsplashImageSrc =
test.describe.parallel('Image bubble step', () => {
test.describe('Content settings', () => {
test('should upload image file correctly', async ({ page }) => {
const typebotId = 'image-bubble-step-image-upload'
const typebotId = generate()
await createTypebots([
{
id: typebotId,
@ -41,7 +42,7 @@ test.describe.parallel('Image bubble step', () => {
})
test('should import image link correctly', async ({ page }) => {
const typebotId = 'image-bubble-step-image-link'
const typebotId = generate()
await createTypebots([
{
id: typebotId,
@ -64,7 +65,7 @@ test.describe.parallel('Image bubble step', () => {
})
test('should import gifs correctly', async ({ page }) => {
const typebotId = 'image-bubble-step-gifs'
const typebotId = generate()
await createTypebots([
{
id: typebotId,
@ -89,7 +90,7 @@ test.describe.parallel('Image bubble step', () => {
test.describe('Preview', () => {
test('should display correctly', async ({ page }) => {
const typebotId = 'image-bubble-step-preview'
const typebotId = generate()
await createTypebots([
{
id: typebotId,

View File

@ -5,11 +5,11 @@ import {
} from '../../services/database'
import { BubbleStepType, defaultTextBubbleContent } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
const typebotId = 'text-bubble-step'
import { generate } from 'short-uuid'
test.describe('Text bubble step', () => {
test('rich text features should work', async ({ page }) => {
const typebotId = generate()
await createTypebots([
{
id: typebotId,

View File

@ -9,6 +9,7 @@ import {
VideoBubbleContentType,
} from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import { generate } from 'short-uuid'
const videoSrc =
'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4'
@ -18,7 +19,7 @@ const vimeoVideoSrc = 'https://vimeo.com/649301125'
test.describe.parallel('Video bubble step', () => {
test.describe('Content settings', () => {
test('should import video url correctly', async ({ page }) => {
const typebotId = 'video-bubble-step-link'
const typebotId = generate()
await createTypebots([
{
id: typebotId,
@ -42,7 +43,7 @@ test.describe.parallel('Video bubble step', () => {
test.describe('Preview', () => {
test('should display video correctly', async ({ page }) => {
const typebotId = 'image-bubble-step-preview-video'
const typebotId = generate()
await createTypebots([
{
id: typebotId,
@ -64,7 +65,7 @@ test.describe.parallel('Video bubble step', () => {
})
test('should display youtube video correctly', async ({ page }) => {
const typebotId = 'image-bubble-step-preview-youtube'
const typebotId = generate()
await createTypebots([
{
id: typebotId,
@ -88,7 +89,7 @@ test.describe.parallel('Video bubble step', () => {
})
test('should display vimeo video correctly', async ({ page }) => {
const typebotId = 'image-bubble-step-preview-vimeo'
const typebotId = generate()
await createTypebots([
{
id: typebotId,