Refactor Dewar service methods and improve field handling

Updated Dewar API methods to use protected endpoints for enhanced security and consistency. Added `pgroups` handling in various frontend components and modified the LogisticsView contact field for clarity. Simplified backend router imports for better readability.
This commit is contained in:
GotthardG
2025-01-30 13:39:49 +01:00
parent 44582cf38e
commit c2215860bf
20 changed files with 304 additions and 262 deletions

View File

@ -53,7 +53,7 @@ interface SlotData extends SlotSchema {
retrievedTimestamp?: string;
beamlineLocation?: string;
shipment_name?: string;
contact_person?: string;
contact?: string;
local_contact?: string;
}
@ -155,7 +155,7 @@ const LogisticsView: React.FC = () => {
needsRefillWarning: true,
beamlineLocation: undefined,
shipmnet_name: undefined,
contact_person: undefined,
contact: undefined,
local_contact: undefined,
};
} else {
@ -174,7 +174,7 @@ const LogisticsView: React.FC = () => {
needsRefillWarning: !associatedDewar || slot.time_until_refill === undefined,
beamlineLocation: slot.beamlineLocation,
shipment_name: slot.shipment_name,
contact_person: slot.contact_person,
contact: slot.contact,
local_contact: slot.local_contact,
};
});
@ -456,7 +456,7 @@ const LogisticsView: React.FC = () => {
<Typography variant="h6">{selectedSlotData.label}</Typography>
<Typography variant="body2">{`Shipment: ${selectedSlotData.shipment_name}`}</Typography>
<Typography variant="body2">{`Dewar: ${selectedSlotData.dewar_name || 'N/A'}`}</Typography>
<Typography variant="body2">{`Contact Person: ${selectedSlotData.contact_person}`}</Typography>
<Typography variant="body2">{`Contact Person: ${selectedSlotData.contact}`}</Typography>
<Typography variant="body2">{`QR Code: ${selectedSlotData.qr_code}`}</Typography>
<Typography variant="body2">{`Occupied: ${selectedSlotData.occupied ? 'Yes' : 'No'}`}</Typography>
<Typography variant="body2">{`Needs Refill: ${selectedSlotData.needsRefillWarning ? 'Yes' : 'No'}`}</Typography>