From fefcaccf802b8443e5c8fc6084b49e66c4d101d6 Mon Sep 17 00:00:00 2001 From: prv-proton Date: Thu, 19 Dec 2024 13:05:46 -0800 Subject: [PATCH] Update fuel code explanation for IDIR users --- frontend/src/assets/locales/en/fuelCode.json | 1 + .../FuelCodes/AddFuelCode/AddEditFuelCode.jsx | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/frontend/src/assets/locales/en/fuelCode.json b/frontend/src/assets/locales/en/fuelCode.json index 84f150236..e1948199c 100644 --- a/frontend/src/assets/locales/en/fuelCode.json +++ b/frontend/src/assets/locales/en/fuelCode.json @@ -6,6 +6,7 @@ "fuelCodeDownloadFailMsg": "Failed to download fuel code information.", "fuelCodeLoadFailMsg": "Failed to load fuel code information.", "newFuelCodeTitle": "Add new fuel code(s)", + "fuelCodeEntryGuide": "Draft fuel codes are saved automatically when all mandatory fields have been entered and validated. Click “Approve code” to make it available in compliance reporting.", "editFuelCodeTitle": "Edit draft fuel code", "viewFuelCodeTitle": "View fuel code", "approvedFuelCodeTitle": "Approved draft fuel code", diff --git a/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx b/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx index ca05f1413..1e54f01bc 100644 --- a/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx +++ b/frontend/src/views/FuelCodes/AddFuelCode/AddEditFuelCode.jsx @@ -103,12 +103,14 @@ const AddEditFuelCodeBase = () => { if (existingFuelCode) { const transformedData = { ...existingFuelCode, - feedstockFuelTransportMode: existingFuelCode.feedstockFuelTransportModes.map( - (mode) => mode.feedstockFuelTransportMode.transportMode - ), - finishedFuelTransportMode: existingFuelCode.finishedFuelTransportModes.map( - (mode) => mode.finishedFuelTransportMode.transportMode - ) + feedstockFuelTransportMode: + existingFuelCode.feedstockFuelTransportModes.map( + (mode) => mode.feedstockFuelTransportMode.transportMode + ), + finishedFuelTransportMode: + existingFuelCode.finishedFuelTransportModes.map( + (mode) => mode.finishedFuelTransportMode.transportMode + ) } setRowData([transformedData]) } else { @@ -452,6 +454,12 @@ const AddEditFuelCodeBase = () => { {existingFuelCode?.fuelCodeStatus.status === FUEL_CODE_STATUSES.APPROVED && t('fuelCode:viewFuelCodeTitle')} + + {(!existingFuelCode || + existingFuelCode?.fuelCodeStatus.status === + FUEL_CODE_STATUSES.DRAFT) && + t('fuelCode:fuelCodeEntryGuide')} +