= ({
{booking.sponsorFirstName} {booking.sponsorLastName}
{booking.sponsorEmail} |
-
- {booking.reservationTitle}
- |
+ {booking.title} |
- {booking.reservationDescription}
+ {booking.description}
|
{booking.expectedAttendance}
diff --git a/media_commons_booking_app/src/client/routes/admin/components/Liaisons.tsx b/media_commons_booking_app/src/client/routes/admin/components/Liaisons.tsx
index cb943d13..1dd381e1 100644
--- a/media_commons_booking_app/src/client/routes/admin/components/Liaisons.tsx
+++ b/media_commons_booking_app/src/client/routes/admin/components/Liaisons.tsx
@@ -1,9 +1,9 @@
import React, { useContext, useMemo, useState } from 'react';
+import { TableNames, getLiaisonTableName } from '../../../../policy';
import { DatabaseContext } from '../../components/Provider';
import EmailListTable from '../../components/EmailListTable';
import Loading from '../../../utils/Loading';
-import { TableNames } from '../../../../policy';
import { formatDate } from '../../../utils/date';
// This is a wrapper for google.script.run that lets us use promises.
import { serverFunctions } from '../../../utils/serverFunctions';
@@ -26,7 +26,7 @@ const AddLiaisonForm = ({ liaisonEmails, reloadLiaisonEmails }) => {
setLoading(true);
try {
- await serverFunctions.appendRowActive(TableNames.LIAISONS, [
+ await serverFunctions.appendRowActive(getLiaisonTableName(), [
email,
department,
new Date().toString(),
@@ -37,6 +37,7 @@ const AddLiaisonForm = ({ liaisonEmails, reloadLiaisonEmails }) => {
alert('Failed to add user');
} finally {
setLoading(false);
+ setEmail('');
}
};
@@ -56,6 +57,7 @@ const AddLiaisonForm = ({ liaisonEmails, reloadLiaisonEmails }) => {
onChange={(e) => {
setEmail(e.target.value);
}}
+ value={email}
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-full 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="name@nyu.edu"
required
@@ -113,7 +115,7 @@ export const Liaisons = () => {
reloadLiaisonEmails={reloadLiaisonUsers}
/>
{
const bookingStatusMatch = bookingStatuses.filter(
- (row) => row.calendarEventId === booking.calendarEventId
+ (row) => row.calendarId === booking.calendarId
)[0];
if (bookingStatusMatch === undefined) return BookingStatusLabel.UNKNOWN;
if (bookingStatusMatch.checkedInAt !== '') {
return BookingStatusLabel.CHECKED_IN;
+ } else if (bookingStatusMatch.noShowedAt !== '') {
+ return BookingStatusLabel.NO_SHOW;
} else if (bookingStatusMatch.canceledAt !== '') {
return BookingStatusLabel.CANCELED;
} else if (bookingStatusMatch.rejectedAt !== '') {
diff --git a/media_commons_booking_app/src/client/routes/booking/approval_email.html b/media_commons_booking_app/src/client/routes/booking/approval_email.html
index 5b9c882e..625466f1 100644
--- a/media_commons_booking_app/src/client/routes/booking/approval_email.html
+++ b/media_commons_booking_app/src/client/routes/booking/approval_email.html
@@ -116,11 +116,11 @@ Room Reservation Request
Reservation Title:
- = reservationTitle ?>
+ = title ?>
Reservation Description:
- = reservationDescription ?>
+ = description ?>
Expected Attendance:
diff --git a/media_commons_booking_app/src/client/routes/booking/bookingProvider.tsx b/media_commons_booking_app/src/client/routes/booking/bookingProvider.tsx
index ddaee013..59977a29 100644
--- a/media_commons_booking_app/src/client/routes/booking/bookingProvider.tsx
+++ b/media_commons_booking_app/src/client/routes/booking/bookingProvider.tsx
@@ -14,32 +14,26 @@ import { serverFunctions } from '../../utils/serverFunctions';
export interface BookingContextType {
bookingCalendarInfo: DateSelectArg | undefined;
- canBookFullTime: boolean;
department: Department | undefined;
isBanned: boolean;
isSafetyTrained: boolean;
- isThesis_PLACEHOLDER: boolean;
role: Role | undefined;
selectedRooms: RoomSetting[];
setBookingCalendarInfo: (x: DateSelectArg) => void;
setDepartment: (x: Department) => void;
- setIsThesis: (x: boolean) => void;
setRole: (x: Role) => void;
setSelectedRooms: (x: RoomSetting[]) => void;
}
export const BookingContext = createContext({
bookingCalendarInfo: undefined,
- canBookFullTime: false,
department: undefined,
isBanned: false,
isSafetyTrained: true,
- isThesis_PLACEHOLDER: false,
role: undefined,
selectedRooms: [],
setBookingCalendarInfo: (x: DateSelectArg) => {},
setDepartment: (x: Department) => {},
- setIsThesis: (x: boolean) => {},
setRole: (x: Role) => {},
setSelectedRooms: (x: RoomSetting[]) => {},
});
@@ -52,15 +46,9 @@ export function BookingProvider({ children }) {
useState();
const [department, setDepartment] = useState();
const [isSafetyTrained, setIsSafetyTrained] = useState(true);
- const [isThesis_PLACEHOLDER, setIsThesis] = useState(false);
const [role, setRole] = useState();
const [selectedRooms, setSelectedRooms] = useState([]);
- const canBookFullTime = useMemo(
- () => isThesis_PLACEHOLDER || role !== 'Student',
- [isThesis_PLACEHOLDER, role]
- );
-
const isBanned = useMemo(() => {
if (!userEmail) return false;
return bannedUsers
@@ -90,16 +78,13 @@ export function BookingProvider({ children }) {
{
const [bookingTimeEvent, setBookingTimeEvent] = useState();
@@ -114,7 +112,6 @@ export const Calendars = ({
allRooms={allRooms}
bookingTimeEvent={bookingTimeEvent}
setBookingTimeEvent={setBookingTimeEvent}
- canBookFullTime={canBookFullTime}
isOverlap={isOverlap}
key={i}
/>
diff --git a/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx b/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx
index 068aaa2d..47febc80 100644
--- a/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx
+++ b/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx
@@ -51,8 +51,6 @@ const FormInput = ({ handleParentSubmit }) => {
const [showTextbox, setShowTextbox] = useState(false);
const roomNumber = selectedRooms.map((room) => room.roomId);
- console.log(selectedRooms);
-
const maxCapacity = selectedRooms.reduce((sum, room) => {
return sum + parseInt(room.capacity);
}, 0);
@@ -79,7 +77,6 @@ const FormInput = ({ handleParentSubmit }) => {
const onSubmit: SubmitHandler = (data) => {
const dumpMediaServices = data.mediaServices || [];
- //@ts-ignore
data.mediaServices = Array.isArray(dumpMediaServices)
? dumpMediaServices.join(', ')
: dumpMediaServices;
@@ -95,15 +92,7 @@ const FormInput = ({ handleParentSubmit }) => {
};
return (
- |