Skip to content

Commit

Permalink
updated text
Browse files Browse the repository at this point in the history
  • Loading branch information
rlho committed Oct 23, 2023
1 parent 6050110 commit fce666a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ export const Calendars = ({
}
if (bookInfo) {
const isConfirmed = window.confirm(
`You are booking the following rooms: ${selectedRooms.map(
`You are requesting to book the following rooms${selectedRooms.map(
(room) => `${room.roomId} ${room.name}`
)}
\nYour reserved time slot: ${formatDate(
bookInfo.startStr
)} ~ ${formatDate(bookInfo.endStr)}`
)} for the time slot ${formatDate(bookInfo.startStr)} ~ ${formatDate(
bookInfo.endStr
)}`
);
if (isConfirmed) handleSetDate(bookInfo);
}
Expand Down Expand Up @@ -115,7 +114,7 @@ export const Calendars = ({
id: Date.now(), // Generate a unique ID for the event
start: selectInfo.startStr,
end: selectInfo.endStr,
title: `${TITLE_TAG} Reserve`,
title: `${TITLE_TAG}`,
groupId: selectInfo.startStr,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
const [agreement, setAgreement] = useState(false);
const [resetRoom, setResetRoom] = useState(false);
const [bookingPolicy, setBookingPolicy] = useState(false);
const [showTextbox, setShowTextbox] = useState(false);

const disabledButton = !(
checklist &&
agreement &&
Expand All @@ -86,6 +88,14 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
};
console.log('errors', errors);

const handleSelectChange = (event) => {
if (event.target.value === 'others') {
setShowTextbox(true);
} else {
setShowTextbox(false);
}
};

return (
<form
className="py-10 items-center"
Expand Down Expand Up @@ -270,6 +280,9 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
required: true,
validate: (value) => value !== '',
})}
onChange={(e) => {
handleSelectChange(e);
}}
>
<option value="" disabled>
Select option
Expand All @@ -283,7 +296,7 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
<option value="Recorded Music">Recorded Music</option>
<option value="others">Other Group</option>
</select>
{watch('department') === 'others' && (
{showTextbox && (
<input
type="text"
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[600px] p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
Expand Down Expand Up @@ -332,7 +345,9 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
id="sponsorFirstName"
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[600px] p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder=""
{...register('sponsorFirstName')}
{...register('sponsorFirstName', {
required: watch('role') === 'Student',
})}
/>
</div>
<div className="mb-6">
Expand All @@ -347,7 +362,9 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
id="sponsorLastName"
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[600px] p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder=""
{...register('sponsorLastName')}
{...register('sponsorLastName', {
required: watch('role') === 'Student',
})}
/>
</div>
<div className="mb-6">
Expand All @@ -367,6 +384,7 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[600px] p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder=""
{...register('sponsorEmail', {
required: watch('role') === 'Student',
pattern: {
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i,
message: 'Invalid email address',
Expand Down Expand Up @@ -522,12 +540,17 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
formation.
</label>
<p className="text-xs"></p>
{errors.setupDetails && (
<ErrorMessage errors={errors.setupDetails.message} />
)}
<input
type="textarea"
id="setupDetails"
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[600px] p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder=""
{...register('setupDetails')}
{...register('setupDetails', {
required: watch('roomSetup') === 'yes',
})}
/>
</div>
)}
Expand Down Expand Up @@ -663,8 +686,16 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
Catering Information
</label>
<p className="text-xs">
Including catering in your event necessitates hiring CBS cleaning
services.
It is required for the reservation holder to pay and arrange for CBS
cleaning services if the event includes catering.
<a
href=""
target="_blank"
className="text-blue-600 hover:underline dark:text-blue-500 mx-1"
>
Please see this link for more information
</a>
.
</p>
<div className="flex items-center mb-4">
<select
Expand All @@ -682,31 +713,6 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
</div>
</div>
)}
{watch('catering') === 'yes' && (
<div className="mb-6">
<label
htmlFor="chartfieldInformation"
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>
Chartfield Information
</label>
<p className="text-xs">
It is required for the reservation holder to pay for CBS cleaning
services if the event includes catering. The 370J Operations team
will arrange for cleaning services with your chartfield information
entered below.
</p>
<div className="flex items-center mb-4">
<input
type="textarea"
id="chartfieldInformation"
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[600px] p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder=""
{...register('chartfieldInformation')}
/>
</div>
</div>
)}

<div className="mb-6">
<label
Expand Down Expand Up @@ -806,33 +812,6 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
</label>
</div>
</div>
<div className="mb-6">
<label
htmlFor="agreement"
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>
I agree to the following attestations: <br />
*I will reset any furniture that I moved, clean up after myself, and
not leave anything behind.
<br />
*If I need to cancel my reservation, I will email the Media Commons.
</label>
<div className="flex items-center mb-4">
<input
id="agreement"
type="checkbox"
value=""
onChange={() => setAgreement(!agreement)}
className="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
/>
<label
htmlFor="agreement"
className="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300"
>
I agree
</label>
</div>
</div>

<div className="mb-6">
<label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ const SheetEditor = () => {
} else if (section === 'selectRoom') {
return (
<div>
Select room and view calendar
<MultipleCalendars
key="calendars"
apiKey={apiKey}
Expand All @@ -286,14 +287,6 @@ const SheetEditor = () => {
{!showModal && (
<>
<div className="flex flex-col justify-items-end items-end">
<a
href={`${BASE_URL}?page=admin`}
target="_blank"
className="text-blue-600 underline"
>
Admin page
</a>

<Header isSafetyTrained={isSafetyTrained} userEmail={userEmail} />
</div>
{UserSection()}
Expand Down
2 changes: 1 addition & 1 deletion media_commons_booking_app/src/server/sheets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ACTIVE_SHEET_ID = '1MnWbn6bvNyMiawddtYYx0tRW4NMgvugl0I8zBO3sy68';
export const ACTIVE_SHEET_ID = '1MnWbn6bvNyMiawddtYYx0tRW4NMgvugl0I8zBO3sy68';

export const fetchRows_ = (sheetName) => {
return SpreadsheetApp.openById(ACTIVE_SHEET_ID)
Expand Down

0 comments on commit fce666a

Please sign in to comment.