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

OBPIH-6372 Full outbound import confirm step page improvements #4679

Merged
merged 7 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
OBPIH-6372 Add pack level 1 and 2 columns when they are present in th…
…e import
  • Loading branch information
drodzewicz committed Jun 17, 2024
commit ce2d8ef6403965e03a5d7e5309f432ae8b4d9c85
2 changes: 2 additions & 0 deletions grails-app/i18n/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4498,3 +4498,5 @@ react.outboundImport.table.column.expirationDate.label=Expiry
react.outboundImport.table.column.quantityPicked.label=Qty Picked
react.outboundImport.table.column.binLocation.label=Bin Location
react.outboundImport.table.column.recipient.label=Recipient
react.outboundImport.table.column.palletName.label=Pack level 1
react.outboundImport.table.column.boxName.label=Pack level 2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import useTranslate from 'hooks/useTranslate';
const OutboundImportItems = ({ data, errors }) => {
const translate = useTranslate();

const isPalletColumnHasAnyValues = useMemo(() => data.some((it) => it.palletName), data);
const isBoxColumnHasAnyValues = useMemo(() => data.some((it) => it.boxName), data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed on slack, I would rely on isPalletColumnEmpty and then eventually use the negation of that, but I would like everyone to agree on that one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I aggree, negation should not appear in the variable name because it will make things confusing.


const columns = useMemo(() => [
{
Header: translate('react.outboundImport.table.column.productCode.label', 'Code'),
Expand Down Expand Up @@ -57,6 +60,18 @@ const OutboundImportItems = ({ data, errors }) => {
accessor: 'recipient.name',
Cell: (row) => <TableCell {...row} showError />,
},
{
Header: translate('react.outboundImport.table.column.palletName.label', 'Pack level 1'),
accessor: 'palletName',
Cell: (row) => <TableCell {...row} showError />,
show: isPalletColumnHasAnyValues,
},
{
Header: translate('react.outboundImport.table.column.boxName.label', 'Pack level 2'),
accessor: 'boxName',
Cell: (row) => <TableCell {...row} showError />,
show: isBoxColumnHasAnyValues,
},
], [translate]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you add the hasBinLocationSupport and the flags related to the pallet and box to the dependency here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, thanks for spotting that


return (
Expand Down
2 changes: 2 additions & 0 deletions src/js/hooks/outboundImport/useOutboundImportForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const testRow = {
username: 'someusername',
name: 'first last',
},
palletName: 'test 1',
boxName: undefined,
};
// TODO: Remove this before feature is finished
const tableErrors = {
Expand Down