From d3b0cad18df0c41bda2a4f0f42c19d211f16f66c Mon Sep 17 00:00:00 2001 From: Donkoko Date: Wed, 19 Jun 2024 15:49:39 +0300 Subject: [PATCH 1/3] fixed issue: - removed reserved from statuses on action validation - added client side control to make sure that manage assets button is disabled --- app/routes/_layout+/kits.$kitId.manage-assets.tsx | 1 - app/routes/_layout+/kits.$kitId.tsx | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/routes/_layout+/kits.$kitId.manage-assets.tsx b/app/routes/_layout+/kits.$kitId.manage-assets.tsx index 42317c854..4ed7aecbf 100644 --- a/app/routes/_layout+/kits.$kitId.manage-assets.tsx +++ b/app/routes/_layout+/kits.$kitId.manage-assets.tsx @@ -242,7 +242,6 @@ export async function action({ context, request, params }: ActionFunctionArgs) { const disallowedBookingStatus: BookingStatus[] = [ BookingStatus.ONGOING, BookingStatus.OVERDUE, - BookingStatus.RESERVED, ]; const kitBookings = kit.assets.find((a) => a.bookings.length > 0)?.bookings ?? []; diff --git a/app/routes/_layout+/kits.$kitId.tsx b/app/routes/_layout+/kits.$kitId.tsx index 2dd71b60a..347e3e7dd 100644 --- a/app/routes/_layout+/kits.$kitId.tsx +++ b/app/routes/_layout+/kits.$kitId.tsx @@ -316,7 +316,17 @@ export default function KitDetails() { ) : kit.status === "AVAILABLE"; - const canManageAssets = kitIsAvailable && !isSelfService; + const kitBookings = + kit.assets.find((a) => a.bookings.length > 0)?.bookings ?? []; + + const canManageAssets = + kitIsAvailable && + !isSelfService && + !kitBookings.some((b) => + ( + [BookingStatus.ONGOING, BookingStatus.OVERDUE] as BookingStatus[] + ).includes(b.status) + ); return ( <> From 3ef2ce3771dd8beca4719a1113a7ebdfc60ee9ad Mon Sep 17 00:00:00 2001 From: Donkoko Date: Wed, 19 Jun 2024 15:52:23 +0300 Subject: [PATCH 2/3] adjust docs issue --- docs/sso/providers/google-workspace.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sso/providers/google-workspace.md b/docs/sso/providers/google-workspace.md index cae08f1af..fb23785bb 100644 --- a/docs/sso/providers/google-workspace.md +++ b/docs/sso/providers/google-workspace.md @@ -61,7 +61,7 @@ This information needs to be entered into Shelf before SSO is activated end-to-e Wait for confirmation that this information has successfully been added to Shelf. It usually takes us 1 business day to configure this information for you. -In the meantime, you can continue with the next steps that will show you how to setup your +In the meantime, you can continue with the next steps that will show you how to setup your groups and users. ## Step 8: Create groups and assign users [#](#step-8-create-groups-and-assign-users) From 4c9dddf2158be9f9ef707322fd205d978a874d14 Mon Sep 17 00:00:00 2001 From: Donkoko Date: Wed, 19 Jun 2024 15:58:16 +0300 Subject: [PATCH 3/3] mend --- docs/sso/providers/google-workspace.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sso/providers/google-workspace.md b/docs/sso/providers/google-workspace.md index fb23785bb..7f474b04d 100644 --- a/docs/sso/providers/google-workspace.md +++ b/docs/sso/providers/google-workspace.md @@ -24,7 +24,7 @@ This is a very important step. Click on _DOWNLOAD METADATA_ and save the file th ![step-4](../../img/google-workspace-step-4.png) -It's very important to send this file to your support contact at Supabase to complete the SSO setup process. If you're not sure where to send this file, you can always reach us at [hello@shelf.nu](mailto:hello@shelf.nu). +It's very important to send this file to your support contact at Shelf to complete the SSO setup process. If you're not sure where to send this file, you can always reach us at [hello@shelf.nu](mailto:hello@shelf.nu). > [!IMPORTANT] > Make sure the certificate as shown on screen has at least 1 year before it expires. Mark down this date in your calendar so you will be reminded that you need to update the certificate without any downtime for your users.