Compare commits

...

3 Commits

Author SHA1 Message Date
Alex Tran
3582e00ceb Use text color of enable/disable shared link properties 2025-12-15 20:30:51 +00:00
Alex Tran
e2ec79dbf0 fix: shared link expiration and small styling 2025-12-14 04:23:40 +00:00
Yaros
33cdea88aa fix(mobile): birthday off by one day on remote (#24527) 2025-12-11 21:23:11 -06:00
3 changed files with 58 additions and 42 deletions

View File

@@ -17,8 +17,10 @@ class PersonApiRepository extends ApiRepository {
}
Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async {
final dto = await checkNull(_api.updatePerson(id, PersonUpdateDto(name: name, birthDate: birthday)));
return _toPerson(dto);
final birthdayUtc = birthday == null ? null : DateTime.utc(birthday.year, birthday.month, birthday.day);
final dto = PersonUpdateDto(name: name, birthDate: birthdayUtc);
final response = await checkNull(_api.updatePerson(id, dto));
return _toPerson(response);
}
static PersonDto _toPerson(PersonResponseDto dto) => PersonDto(

View File

@@ -5,7 +5,7 @@
import { getSharedLinkActions } from '$lib/services/shared-link.service';
import { locale } from '$lib/stores/preferences.store';
import { SharedLinkType, type SharedLinkResponseDto } from '@immich/sdk';
import { Badge, ContextMenuButton, MenuItemType, Text } from '@immich/ui';
import { ContextMenuButton, MenuItemType, Text } from '@immich/ui';
import { DateTime, type ToRelativeUnit } from 'luxon';
import { t } from 'svelte-i18n';
@@ -44,8 +44,19 @@
>
<ShareCover class="transition-all duration-300 hover:shadow-lg" {sharedLink} />
<div class="flex flex-col gap-2">
<Text size="large" color="primary" class="flex place-items-center gap-2 break-all">
<div class="flex flex-col gap-4 justify-between">
<div class="flex flex-col">
<Text size="tiny" color={isExpired ? 'danger' : 'muted'} class="font-medium">
{#if isExpired}
{$t('expired')}
{:else if expiresAt}
{$t('expires_date', { values: { date: getCountDownExpirationDate(expiresAt, now) } })}
{:else}
{$t('expires_date', { values: { date: '∞' } })}
{/if}
</Text>
<Text size="large" color="primary" class="flex place-items-center gap-2 break-all font-medium">
{#if sharedLink.type === SharedLinkType.Album}
{sharedLink.album?.albumName}
{:else if sharedLink.type === SharedLinkType.Individual}
@@ -53,42 +64,45 @@
{/if}
</Text>
<div class="flex flex-wrap gap-1">
{#if isExpired}
<Badge size="small" color="danger">{$t('expired')}</Badge>
{:else if expiresAt}
<Badge size="small" color="secondary">
{$t('expires_date', { values: { date: getCountDownExpirationDate(expiresAt, now) } })}
</Badge>
{:else}
<Badge size="small" color="secondary">{$t('expires_date', { values: { date: '∞' } })}</Badge>
{/if}
{#if sharedLink.slug}
<Badge size="small" color="secondary">{$t('custom_url')}</Badge>
{/if}
{#if sharedLink.allowUpload}
<Badge size="small" color="secondary">{$t('upload')}</Badge>
{/if}
{#if sharedLink.showMetadata && sharedLink.allowDownload}
<Badge size="small" color="secondary">{$t('download')}</Badge>
{/if}
{#if sharedLink.showMetadata}
<Badge size="small" color="secondary">{$t('exif')}</Badge>
{/if}
{#if sharedLink.password}
<Badge size="small" color="secondary">{$t('password')}</Badge>
{/if}
</div>
{#if sharedLink.description}
<Text size="small" class="line-clamp-1">{sharedLink.description}</Text>
{/if}
</div>
<div class="flex flex-wrap items-center gap-2">
<Text
size="small"
color={sharedLink.allowUpload ? 'primary' : 'muted'}
class={sharedLink.allowUpload ? 'font-medium' : 'opacity-50'}
>
{$t('upload')}
</Text>
<Text size="small" color="muted"></Text>
<Text
size="small"
color={sharedLink.allowDownload ? 'primary' : 'muted'}
class={sharedLink.allowDownload ? 'font-medium' : 'opacity-50'}
>
{$t('download')}
</Text>
<Text size="small" color="muted"></Text>
<Text
size="small"
color={sharedLink.showMetadata ? 'primary' : 'muted'}
class={sharedLink.showMetadata ? 'font-medium' : 'opacity-50'}
>
{$t('exif')}
</Text>
<Text size="small" color="muted"></Text>
<Text
size="small"
color={sharedLink.password ? 'primary' : 'muted'}
class={sharedLink.password ? 'font-medium' : 'opacity-50'}
>
{$t('password')}
</Text>
</div>
</div>
</svelte:element>
<div class="flex flex-auto flex-col place-content-center place-items-end text-end ms-4">
<div class="sm:flex hidden">

View File

@@ -3,7 +3,7 @@
import { page } from '$app/state';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import OnEvents from '$lib/components/OnEvents.svelte';
import SharedLinkCard from '$lib/components/sharedlinks-page/shared-link-card.svelte';
import SharedLinkCard from '$lib/components/sharedlinks-page/SharedLinkCard.svelte';
import { AppRoute } from '$lib/constants';
import GroupTab from '$lib/elements/GroupTab.svelte';
import SharedLinkUpdateModal from '$lib/modals/SharedLinkUpdateModal.svelte';