From 99f0aa868a46ec5db3a86fe1705d22cc50debeb5 Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Sun, 26 May 2024 14:10:01 +0200 Subject: [PATCH] fix(web): detail panel asset description (#9765) --- .../asset-viewer/detail-panel.e2e-spec.ts | 14 +++++ .../detail-panel-description.svelte | 62 +++++++++++++++++++ .../asset-viewer/detail-panel.svelte | 61 ++---------------- 3 files changed, 80 insertions(+), 57 deletions(-) create mode 100644 web/src/lib/components/asset-viewer/detail-panel-description.svelte diff --git a/e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts b/e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts index ad847dab15..9cfcc4f37b 100644 --- a/e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts +++ b/e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts @@ -43,4 +43,18 @@ test.describe('Detail Panel', () => { await page.keyboard.press('i'); await expect(page.locator('#detail-panel')).toHaveCount(0); }); + + test('description is visible for owner on shared links', async ({ context, page }) => { + const sharedLink = await utils.createSharedLink(admin.accessToken, { + type: SharedLinkType.Individual, + assetIds: [asset.id], + }); + await utils.setAuthCookies(context, admin.accessToken); + await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); + + const textarea = page.getByRole('textbox', { name: 'Add a description' }); + await page.getByRole('button', { name: 'Info' }).click(); + await expect(textarea).toBeVisible(); + await expect(textarea).not.toBeDisabled(); + }); }); diff --git a/web/src/lib/components/asset-viewer/detail-panel-description.svelte b/web/src/lib/components/asset-viewer/detail-panel-description.svelte new file mode 100644 index 0000000000..c26eab1a84 --- /dev/null +++ b/web/src/lib/components/asset-viewer/detail-panel-description.svelte @@ -0,0 +1,62 @@ + + +{#if isOwner} +
+