feat(conversations): add swap button (#32)
Adds a button between the two person typeaheads that swaps sender and receiver, then reloads the conversation view. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -140,6 +140,7 @@
|
|||||||
"conv_empty_text": "Die Korrespondenz wird hier angezeigt.",
|
"conv_empty_text": "Die Korrespondenz wird hier angezeigt.",
|
||||||
"conv_no_results_heading": "Keine Dokumente gefunden.",
|
"conv_no_results_heading": "Keine Dokumente gefunden.",
|
||||||
"conv_no_results_text": "Versuchen Sie, den Zeitraum anzupassen.",
|
"conv_no_results_text": "Versuchen Sie, den Zeitraum anzupassen.",
|
||||||
|
"conv_swap_btn": "Personen tauschen",
|
||||||
|
|
||||||
"admin_heading": "Admin Dashboard",
|
"admin_heading": "Admin Dashboard",
|
||||||
"admin_tab_users": "Benutzer",
|
"admin_tab_users": "Benutzer",
|
||||||
|
|||||||
@@ -140,6 +140,7 @@
|
|||||||
"conv_empty_text": "The correspondence will be shown here.",
|
"conv_empty_text": "The correspondence will be shown here.",
|
||||||
"conv_no_results_heading": "No documents found.",
|
"conv_no_results_heading": "No documents found.",
|
||||||
"conv_no_results_text": "Try adjusting the time period.",
|
"conv_no_results_text": "Try adjusting the time period.",
|
||||||
|
"conv_swap_btn": "Swap persons",
|
||||||
|
|
||||||
"admin_heading": "Admin Dashboard",
|
"admin_heading": "Admin Dashboard",
|
||||||
"admin_tab_users": "Users",
|
"admin_tab_users": "Users",
|
||||||
|
|||||||
@@ -140,6 +140,7 @@
|
|||||||
"conv_empty_text": "La correspondencia se mostrará aquí.",
|
"conv_empty_text": "La correspondencia se mostrará aquí.",
|
||||||
"conv_no_results_heading": "No se encontraron documentos.",
|
"conv_no_results_heading": "No se encontraron documentos.",
|
||||||
"conv_no_results_text": "Intente ajustar el período de tiempo.",
|
"conv_no_results_text": "Intente ajustar el período de tiempo.",
|
||||||
|
"conv_swap_btn": "Intercambiar personas",
|
||||||
|
|
||||||
"admin_heading": "Panel de administración",
|
"admin_heading": "Panel de administración",
|
||||||
"admin_tab_users": "Usuarios",
|
"admin_tab_users": "Usuarios",
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ function toggleSort() {
|
|||||||
sortDir = sortDir === 'DESC' ? 'ASC' : 'DESC';
|
sortDir = sortDir === 'DESC' ? 'ASC' : 'DESC';
|
||||||
applyFilters();
|
applyFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function swapPersons() {
|
||||||
|
const tmp = senderId;
|
||||||
|
senderId = receiverId;
|
||||||
|
receiverId = tmp;
|
||||||
|
applyFilters();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="mx-auto max-w-5xl px-4 py-10">
|
<div class="mx-auto max-w-5xl px-4 py-10">
|
||||||
@@ -80,6 +87,27 @@ function toggleSort() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if senderId && receiverId}
|
||||||
|
<div class="mb-4 flex justify-center">
|
||||||
|
<button
|
||||||
|
data-testid="conv-swap-btn"
|
||||||
|
onclick={swapPersons}
|
||||||
|
class="flex items-center gap-2 rounded-sm border border-brand-sand px-4 py-2 text-xs font-bold tracking-widest text-brand-navy uppercase transition-colors hover:bg-brand-navy hover:text-white"
|
||||||
|
title={m.conv_swap_btn()}
|
||||||
|
>
|
||||||
|
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M7 16V4m0 0L3 8m4-4l4 4M17 8v12m0 0l4-4m-4 4l-4-4"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
{m.conv_swap_btn()}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<div class="relative z-10 grid grid-cols-1 items-end gap-6 md:grid-cols-3">
|
<div class="relative z-10 grid grid-cols-1 items-end gap-6 md:grid-cols-3">
|
||||||
<!-- Date From -->
|
<!-- Date From -->
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user