Skip to content

Commit

Permalink
Chartfield for Hiring security
Browse files Browse the repository at this point in the history
  • Loading branch information
rlho committed Jan 8, 2024
1 parent 4f1051e commit 13de735
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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],
};
};

Expand Down Expand Up @@ -213,6 +216,9 @@ export const Bookings = () => {
<th scope="col" className="px-2 py-3">
Set up
</th>
<th scope="col" className="px-2 py-3">
Chartfield Information for Room Setup
</th>
<th scope="col" className="px-2 py-3">
Media Service
</th>
Expand All @@ -223,11 +229,14 @@ export const Bookings = () => {
Catering Service
</th>
<th scope="col" className="px-2 py-3">
Chartfield Information
Chartfield Information for catering
</th>
<th scope="col" className="px-2 py-3">
Hire security
</th>
<th scope="col" className="px-2 py-3">
Chartfield Information for security
</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -354,6 +363,9 @@ export const Bookings = () => {
</>
)}
</td>
<td className="px-2 py-4 w-24">
{booking.chartFieldForRoomSetup}
</td>
<td className="px-2 py-4 w-24">
{booking.mediaServices}
{booking.mediaServicesDetails && (
Expand All @@ -367,8 +379,13 @@ export const Bookings = () => {
</td>
<td className="px-2 py-4 w-18">{booking.catering}</td>
<td className="px-2 py-4 w-18">{booking.cateringService}</td>

<td className="px-2 py-4 w-24">
{booking.chartFieldForCatering}
</td>
<td className="px-2 py-4 w-18">{booking.hireSecurity}</td>
<td className="px-2 py-4 w-24">
{booking.chartFieldForSecurity}
</td>
</tr>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ <h2>Room Reservation Request</h2>
Room setup needed?:
<?= roomSetup ?>
<?= setupDetails ?>
</p>
Chartfield for Room setup?:
<?= char ?>
</p>
<p>
Media Services:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export type Inputs = {
expectedAttendance: string;
cateringService: string;
missingEmail?: string;
chartFieldForCatering: string;
chartFieldForSecurity: string;
chartFieldForRoomSetup: string;
};

const ErrorMessage = (message) => {
Expand All @@ -39,7 +42,7 @@ const ErrorMessage = (message) => {
);
};

const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
const FormInput = ({ hasEmail, handleParentSubmit, selectedRoom }) => {
const {
register,
handleSubmit,
Expand All @@ -56,6 +59,9 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
mediaServicesDetails: '',
role: '',
catering: '',
chartFieldForCatering: '',
chartFieldForSecurity: '',
chartFieldForRoomSetup: '',
hireSecurity: '',
attendeeAffiliation: '',
department: '',
Expand All @@ -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();
Expand Down Expand Up @@ -548,6 +557,25 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
/>
</div>
)}
{watch('roomSetup') === 'yes' && (
<div className="mb-6">
<label
htmlFor="chartFieldForRoomSetup"
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>
ChartField for Campus Safety
</label>
<div className="flex items-center mb-4">
<input
type="text"
id="chartFieldForRoomSetup"
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('chartFieldForRoomSetup')}
/>
</div>
</div>
)}
<div className="mb-6">
<label
htmlFor="mediaServices"
Expand Down Expand Up @@ -720,6 +748,25 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
</div>
</div>
)}
{watch('catering') === 'yes' && (
<div className="mb-6">
<label
htmlFor="chartFieldForCatering"
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>
ChartField for Event Cleanup
</label>
<div className="flex items-center mb-4">
<input
type="text"
id="chartFieldForCatering"
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('chartFieldForCatering')}
/>
</div>
</div>
)}

<div className="mb-6">
<label
Expand Down Expand Up @@ -756,6 +803,25 @@ const FormInput = ({ hasEmail, roomNumber, handleParentSubmit }) => {
</select>
</div>
</div>
{watch('hireSecurity') === 'yes' && (
<div className="mb-6">
<label
htmlFor="chartFieldForSecurity"
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>
ChartField for Campus Safety
</label>
<div className="flex items-center mb-4">
<input
type="text"
id="chartFieldForSecurity"
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('chartFieldForSecurity')}
/>
</div>
</div>
)}

<div className="mb-6">
<label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ const SheetEditor = () => {
'catering',
'cateringService',
'hireSecurity',
'chartFieldForCatering',
'chartFieldForSecurity',
'chartFieldForRoomSetup',
];

useEffect(() => {
Expand Down Expand Up @@ -255,8 +258,8 @@ const SheetEditor = () => {
</button>
<FormInput
hasEmail={userEmail ? true : false}
roomNumber={selectedRoom.map((room) => room.roomId)}
handleParentSubmit={handleSubmit}
selectedRoom={selectedRoom}
/>
</div>
);
Expand Down
4 changes: 4 additions & 0 deletions media_commons_booking_app/src/server/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
Expand Down

0 comments on commit 13de735

Please sign in to comment.