Skip to content

Commit

Permalink
UIREQ-1145 - navigate to first page on printPick slip on savePrintLog…
Browse files Browse the repository at this point in the history
… enabled
  • Loading branch information
manvendra-s-rathore committed Sep 27, 2024
1 parent b13d051 commit 98e9fd4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/routes/RequestsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,11 @@ class RequestsRoute extends React.Component {
await this.savePrintEventDetails(requestIds);
}
}}
onAfterPrint={() => {
if (isViewPrintDetailsEnabled) {
mutator.resultOffset.replace(0);
}
}}
>
<FormattedMessage
id="ui-requests.printPickSlips"
Expand Down Expand Up @@ -1550,6 +1555,14 @@ class RequestsRoute extends React.Component {
}
}
}
onAfterPrint={() => {
if (isViewPrintDetailsEnabled) {
if (selectedRows && this.props.mutator.resultOffset) {
this.setState({ selectedRows: {} });
mutator.resultOffset.replace(0);
}
}
}}
>
<FormattedMessage
id="ui-requests.printPickSlipsSelected"
Expand Down
2 changes: 2 additions & 0 deletions src/routes/RequestsRoute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ jest.mock('../components', () => ({
PrintButton: jest.fn(({
onBeforeGetContent,
onBeforePrint,
onAfterPrint,
children,
}) => {
const handleClick = () => {
Promise.resolve(onBeforeGetContent());
Promise.resolve(onBeforePrint());
Promise.resolve(onAfterPrint());
};
return (
<div>
Expand Down

0 comments on commit 98e9fd4

Please sign in to comment.