From eace0af7a52d1880ace367be8f236e01793ae7e5 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 15 Jan 2023 14:01:10 -0600 Subject: [PATCH] fix(web) Disable draggable on common usage element to avoid trigger drag-n-drop layer (#1330) --- server/immich-openapi-specs.json | 346 +++++++++--------- .../components/album-page/album-card.svelte | 1 + .../components/album-page/album-viewer.svelte | 8 +- .../album-page/user-selection-modal.svelte | 2 +- .../asset-viewer/album-list-item.svelte | 1 + .../asset-viewer/detail-panel.svelte | 1 + .../asset-viewer/photo-viewer.svelte | 1 + .../forms/admin-registration-form.svelte | 9 +- .../forms/change-password-form.svelte | 9 +- .../components/forms/create-user-form.svelte | 9 +- .../lib/components/forms/login-form.svelte | 9 +- .../individual-shared-viewer.svelte | 2 +- .../shared-components/circle-avatar.svelte | 1 + .../drag-and-drop-upload-overlay.svelte | 1 + .../shared-components/immich-thumbnail.svelte | 1 + .../navigation-bar/account-info-panel.svelte | 1 + .../navigation-bar/navigation-bar.svelte | 3 +- .../side-bar/side-bar.svelte | 5 +- .../shared-components/upload-panel.svelte | 1 + .../sharedlinks-page/shared-link-card.svelte | 1 + .../shared-album-list-tile.svelte | 1 + web/src/routes/+error.svelte | 2 +- web/src/routes/+page.svelte | 9 +- web/src/routes/albums/+page.svelte | 2 +- web/src/routes/sharing/+page.svelte | 2 +- 25 files changed, 241 insertions(+), 187 deletions(-) diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index 82f2a501df..4de55a4f75 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -1476,6 +1476,153 @@ ] } }, + "/tag": { + "post": { + "operationId": "create", + "description": "", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTagDto" + } + } + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TagResponseDto" + } + } + } + } + }, + "tags": [ + "Tag" + ] + }, + "get": { + "operationId": "findAll", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TagResponseDto" + } + } + } + } + } + }, + "tags": [ + "Tag" + ] + } + }, + "/tag/{id}": { + "get": { + "operationId": "findOne", + "description": "", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TagResponseDto" + } + } + } + } + }, + "tags": [ + "Tag" + ] + }, + "patch": { + "operationId": "update", + "description": "", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTagDto" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TagResponseDto" + } + } + } + } + }, + "tags": [ + "Tag" + ] + }, + "delete": { + "operationId": "delete", + "description": "", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "Tag" + ] + } + }, "/album/count-by-user-id": { "get": { "operationId": "getAlbumCountByUserId", @@ -1947,153 +2094,6 @@ ] } }, - "/tag": { - "post": { - "operationId": "create", - "description": "", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTagDto" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagResponseDto" - } - } - } - } - }, - "tags": [ - "Tag" - ] - }, - "get": { - "operationId": "findAll", - "description": "", - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TagResponseDto" - } - } - } - } - } - }, - "tags": [ - "Tag" - ] - } - }, - "/tag/{id}": { - "get": { - "operationId": "findOne", - "description": "", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagResponseDto" - } - } - } - } - }, - "tags": [ - "Tag" - ] - }, - "patch": { - "operationId": "update", - "description": "", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateTagDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagResponseDto" - } - } - } - } - }, - "tags": [ - "Tag" - ] - }, - "delete": { - "operationId": "delete", - "description": "", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "Tag" - ] - } - }, "/auth/login": { "post": { "operationId": "login", @@ -3786,6 +3786,32 @@ } } }, + "CreateTagDto": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/TagTypeEnum" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + }, + "UpdateTagDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "renameTagId": { + "type": "string" + } + } + }, "AlbumCountResponseDto": { "type": "object", "properties": { @@ -3922,32 +3948,6 @@ "albumId" ] }, - "CreateTagDto": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/TagTypeEnum" - }, - "name": { - "type": "string" - } - }, - "required": [ - "type", - "name" - ] - }, - "UpdateTagDto": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "renameTagId": { - "type": "string" - } - } - }, "LoginCredentialDto": { "type": "object", "properties": { diff --git a/web/src/lib/components/album-page/album-card.svelte b/web/src/lib/components/album-page/album-card.svelte index a1bcd09774..f702538ef8 100644 --- a/web/src/lib/components/album-page/album-card.svelte +++ b/web/src/lib/components/album-page/album-card.svelte @@ -79,6 +79,7 @@ alt={album.id} class={`object-cover h-full w-full transition-all z-0 rounded-xl duration-300 hover:shadow-lg`} data-testid="album-image" + draggable="false" /> diff --git a/web/src/lib/components/album-page/album-viewer.svelte b/web/src/lib/components/album-page/album-viewer.svelte index 501d68d5a7..566b5627f8 100644 --- a/web/src/lib/components/album-page/album-viewer.svelte +++ b/web/src/lib/components/album-page/album-viewer.svelte @@ -418,7 +418,13 @@ class="flex gap-2 place-items-center hover:cursor-pointer ml-6" href="https://immich.app" > - immich logo + immich logo

IMMICH

diff --git a/web/src/lib/components/album-page/user-selection-modal.svelte b/web/src/lib/components/album-page/user-selection-modal.svelte index 07c1e0b353..d735f852d7 100644 --- a/web/src/lib/components/album-page/user-selection-modal.svelte +++ b/web/src/lib/components/album-page/user-selection-modal.svelte @@ -53,7 +53,7 @@ dispatch('close')}> - Immich + Immich

