diff --git a/src/apps/loan-list/list/loan-list.dev.tsx b/src/apps/loan-list/list/loan-list.dev.tsx index c3f3c56840..4235b50b08 100644 --- a/src/apps/loan-list/list/loan-list.dev.tsx +++ b/src/apps/loan-list/list/loan-list.dev.tsx @@ -10,6 +10,7 @@ import loanGroupModalArgs from "../../../core/storybook/loanGroupModalArgs"; import materialDetailsModalArgs from "../../../core/storybook/materialDetailsModalArgs"; import renewalArgs from "../../../core/storybook/renewalArgs"; import { getModalIds } from "../../../core/utils/helpers/modal-helpers"; +import globalConfigArgs from "../../../core/storybook/globalConfigArgs"; export default { title: "Apps / Loan list", @@ -18,6 +19,7 @@ export default { ...serviceUrlArgs, ...groupModalArgs, ...globalTextArgs, + ...globalConfigArgs, ...loanGroupModalArgs, ...renewalArgs, ...materialDetailsModalArgs, diff --git a/src/apps/loan-list/materials/selectable-material/StatusMessage.tsx b/src/apps/loan-list/materials/selectable-material/StatusMessage.tsx index 10df48022a..887bd97273 100644 --- a/src/apps/loan-list/materials/selectable-material/StatusMessage.tsx +++ b/src/apps/loan-list/materials/selectable-material/StatusMessage.tsx @@ -18,9 +18,12 @@ const StatusMessage: FC = ({ return ( <> {renewalStatusList && - renewalStatusList.map((text) => ( - {getStatusText(text, t)} - ))} + renewalStatusList.map((text) => { + if (text !== "deniedOtherReason") { + return {getStatusText(text, t)}; + } + return null; + })} {loanType === "interLibraryLoan" && ( {t("groupModalRenewLoanDeniedInterLibraryLoanText")} diff --git a/src/apps/loan-list/materials/stackable-material/material-status.tsx b/src/apps/loan-list/materials/stackable-material/material-status.tsx index 6062895f0d..a659f84111 100644 --- a/src/apps/loan-list/materials/stackable-material/material-status.tsx +++ b/src/apps/loan-list/materials/stackable-material/material-status.tsx @@ -9,6 +9,7 @@ import { formatDate, formatDateTime } from "../../../../core/utils/helpers/date"; +import StatusMessage from "../selectable-material/StatusMessage"; interface MaterialStatusProps { loan: LoanType; @@ -77,6 +78,16 @@ const MaterialStatus: FC = ({ placeholders: { "@date": formatDate(dueDate) } })}

+ {!isDigital(loan) && ( +

+ +

+ )} + {children} diff --git a/src/apps/loan-list/modal/material-details.tsx b/src/apps/loan-list/modal/material-details.tsx index 6f757fec1e..090f4b5c6b 100644 --- a/src/apps/loan-list/modal/material-details.tsx +++ b/src/apps/loan-list/modal/material-details.tsx @@ -55,7 +55,9 @@ const MaterialDetails: FC = ({ isRenewable, materialItemNumber, loanDate, - periodical + loanType, + periodical, + renewalStatusList } = loan; const { authors, materialType, year, title, pid, description, series } = material || {}; @@ -111,8 +113,10 @@ const MaterialDetails: FC = ({ renewable={isRenewable} hideOnMobile renewingStatus={renewingStatus} + loanType={loanType || ""} setRenewingStatus={setRenewingStatus} setRenewingResponse={setRenewingResponse} + renewalStatusList={renewalStatusList} /> )} {isDigital(loan) && ( @@ -175,9 +179,11 @@ const MaterialDetails: FC = ({ loanId={loanId} renewable={isRenewable} hideOnMobile={false} + loanType={loanType || ""} renewingStatus={renewingStatus} setRenewingStatus={setRenewingStatus} setRenewingResponse={setRenewingResponse} + renewalStatusList={renewalStatusList} /> )} {isDigital(loan) && ( diff --git a/src/apps/loan-list/modal/renew-button.tsx b/src/apps/loan-list/modal/renew-button.tsx index 26779187e1..1c78955b49 100644 --- a/src/apps/loan-list/modal/renew-button.tsx +++ b/src/apps/loan-list/modal/renew-button.tsx @@ -9,6 +9,7 @@ import { RenewedLoanV2 } from "../../../core/fbs/model"; import { getRenewButtonLabel } from "../../../core/utils/helpers/renewal"; import { useStatistics } from "../../../core/statistics/useStatistics"; import { statistics } from "../../../core/statistics/statistics"; +import StatusMessage from "../materials/selectable-material/StatusMessage"; interface RenewButtonProps { loanId: LoanId; @@ -17,6 +18,8 @@ interface RenewButtonProps { hideOnMobile: boolean; setRenewingStatus: (status: RequestStatus) => void; renewingStatus: RequestStatus; + renewalStatusList: string[]; + loanType: string; setRenewingResponse: (response: RenewedLoanV2[] | null) => void; } @@ -27,6 +30,8 @@ const RenewButton: FC = ({ hideOnMobile, setRenewingStatus, renewingStatus, + renewalStatusList, + loanType, setRenewingResponse }) => { const t = useText(); @@ -76,6 +81,11 @@ const RenewButton: FC = ({ hideOnMobile && `modal-details__buttons--hide-on-mobile` } modal-details__buttons`} > +