Commit b90dc108 authored by Øyvind Julsrud's avatar Øyvind Julsrud Committed by Magnus Westergaard
Browse files

DEICH-5943: deichman.no: revert back to original commit

parent e7e6d6f9
......@@ -44,11 +44,6 @@ const availableFields = {
[LANGUAGE_COURSE]: ["format"]
};
function getNumHolds(copies, recordId) {
return copies[recordId]?.numHolds || 0;
}
export default function ReservePublicationWidget({
publications,
currentPublication,
......@@ -205,21 +200,22 @@ export default function ReservePublicationWidget({
return (
<div data-animate-in="top" data-animation-order="4">
<div className="reserve-work-widget">
{reasons.length > 1 || (reasons.length === 1 && reasons[0] !== "Til bruk i biblioteket") &&
<h3>Denne er ikke tilgjengelig</h3>
}
{reasons.length > 1 ||
(reasons.length === 1 &&
reasons[0] !== "Til bruk i biblioteket" && (
<h3>Denne er ikke tilgjengelig</h3>
))}
<Block>
<p>
{reasons.length === 1 && <>{reasons[0]}</>}
{reasons.length > 1 && "Kan ikke bestilles"}
</p>
<p>
{reasons.length === 1 && <>{reasons[0]}</>}
{reasons.length > 1 && "Kan ikke bestilles"}
</p>
</Block>
{reasons.length === 1 && reasons[0] === "Til bruk i biblioteket" &&
{reasons.length === 1 && reasons[0] === "Til bruk i biblioteket" && (
<Block top={4}>
<Availability items={copies[currentPublication.recordId].items} />
<div className="numHolds">
, {getNumHolds(copies, currentPublication.recordId)} venteliste
</div>
<Availability
publications={copies[currentPublication.recordId]}
/>
<PublicationDetailsButton
className="link"
publication={currentPublication}
......@@ -228,7 +224,7 @@ export default function ReservePublicationWidget({
Finn i biblioteket
</PublicationDetailsButton>
</Block>
}
)}
</div>
</div>
);
......@@ -346,7 +342,8 @@ export function notReservableReason(publication, copies) {
const items = copies[publication.recordId]?.items || [];
const isReservable = items.filter(item => item.reservable).length > 0;
const isOnlyForBranchUse = items.length > 0 && items.every(item => item.notforloan);
const isOnlyForBranchUse =
items.length > 0 && items.every(item => item.notforloan);
if (
publication.formats?.includes(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment