diff --git a/ui/src/overridden/frontsite/Document/DocumentDetails/DocumentCirculationExtras.js b/ui/src/overridden/frontsite/Document/DocumentDetails/DocumentCirculationExtras.js index ea790c890..57780e6b9 100644 --- a/ui/src/overridden/frontsite/Document/DocumentDetails/DocumentCirculationExtras.js +++ b/ui/src/overridden/frontsite/Document/DocumentDetails/DocumentCirculationExtras.js @@ -34,9 +34,13 @@ function getLoanableItem(locations) { }); for (const item of allRelevantItems) { - const itemStatus = _get(item, "circulation.state"); - // If item is not on loan, return item's shelf value - if (!invenioConfig.CIRCULATION.loanActiveStates.includes(itemStatus)) { + const circulationStatus = _get(item, "circulation.state"); + const itemStatus = _get(item, "status"); + // If item is not on loan and it can be circulated, return item's shelf value + if ( + !invenioConfig.CIRCULATION.loanActiveStates.includes(circulationStatus) && + invenioConfig.ITEMS.canCirculateStatuses.includes(itemStatus) + ) { return item; } } diff --git a/ui/src/overridden/utils.js b/ui/src/overridden/utils.js index f3394aebe..5126e74aa 100644 --- a/ui/src/overridden/utils.js +++ b/ui/src/overridden/utils.js @@ -1,5 +1,5 @@ import React from "react"; -import { invenioConfig } from "@inveniosoftware/react-invenio-app-ils"; +import { InfoPopup, invenioConfig } from "@inveniosoftware/react-invenio-app-ils"; import { Icon } from "semantic-ui-react"; import _get from "lodash/get"; @@ -47,16 +47,18 @@ export const shelfLinkComponent = ( const linkToShelf = shelfLink(shelfNumber, { popupContent: { "Title": title, "Call number": callNumber }, }); - return ( + return shelfNumber ? ( <> - {shelfNumber && ( - - - {shelfNumber} - - )}{" "} + + + {shelfNumber} + {" "} {callNumber} + ) : ( + + {callNumber} + ); };