From dd9f76be6ffac6da7bdfb18199e920a92041b981 Mon Sep 17 00:00:00 2001 From: Ricardo Gonzalez Date: Thu, 28 May 2026 15:30:38 -0500 Subject: [PATCH] fix: orden dashboard + i18n HuDrafts + tipo Epic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DashboardView: borradores antes de épicas, HuDrafts antes de tabla HUs - DashboardView: skeletons eliminados - DashboardView: fix duplicate const project (causaba ReferenceError) - HuDrafts: i18n para tipos (Epic, Feature, Task, HU, Bug) - HuDrafts: tipo Epic (E) agregado al selector - i18n: +hierarchy section con labels en es/en --- src/components/HuDrafts.vue | 14 ++- src/i18n/locales/en.json | 7 ++ src/i18n/locales/es.json | 7 ++ src/views/DashboardView.vue | 199 +++++++++++++++--------------------- 4 files changed, 105 insertions(+), 122 deletions(-) diff --git a/src/components/HuDrafts.vue b/src/components/HuDrafts.vue index 426afaf..95f1fe9 100644 --- a/src/components/HuDrafts.vue +++ b/src/components/HuDrafts.vue @@ -14,6 +14,14 @@ import { Plus, Send, Pencil, CheckCircle2, Clock } from 'lucide-vue-next' const { t } = useI18n() +const TYPE_I18N: Record = { + E: 'hierarchy.epic', + U: 'hierarchy.hu', + F: 'hierarchy.feature', + T: 'hierarchy.task', + B: 'hierarchy.bug', +} + const props = defineProps<{ initiativeId: number }>() @@ -42,10 +50,10 @@ const form = ref({ updated_at: null, }) -const draftTypes: ItemType[] = ['U', 'F', 'T', 'B'] +const draftTypes: ItemType[] = ['E', 'F', 'T', 'U', 'B'] const itemTypeOptions = computed(() => - draftTypes.map(type => ({ value: type, label: getTypeLabel(type) })) + draftTypes.map(type => ({ value: type, label: t(TYPE_I18N[type] || 'hierarchy.hu') })) ) const unPushedDrafts = computed(() => @@ -188,7 +196,7 @@ onMounted(loadDrafts) class="inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-bold" :class="getTypeColor((d.item_type || 'U') as ItemType)" > - {{ getTypeLabel((d.item_type || 'U') as ItemType) }} + {{ t(TYPE_I18N[d.item_type || 'U'] || 'hierarchy.hu') }} {{ d.title }} diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index b497ad5..6b43ab8 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -318,6 +318,13 @@ "switchModel": "Switch model", "settings": "Settings..." }, + "hierarchy": { + "epic": "Epic", + "hu": "HU", + "feature": "Feature", + "task": "Task", + "bug": "Bug" + }, "workitems": { "unnamedEpic": "Epic {id}" } diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 26893dc..ddc43e6 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -318,6 +318,13 @@ "switchModel": "Cambiar modelo", "settings": "Configuración..." }, + "hierarchy": { + "epic": "Épica", + "feature": "Caracteristica", + "task": "Tarea", + "hu": "HU", + "bug": "Error" + }, "workitems": { "unnamedEpic": "Épica {id}" } diff --git a/src/views/DashboardView.vue b/src/views/DashboardView.vue index a160cab..414b628 100644 --- a/src/views/DashboardView.vue +++ b/src/views/DashboardView.vue @@ -14,7 +14,6 @@ import { kappa } from '@/services/kappa-api' import { generateAndSavePlan, getQAPlans, type HUQAPlan } from '@/services/qa-analyzer' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' -import { Skeleton } from '@/components/ui/skeleton' import { Table, TableBody, @@ -28,6 +27,8 @@ const { t } = useI18n() const projects = useProjectsStore() const workItems = useWorkItemsStore() +const project = computed(() => projects.selected) + const emit = defineEmits<{ 'navigate-settings': [] }>() @@ -195,8 +196,6 @@ async function runAnalysis() { } } -const project = computed(() => projects.selected) - watch( () => projects.selectedId, async (id) => { @@ -340,122 +339,6 @@ const statusLabel = (status: unknown) => { - - - - - - - - - - {{ t('dashboard.userStoriesTitle') }} - {{ t('dashboard.husCount', { count: workItems.userStories.length }) }} - - - - - - {{ t('dashboard.code') }} - {{ t('users.role') }} - {{ t('dashboard.title') }} - {{ t('dashboard.status') }} - {{ t('dashboard.priority') }} - - - - - - {{ hu.code || `HU-${hu.id}` }} - - - - {{ getTypeLabel(hu._itemType) }} - - - - - {{ hu._cleanTitle || hu.title }} - - -
-

Criterios de aceptación

-
    -
  1. {{ c }}
  2. -
-
-
-
- - - {{ statusLabel(hu.status || '') }} - - - - {{ hu.priority || '—' }} - -
-
-
-

- {{ t('dashboard.noUserStories') }} -

-
-
- @@ -508,8 +391,86 @@ const statusLabel = (status: unknown) => { + + + + + + + + {{ t('dashboard.userStoriesTitle') }} + {{ t('dashboard.husCount', { count: workItems.userStories.length }) }} + + + + + + {{ t('dashboard.code') }} + {{ t('users.role') }} + {{ t('dashboard.title') }} + {{ t('dashboard.status') }} + {{ t('dashboard.priority') }} + + + + + {{ hu.code || `HU-${hu.id}` }} + + {{ getTypeLabel(hu._itemType) }} + + + + {{ hu._cleanTitle || hu.title }} + + +
+

Criterios de aceptación

+
  1. {{ c }}
+
+
+
+ {{ statusLabel(hu.status || '') }} + {{ hu.priority || '—' }} +
+
+
+

{{ t('dashboard.noUserStories') }}

+
+