shelf.nu icon indicating copy to clipboard operation
shelf.nu copied to clipboard

[Feature request]: Create booking via asset page

Open jurrejansen opened this issue 1 year ago • 1 comments

Contact Details

[email protected]

Is your feature request related to a problem? Please describe?

This was requested by Leonardo from Laerdal Medical.

The ability to book an asset from “within” the asset. (i.e. I open an asset page and I can directly create a booking with that asset from there, without having to open the booking page and create a new booking with that particular asset)

@DonKoko we discussed this briefly via Discord.

Describe the solution you'd like

SCENARIO https://www.figma.com/file/ykvc0MhPeNLsrJ4tJsKosQ/Shelf-%7C-UX-Scenarios?type=design&node-id=4478-29320&mode=design

This feature should work for both Administrators and Self-service users. Of course Self-service user can only select themselves as Custodian.

  • Add a Book button on the asset page
  • Clicking the Book button opens a Create booking modal
  • User fills Name, Booking period and Custodian
  • User clicks Create booking
  • User gets redirected to the newly created Draft booking with Name, Booking period and Custodian fields filled
  • Also the asset is already added to the booking (if warning labels shows it indicates the asset is already booked during booking period or in custody)

From there they can further configure the booking if needed

  • The Book button should be hidden on asset page when is marked as 'Unavailable for bookings'

Describe alternatives you've considered

No response

Additional context

No response

jurrejansen avatar Mar 18 '24 12:03 jurrejansen

An alternative for this could be to enable scanning of tags on the booking create flow?

carlosvirreira avatar Mar 21 '24 19:03 carlosvirreira

In terms of technical implementation:

  1. Clicking on Book button will lead to bookings.new
  2. We sent some search params with the assetId.
  3. In the booking.new loader, we parse those search params and use the assetId if present when creating the booking to already link it to assets. Note: This should support an array of assetIds. That way we can also use it in bulk actions.

DonKoko avatar Jul 12 '24 07:07 DonKoko

@DonKoko , I'd like to work on this. Please assign!

Bhavyajain21 avatar Jul 12 '24 08:07 Bhavyajain21

Nice release. Functionality works great. Only concern I have that I did not voice earlier is the focus on booking as a primary action on the page. At some point I might request to move the book cat under actions. But, not relevant for now.

carlosvirreira avatar Jul 17 '24 07:07 carlosvirreira

@carlosvirreira @jurrejansen btw I added it also for kits. So it works there as well.

DonKoko avatar Jul 17 '24 07:07 DonKoko