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',
|
||||
READY: 'Lista para cerrar',
|
||||
CLOSED: 'Cerrada',
|
||||
LOCKED: 'Bloqueada · esperando manifestación',
|
||||
SEALED: 'Sellada',
|
||||
READY: 'Lista para cerrar · legado',
|
||||
CLOSED: 'Cerrada · legado',
|
||||
CANCELLED: 'Cancelada',
|
||||
RECTIFIED: 'Rectificada',
|
||||
RECTIFIED: 'Rectificada · legado',
|
||||
};
|
||||
|
||||
const eventLabels: Record<InspectionActVersionEvent, string> = {
|
||||
const eventLabels: Record<string, string> = {
|
||||
CREATED: 'Creació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',
|
||||
CLOSED: 'Cierre y sellado',
|
||||
CLOSED: 'Cierre · legado',
|
||||
CANCELLED: 'Cancelación',
|
||||
};
|
||||
|
||||
export function inspectionActStatusLabel(value: InspectionActStatus): string {
|
||||
return statusLabels[value];
|
||||
export function inspectionActStatusLabel(value: string): string {
|
||||
return statusLabels[value] ?? value;
|
||||
}
|
||||
|
||||
export function inspectionActStatusClass(value: InspectionActStatus): string {
|
||||
if (value === 'CLOSED') return 'active';
|
||||
if (value === 'READY' || value === 'RECTIFIED') return 'observed';
|
||||
export function inspectionActStatusClass(value: string): string {
|
||||
if (value === 'SEALED' || value === 'CLOSED') return 'active';
|
||||
if (value === 'LOCKED' || value === 'READY' || value === 'RECTIFIED') return 'observed';
|
||||
if (value === 'CANCELLED') return 'inactive';
|
||||
return 'pending';
|
||||
}
|
||||
|
||||
export function inspectionActVersionEventLabel(value: InspectionActVersionEvent): string {
|
||||
return eventLabels[value];
|
||||
export function inspectionActVersionEventLabel(value: InspectionActVersionEvent | string): string {
|
||||
return eventLabels[value] ?? value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user