From a24e591cb4f04e21a8664213dc281c99e1490332 Mon Sep 17 00:00:00 2001 From: borja Date: Thu, 23 Oct 2025 10:03:40 +0200 Subject: [PATCH] =?UTF-8?q?cambia=20algunos=20iconos=20para=20que=20sin=20?= =?UTF-8?q?responsable=20sea=20=F0=9F=99=85=20y=20que=20las=20badges=20en?= =?UTF-8?q?=20la=20web=20est=C3=A9n=20centradas=20aunque=20la=20row=20sea?= =?UTF-8?q?=20de=20dos=20lineas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/routes/app/groups/+page.svelte | 467 ++++++++++---------- src/services/command.ts | 24 +- src/utils/icons.ts | 24 +- 3 files changed, 263 insertions(+), 252 deletions(-) diff --git a/apps/web/src/routes/app/groups/+page.svelte b/apps/web/src/routes/app/groups/+page.svelte index d3289c3..b0e0f6c 100644 --- a/apps/web/src/routes/app/groups/+page.svelte +++ b/apps/web/src/routes/app/groups/+page.svelte @@ -1,240 +1,251 @@ - Grupos - + Grupos + {#if groups.length === 0} -

No perteneces a ningún grupo permitido.

+

No perteneces a ningún grupo permitido.

{:else} -

Grupos

- -
- -
- - {#each groups as g (g.id)} -
handleToggle(g.id, e)} - > - - {g.name ?? g.id} - - tareas: {g.counts.open} - 🙅‍♂️: {g.counts.unassigned} - - - {#if isOpen(g.id)} -
- -
    - {#each itemsByGroup[g.id] || [] as t (t.id)} - updateGroupTask(g.id, e.detail)} - /> - {/each} -
-
-
- {/if} -
- {/each} +

Grupos

+ +
+ +
+ + {#each groups as g (g.id)} +
handleToggle(g.id, e)} + > + + {g.name ?? g.id} + + tareas: {g.counts.open} + 🙅‍♂️: {g.counts.unassigned} + + + {#if isOpen(g.id)} +
+ +
    + {#each itemsByGroup[g.id] || [] as t (t.id)} + updateGroupTask(g.id, e.detail)} + /> + {/each} +
+
+
+ {/if} +
+ {/each} {/if} diff --git a/src/services/command.ts b/src/services/command.ts index 7cb3e0b..525e3b6 100644 --- a/src/services/command.ts +++ b/src/services/command.ts @@ -1037,7 +1037,7 @@ export class CommandService { VALUES (?, ?, ?, NULL) `).run(ensured, tokenHash, expiresIso); - try { Metrics.inc('web_tokens_issued_total'); } catch {} + try { Metrics.inc('web_tokens_issued_total'); } catch { } const url = new URL(`/login?token=${encodeURIComponent(token)}`, base).toString(); return [{ @@ -1050,7 +1050,7 @@ export class CommandService { const feature = String(process.env.FEATURE_HELP_V2 ?? 'true').toLowerCase(); const helpV2Enabled = !['false', '0', 'no'].includes(feature); - try { Metrics.inc('commands_unknown_total'); } catch {} + try { Metrics.inc('commands_unknown_total'); } catch { } if (!helpV2Enabled) { return [{ recipient: context.sender, @@ -1093,7 +1093,7 @@ export class CommandService { try { const gid = isGroupId(context.groupId) ? context.groupId : 'dm'; Metrics.inc('onboarding_assign_failures_total', 1, { group_id: String(gid), source, reason }); - } catch {} + } catch { } }; // 1) Menciones aportadas por el backend (JIDs crudos) @@ -1229,7 +1229,7 @@ export class CommandService { `).run(taskId, groupIdToUse, context.messageId); } } - } catch {} + } catch { } // Recuperar la tarea creada para obtener display_code asignado const createdTask = TaskService.getTaskById(taskId); @@ -1291,16 +1291,16 @@ export class CommandService { const enabled = isTest ? String(process.env.ONBOARDING_ENABLE_IN_TEST || '').toLowerCase() === 'true' : (() => { - const v = process.env.ONBOARDING_PROMPTS_ENABLED; - return v == null ? true : ['true','1','yes'].includes(String(v).toLowerCase()); - })(); + const v = process.env.ONBOARDING_PROMPTS_ENABLED; + return v == null ? true : ['true', '1', 'yes'].includes(String(v).toLowerCase()); + })(); const groupLabel = isGroupId(context.groupId) ? String(context.groupId) : 'dm'; if (!enabled) { - try { Metrics.inc('onboarding_prompts_skipped_total', 1, { group_id: groupLabel, source: 'jit_assignee_failure', reason: 'disabled' }); } catch {} + try { Metrics.inc('onboarding_prompts_skipped_total', 1, { group_id: groupLabel, source: 'jit_assignee_failure', reason: 'disabled' }); } catch { } } else { const bot = String(process.env.CHATBOT_PHONE_NUMBER || '').trim(); if (!bot || !/^\d+$/.test(bot)) { - try { Metrics.inc('onboarding_prompts_skipped_total', 1, { group_id: groupLabel, source: 'jit_assignee_failure', reason: 'missing_bot_number' }); } catch {} + try { Metrics.inc('onboarding_prompts_skipped_total', 1, { group_id: groupLabel, source: 'jit_assignee_failure', reason: 'missing_bot_number' }); } catch { } } else { const list = unresolvedList.join(', '); let groupCtx = ''; @@ -1310,7 +1310,7 @@ export class CommandService { } const msg = `No puedo asignar a ${list} aún${groupCtx}. Pídele que toque este enlace y diga 'activar': https://wa.me/${bot}`; responses.push({ recipient: createdBy, message: msg }); - try { Metrics.inc('onboarding_prompts_sent_total', 1, { group_id: groupLabel, source: 'jit_assignee_failure' }); } catch {} + try { Metrics.inc('onboarding_prompts_sent_total', 1, { group_id: groupLabel, source: 'jit_assignee_failure' }); } catch { } } } } @@ -1332,12 +1332,12 @@ export class CommandService { // Gating de grupos en modo 'enforce' (cuando CommandService se invoca directamente) if (isGroupId(context.groupId)) { - try { (AllowedGroups as any).dbInstance = this.dbInstance; } catch {} + try { (AllowedGroups as any).dbInstance = this.dbInstance; } catch { } const mode = String(process.env.GROUP_GATING_MODE || 'off').toLowerCase(); if (mode === 'enforce') { try { if (!AllowedGroups.isAllowed(context.groupId)) { - try { Metrics.inc('commands_blocked_total'); } catch {} + try { Metrics.inc('commands_blocked_total'); } catch { } return { responses: [], ok: true }; } } catch { diff --git a/src/utils/icons.ts b/src/utils/icons.ts index 71743fd..527acf3 100644 --- a/src/utils/icons.ts +++ b/src/utils/icons.ts @@ -1,14 +1,14 @@ export const ICONS = { - create: '📝', - complete: '✅', - assignNotice: '📬', - reminder: '⏰', - date: '📅', - unassigned: '🚫👤', - take: '✋', - unassign: '↩️', - info: 'ℹ️', - warn: '⚠️', - person: '👤', - people: '👥', + create: '📝', + complete: '✅', + assignNotice: '📬', + reminder: '⏰', + date: '📅', + unassigned: '🙅', + take: '✋', + unassign: '↩️', + info: 'ℹ️', + warn: '⚠️', + person: '👤', + people: '👥', } as const;