Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5354 Hide extra columns for general requisitions #5356

Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const LabelAndOptions = <T,>({
<Grid item>
{noOptionsDisplay || (
<Autocomplete
width="300"
width="450"
renderOption={renderOption}
getOptionDisabled={getOptionDisabled}
autoFocus={autoFocus}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const RequestStoreStats: React.FC<RequestStoreStatsProps> = ({
: 100;

return (
<Box sx={{ height: 400, width: 500 }}>
<Box sx={{ maxHeight: 400, width: 500, minHeight: 200 }}>
<Box display="flex" flexDirection="column" paddingTop={2} paddingLeft={4}>
<Box display="flex">
<Typography fontSize={12} fontWeight={700}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,84 +107,88 @@ export const ResponseLineEdit = ({
sx={{ marginBottom: 1 }}
/>
)}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.incomingUnits}
onChange={value => update({ incomingUnits: value })}
onBlur={save}
{isProgram && (
<>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.incomingUnits}
onChange={value => update({ incomingUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.incoming-stock')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.incoming-stock')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.outgoingUnits}
onChange={value => update({ outgoingUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.outgoingUnits}
onChange={value => update({ outgoingUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.outgoing')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.outgoing')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.lossInUnits}
onChange={value => update({ lossInUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.lossInUnits}
onChange={value => update({ lossInUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.losses')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.losses')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.additionInUnits}
onChange={value => update({ additionInUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.additionInUnits}
onChange={value => update({ additionInUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.additions')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.additions')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.expiringUnits}
onChange={value => update({ expiringUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.expiringUnits}
onChange={value => update({ expiringUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.short-expiry')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.short-expiry')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.daysOutOfStock}
onChange={value => update({ daysOutOfStock: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.daysOutOfStock}
onChange={value => update({ daysOutOfStock: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.days-out-of-stock')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.days-out-of-stock')}
sx={{ marginBottom: 1 }}
/>
</>
)}
<InputWithLabelRow
Input={
<NumericTextInput
Expand All @@ -200,18 +204,20 @@ export const ResponseLineEdit = ({
label={t('label.amc')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={MOS}
disabled
decimalLimit={2}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.months-of-stock')}
/>
{isProgram && (
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={MOS}
disabled
decimalLimit={2}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.months-of-stock')}
/>
)}
</Box>
<Box>
{/* Right column content */}
Expand Down Expand Up @@ -274,18 +280,20 @@ export const ResponseLineEdit = ({
)}
</Box>
</Box>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={available}
disabled
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.available')}
sx={{ marginBottom: 1 }}
/>
{isProgram && (
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={available}
disabled
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.available')}
sx={{ marginBottom: 1 }}
/>
)}
<InputWithLabelRow
Input={
<NumericTextInput
Expand Down Expand Up @@ -374,26 +382,28 @@ export const ResponseLineEdit = ({
)}
</Box>
</Box>
<InputWithLabelRow
Input={
<ReasonOptionsSearchInput
value={draft?.reason}
onChange={value => {
update({ reason: value });
}}
width={200}
type={ReasonOptionNodeType.RequisitionLineVariance}
isDisabled={
draft?.requestedQuantity === draft?.suggestedQuantity ||
!!hasLinkedRequisition
}
onBlur={save}
/>
}
labelWidth={'66px'}
label={t('label.reason')}
sx={{ marginBottom: 1 }}
/>
{isProgram && (
<InputWithLabelRow
Input={
<ReasonOptionsSearchInput
value={draft?.reason}
onChange={value => {
update({ reason: value });
}}
width={200}
type={ReasonOptionNodeType.RequisitionLineVariance}
isDisabled={
draft?.requestedQuantity === draft?.suggestedQuantity ||
!!hasLinkedRequisition
}
onBlur={save}
/>
}
labelWidth={'66px'}
label={t('label.reason')}
sx={{ marginBottom: 1 }}
/>
)}
<InputWithLabelRow
Input={
<TextArea
Expand Down
Loading
Loading