From 6bce42734a9ad7bc7e5ef8ae0e8adcfb4ce26df0 Mon Sep 17 00:00:00 2001 From: Travis Menghini Date: Tue, 26 Nov 2024 09:34:03 -1000 Subject: [PATCH 1/4] Allow Tags to be applied in bulk on search page --- .../search/[[photos=photos]]/[[assetId=id]]/+page.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte index c800dd7014910..647b0dfdd00ed 100644 --- a/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -44,6 +44,8 @@ import { t } from 'svelte-i18n'; import { onMount, tick } from 'svelte'; import AssetJobActions from '$lib/components/photos-page/actions/asset-job-actions.svelte'; + import { preferences, user } from '$lib/stores/user.store'; + import TagAction from '$lib/components/photos-page/actions/tag-action.svelte'; const MAX_ASSET_COUNT = 5000; let { isViewing: showAssetViewer } = assetViewingStore; @@ -229,6 +231,8 @@ function getObjectKeys(obj: T): (keyof T)[] { return Object.keys(obj) as (keyof T)[]; } + let isAllUserOwned = $derived([...$selectedAssets].every((asset) => asset.ownerId === $user.id)); + @@ -250,6 +254,9 @@ + {#if $preferences.tags.enabled && isAllUserOwned} + + {/if}
From a60d24b841058ae760f832270acf3bd6f2da6653 Mon Sep 17 00:00:00 2001 From: Travis Menghini Date: Tue, 26 Nov 2024 09:46:24 -1000 Subject: [PATCH 2/4] Added Tags Action To PersonID Page --- .../[[photos=photos]]/[[assetId=id]]/+page.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte index 48e194dda4728..cf9fbea3ea9a8 100644 --- a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -58,6 +58,8 @@ import { listNavigation } from '$lib/actions/list-navigation'; import { t } from 'svelte-i18n'; import ButtonContextMenu from '$lib/components/shared-components/context-menu/button-context-menu.svelte'; + import { preferences, user } from '$lib/stores/user.store'; + import TagAction from '$lib/components/photos-page/actions/tag-action.svelte'; interface Props { data: PageData; @@ -337,6 +339,8 @@ let isAllArchive = $derived([...$selectedAssets].every((asset) => asset.isArchived)); let isAllFavorite = $derived([...$selectedAssets].every((asset) => asset.isFavorite)); + let isAllUserOwned = $derived([...$selectedAssets].every((asset) => asset.ownerId === $user.id)); + {#if viewMode === PersonPageViewMode.UNASSIGN_ASSETS} @@ -391,6 +395,9 @@ $assetStore.removeAssets(assetIds)} /> + {#if $preferences.tags.enabled && isAllUserOwned} + + {/if} $assetStore.removeAssets(assetIds)} /> From 6b38f9e86a9196d85f1829577b1c189406af0567 Mon Sep 17 00:00:00 2001 From: Travis Menghini Date: Wed, 27 Nov 2024 11:52:21 -1000 Subject: [PATCH 3/4] Fixed Formatting Issues --- .../[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte | 1 - .../(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte | 1 - 2 files changed, 2 deletions(-) diff --git a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte index cf9fbea3ea9a8..143a19dd5cb03 100644 --- a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -340,7 +340,6 @@ let isAllArchive = $derived([...$selectedAssets].every((asset) => asset.isArchived)); let isAllFavorite = $derived([...$selectedAssets].every((asset) => asset.isFavorite)); let isAllUserOwned = $derived([...$selectedAssets].every((asset) => asset.ownerId === $user.id)); - {#if viewMode === PersonPageViewMode.UNASSIGN_ASSETS} diff --git a/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte index 647b0dfdd00ed..7372f05e773b7 100644 --- a/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/search/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -232,7 +232,6 @@ return Object.keys(obj) as (keyof T)[]; } let isAllUserOwned = $derived([...$selectedAssets].every((asset) => asset.ownerId === $user.id)); - From 4ed136054f2cca5d204a946d3f1d6eb51ab9365d Mon Sep 17 00:00:00 2001 From: Travis Menghini Date: Wed, 27 Nov 2024 15:53:06 -1000 Subject: [PATCH 4/4] Added Tags Option to Memory-Viewer --- web/src/lib/components/memory-page/memory-viewer.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/lib/components/memory-page/memory-viewer.svelte b/web/src/lib/components/memory-page/memory-viewer.svelte index 72723670e60d1..65ef47c9ca034 100644 --- a/web/src/lib/components/memory-page/memory-viewer.svelte +++ b/web/src/lib/components/memory-page/memory-viewer.svelte @@ -46,6 +46,8 @@ import { tweened } from 'svelte/motion'; import { derived as storeDerived } from 'svelte/store'; import { fade } from 'svelte/transition'; + import { preferences, user } from '$lib/stores/user.store'; + import TagAction from '$lib/components/photos-page/actions/tag-action.svelte'; type MemoryIndex = { memoryIndex: number; @@ -221,6 +223,7 @@ $effect(() => { handlePromiseError(handleAction(galleryInView ? 'pause' : 'play')); }); + let isAllUserOwned = $derived([...$selectedAssets].every((asset) => asset.ownerId === $user.id)); + {#if $preferences.tags.enabled && isAllUserOwned} + + {/if}