4 Commits

Author SHA1 Message Date
9d72a99626 Merge pull request 'f113_UI_fixes' (#40) from f113_UI_fixes into development
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
Reviewed-on: #40
2025-11-13 12:51:29 +01:00
320f6d6c8b remove Vorgang label 2025-11-13 12:46:58 +01:00
ac79f10153 adjust ´edit´ and ´delete´ button on Vorgang page with crimesList 2025-11-13 12:45:07 +01:00
dac1c57c98 align Vorgang item on list page and remove ´Vorgang´ description 2025-11-13 12:03:51 +01:00
3 changed files with 120 additions and 89 deletions

View File

@@ -58,26 +58,53 @@
}
</script>
<div data-testid="test-nameItemEditor">
<div data-testid="test-nameItemEditor" class="flex flex-col gap-1">
{#if isEditing}
<div class="flex items-center gap-1">
<input
data-testid="test-input"
bind:this={inputRef}
bind:value={localName}
onkeydown={handleKeydown}
class="flex-1 border border-gray-300 rounded px-1.5 py-0.5 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500"
/>
<button
data-testid="commit-button"
disabled={!!error || localName === currentName}
onclick={commitEdit}><Check /></button
onclick={commitEdit}
class="text-gray-500 hover:text-green-600 transition disabled:opacity-40"
>
<button data-testid="cancel-button" onclick={cancelEdit}><X /></button>
<Check class="w-4 h-4" />
</button>
<button
data-testid="cancel-button"
onclick={cancelEdit}
class="text-gray-500 hover:text-red-600 transition"
>
<X class="w-4 h-4" />
</button>
</div>
{:else}
<span>{localName}</span>
<button data-testid="edit-button" onclick={startEdit}><Edit /></button>
<button data-testid="delete-button" onclick={handleDeleteClick}><Trash /></button>
<div class="flex items-center gap-1">
<span class="text-sm font-medium text-gray-900 truncate">{localName}</span>
<button
data-testid="edit-button"
onclick={startEdit}
class="text-gray-500 hover:text-blue-600 transition"
>
<Edit class="w-4 h-4" />
</button>
<button
data-testid="delete-button"
onclick={handleDeleteClick}
class="text-gray-500 hover:text-red-600 transition"
>
<Trash class="w-4 h-4" />
</button>
</div>
{/if}
{#if error}
<p class="text-red-500">{error}</p>
<p class="text-xs text-red-500 mt-1">{error}</p>
{/if}
</div>

View File

@@ -102,27 +102,24 @@
<li data-testid="test-list-item">
<a
href="{ROUTE_NAMES.VORGANG(vorgangItem.vorgangToken)}"
class="flex justify-between gap-x-6 py-5"
>
<div class="flex gap-x-4">
<Folder />
<div class="min-w-0 flex-auto">
<span class="text-sm font-semibold leading-6 text-gray-900"
>{vorgangItem.vorgangName}</span
class="flex flex-col items-center justify-center gap-2 py-4 px-4 rounded-lg hover:bg-gray-50 transition text-center"
>
<div class="flex items-center justify-center gap-3">
<Folder class="w-6 h-6 text-gray-600" />
<span class="text-sm font-semibold leading-6 text-gray-900">
{vorgangItem.vorgangName}
</span>
<button
style="padding: 2px"
id="del__{vorgangItem.vorgangToken}"
on:click|preventDefault={delete_item}
aria-label="Vorgang {vorgangItem.name} löschen"
class="p-1.5 rounded-full text-gray-500 hover:text-red-600 hover:bg-red-50 transition"
>
<Trash />
<Trash class="w-4 h-4" />
</button>
</div>
</div>
<div class="hidden sm:flex sm:flex-col sm:items-end">
<p class="text-sm leading-6 text-gray-900">Vorgang</p>
</div>
</a>
</li>
{/each}
@@ -198,3 +195,4 @@
min-width: 24rem;
}
</style>

View File

@@ -248,7 +248,7 @@ Mit freundlichen Grüßen,
{#if data.vorgang && crimesList}
<div class="-z-10 bg-white">
<div class="flex flex-col items-center justify-center w-full">
<h1 class="text-xl">Vorgang {vorgangName}</h1>
<h1 class="text-xl">{vorgangName}</h1>
{#if admin}
Zugangs-PIN: {vorgangPIN}
@@ -263,50 +263,56 @@ Mit freundlichen Grüßen,
<EmptyList></EmptyList>
{:else}
{#each crimesList as item (item.name)}
<li data-testid="test-list-item">
<div class=" flex gap-x-4">
<li
data-testid="test-list-item"
class="flex items-center justify-between gap-6 py-4 px-2 hover:bg-gray-50 rounded-lg transition"
>
<div class="flex items-center gap-4 flex-1">
<a
data-testid="crime-link"
href="{ROUTE_NAMES.CRIME(vorgangToken, item.name, vorgangPIN)}"
class=" flex justify-between gap-x-6 py-5"
class="flex items-center justify-center w-8 h-8 text-gray-600 hover:text-blue-600 transition"
aria-label="{ROUTE_NAMES.CRIME(vorgangToken, item.name, vorgangPIN)}"
title={item.name}
>
<Cube />
<Cube class="w-5 h-5" />
</a>
<div class="min-w-0 flex-auto">
<div class="flex flex-col flex-1 min-w-0">
{#if admin}
<NameItemEditor
list={crimesList}
currentName={item.name}
onSave={handleSave}
onDelete={handleDelete}
></NameItemEditor>
/>
{:else}
<p
data-testid="test-nameItem-p"
class="text-sm font-semibold leading-6 text-gray-900 inline-block min-w-1"
class="text-sm font-semibold leading-6 text-gray-900 truncate"
>
{item.name}
</p>
{/if}
<!-- size left, last modified right -->
<div class="flex items-center justify-between mt-1 text-xs leading-5 text-gray-500">
{#if item.size}
<p class="mt-1 truncate text-xs leading-5 text-gray-500">
{shortenFileSize(item.size)}
</p>
<span>{shortenFileSize(item.size)}</span>
{:else}
<span></span>
{/if}
</div>
</div>
<div class="hidden sm:flex sm:flex-col sm:items-end">
<p class="text-sm leading-6 text-gray-900">3D Tatort</p>
{#if item.lastModified}
<p class="mt-1 text-xs leading-5 text-gray-500">
Zuletzt geändert <time datetime="2023-01-23T13:23Z"
>{timeElapsed(new Date(item.lastModified))}</time
>
</p>
<span>
Zuletzt geändert
<time datetime={item.lastModified}>
{timeElapsed(new Date(item.lastModified))}
</time>
</span>
{/if}
</div>
</div>
</div>
</li>
{/each}
{/if}