diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a54ce4b3..90bcb6b24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to ## [Unreleased] +### Fixed + +- 🐛(frontend) hide Leave in the doc menu when not logged in #2626 + ## [v5.6.0] - 2026-09-03 ### Added diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-visibility.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-visibility.spec.ts index 548880600..f9a0fab20 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-visibility.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-visibility.spec.ts @@ -247,6 +247,13 @@ test.describe('Doc Visibility: Public', () => { await writeInEditor({ page, text: 'Can you see it ?' }); await expect(otherEditor.getByText('Can you see it ?')).toBeVisible(); + await otherPage + .getByRole('button', { name: 'Open the document options' }) + .click(); + await expect( + otherPage.getByRole('menuitem', { name: 'Leave' }), + ).toBeHidden(); + await cleanup(); }); diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/components/DocToolBox.tsx b/src/frontend/apps/impress/src/features/docs/doc-management/components/DocToolBox.tsx index cef8bed47..45e10c880 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-management/components/DocToolBox.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-management/components/DocToolBox.tsx @@ -311,8 +311,9 @@ const DocToolBoxComponent = ({ * A user can only leave a top parent because we cannot * leave a child if the parent is not left. * ⚠️ This doc can still be a child for other users. + * Unauthenticated visitors also cannot leave. */ - isHidden: !isTopParent, + isHidden: !isTopParent || !authenticated, }, { label: t('Delete', {