mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-09 19:27:55 +02:00
🐛(frontend) hide leave option when unauthenticated
Leave was shown in the document menu for anonymous visitors. Hide it unless the current user can actually leave the doc. Signed-off-by: Mora <razvi.morariu.mihai@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user