1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-06 03:46:47 +01:00

Add select all to search

This commit is contained in:
Yonggan 2023-06-10 14:21:02 +02:00
parent a8c8e33c10
commit 6f09f28206
6 changed files with 209 additions and 197 deletions

View file

@ -347,7 +347,7 @@
assets={multiSelectAsset}
clearSelect={() => (multiSelectAsset = new Set())}
>
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
<DownloadAction filename={album.albumName} sharedLinkKey={sharedLink?.key} />
{#if isOwned}
<RemoveFromAlbum bind:album />

View file

@ -7,7 +7,6 @@
import {api, AssetResponseDto} from '@api';
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import TimerSand from 'svelte-material-icons/TimerSand.svelte';
import {getAssetControlContext} from '../asset-select-control-bar.svelte';
import {
assetInteractionStore,
selectedAssets
@ -45,5 +44,5 @@
<CircleIconButton title="Delete" logo={TimerSand}/>
{/if}
{#if !selecting}
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
{/if}

View file

@ -62,7 +62,7 @@
clearSelect={() => (selectedAssets = new Set())}
>
<ArchiveAction unarchive onAssetArchive={(asset) => onAssetDelete(asset.id)} />
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
<CreateSharedLink />
<AssetSelectContextMenu icon={Plus} title="Add">
<AddToAlbum />

View file

@ -53,7 +53,7 @@
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
<FavoriteAction removeFavorite onAssetFavorite={(asset) => onAssetDelete(asset.id)}/>
<CreateSharedLink/>
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
<AssetSelectContextMenu icon={Plus} title="Add">
<AddToAlbum/>
<AddToAlbum shared/>

View file

@ -13,6 +13,7 @@
import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte';
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte';
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import {AppRoute} from '$lib/constants';
import {handleError} from '$lib/utils/handle-error';
import {AssetResponseDto, api} from '@api';
@ -20,6 +21,8 @@
import DotsVertical from 'svelte-material-icons/DotsVertical.svelte';
import Plus from 'svelte-material-icons/Plus.svelte';
import type {PageData} from './$types';
import {archivedAsset} from "$lib/stores/archived-asset.store";
import CircleIconButton from "$lib/components/elements/buttons/circle-icon-button.svelte";
export let data: PageData;
@ -50,11 +53,15 @@
const onAssetDelete = (assetId: string) => {
data.assets = data.assets.filter((asset: AssetResponseDto) => asset.id !== assetId);
};
const handleSelectAll = () => {
selectedAssets = new Set(data.assets)
}
</script>
{#if isMultiSelectionMode}
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
<CreateSharedLink/>
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
<AssetSelectContextMenu icon={Plus} title="Add">
<AddToAlbum/>
<AddToAlbum shared/>

View file

@ -18,6 +18,8 @@
import ImageOffOutline from 'svelte-material-icons/ImageOffOutline.svelte';
import Plus from 'svelte-material-icons/Plus.svelte';
import type {PageData} from './$types';
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import CircleIconButton from "$lib/components/elements/buttons/circle-icon-button.svelte";
export let data: PageData;
@ -44,12 +46,16 @@
const onAssetDelete = (assetId: string) => {
searchResultAssets = searchResultAssets.filter((a: AssetResponseDto) => a.id !== assetId);
};
const handleSelectAll = () => {
selectedAssets = new Set(searchResultAssets)
}
</script>
<section>
{#if isMultiSelectionMode}
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
<CreateSharedLink/>
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
<AssetSelectContextMenu icon={Plus} title="Add">
<AddToAlbum/>
<AddToAlbum shared/>