From 955c289e8ecaef5be215f5cce88c0e8a2559535a Mon Sep 17 00:00:00 2001 From: Jacob Pihl Date: Tue, 28 Nov 2023 18:03:18 +0100 Subject: [PATCH 1/2] Align fees url In an attempt to streamline the fee url to a single field from Drupal, we wan to use the feesAndCompensationRatesUrl instead. feespageURL is used for the user fee page /user/me/fees --- .../dashboard-notification-list.tsx | 9 ++++++++- src/apps/loan-list/modal/material-details.tsx | 4 ++-- src/core/storybook/materialDetailsModalArgs.ts | 6 +++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx b/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx index e25d71e6d3..9baafd6bdd 100644 --- a/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx +++ b/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx @@ -42,7 +42,7 @@ const DashboardNotificationList: FC = ({ all: { reservations, readyToLoan: reservationsReadyToLoan, - queued: reservationsQueued + queued: reservationsQueuedAll } } = useReservations(); const { @@ -68,6 +68,13 @@ const DashboardNotificationList: FC = ({ useState(null); const [reservationModalId, setReservationModalId] = useState(""); + //filter digital reservations + const reservationsQueued = reservationsQueuedAll + .filter((reservation) => !reservation.faust) + .slice(0, 1); + + console.log("reservationsQueued", reservationsQueued); + const openModalHandler = useCallback( (modalId: string) => { setReservationModalId(modalId); diff --git a/src/apps/loan-list/modal/material-details.tsx b/src/apps/loan-list/modal/material-details.tsx index 76839284e4..9c19f2d675 100644 --- a/src/apps/loan-list/modal/material-details.tsx +++ b/src/apps/loan-list/modal/material-details.tsx @@ -39,7 +39,7 @@ const MaterialDetails: FC = ({ >(null); const t = useText(); - const { ereolenMyPageUrl, feesPageUrl } = useUrls(); + const { ereolenMyPageUrl, viewFeesAndCompensationRatesUrl } = useUrls(); if (!loan) { return null; @@ -131,7 +131,7 @@ const MaterialDetails: FC = ({ {dueDate && materialIsOverdue(dueDate) && (
diff --git a/src/core/storybook/materialDetailsModalArgs.ts b/src/core/storybook/materialDetailsModalArgs.ts index 91f6533d62..fc3f3655c0 100644 --- a/src/core/storybook/materialDetailsModalArgs.ts +++ b/src/core/storybook/materialDetailsModalArgs.ts @@ -66,7 +66,11 @@ export default { defaultValue: "Renew your loan" }, feesPageUrl: { - defaultValue: "/user/me/fees", // open source image of a red panda + defaultValue: "/user/me/fees", + control: { type: "text" } + }, + viewFeesAndCompensationRatesUrl: { + defaultValue: "https://unsplash.com/photos/wd6YQy0PJt8", // open source image of a red panda control: { type: "text" } }, ereolenMyPageUrl: { From e228a18cb26f79c2dceb54e6fe6fc84f1865cf54 Mon Sep 17 00:00:00 2001 From: Jacob Pihl Date: Tue, 28 Nov 2023 18:07:02 +0100 Subject: [PATCH 2/2] Removed leftovers --- .../dashboard-notification-list.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx b/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx index 9baafd6bdd..e25d71e6d3 100644 --- a/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx +++ b/src/apps/dashboard/dashboard-notification-list/dashboard-notification-list.tsx @@ -42,7 +42,7 @@ const DashboardNotificationList: FC = ({ all: { reservations, readyToLoan: reservationsReadyToLoan, - queued: reservationsQueuedAll + queued: reservationsQueued } } = useReservations(); const { @@ -68,13 +68,6 @@ const DashboardNotificationList: FC = ({ useState(null); const [reservationModalId, setReservationModalId] = useState(""); - //filter digital reservations - const reservationsQueued = reservationsQueuedAll - .filter((reservation) => !reservation.faust) - .slice(0, 1); - - console.log("reservationsQueued", reservationsQueued); - const openModalHandler = useCallback( (modalId: string) => { setReservationModalId(modalId);