From 05e851ef4466b0679771e863777bfe088d987543 Mon Sep 17 00:00:00 2001 From: Yonggan Date: Sat, 10 Jun 2023 00:23:28 +0200 Subject: [PATCH] Add select all to photos --- .../actions/select-all-assets.svelte | 51 +++++++++++++++++++ .../asset-select-control-bar.svelte | 1 + web/src/lib/stores/assets.store.ts | 1 + web/src/routes/(user)/photos/+page.svelte | 2 + 4 files changed, 55 insertions(+) create mode 100644 web/src/lib/components/photos-page/actions/select-all-assets.svelte diff --git a/web/src/lib/components/photos-page/actions/select-all-assets.svelte b/web/src/lib/components/photos-page/actions/select-all-assets.svelte new file mode 100644 index 0000000000..64f9cfaa08 --- /dev/null +++ b/web/src/lib/components/photos-page/actions/select-all-assets.svelte @@ -0,0 +1,51 @@ + +{#if selecting} + +{/if} +{#if !selecting} + +{/if} diff --git a/web/src/lib/components/photos-page/asset-select-control-bar.svelte b/web/src/lib/components/photos-page/asset-select-control-bar.svelte index 3e0f4bcca0..866446ddc9 100644 --- a/web/src/lib/components/photos-page/asset-select-control-bar.svelte +++ b/web/src/lib/components/photos-page/asset-select-control-bar.svelte @@ -2,6 +2,7 @@ import { createContext } from '$lib/utils/context'; export type OnAssetDelete = (assetId: string) => void; + export type OnSelectAll = (assetId: string) => void; export type OnAssetArchive = (asset: AssetResponseDto, archived: boolean) => void; export type OnAssetFavorite = (asset: AssetResponseDto, favorite: boolean) => void; diff --git a/web/src/lib/stores/assets.store.ts b/web/src/lib/stores/assets.store.ts index eac4e18463..43dbc0af3f 100644 --- a/web/src/lib/stores/assets.store.ts +++ b/web/src/lib/stores/assets.store.ts @@ -58,6 +58,7 @@ function createAssetStore() { userId }); + console.log("Initial buckets: "+ data.buckets.length) // Update timeline height based on calculated bucket height assetGridState.update((state) => { state.timelineHeight = sumBy(state.buckets, (d) => d.bucketHeight); diff --git a/web/src/routes/(user)/photos/+page.svelte b/web/src/routes/(user)/photos/+page.svelte index 91d521a96a..d7daebefc7 100644 --- a/web/src/routes/(user)/photos/+page.svelte +++ b/web/src/routes/(user)/photos/+page.svelte @@ -6,6 +6,7 @@ import DeleteAssets from '$lib/components/photos-page/actions/delete-assets.svelte'; import DownloadAction from '$lib/components/photos-page/actions/download-action.svelte'; import FavoriteAction from '$lib/components/photos-page/actions/favorite-action.svelte'; + import SelectAllAssets from '$lib/components/photos-page/actions/select-all-assets.svelte'; import AssetGrid from '$lib/components/photos-page/asset-grid.svelte'; import AssetSelectContextMenu from '$lib/components/photos-page/asset-select-context-menu.svelte'; import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte'; @@ -37,6 +38,7 @@ clearSelect={assetInteractionStore.clearMultiselect} > +