corregir statusVariant/Label: KAPPA retorna boolean en status, usar String()
This commit is contained in:
@@ -32,23 +32,26 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
const statusVariant = (status: string) => {
|
||||
const s = status?.toLowerCase() || ''
|
||||
const statusVariant = (status: unknown) => {
|
||||
const s = String(status ?? '').toLowerCase()
|
||||
if (['done', 'completed', 'closed', 'finalizado'].includes(s)) return 'secondary'
|
||||
if (['in_progress', 'doing', 'wip', 'active', 'in progress', 'en progreso'].includes(s)) return 'default'
|
||||
if (['blocked', 'bloqueado'].includes(s)) return 'destructive'
|
||||
if (s === 'true') return 'default'
|
||||
return 'outline'
|
||||
}
|
||||
|
||||
const statusLabel = (status: string) => {
|
||||
const s = status?.toLowerCase() || ''
|
||||
const statusLabel = (status: unknown) => {
|
||||
const s = String(status ?? '').toLowerCase()
|
||||
if (s === 'true') return t('status.inProgress')
|
||||
if (['done', 'completed', 'closed', 'finalizado'].includes(s)) return t('status.completed')
|
||||
if (['in_progress', 'doing', 'wip', 'active', 'in progress', 'en progreso'].includes(s)) return t('status.inProgress')
|
||||
if (['blocked', 'bloqueado'].includes(s)) return t('status.blocked')
|
||||
if (['todo', 'por hacer'].includes(s)) return t('status.todo')
|
||||
if (['review', 'revisión'].includes(s)) return t('status.review')
|
||||
if (['testing', 'pruebas'].includes(s)) return t('status.testing')
|
||||
return status || '—'
|
||||
if (s === 'false') return t('status.todo')
|
||||
return String(status ?? '—')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user