cambia algunos iconos para que sin responsable sea 🙅 y que las badges en la web estén centradas aunque la row sea de dos lineas

main
borja 6 days ago
parent 226e1bc01f
commit a24e591cb4

@ -27,7 +27,7 @@
const groups = data.groups || [];
let itemsByGroup: Record<string, Task[]> = {};
for (const [gid, arr] of Object.entries(data.itemsByGroup || {})) {
itemsByGroup[gid] = Array.isArray(arr as any) ? ([...(arr as any)]) : [];
itemsByGroup[gid] = Array.isArray(arr as any) ? [...(arr as any)] : [];
}
function buildQuery(params: { unassignedFirst?: boolean }) {
@ -103,12 +103,21 @@
queueMicrotask(() => window.scrollTo({ top: y }));
}
function updateGroupTask(groupId: string, detail: { id: number; action: string; patch: Partial<Task & { completed?: boolean; completed_at?: string | null }> }) {
function updateGroupTask(
groupId: string,
detail: {
id: number;
action: string;
patch: Partial<
Task & { completed?: boolean; completed_at?: string | null }
>;
},
) {
const { id, action, patch } = detail;
const arr = itemsByGroup[groupId] || [];
const idx = arr.findIndex((t) => t.id === id);
if (action === 'complete') {
if (action === "complete") {
if (idx >= 0) {
maintainScrollWhile(() => {
arr.splice(idx, 1);
@ -228,6 +237,8 @@
border: 1px solid var(--color-border);
border-radius: 999px;
font-size: 12px;
align-self: center;
white-space: nowrap;
}
.badge.warn {
border-color: var(--color-warning);

@ -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);
@ -1292,15 +1292,15 @@ export class CommandService {
? 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());
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 {

@ -4,7 +4,7 @@ export const ICONS = {
assignNotice: '📬',
reminder: '⏰',
date: '📅',
unassigned: '🚫👤',
unassigned: '🙅',
take: '✋',
unassign: '↩️',
info: '',

Loading…
Cancel
Save