From 3d1989309141d25700180c9b90d14c8e7f773070 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 30 Aug 2024 15:06:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5(frontend)=20remove=20saving=20moda?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The saving toast are removed. Users were complaining about the toast that was shown when saving a document. --- CHANGELOG.md | 12 ++++++++++-- .../e2e/__tests__/app-impress/doc-editor.spec.ts | 4 ---- .../features/docs/doc-editor/hook/useSaveDoc.tsx | 15 --------------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b559d621..e04a11bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,18 @@ and this project adheres to ## [Unreleased] -# Added +## Added - ✨Add image attachments with access control -- ✨(frontend) Upload image to a document +- ✨(frontend) Upload image to a document #211 + +## Changed + +- 🔥(frontend) hide markdown button if not text #213 + +## Removed + +- 🔥(frontend) remove saving modal #213 ## [1.2.1] - 2024-08-23 diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts index 54c8f98a..458ea2ec 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts @@ -106,10 +106,6 @@ test.describe('Doc Editor', () => { nthRow: 2, }); - await expect( - page.getByText(`Your document "${doc}" has been saved.`), - ).toBeVisible(); - await expect(page.locator('h2').getByText(secondDoc)).toBeVisible(); await goToGridDoc(page, { diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx index 2b065d10..8b036b32 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx @@ -1,7 +1,5 @@ -import { VariantType, useToastProvider } from '@openfun/cunningham-react'; import { useRouter } from 'next/router'; import { useCallback, useEffect, useRef, useState } from 'react'; -import { useTranslation } from 'react-i18next'; import * as Y from 'yjs'; import { useUpdateDoc } from '@/features/docs/doc-management/'; @@ -11,22 +9,9 @@ import { useDocStore } from '../stores'; import { toBase64 } from '../utils'; const useSaveDoc = (docId: string, doc: Y.Doc, canSave: boolean) => { - const { toast } = useToastProvider(); - const { t } = useTranslation(); const { forceSave, setForceSave } = useDocStore(); const { mutate: updateDoc } = useUpdateDoc({ - onSuccess: (data) => { - toast( - t('Your document "{{docTitle}}" has been saved.', { - docTitle: data.title, - }), - VariantType.SUCCESS, - { - duration: 1500, - }, - ); - }, listInvalideQueries: [KEY_LIST_DOC_VERSIONS], }); const [initialDoc, setInitialDoc] = useState(