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