Name | -Deactivate | -|||
---|---|---|---|---|
{account.firstName} {account.lastName} | -{account.email} | -- - | -
Name | +Deactivate | + {checkedAccountIds.length > 0 && ++ + | + } +||
---|---|---|---|---|
+ |
+ {account.firstName} {account.lastName} | +{account.email} | + {checkedAccountIds.length > 0 && +} - |
Name | -Action | +Name | +Action | + {checkedAccountIds.length > 0 && ++ + + | + }||||
---|---|---|---|---|---|---|---|---|
{account.firstName} {account.lastName} | -{account.email} | -- - + | ||||||
{account.firstName} {account.lastName} | +{account.email} | + {checkedAccountIds.length > 0 && ++ } + { + accountStatus[account.id] === "pending" ? ( + | + + | -Approved | + ) : ( +Declined | + ) + } + ) ) } @@ -69,6 +191,7 @@ const PendingAccounts = ( {accountType} ) => { PendingAccounts.propTypes = { accountType: PropTypes.string.isRequired, + setHasPendingAccounts: PropTypes.func.isRequired }; -export default PendingAccounts; \ No newline at end of file +export default PendingAccounts; diff --git a/src/components/AddDayForm/AddDayForm.jsx b/src/components/AddDayForm/AddDayForm.jsx index 1313b4a..c9d88f4 100644 --- a/src/components/AddDayForm/AddDayForm.jsx +++ b/src/components/AddDayForm/AddDayForm.jsx @@ -19,10 +19,10 @@ import { NPOBackend } from '../../utils/auth_utils'; const schema = yup.object({ date: yup.date().nullable().transform((curr, orig) => orig === '' ? null : curr).required('Date required'), - location: yup.string().required('Location required').max(50, 'Location exceeds 50 character limit'), + location: yup.string().required('Location required').max(100, 'Location exceeds 100 character limit'), details: yup .string() - .max(50, 'Details exceeds 50 character limit'), + .max(200, 'Details exceeds 200 character limit'), }); const AddDayForm = ({ onClose, onOpen, setDayId, dayData, setShouldDataRevalidate }) => { diff --git a/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx b/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx index 35b3ab7..4f875f4 100644 --- a/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx +++ b/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx @@ -12,7 +12,9 @@ import { Heading, Flex, Text, - Stack + HStack, + useDisclosure, + Spacer } from '@chakra-ui/react'; import { yupResolver } from '@hookform/resolvers/yup'; import { useForm } from 'react-hook-form'; @@ -30,14 +32,19 @@ import Dropdown from '../Dropdown/Dropdown'; import PropTypes from 'prop-types'; import { PlannerContext } from '../Planner/PlannerContext'; import PlannedEvent, { convertTimeToMinutes } from '../Planner/PlannedEvent'; +import RemoveTimelineEventModal from '../Planner/RemoveTimelineEventModal'; const schema = yup.object({ - startTime: yup.string().required('Start time is required'), + startTime: yup.string().required('Start time is required').test('is-after-7-am', 'Start time cannot be earlier than 7 AM', function(startTime) { + return startTime && startTime >= "07:00"; + }), endTime: yup.string() .required('End time is required') .test('is-after', 'End time must be after start time', function(endTime) { const startTime = this.parent.startTime; return startTime && endTime && startTime < endTime; + }).test('is-before-11-pm', 'End time must be earlier than 11 PM', function(endTime) { + return endTime && endTime <= "23:00"; }), host: yup.string().max(50, 'Host exceeds 50 character limit').default('').nullable(), title: yup.string().required('Title Required').max(50, 'Title exceeds 50 character limit'), @@ -58,6 +65,7 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { const [seasonFilter, yearFilter, subjectFilter, eventFilter] = filters; const [checkboxVal, setCheckboxVal] = useState(undefined); const [formData, setFormData] = useState({...eventData}); + const { isOpen: isRemoveOpen, onOpen: onRemoveOpen, onClose: onRemoveClose } = useDisclosure(); useEffect(() => { if (Object.keys(eventData).length === 0) { @@ -85,7 +93,7 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { }, [eventData]); useEffect(() => { - if (formData.startTime && formData.endTime && formData.startTime < formData.endTime) { + if (formData.startTime && formData.endTime && formData.startTime < formData.endTime && formData.startTime >= "07:00" && formData.endTime <= "23:00") { // if (isEdit) { // // setPlannedEvents([...plannedEvents.filter(e => e.id != -1 && e.id != eventData.id)]); // } @@ -265,7 +273,7 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { return (