Invite to album

diff --git a/web/src/lib/components/asset-viewer/album-list-item.svelte b/web/src/lib/components/asset-viewer/album-list-item.svelte index 1b23a87941..b39fbb1e70 100644 --- a/web/src/lib/components/asset-viewer/album-list-item.svelte +++ b/web/src/lib/components/asset-viewer/album-list-item.svelte @@ -33,6 +33,7 @@ alt={album.albumName} class={`object-cover h-full w-full transition-all z-0 rounded-xl duration-300 hover:shadow-lg`} data-testid="album-image" + draggable="false" />
diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index 56262fb73f..0ad2979894 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -208,6 +208,7 @@ alt={album.albumName} class="w-[50px] h-[50px] object-cover rounded" src={`/api/asset/thumbnail/${album.albumThumbnailAssetId}?format=JPEG`} + draggable="false" />
diff --git a/web/src/lib/components/asset-viewer/photo-viewer.svelte b/web/src/lib/components/asset-viewer/photo-viewer.svelte index d97fba21c8..9a2d2dacf2 100644 --- a/web/src/lib/components/asset-viewer/photo-viewer.svelte +++ b/web/src/lib/components/asset-viewer/photo-viewer.svelte @@ -85,6 +85,7 @@ alt={assetId} class="object-contain h-full transition-all" loading="lazy" + draggable="false" /> {/await} {/if} diff --git a/web/src/lib/components/forms/admin-registration-form.svelte b/web/src/lib/components/forms/admin-registration-form.svelte index 10cf620a3a..0e9cc1f665 100644 --- a/web/src/lib/components/forms/admin-registration-form.svelte +++ b/web/src/lib/components/forms/admin-registration-form.svelte @@ -55,7 +55,14 @@ class="border bg-immich-bg dark:bg-immich-dark-gray dark:border-immich-dark-gray p-4 shadow-sm w-[500px] max-w-[95vw] rounded-3xl py-8 dark:text-immich-dark-fg" >
- immich-logo + immich-logo

Admin Registration

diff --git a/web/src/lib/components/forms/change-password-form.svelte b/web/src/lib/components/forms/change-password-form.svelte index 46cc15db8c..64dff66d4a 100644 --- a/web/src/lib/components/forms/change-password-form.svelte +++ b/web/src/lib/components/forms/change-password-form.svelte @@ -47,7 +47,14 @@ class="border bg-immich-bg dark:bg-immich-dark-gray dark:border-immich-dark-gray p-4 shadow-sm w-[500px] max-w-[95vw] rounded-3xl py-8 dark:text-immich-dark-fg" >
- immich-logo + immich-logo

Change Password

diff --git a/web/src/lib/components/forms/create-user-form.svelte b/web/src/lib/components/forms/create-user-form.svelte index 9f1a885d0e..bd1eb16d3e 100644 --- a/web/src/lib/components/forms/create-user-form.svelte +++ b/web/src/lib/components/forms/create-user-form.svelte @@ -80,7 +80,14 @@ class="border bg-immich-bg dark:bg-immich-dark-gray dark:border-immich-dark-gray p-4 shadow-sm w-[500px] max-w-[95vw] rounded-3xl py-8 dark:text-immich-dark-fg" >
- immich-logo + immich-logo

Create new user

diff --git a/web/src/lib/components/forms/login-form.svelte b/web/src/lib/components/forms/login-form.svelte index 33ba0598a8..e8d9de1108 100644 --- a/web/src/lib/components/forms/login-form.svelte +++ b/web/src/lib/components/forms/login-form.svelte @@ -77,7 +77,14 @@ class="border bg-white dark:bg-immich-dark-gray dark:border-immich-dark-gray p-4 shadow-sm w-[500px] max-w-[95vw] rounded-md py-8" >
- immich-logo + immich-logo

Login

