diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/ResponseLineEdit/ResponseLineEdit.tsx b/client/packages/requisitions/src/ResponseRequisition/DetailView/ResponseLineEdit/ResponseLineEdit.tsx index 28d9b8ca19..0333f3d01c 100644 --- a/client/packages/requisitions/src/ResponseRequisition/DetailView/ResponseLineEdit/ResponseLineEdit.tsx +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/ResponseLineEdit/ResponseLineEdit.tsx @@ -14,6 +14,7 @@ import { Popover, ReasonOptionNodeType, TextArea, + useAuthContext, useToggle, } from '@openmsupply-client/common'; import { useResponse } from '../../api'; @@ -49,6 +50,7 @@ export const ResponseLineEdit = ({ isProgram, }: ResponseLineEditProps) => { const t = useTranslation(); + const { store } = useAuthContext(); const { isOn: ourStats, toggle: toggleOurStats } = useToggle(); const { isOn: theirStats, toggle: toggleTheirStats } = useToggle(); const { data } = useResponse.line.stats(draft?.id); @@ -107,7 +109,7 @@ export const ResponseLineEdit = ({ sx={{ marginBottom: 1 }} /> )} - {isProgram && ( + {isProgram && store?.preferences.extraFieldsInRequisition && ( <> - {isProgram && ( + {isProgram && store?.preferences.extraFieldsInRequisition && ( - {isProgram && ( + {isProgram && store?.preferences.extraFieldsInRequisition && ( - {isProgram && ( + {isProgram && store?.preferences.extraFieldsInRequisition && ( { updateSortQuery, queryParams: { sortBy }, } = useUrlQueryParams({ initialSort: { key: 'itemName', dir: 'asc' } }); + const { store } = useAuthContext(); const { isRemoteAuthorisation } = useResponse.utils.isRemoteAuthorisation(); const { programName } = useResponse.document.fields(['programName']); @@ -71,7 +73,7 @@ export const useResponseColumns = () => { accessor: ({ rowData }) => rowData.availableStockOnHand, }); } - if (programName) { + if (programName && store?.preferences?.extraFieldsInRequisition) { columnDefinitions.push( // TODO: Global pref to show/hide the next columns { @@ -234,7 +236,7 @@ export const useResponseColumns = () => { ]); // TODO: Global pref to show/hide column - if (programName) { + if (programName && store?.preferences?.extraFieldsInRequisition) { columnDefinitions.push({ key: 'reason', label: 'label.reason',