diff --git a/CHANGELOG.md b/CHANGELOG.md
index 40836c5b..96af9430 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,16 @@ and this project adheres to
## [Unreleased]
+## Added
+
+- Update document (#68)
+- Remove document (#68)
+
+## Changed
+
+- Generate PDF from a modal (#68)
+- Remove trigger workflow on push tags on CI (#68)
+
## [0.1.0] - 2024-05-24
## Added
diff --git a/src/frontend/apps/e2e/__tests__/app-impress/pad-tools.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/pad-tools.spec.ts
index 1fc32645..9eb20c20 100644
--- a/src/frontend/apps/e2e/__tests__/app-impress/pad-tools.spec.ts
+++ b/src/frontend/apps/e2e/__tests__/app-impress/pad-tools.spec.ts
@@ -102,4 +102,37 @@ test.describe('Pad Tools', () => {
page.getByRole('checkbox', { name: 'Is it public ?' }),
).not.toBeChecked();
});
+
+ test('it deletes the pad', async ({ page, browserName }) => {
+ const [randomPad] = await createPad(page, 'pad-delete', browserName, 1);
+ await expect(page.locator('h2').getByText(randomPad)).toBeVisible();
+
+ await page.getByLabel('Open the document options').click();
+ await page
+ .getByRole('button', {
+ name: 'Delete document',
+ })
+ .click();
+
+ await expect(
+ page.locator('h2').getByText(`Deleting the document "${randomPad}"`),
+ ).toBeVisible();
+
+ await page
+ .getByRole('button', {
+ name: 'Confirm deletion',
+ })
+ .click();
+
+ await expect(
+ page.getByText('The document has been deleted.'),
+ ).toBeVisible();
+
+ await expect(
+ page.getByRole('button', { name: 'Create a new pad' }),
+ ).toBeVisible();
+
+ const panel = page.getByLabel('Pads panel').first();
+ await expect(panel.locator('li').getByText(randomPad)).toBeHidden();
+ });
});
diff --git a/src/frontend/apps/impress/src/features/pads/pad-tools/components/PadToolBox.tsx b/src/frontend/apps/impress/src/features/pads/pad-tools/components/PadToolBox.tsx
index 1c5bf1b8..c9b79a48 100644
--- a/src/frontend/apps/impress/src/features/pads/pad-tools/components/PadToolBox.tsx
+++ b/src/frontend/apps/impress/src/features/pads/pad-tools/components/PadToolBox.tsx
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { Box, DropButton, IconOptions, Text } from '@/components';
import { Pad } from '@/features/pads/pad';
-import { ModalUpdatePad } from '@/features/pads/pads-create';
+import { ModalRemovePad, ModalUpdatePad } from '@/features/pads/pads-create';
import { TemplatesOrdering, useTemplates } from '../api/useTemplates';
@@ -20,6 +20,7 @@ export const PadToolBox = ({ pad }: PadToolBoxProps) => {
ordering: TemplatesOrdering.BY_CREATED_ON_DESC,
});
const [isModalUpdateOpen, setIsModalUpdateOpen] = useState(false);
+ const [isModalRemoveOpen, setIsModalRemoveOpen] = useState(false);
const [isModalPDFOpen, setIsModalPDFOpen] = useState(false);
const [isDropOpen, setIsDropOpen] = useState(false);
@@ -63,6 +64,16 @@ export const PadToolBox = ({ pad }: PadToolBoxProps) => {
>
{t('Update document')}
+
+ }
+ onClose={() => onClose()}
+ rightActions={
+
+ }
+ size={ModalSize.MEDIUM}
+ title={
+
+
+
+ {t('Deleting the document "{{title}}"', { title: pad.title })}
+
+
+ }
+ >
+
+
+ {t('Are you sure you want to delete the document "{{title}}"?', {
+ title: pad.title,
+ })}
+
+
+ {isError && (
+
+ )}
+
+
+
+
+ {pad.title}
+
+
+
+
+ );
+};
diff --git a/src/frontend/apps/impress/src/features/pads/pads-create/components/index.ts b/src/frontend/apps/impress/src/features/pads/pads-create/components/index.ts
index 22282015..6a07d271 100644
--- a/src/frontend/apps/impress/src/features/pads/pads-create/components/index.ts
+++ b/src/frontend/apps/impress/src/features/pads/pads-create/components/index.ts
@@ -1,2 +1,3 @@
export * from './CardCreatePad';
+export * from './ModalRemovePad';
export * from './ModalUpdatePad';