From ecee36f8e3db650a9d28321168d6ad50af186787 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Sat, 21 Dec 2024 02:21:59 +0000 Subject: [PATCH 1/3] fix capturing the order type in adding orders detail info --- .../Office/OrdersDetailForm/OrdersDetailForm.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx b/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx index b24ff3ae670..1c6897583b2 100644 --- a/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx +++ b/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx @@ -82,12 +82,16 @@ const OrdersDetailForm = ({ { setFormOrdersType(e.target.value); setFieldValue('ordersType', e.target.value); }} - isDisabled={formIsDisabled || formOrdersType === 'SAFETY'} + isDisabled={formIsDisabled || formOrdersType === 'SAFETY' || formOrdersType === 'BLUEBARK'} /> {showOrdersTypeDetail && ( Date: Thu, 26 Dec 2024 15:57:53 +0000 Subject: [PATCH 2/3] use contant values --- .../Office/OrdersDetailForm/OrdersDetailForm.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx b/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx index 1c6897583b2..046c4ae9169 100644 --- a/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx +++ b/src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx @@ -8,6 +8,7 @@ import { CheckboxField, DropdownInput, DatePickerInput, DutyLocationInput } from import TextField from 'components/form/fields/TextField/TextField'; import MaskedTextField from 'components/form/fields/MaskedTextField/MaskedTextField'; import { DropdownArrayOf } from 'types/form'; +import { SPECIAL_ORDERS_TYPES } from 'constants/orders'; const OrdersDetailForm = ({ deptIndicatorOptions, @@ -83,7 +84,7 @@ const OrdersDetailForm = ({ name="ordersType" label="Orders type" options={ - formOrdersType === 'SAFETY' || formOrdersType === 'BLUEBARK' + formOrdersType === SPECIAL_ORDERS_TYPES.SAFETY || formOrdersType === SPECIAL_ORDERS_TYPES.BLUEBARK ? dropdownInputOptions({ SAFETY: 'Safety', BLUEBARK: 'Bluebark' }) : ordersTypeOptions } @@ -91,7 +92,11 @@ const OrdersDetailForm = ({ setFormOrdersType(e.target.value); setFieldValue('ordersType', e.target.value); }} - isDisabled={formIsDisabled || formOrdersType === 'SAFETY' || formOrdersType === 'BLUEBARK'} + isDisabled={ + formIsDisabled || + formOrdersType === SPECIAL_ORDERS_TYPES.SAFETY || + formOrdersType === SPECIAL_ORDERS_TYPES.BLUEBARK + } /> {showOrdersTypeDetail && ( Date: Thu, 26 Dec 2024 16:29:51 +0000 Subject: [PATCH 3/3] fix test --- migrations/app/migrations_manifest.txt | 2 +- .../OrdersDetailForm/OrdersDetailForm.test.jsx | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 1a397d886a9..470dc5e1af7 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1054,6 +1054,6 @@ 20241204155919_update_ordering_proc.up.sql 20241204210208_retroactive_update_of_ppm_max_and_estimated_incentives_prd.up.sql 20241210143143_redefine_mto_shipment_audit_table.up.sql -20241217163231_update_duty_locations_bad_zips.up.sql 20241216170325_update_nts_enum_name.up.sql +20241217163231_update_duty_locations_bad_zips.up.sql 20241217180136_add_AK_zips_to_zip3_distances.up.sql diff --git a/src/components/Office/OrdersDetailForm/OrdersDetailForm.test.jsx b/src/components/Office/OrdersDetailForm/OrdersDetailForm.test.jsx index 37ec69d7645..37861c8b881 100644 --- a/src/components/Office/OrdersDetailForm/OrdersDetailForm.test.jsx +++ b/src/components/Office/OrdersDetailForm/OrdersDetailForm.test.jsx @@ -196,7 +196,23 @@ describe('OrdersDetailForm', () => { showNTSTac: false, showNTSSac: false, showOrdersAcknowledgement: false, - ordersType: 'SAFETY', + ordersType: 'Safety', + }); + + // correct labels are visible + expect(await screen.findByLabelText('Orders type')).toBeDisabled(); + }); + it('has orders type dropdown disabled if bluebark move', async () => { + renderOrdersDetailForm({ + showDepartmentIndicator: false, + showOrdersNumber: false, + showOrdersTypeDetail: false, + showHHGTac: false, + showHHGSac: false, + showNTSTac: false, + showNTSSac: false, + showOrdersAcknowledgement: false, + ordersType: 'BLUEBARK', }); // correct labels are visible