F4: present locked and sealed Act states
This commit is contained in:
@@ -1,33 +1,37 @@
|
|||||||
import type { InspectionActStatus, InspectionActVersionEvent } from '../../lib/api';
|
import type { InspectionActVersionEvent } from '../../lib/api';
|
||||||
|
|
||||||
const statusLabels: Record<InspectionActStatus, string> = {
|
const statusLabels: Record<string, string> = {
|
||||||
DRAFT: 'Borrador',
|
DRAFT: 'Borrador',
|
||||||
READY: 'Lista para cerrar',
|
LOCKED: 'Bloqueada · esperando manifestación',
|
||||||
CLOSED: 'Cerrada',
|
SEALED: 'Sellada',
|
||||||
|
READY: 'Lista para cerrar · legado',
|
||||||
|
CLOSED: 'Cerrada · legado',
|
||||||
CANCELLED: 'Cancelada',
|
CANCELLED: 'Cancelada',
|
||||||
RECTIFIED: 'Rectificada',
|
RECTIFIED: 'Rectificada · legado',
|
||||||
};
|
};
|
||||||
|
|
||||||
const eventLabels: Record<InspectionActVersionEvent, string> = {
|
const eventLabels: Record<string, string> = {
|
||||||
CREATED: 'Creación',
|
CREATED: 'Creación',
|
||||||
UPDATED: 'Actualización',
|
UPDATED: 'Actualización',
|
||||||
READY: 'Preparación para firmas',
|
LOCKED: 'Bloqueo para firmas',
|
||||||
|
SEALED: 'Sellado definitivo',
|
||||||
|
READY: 'Preparación para firmas · legado',
|
||||||
REOPENED: 'Vuelta a borrador',
|
REOPENED: 'Vuelta a borrador',
|
||||||
CLOSED: 'Cierre y sellado',
|
CLOSED: 'Cierre · legado',
|
||||||
CANCELLED: 'Cancelación',
|
CANCELLED: 'Cancelación',
|
||||||
};
|
};
|
||||||
|
|
||||||
export function inspectionActStatusLabel(value: InspectionActStatus): string {
|
export function inspectionActStatusLabel(value: string): string {
|
||||||
return statusLabels[value];
|
return statusLabels[value] ?? value;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function inspectionActStatusClass(value: InspectionActStatus): string {
|
export function inspectionActStatusClass(value: string): string {
|
||||||
if (value === 'CLOSED') return 'active';
|
if (value === 'SEALED' || value === 'CLOSED') return 'active';
|
||||||
if (value === 'READY' || value === 'RECTIFIED') return 'observed';
|
if (value === 'LOCKED' || value === 'READY' || value === 'RECTIFIED') return 'observed';
|
||||||
if (value === 'CANCELLED') return 'inactive';
|
if (value === 'CANCELLED') return 'inactive';
|
||||||
return 'pending';
|
return 'pending';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function inspectionActVersionEventLabel(value: InspectionActVersionEvent): string {
|
export function inspectionActVersionEventLabel(value: InspectionActVersionEvent | string): string {
|
||||||
return eventLabels[value];
|
return eventLabels[value] ?? value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user