mirror of
https://github.com/immich-app/immich.git
synced 2025-01-22 11:42:46 +01:00
Add select all to search
This commit is contained in:
parent
a8c8e33c10
commit
6f09f28206
6 changed files with 209 additions and 197 deletions
|
@ -347,7 +347,7 @@
|
||||||
assets={multiSelectAsset}
|
assets={multiSelectAsset}
|
||||||
clearSelect={() => (multiSelectAsset = new Set())}
|
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} />
|
<DownloadAction filename={album.albumName} sharedLinkKey={sharedLink?.key} />
|
||||||
{#if isOwned}
|
{#if isOwned}
|
||||||
<RemoveFromAlbum bind:album />
|
<RemoveFromAlbum bind:album />
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
import {api, AssetResponseDto} from '@api';
|
import {api, AssetResponseDto} from '@api';
|
||||||
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
|
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
|
||||||
import TimerSand from 'svelte-material-icons/TimerSand.svelte';
|
import TimerSand from 'svelte-material-icons/TimerSand.svelte';
|
||||||
import {getAssetControlContext} from '../asset-select-control-bar.svelte';
|
|
||||||
import {
|
import {
|
||||||
assetInteractionStore,
|
assetInteractionStore,
|
||||||
selectedAssets
|
selectedAssets
|
||||||
|
@ -45,5 +44,5 @@
|
||||||
<CircleIconButton title="Delete" logo={TimerSand}/>
|
<CircleIconButton title="Delete" logo={TimerSand}/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if !selecting}
|
{#if !selecting}
|
||||||
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
|
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
clearSelect={() => (selectedAssets = new Set())}
|
clearSelect={() => (selectedAssets = new Set())}
|
||||||
>
|
>
|
||||||
<ArchiveAction unarchive onAssetArchive={(asset) => onAssetDelete(asset.id)} />
|
<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 />
|
<CreateSharedLink />
|
||||||
<AssetSelectContextMenu icon={Plus} title="Add">
|
<AssetSelectContextMenu icon={Plus} title="Add">
|
||||||
<AddToAlbum />
|
<AddToAlbum />
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
||||||
<FavoriteAction removeFavorite onAssetFavorite={(asset) => onAssetDelete(asset.id)}/>
|
<FavoriteAction removeFavorite onAssetFavorite={(asset) => onAssetDelete(asset.id)}/>
|
||||||
<CreateSharedLink/>
|
<CreateSharedLink/>
|
||||||
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
|
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
|
||||||
<AssetSelectContextMenu icon={Plus} title="Add">
|
<AssetSelectContextMenu icon={Plus} title="Add">
|
||||||
<AddToAlbum/>
|
<AddToAlbum/>
|
||||||
<AddToAlbum shared/>
|
<AddToAlbum shared/>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte';
|
import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte';
|
||||||
import ControlAppBar from '$lib/components/shared-components/control-app-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 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 {AppRoute} from '$lib/constants';
|
||||||
import {handleError} from '$lib/utils/handle-error';
|
import {handleError} from '$lib/utils/handle-error';
|
||||||
import {AssetResponseDto, api} from '@api';
|
import {AssetResponseDto, api} from '@api';
|
||||||
|
@ -20,6 +21,8 @@
|
||||||
import DotsVertical from 'svelte-material-icons/DotsVertical.svelte';
|
import DotsVertical from 'svelte-material-icons/DotsVertical.svelte';
|
||||||
import Plus from 'svelte-material-icons/Plus.svelte';
|
import Plus from 'svelte-material-icons/Plus.svelte';
|
||||||
import type {PageData} from './$types';
|
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;
|
export let data: PageData;
|
||||||
|
|
||||||
|
@ -50,11 +53,15 @@
|
||||||
const onAssetDelete = (assetId: string) => {
|
const onAssetDelete = (assetId: string) => {
|
||||||
data.assets = data.assets.filter((asset: AssetResponseDto) => asset.id !== assetId);
|
data.assets = data.assets.filter((asset: AssetResponseDto) => asset.id !== assetId);
|
||||||
};
|
};
|
||||||
|
const handleSelectAll = () => {
|
||||||
|
selectedAssets = new Set(data.assets)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if isMultiSelectionMode}
|
{#if isMultiSelectionMode}
|
||||||
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
||||||
<CreateSharedLink/>
|
<CreateSharedLink/>
|
||||||
|
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
|
||||||
<AssetSelectContextMenu icon={Plus} title="Add">
|
<AssetSelectContextMenu icon={Plus} title="Add">
|
||||||
<AddToAlbum/>
|
<AddToAlbum/>
|
||||||
<AddToAlbum shared/>
|
<AddToAlbum shared/>
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
import ImageOffOutline from 'svelte-material-icons/ImageOffOutline.svelte';
|
import ImageOffOutline from 'svelte-material-icons/ImageOffOutline.svelte';
|
||||||
import Plus from 'svelte-material-icons/Plus.svelte';
|
import Plus from 'svelte-material-icons/Plus.svelte';
|
||||||
import type {PageData} from './$types';
|
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;
|
export let data: PageData;
|
||||||
|
|
||||||
|
@ -44,12 +46,16 @@
|
||||||
const onAssetDelete = (assetId: string) => {
|
const onAssetDelete = (assetId: string) => {
|
||||||
searchResultAssets = searchResultAssets.filter((a: AssetResponseDto) => a.id !== assetId);
|
searchResultAssets = searchResultAssets.filter((a: AssetResponseDto) => a.id !== assetId);
|
||||||
};
|
};
|
||||||
|
const handleSelectAll = () => {
|
||||||
|
selectedAssets = new Set(searchResultAssets)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
{#if isMultiSelectionMode}
|
{#if isMultiSelectionMode}
|
||||||
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
||||||
<CreateSharedLink/>
|
<CreateSharedLink/>
|
||||||
|
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll}/>
|
||||||
<AssetSelectContextMenu icon={Plus} title="Add">
|
<AssetSelectContextMenu icon={Plus} title="Add">
|
||||||
<AddToAlbum/>
|
<AddToAlbum/>
|
||||||
<AddToAlbum shared/>
|
<AddToAlbum shared/>
|
||||||
|
|
Loading…
Reference in a new issue