From c565adc3e16886d371050319541d1ad1a8810268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kuklis?= Date: Mon, 2 Aug 2021 16:37:54 -0400 Subject: [PATCH] UIREQ-629: Disable hold shelf clearance report when a request for hold-shelf-clearance is pending. (#766) --- CHANGELOG.md | 1 + src/routes/RequestsRoute.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1aca86f..4a5572c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/routes/RequestsRoute.js b/src/routes/RequestsRoute.js index 6efe99e0..7dd2a913 100644 --- a/src/routes/RequestsRoute.js +++ b/src/routes/RequestsRoute.js @@ -457,6 +457,7 @@ class RequestsRoute extends React.Component { setCurrentServicePointId = () => { const { mutator } = this.props; const { id } = this.getCurrentServicePointInfo(); + mutator.currentServicePoint.update({ id }); this.buildRecordsForHoldsShelfReport(); }; @@ -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', ''); @@ -633,6 +638,7 @@ class RequestsRoute extends React.Component { this.setState({ servicePointId, requests, + holdsShelfReportPending: false, }); } @@ -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', []); @@ -828,7 +835,7 @@ class RequestsRoute extends React.Component {