fix merge

This commit is contained in:
martabal 2023-10-25 23:54:29 +02:00
parent fc0d358d4e
commit 00ee2aca62
No known key found for this signature in database
GPG key ID: C00196E3148A52BD
3 changed files with 26 additions and 99 deletions

View file

@ -153,14 +153,6 @@
disabled={!isOwner}
/>
</section>
{#if asset.exifInfo?.dateTimeOriginal}
{@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, {
zone: asset.exifInfo.timeZone ?? undefined,
})}
<div class="flex gap-4 py-4">
<div>
<Icon path={mdiCalendar} size="24" />
</div>
{#if !api.isSharedLink && people.length > 0}
<section class="px-4 py-4 text-sm">
@ -286,9 +278,9 @@
</div>
{/if}
{#if asset.exifInfo?.fileSizeInByte}
<div class="flex gap-4 py-4">
<div><Icon path={mdiImageOutline} size="24" /></div>
{#if asset.exifInfo?.make || asset.exifInfo?.model || asset.exifInfo?.fNumber}
<div class="flex gap-4 py-4">
<div><CameraIris size="24" /></div>
<div>
<p>{asset.exifInfo.make || ''} {asset.exifInfo.model || ''}</p>
@ -315,10 +307,10 @@
</div>
{/if}
{#if asset.exifInfo?.make || asset.exifInfo?.model || asset.exifInfo?.fNumber}
<div class="flex gap-4 py-4">
<div><Icon path={mdiCameraIris} size="24" /></div>
{#if asset.exifInfo?.city}
<div class="flex gap-4 py-4">
<div><MapMarkerOutline size="24" /></div>
<div>
<div>
<p>{asset.exifInfo.city}</p>
{#if asset.exifInfo?.state}
@ -333,68 +325,8 @@
{/if}
</div>
</div>
</div>
{/if}
{/if}
{#if asset.exifInfo?.city}
<div class="flex gap-4 py-4">
<div><Icon path={mdiMapMarkerOutline} size="24" /></div>
<div>
<p>{asset.exifInfo.city}</p>
{#if asset.exifInfo?.state}
<div class="flex gap-2 text-sm">
<p>{asset.exifInfo.state}</p>
</div>
{/if}
{#if asset.exifInfo?.country}
<div class="flex gap-2 text-sm">
<p>{asset.exifInfo.country}</p>
</div>
{/if}
</div>
</div>
{/if}
</div>
</section>
{#if latlng && $featureFlags.loaded && $featureFlags.map}
<div class="h-[360px]">
{#await import('../shared-components/leaflet') then { Map, TileLayer, Marker }}
<Map center={latlng} zoom={14}>
<TileLayer
urlTemplate={$serverConfig.mapTileUrl}
options={{
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
}}
/>
<Marker {latlng}>
<p>
{lat}, {lng}
</p>
<a href="https://www.openstreetmap.org/?mlat={lat}&mlon={lng}&zoom=15#map=15/{lat}/{lng}">
Open in OpenStreetMap
</a>
</Marker>
</Map>
{/await}
</div>
{/if}
{#if asset.owner && !isOwner}
<section class="px-6 pt-6 dark:text-immich-dark-fg">
<p class="text-sm">SHARED BY</p>
<div class="flex gap-4 pt-4">
<div>
<UserAvatar user={asset.owner} size="md" autoColor />
</div>
<div class="mb-auto mt-auto">
<p>
{asset.owner.firstName}
{asset.owner.lastName}
</p>
</div>
</div>
</section>

View file

@ -7,21 +7,17 @@
<script lang="ts">
import { blur, fly } from 'svelte/transition';
import ArrowLeftThin from 'svelte-material-icons/ArrowLeftThin.svelte';
import Magnify from 'svelte-material-icons/Magnify.svelte';
import Plus from 'svelte-material-icons/Plus.svelte';
import { linear } from 'svelte/easing';
import { api, ThumbnailFormat, type PersonResponseDto, UnassignedFacesResponseDto } from '@api';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
import { cloneDeep } from 'lodash-es';
import { handleError } from '$lib/utils/handle-error';
import Close from 'svelte-material-icons/Close.svelte';
import { createEventDispatcher, onMount } from 'svelte';
import Minus from 'svelte-material-icons/Minus.svelte';
import Account from 'svelte-material-icons/Account.svelte';
import Restart from 'svelte-material-icons/Restart.svelte';
import { mdiRestart, mdiAccount, mdiMinus, mdiClose, mdiPlus, mdiMagnify, mdiArrowLeftThin } from '@mdi/js';
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
import { NotificationType, notificationController } from '../shared-components/notification/notification';
import Icon from '$lib/components/elements/icon.svelte';
export let people: PersonResponseDto[];
export let unassignedFaces: UnassignedFacesResponseDto[];
@ -266,7 +262,7 @@
class="flex place-content-center rounded-full p-3 transition-colors hover:bg-gray-200 dark:text-immich-dark-fg dark:hover:bg-gray-900"
on:click={handleBackButton}
>
<ArrowLeftThin size="24" />
<Icon path={mdiArrowLeftThin} size="24" />
</button>
<p class="flex text-lg text-immich-fg dark:text-immich-dark-fg">Edit faces</p>
</div>
@ -308,7 +304,7 @@
>
<button on:click={() => handleReset(index)} class="flex h-full w-full">
<div class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] transform">
<Minus size={18} />
<Icon path={mdiMinus} size={18} />
</div>
</button>
</div>
@ -320,13 +316,13 @@
{#if (selectedPersonToCreate[index] && selectedPersonToCreate[index]?.canEdit !== false) || selectedPersonToReassign[index]}
<button on:click={() => handleReset(index)} class="flex h-full w-full">
<div class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] transform">
<Restart size={18} />
<Icon path={mdiRestart} size={18} />
</div>
</button>
{:else}
<button on:click={() => handlePersonPicker(index)} class="flex h-full w-full">
<div class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] transform">
<Account size={18} />
<Icon path={mdiAccount} size={18} />
</div>
</button>
{/if}
@ -354,7 +350,7 @@
>
<button on:click={() => handlePersonPicker(index)} class="flex h-full w-full">
<div class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] transform">
<Minus size={18} />
<Icon path={mdiMinus} size={18} />
</div>
</button>
</div>
@ -376,7 +372,7 @@
class="flex place-content-center rounded-full p-3 transition-colors hover:bg-gray-200 dark:text-immich-dark-fg dark:hover:bg-gray-900"
on:click={handleBackButton}
>
<ArrowLeftThin size="24" />
<Icon path={mdiArrowLeftThin} size="24" />
</button>
<p class="flex text-lg text-immich-fg dark:text-immich-dark-fg">Select face</p>
</div>
@ -389,7 +385,7 @@
searchFaces = true;
}}
>
<Magnify size="24" />
<Icon path={mdiMagnify} size="24" />
</button>
{:else}
<div
@ -404,7 +400,7 @@
on:click={() => handleCreatePerson()}
title="Create new person"
>
<Plus size="24" />
<Icon path={mdiPlus} size="24" />
</button>
</div>
{:else}
@ -412,7 +408,7 @@
class="flex place-content-center rounded-full p-3 transition-colors hover:bg-gray-200 dark:text-immich-dark-fg dark:hover:bg-gray-900"
on:click={handleBackButton}
>
<ArrowLeftThin size="24" />
<Icon path={mdiArrowLeftThin} size="24" />
</button>
<input
class="w-full gap-2 bg-immich-bg dark:bg-immich-dark-bg"
@ -426,7 +422,7 @@
class="flex place-content-center place-items-center rounded-full p-3 transition-colors hover:bg-gray-200 dark:text-immich-dark-fg dark:hover:bg-gray-900"
on:click={() => (searchFaces = false)}
>
<Close size="24" />
<Icon path={mdiClose} size="24" />
</button>
{/if}
</div>

View file

@ -6,13 +6,12 @@
import { api, AssetFaceUpdateItem, type PersonResponseDto } from '@api';
import ControlAppBar from '../shared-components/control-app-bar.svelte';
import Button from '../elements/buttons/button.svelte';
import Merge from 'svelte-material-icons/Merge.svelte';
import CloseThick from 'svelte-material-icons/CloseThick.svelte';
import Plus from 'svelte-material-icons/Plus.svelte';
import { mdiPlus, mdiCloseThick, mdiMerge } from '@mdi/js';
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
import { handleError } from '$lib/utils/handle-error';
import { notificationController, NotificationType } from '../shared-components/notification/notification';
import PeopleList from './people-list.svelte';
import Icon from '$lib/components/elements/icon.svelte';
let people: PersonResponseDto[] = [];
export let assetIds: string[];
@ -137,7 +136,7 @@
}}
>
{#if !showLoadingSpinnerUnassign}
<CloseThick size={18} />
<Icon path={mdiCloseThick} size={18} />
{:else}
<LoadingSpinner />
{/if}
@ -152,7 +151,7 @@
}}
>
{#if !showLoadingSpinnerCreate}
<Plus size={18} />
<Icon path={mdiPlus} size={18} />
{:else}
<LoadingSpinner />
{/if}
@ -167,7 +166,7 @@
}}
>
{#if !showLoadingSpinnerReassign}
<Merge size={18} class="rotate-180" />
<Icon path={mdiMerge} size={18} class="rotate-180" />
{:else}
<LoadingSpinner />
{/if}