diff --git a/web/src/lib/components/share-page/individual-shared-viewer.svelte b/web/src/lib/components/share-page/individual-shared-viewer.svelte index fb75e24014..cfc64d0b13 100644 --- a/web/src/lib/components/share-page/individual-shared-viewer.svelte +++ b/web/src/lib/components/share-page/individual-shared-viewer.svelte @@ -120,7 +120,7 @@ class="flex gap-2 place-items-center hover:cursor-pointer ml-6" href="https://immich.app" > - immich logo + immich logo

IMMICH

diff --git a/web/src/lib/components/shared-components/circle-avatar.svelte b/web/src/lib/components/shared-components/circle-avatar.svelte index ee26386475..29c4e75b1e 100644 --- a/web/src/lib/components/shared-components/circle-avatar.svelte +++ b/web/src/lib/components/shared-components/circle-avatar.svelte @@ -45,6 +45,7 @@ style:height={`${size}px`} class={`inline rounded-full object-cover border shadow-md`} title={user.email} + draggable="false" /> {:catch} diff --git a/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte b/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte index 90944c5f34..f3b65750c9 100644 --- a/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte +++ b/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte @@ -20,6 +20,7 @@ height="200" width="200" class="animate-bounce pb-16" + draggable="false" />
Drop files anywhere to upload
diff --git a/web/src/lib/components/shared-components/immich-thumbnail.svelte b/web/src/lib/components/shared-components/immich-thumbnail.svelte index bf8f32f259..2bcea3c2db 100644 --- a/web/src/lib/components/shared-components/immich-thumbnail.svelte +++ b/web/src/lib/components/shared-components/immich-thumbnail.svelte @@ -252,6 +252,7 @@ alt={asset.id} class={`object-cover ${getSize()} transition-all z-0 ${getThumbnailBorderStyle()}`} loading="lazy" + draggable="false" /> {/if} diff --git a/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte b/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte index 849af8615e..1bf4aae8c8 100644 --- a/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte +++ b/web/src/lib/components/shared-components/navigation-bar/account-info-panel.svelte @@ -38,6 +38,7 @@ src={`${$page.url.origin}/api/user/profile-image/${user.id}`} alt="profile-img" class="inline rounded-full h-20 w-20 object-cover shadow-md" + draggable="false" /> {:catch}
diff --git a/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte b/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte index 268665ae0a..378bb1cae9 100644 --- a/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte +++ b/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte @@ -50,7 +50,7 @@ class="flex gap-2 place-items-center hover:cursor-pointer" href="/photos" > - immich logo + immich logo

IMMICH

@@ -102,6 +102,7 @@ src={`${$page.url.origin}/api/user/profile-image/${user.id}`} alt="profile-img" class="inline rounded-full h-12 w-12 object-cover shadow-md" + draggable="false" /> {:catch} {getFirstLetter(user.firstName)}{getFirstLetter(user.lastName)} diff --git a/web/src/lib/components/shared-components/side-bar/side-bar.svelte b/web/src/lib/components/shared-components/side-bar/side-bar.svelte index 76a9cc89e6..a94873d71f 100644 --- a/web/src/lib/components/shared-components/side-bar/side-bar.svelte +++ b/web/src/lib/components/shared-components/side-bar/side-bar.svelte @@ -40,6 +40,7 @@ data-sveltekit-noscroll href={AppRoute.PHOTOS} class="relative" + draggable="false" > - +

LIBRARY

- +
diff --git a/web/src/lib/components/sharedlinks-page/shared-link-card.svelte b/web/src/lib/components/sharedlinks-page/shared-link-card.svelte index d6811fef1d..a73855ef85 100644 --- a/web/src/lib/components/sharedlinks-page/shared-link-card.svelte +++ b/web/src/lib/components/sharedlinks-page/shared-link-card.svelte @@ -73,6 +73,7 @@ alt={asset.id} class="object-cover w-[100px] h-[100px] rounded-lg" loading="lazy" + draggable="false" /> {/await}
diff --git a/web/src/lib/components/sharing-page/shared-album-list-tile.svelte b/web/src/lib/components/sharing-page/shared-album-list-tile.svelte index b71d5aa3a9..fdcaddd3fe 100644 --- a/web/src/lib/components/sharing-page/shared-album-list-tile.svelte +++ b/web/src/lib/components/sharing-page/shared-album-list-tile.svelte @@ -41,6 +41,7 @@ src={imageData} alt={album.id} class={`object-cover w-[75px] h-[75px] transition-all z-0 rounded-xl duration-300 `} + draggable="false" /> {/await}
diff --git a/web/src/routes/+error.svelte b/web/src/routes/+error.svelte index d0b25f87e5..ad9625e197 100644 --- a/web/src/routes/+error.svelte +++ b/web/src/routes/+error.svelte @@ -33,7 +33,7 @@