feat(web): add album to search result (#2900)

* Add album to search result page

* Update web/src/routes/(user)/search/+page.svelte

Co-authored-by: Thomas <9749173+uhthomas@users.noreply.github.com>

* Update web/src/routes/(user)/search/+page.svelte

Co-authored-by: Thomas <9749173+uhthomas@users.noreply.github.com>

* change font weight

* hide context menu in this view

---------

Co-authored-by: Thomas <9749173+uhthomas@users.noreply.github.com>
This commit is contained in:
Alex 2023-06-21 15:18:00 -05:00 committed by GitHub
parent 069c68bfe4
commit 0f0375a67e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 8 deletions

View file

@ -10,6 +10,8 @@
export let album: AlbumResponseDto;
export let isSharingView = false;
export let user: UserResponseDto;
export let showItemCount = true;
export let showContextMenu = true;
$: imageData = album.albumThumbnailAssetId
? api.getAssetThumbnailUrl(album.albumThumbnailAssetId, ThumbnailFormat.Webp)
@ -63,7 +65,7 @@
data-testid="album-card"
>
<!-- svelte-ignore a11y-click-events-have-key-events -->
{#if !isSharingView}
{#if showContextMenu}
<div
id={`icon-${album.id}`}
class="absolute top-6 right-6 z-10"
@ -101,10 +103,12 @@
</p>
<span class="text-sm flex gap-2 dark:text-immich-dark-fg" data-testid="album-details">
<p>
{album.assetCount.toLocaleString($locale)}
{album.assetCount == 1 ? `item` : `items`}
</p>
{#if showItemCount}
<p>
{album.assetCount.toLocaleString($locale)}
{album.assetCount == 1 ? `item` : `items`}
</p>
{/if}
{#if isSharingView || album.shared}
<p>·</p>

View file

@ -89,6 +89,10 @@
if (from?.url.pathname === '/sharing' && album.sharedUsers.length === 0) {
isCreatingSharedAlbum = true;
}
if (from?.route.id === '/(user)/search') {
backUrl = from.url.href;
}
});
const albumDateFormat: Intl.DateTimeFormatOptions = {

View file

@ -94,7 +94,7 @@
<div class="px-5 pt-5 text-xs">
<p>
Smart search is enabled by default, to search for metadata use the syntax <span
class="font-mono p-2 font-semibold text-immich-primary dark:text-immich-dark-primary bg-gray-100 rounded-lg dark:bg-gray-900"
class="font-mono p-2 font-semibold text-immich-primary dark:text-immich-dark-primary bg-gray-100 rounded-lg dark:bg-gray-900 leading-7"
>m:your-search-term</span
>
</p>