DashboardView: columna SP + fix priority/story_points perdidos en enrichHU
- enrichHU ahora incluye status, priority y story_points en el return - Nueva columna SP (story points) entre Título y Estado en tabla HUs - Filtro prioridad acepta valores numéricos (1/2/3)
This commit is contained in:
@@ -152,3 +152,36 @@ Nueva vista **Transcripciones** en la barra lateral (icono upload).
|
||||
5. ⬜ **Generador de reportes** (K-13)
|
||||
6. ⬜ **Integración calendario Google/Outlook** (K-21)
|
||||
7. ⬜ **Alertas post-reunión** (K-22)
|
||||
|
||||
---
|
||||
|
||||
## Changelog — Decisiones técnicas
|
||||
|
||||
### 2026-05-29: Asignación HU + Status desde KAPPA
|
||||
|
||||
**Asignado (employee_id vs user_id)**
|
||||
- KAPPA devuelve `asignado_a: [1135]` donde 1135 es **employee_id**, no user_id.
|
||||
- Employee 1135 → user 1115 (Felipe Crespo). El mapeo está en `usersStore.employees`.
|
||||
- `parseAssignedUser()` en `stores/workitems.ts` separa:
|
||||
- `asignado_a` → `_assignedEmployeeId` (employee_id)
|
||||
- `assigned_to` → `_assignedUserId` (user_id directo)
|
||||
- `DashboardView.resolveEmployeeToUser()` busca en `usersStore.employees.find(e.id === employeeId)?.user`
|
||||
- Para persistencia en Turso (un solo campo `assigned_to`): employee_id se guarda como **negativo** (`-1135`).
|
||||
`parseAssignedUser()` detecta negativos y los trata como employee_id.
|
||||
|
||||
**Status**
|
||||
- KAPPA devuelve `status: 6` (número) + `status_name: "QA-Client"`.
|
||||
- `enrichHU()` usa `hu.status_name` primero; fallback a `resolveStatusName(hu.status)`.
|
||||
- `STATUS_MAP` en `services/statuses-db.ts` ahora mapea valores numéricos (`'1'`–`'7'`) y nombres KAPPA.
|
||||
|
||||
**Prioridad**
|
||||
- KAPPA devuelve `priority: "3"` (string numérico). `PRIORITY_MAP` mapea `"1"`/`"2"`/`"3"` y texto.
|
||||
|
||||
**UI - Tabla HUs**
|
||||
- Columna Asignado: texto plano (no Select). Muestra nombre real o `asignado_a_names` de KAPPA.
|
||||
- Columna Estado: muestra `status_name` de KAPPA (ej: QA-Client) con badge de color.
|
||||
- Filtros con placeholder "Estado"/"Prioridad"/"Asignado". Filtro Asignado solo lista desarrolladores con HUs.
|
||||
|
||||
**Dexie (browser)**
|
||||
- Schema v8: nueva tabla `user_stories` con `&id, initiative_id`.
|
||||
- Fallback en `tauri-db.ts` para get/save user_stories (antes solo Tauri).
|
||||
|
||||
@@ -89,7 +89,7 @@ export const useWorkItemsStore = defineStore('workitems', () => {
|
||||
return { id: null, name: '', employeeId: null }
|
||||
}
|
||||
|
||||
function enrichHU(hu: { title?: string; id?: number; status?: string | number | null; status_name?: string | null; acceptance_criteria?: string | null; criterios_aceptacion?: string | null; assigned_to?: number | null; asignado_a?: number[] | string[] | null; asignado_a_names?: string[] | string | null; assigned_name?: string }, initiativeId: number): EnrichedUserStory {
|
||||
function enrichHU(hu: { title?: string; id?: number; status?: string | number | null; status_name?: string | null; priority?: string | number | null; story_points?: number | null; acceptance_criteria?: string | null; criterios_aceptacion?: string | null; assigned_to?: number | null; asignado_a?: number[] | string[] | null; asignado_a_names?: string[] | string | null; assigned_name?: string }, initiativeId: number): EnrichedUserStory {
|
||||
const h = parseHierarchy(hu.title || '')
|
||||
const rawCriteria = hu.acceptance_criteria || hu.criterios_aceptacion || ''
|
||||
const criteriaList = rawCriteria ? parseQuillList(rawCriteria) : []
|
||||
@@ -97,6 +97,9 @@ export const useWorkItemsStore = defineStore('workitems', () => {
|
||||
return {
|
||||
id: hu.id ?? 0,
|
||||
title: hu.title || '',
|
||||
status: String(hu.status ?? ''),
|
||||
priority: String(hu.priority ?? ''),
|
||||
story_points: hu.story_points ?? undefined,
|
||||
acceptance_criteria: rawCriteria,
|
||||
criterios_aceptacion: rawCriteria,
|
||||
initiative: initiativeId,
|
||||
|
||||
@@ -695,6 +695,9 @@ const statusLabel = (status: unknown) => {
|
||||
<SelectItem value="baja" class="text-xs">Baja</SelectItem>
|
||||
<SelectItem value="critical" class="text-xs">Crítica</SelectItem>
|
||||
<SelectItem value="urgente" class="text-xs">Urgente</SelectItem>
|
||||
<SelectItem value="1" class="text-xs">Alta (1)</SelectItem>
|
||||
<SelectItem value="2" class="text-xs">Media (2)</SelectItem>
|
||||
<SelectItem value="3" class="text-xs">Baja (3)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Select v-model="filterAssigned">
|
||||
@@ -713,6 +716,7 @@ const statusLabel = (status: unknown) => {
|
||||
<TableHead class="w-[80px]">{{ t('dashboard.code') }}</TableHead>
|
||||
<TableHead class="w-[60px]">{{ t('users.role') }}</TableHead>
|
||||
<TableHead>{{ t('dashboard.title') }}</TableHead>
|
||||
<TableHead class="w-[50px] text-center">SP</TableHead>
|
||||
<TableHead class="w-[110px]">{{ t('dashboard.status') }}</TableHead>
|
||||
<TableHead class="w-[90px]">{{ t('dashboard.priority') }}</TableHead>
|
||||
<TableHead class="w-[140px]">{{ t('dashboard.assignedTo') }}</TableHead>
|
||||
@@ -735,6 +739,7 @@ const statusLabel = (status: unknown) => {
|
||||
</div>
|
||||
</span>
|
||||
</TableCell>
|
||||
<TableCell class="text-center text-xs font-mono text-muted-foreground">{{ hu.story_points ?? '—' }}</TableCell>
|
||||
<TableCell><Badge :variant="statusVariant(hu.status || '')" class="text-xs capitalize">{{ hu._statusName || statusLabel(hu.status || '') }}</Badge></TableCell>
|
||||
<TableCell><Badge :variant="priorityVariant(hu.priority)" class="text-xs">{{ priorityLabel(hu.priority) }}</Badge></TableCell>
|
||||
<TableCell>
|
||||
|
||||
Reference in New Issue
Block a user