From 2b139d9e40795fd52b72651646320ea0359697bd Mon Sep 17 00:00:00 2001 From: Florian Cassayre Date: Tue, 1 Sep 2020 09:47:28 +0200 Subject: [PATCH] Minor bugfixes * addresses #172 * DocumentAuthors component raising exception * "checkout" button in loan requests not disabled during loading --- src/lib/modules/Document/DocumentAuthors.js | 7 ++++--- .../Item/ItemDetails/ItemPendingLoans/ItemPendingLoans.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/modules/Document/DocumentAuthors.js b/src/lib/modules/Document/DocumentAuthors.js index cf4329286..0dd76c393 100644 --- a/src/lib/modules/Document/DocumentAuthors.js +++ b/src/lib/modules/Document/DocumentAuthors.js @@ -171,12 +171,13 @@ class DocumentAuthors extends Component { } = this.props; const { isExpanded } = this.state; - let displayedAuthors = authors; + const allAuthors = authors ? authors : []; + let displayedAuthors = allAuthors; if (!isExpanded) { - displayedAuthors = authors.slice(0, limit); + displayedAuthors = allAuthors.slice(0, limit); } - const isShowingAllAuthors = displayedAuthors.length === authors.length; + const isShowingAllAuthors = displayedAuthors.length === allAuthors.length; const showAllAuthorsCmp = !isShowingAllAuthors && expandable ? ( <> diff --git a/src/lib/pages/backoffice/Item/ItemDetails/ItemPendingLoans/ItemPendingLoans.js b/src/lib/pages/backoffice/Item/ItemDetails/ItemPendingLoans/ItemPendingLoans.js index 230c0f7d5..d954d40a2 100644 --- a/src/lib/pages/backoffice/Item/ItemDetails/ItemPendingLoans/ItemPendingLoans.js +++ b/src/lib/pages/backoffice/Item/ItemDetails/ItemPendingLoans/ItemPendingLoans.js @@ -86,7 +86,8 @@ export default class ItemPendingLoans extends Component { ) || !invenioConfig.ITEMS.canCirculateStatuses.includes( itemDetails.metadata.status - ) + ) || + isPendingLoansLoading } onClick={() => performCheckoutAction(