feat(web): shared link filters (#15948)

This commit is contained in:
Jason Rasmussen
2025-02-07 13:05:15 -05:00
committed by GitHub
parent 23014c263b
commit c5360e78c5
22 changed files with 520 additions and 112 deletions

View File

@@ -1,15 +1,22 @@
<script lang="ts">
import { goto } from '$app/navigation';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import { AppRoute } from '$lib/constants';
import type { SharedLinkResponseDto } from '@immich/sdk';
import { mdiCircleEditOutline } from '@mdi/js';
import { t } from 'svelte-i18n';
interface Props {
menuItem?: boolean;
onEdit: () => void;
sharedLink: SharedLinkResponseDto;
}
let { menuItem = false, onEdit }: Props = $props();
let { sharedLink, menuItem = false }: Props = $props();
const onEdit = async () => {
await goto(`${AppRoute.SHARED_LINKS}/${sharedLink.id}`);
};
</script>
{#if menuItem}

View File

@@ -15,10 +15,9 @@
interface Props {
link: SharedLinkResponseDto;
onDelete: () => void;
onEdit: () => void;
}
let { link, onDelete, onEdit }: Props = $props();
let { link, onDelete }: Props = $props();
let now = DateTime.now();
let expiresAt = $derived(link.expiresAt ? DateTime.fromISO(link.expiresAt) : undefined);
@@ -95,10 +94,9 @@
</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">
<SharedLinkEdit {onEdit} />
<SharedLinkEdit sharedLink={link} />
<SharedLinkCopy {link} />
<SharedLinkDelete {onDelete} />
</div>
@@ -112,7 +110,7 @@
padding="3"
hideContent
>
<SharedLinkEdit menuItem {onEdit} />
<SharedLinkEdit menuItem sharedLink={link} />
<SharedLinkCopy menuItem {link} />
<SharedLinkDelete menuItem {onDelete} />
</ButtonContextMenu>