From 13de735be6effa436c0dddb3ffb8c2b31110a1ba Mon Sep 17 00:00:00 2001 From: "riho.takagi" Date: Mon, 8 Jan 2024 11:46:38 -0500 Subject: [PATCH] Chartfield for Hiring security --- .../client/admin-page/components/Bookings.tsx | 21 +++++- .../src/client/booking/approval_email.html | 3 + .../client/booking/components/FormInput.tsx | 68 ++++++++++++++++++- .../client/booking/components/SheetEditor.tsx | 5 +- media_commons_booking_app/src/server/admin.js | 4 ++ 5 files changed, 97 insertions(+), 4 deletions(-) diff --git a/media_commons_booking_app/src/client/admin-page/components/Bookings.tsx b/media_commons_booking_app/src/client/admin-page/components/Bookings.tsx index 48e8d201..46f2b756 100644 --- a/media_commons_booking_app/src/client/admin-page/components/Bookings.tsx +++ b/media_commons_booking_app/src/client/admin-page/components/Bookings.tsx @@ -114,6 +114,9 @@ export const Bookings = () => { catering: values[24], cateringService: values[25], hireSecurity: values[26], + chartFieldForCatering: values[27], + chartFieldForSecurity: values[28], + chartFieldForRoomSetup: values[29], }; }; @@ -213,6 +216,9 @@ export const Bookings = () => { Set up + + Chartfield Information for Room Setup + Media Service @@ -223,11 +229,14 @@ export const Bookings = () => { Catering Service - Chartfield Information + Chartfield Information for catering Hire security + + Chartfield Information for security + @@ -354,6 +363,9 @@ export const Bookings = () => { )} + + {booking.chartFieldForRoomSetup} + {booking.mediaServices} {booking.mediaServicesDetails && ( @@ -367,8 +379,13 @@ export const Bookings = () => { {booking.catering} {booking.cateringService} - + + {booking.chartFieldForCatering} + {booking.hireSecurity} + + {booking.chartFieldForSecurity} + ); })} diff --git a/media_commons_booking_app/src/client/booking/approval_email.html b/media_commons_booking_app/src/client/booking/approval_email.html index 38732308..3f97ae82 100644 --- a/media_commons_booking_app/src/client/booking/approval_email.html +++ b/media_commons_booking_app/src/client/booking/approval_email.html @@ -134,6 +134,9 @@

Room Reservation Request

Room setup needed?: +

+ Chartfield for Room setup?: +

Media Services: diff --git a/media_commons_booking_app/src/client/booking/components/FormInput.tsx b/media_commons_booking_app/src/client/booking/components/FormInput.tsx index a554561a..e9c40677 100644 --- a/media_commons_booking_app/src/client/booking/components/FormInput.tsx +++ b/media_commons_booking_app/src/client/booking/components/FormInput.tsx @@ -26,6 +26,9 @@ export type Inputs = { expectedAttendance: string; cateringService: string; missingEmail?: string; + chartFieldForCatering: string; + chartFieldForSecurity: string; + chartFieldForRoomSetup: string; }; const ErrorMessage = (message) => { @@ -39,7 +42,7 @@ const ErrorMessage = (message) => { ); }; -const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => { +const FormInput = ({ hasEmail, handleParentSubmit, selectedRoom }) => { const { register, handleSubmit, @@ -56,6 +59,9 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => { mediaServicesDetails: '', role: '', catering: '', + chartFieldForCatering: '', + chartFieldForSecurity: '', + chartFieldForRoomSetup: '', hireSecurity: '', attendeeAffiliation: '', department: '', @@ -67,7 +73,10 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => { const [resetRoom, setResetRoom] = useState(false); const [bookingPolicy, setBookingPolicy] = useState(false); const [showTextbox, setShowTextbox] = useState(false); + const roomNumber = selectedRoom.map((room) => room.roomId); + const maxCapacity = selectedRoom.map((room) => room.maxCapacity); + console.log('maxCapacity', maxCapacity); const disabledButton = !(checklist && resetRoom && bookingPolicy); useEffect(() => { trigger(); @@ -548,6 +557,25 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => { /> )} + {watch('roomSetup') === 'yes' && ( +

+ +
+ +
+
+ )}
)} + {watch('catering') === 'yes' && ( +
+ +
+ +
+
+ )}
+ {watch('hireSecurity') === 'yes' && ( +
+ +
+ +
+
+ )}
); diff --git a/media_commons_booking_app/src/server/admin.js b/media_commons_booking_app/src/server/admin.js index 26379ee9..db07e338 100644 --- a/media_commons_booking_app/src/server/admin.js +++ b/media_commons_booking_app/src/server/admin.js @@ -44,7 +44,11 @@ export const bookingContents = (id) => { mediaServicesDetails: values[24], catering: values[25], cateringService: values[26], + hireSecurity: values[27], + chartFieldForCatering: values[28], + chartFieldForSecurity: values[29], + chartFieldForRoomSetup: values[30], approvalUrl: approvalUrl(id), rejectedUrl: rejectUrl(id), };