From 7b00f1336d2af5230930c7349d040992b8603556 Mon Sep 17 00:00:00 2001 From: icamarillo Date: Tue, 24 Mar 2026 08:27:13 -0600 Subject: [PATCH] Asunto funcionando --- .../lib/components/IssueDetailModal.svelte | 221 ++++++++++++++++ frontend-client/src/lib/utils/api.ts | 6 +- .../src/routes/tickets/[id]/+page.svelte | 249 +++++++++++++----- 3 files changed, 414 insertions(+), 62 deletions(-) create mode 100644 frontend-client/src/lib/components/IssueDetailModal.svelte diff --git a/frontend-client/src/lib/components/IssueDetailModal.svelte b/frontend-client/src/lib/components/IssueDetailModal.svelte new file mode 100644 index 0000000..8d6d551 --- /dev/null +++ b/frontend-client/src/lib/components/IssueDetailModal.svelte @@ -0,0 +1,221 @@ + + +
+
+
e.key === 'Escape' && handleClose()} + /> +
+ +
+

Detalle del Asunto

+ +
+ + +
+ +
+ + {priorityLabel} + + + {statusLabel} + +
+ + +
+

Descripción

+

+ {issue.content} +

+
+ + +
+ Creado por {issue.created_by_name} + {formatDate(issue.created_at)} +
+ + + {#if issue.tagged_users?.length > 0} +
+

Usuarios etiquetados

+
+ {#each issue.tagged_users as user} +
+ {user.full_name} + · + {user.email} +
+ {/each} +
+
+ {/if} + + + {#if issue.attachment_filename} +
+

Adjunto

+
+ + + + {issue.attachment_filename} +
+
+ {/if} + + + {#if canManage} +
+ + +
+ {/if} +
+ + +
+ {#if canManage} + + {:else} +
+ {/if} + +
+
+
+
diff --git a/frontend-client/src/lib/utils/api.ts b/frontend-client/src/lib/utils/api.ts index 9892269..7064953 100644 --- a/frontend-client/src/lib/utils/api.ts +++ b/frontend-client/src/lib/utils/api.ts @@ -2,6 +2,7 @@ import { auth } from '$lib/stores/auth'; import { get } from 'svelte/store'; const API_BASE = '/api/v1'; + interface RequestOptions extends RequestInit { params?: Record; } @@ -65,7 +66,6 @@ async function downloadFile(endpoint: string, filename: string): Promise { if (authState.token) { headers.set('Authorization', `Bearer ${authState.token}`); } - } headers.set('X-App', 'client'); const slug = get(auth)?.user?.tenant_slug || get(auth)?.user?.tenant_id || ''; headers.set('X-Tenant-Slug', slug); @@ -108,5 +108,7 @@ export const api = { delete: (endpoint: string) => request(endpoint, { method: 'DELETE' }), downloadFile: (endpoint: string, filename: string) => - downloadFile(endpoint, filename) + downloadFile(endpoint, filename), + postForm: (endpoint: string, body: FormData) => + request(endpoint, { method: 'POST', body }) }; \ No newline at end of file diff --git a/frontend-client/src/routes/tickets/[id]/+page.svelte b/frontend-client/src/routes/tickets/[id]/+page.svelte index 153408d..c0beec0 100644 --- a/frontend-client/src/routes/tickets/[id]/+page.svelte +++ b/frontend-client/src/routes/tickets/[id]/+page.svelte @@ -1,11 +1,12 @@