Skip to content

Commit

Permalink
UIREQ-629: Disable hold shelf clearance report when a request for hol…
Browse files Browse the repository at this point in the history
…d-shelf-clearance is pending. (#766)
  • Loading branch information
mkuklis committed Aug 4, 2021
1 parent 1b224e8 commit c565adc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Fix proxy bug in request duplication. Fixes UIREQ-626.
* Include `request-preferences` permission in edit and create psets. Refs UIREQ-628.
* Omit request-cancellation details in duplicated requests. Refs UIREQ-627.
* Disable hold shelf clearance report button when a request for `hold-shelf-clearance` data is pending. Fixes UIREQ-629.

## [5.1.0](https://github.com/folio-org/ui-requests/tree/v5.1.0) (2021-06-17)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v5.0.0...v5.1.0)
Expand Down
9 changes: 8 additions & 1 deletion src/routes/RequestsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ class RequestsRoute extends React.Component {
setCurrentServicePointId = () => {
const { mutator } = this.props;
const { id } = this.getCurrentServicePointInfo();

mutator.currentServicePoint.update({ id });
this.buildRecordsForHoldsShelfReport();
};
Expand Down Expand Up @@ -624,6 +625,10 @@ class RequestsRoute extends React.Component {
stripes: { user },
} = this.props;

this.setState({
holdsShelfReportPending: true,
});

reset();

const servicePointId = get(user, 'user.curServicePoint.id', '');
Expand All @@ -633,6 +638,7 @@ class RequestsRoute extends React.Component {
this.setState({
servicePointId,
requests,
holdsShelfReportPending: false,
});
}

Expand Down Expand Up @@ -757,6 +763,7 @@ class RequestsRoute extends React.Component {
errorModalData,
requests,
servicePointId,
holdsShelfReportPending,
} = this.state;
const { name: servicePointName } = this.getCurrentServicePointInfo();
const pickSlips = get(resources, 'pickSlips.records', []);
Expand Down Expand Up @@ -828,7 +835,7 @@ class RequestsRoute extends React.Component {
<Button
buttonStyle="dropdownItem"
id="exportExpiredHoldsToCsvPaneHeaderBtn"
disabled={servicePointId && requestsEmpty}
disabled={holdsShelfReportPending || (servicePointId && requestsEmpty)}
onClick={() => {
onToggle();
this.exportExpiredHoldsToCSV();
Expand Down

0 comments on commit c565adc

Please sign in to comment.