From 54542b40a3c7d4ebf198089b71d38db3998754d5 Mon Sep 17 00:00:00 2001 From: cherhchen <54284307+cherhchen@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:29:24 -0700 Subject: [PATCH 1/6] 83 final day planner adjustments (#91) * finished? * fixed one day off bug? --------- Co-authored-by: chloecheng8 <30807247+chloecheng8@users.noreply.github.com> Co-authored-by: ThatMegamind <92563733+ThatMegamind@users.noreply.github.com> Co-authored-by: Cheryl Chen Co-authored-by: michellelin1 <66575725+michellelin1@users.noreply.github.com> --- .../AddEventToPublishedScheduleForm.jsx | 3 ++- src/components/Catalog/CatalogTable.jsx | 3 ++- src/components/Planner/PlannerEvents/PlannerEvents.jsx | 7 ++++++- src/pages/PublishedSchedule/PublishedSchedule.jsx | 6 ++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx b/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx index 5e8d3b7..4f875f4 100644 --- a/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx +++ b/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx @@ -169,7 +169,8 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { variant: 'subtle', position: 'top-right', containerStyle: { - mt: '6rem', + mt: '3rem', + mr: '2rem' }, duration: 3000, isClosable: true, diff --git a/src/components/Catalog/CatalogTable.jsx b/src/components/Catalog/CatalogTable.jsx index 8481ce1..aba2132 100644 --- a/src/components/Catalog/CatalogTable.jsx +++ b/src/components/Catalog/CatalogTable.jsx @@ -130,7 +130,8 @@ const CatalogTable = ({ tableData, handleActionClick, onDayPlanner, setCurrEvent : { const [dataShouldRevalidate, setShouldDataRevalidate] = useState(false); const plannedEvents = plannedEventsContext[0]; + const getUTCDate = (eventDate) => { + const utcDate = new Date(eventDate); + return new Date(utcDate.getTime() + utcDate.getTimezoneOffset() * 60000); + } + const getDayData = async () => { try { // console.log('getDayData'); const response = await NPOBackend.get(`/day/${dayId}`); const responseData = response.data[0]; const [datePart] = responseData.eventDate.split('T'); - const dateObj = new Date(responseData.eventDate); + const dateObj = getUTCDate(responseData.eventDate); // console.log(dateObj); setDateHeader(dateObj.toLocaleDateString({ year: 'numeric', month: 'short', day: '2-digit' })); setDayData({id: responseData.id, eventDate: datePart, location: responseData.location, details: responseData.notes}); diff --git a/src/pages/PublishedSchedule/PublishedSchedule.jsx b/src/pages/PublishedSchedule/PublishedSchedule.jsx index a0aad50..1f80f04 100644 --- a/src/pages/PublishedSchedule/PublishedSchedule.jsx +++ b/src/pages/PublishedSchedule/PublishedSchedule.jsx @@ -38,7 +38,9 @@ const PublishedSchedule = () => { data.unshift(curSeason); } - setSelectedSeason(curSeason); + if (selectedSeason === '') { + setSelectedSeason(curSeason); + } const seasonOrder = ['Fall', 'Summer', 'Spring']; data.sort((a, b) => { @@ -54,7 +56,7 @@ const PublishedSchedule = () => { }; renderTable(); - }, [currentUser, curSeason]); + }, [currentUser, curSeason, allSeasons]); //update chakra table container accordingly return ( From f9581f0930ff2a9fbc74e51ae0dd3a002fffcd8f Mon Sep 17 00:00:00 2001 From: Ethan Ho Date: Mon, 29 Apr 2024 19:01:55 -0700 Subject: [PATCH 2/6] 81 final catalog adjustments frontend (#88) * locked catalog col width to 20vw (prev max width) * fixed a bug with host col --------- Co-authored-by: michellelin1 <66575725+michellelin1@users.noreply.github.com> --- src/components/Catalog/CatalogTable.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Catalog/CatalogTable.jsx b/src/components/Catalog/CatalogTable.jsx index aba2132..d14040e 100644 --- a/src/components/Catalog/CatalogTable.jsx +++ b/src/components/Catalog/CatalogTable.jsx @@ -20,9 +20,9 @@ const CatalogTable = ({ tableData, handleActionClick, onDayPlanner, setCurrEvent > - Event - Host - Tags + Event + Host + Tags @@ -30,13 +30,13 @@ const CatalogTable = ({ tableData, handleActionClick, onDayPlanner, setCurrEvent {tableData.map(({ id, host, title, eventType, subject, year, season, description}) => ( - {title} - {description} + {title} + {description} - + {host} - + {season[0] !== '' && season.map((seasonItem, index) => ( Date: Tue, 30 Apr 2024 20:56:09 -0700 Subject: [PATCH 3/6] increased size of tags and fixed confirm button bug (#93) --- src/components/Dropdown/Dropdown.jsx | 1 + src/components/Events/DailyEvent.jsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Dropdown/Dropdown.jsx b/src/components/Dropdown/Dropdown.jsx index af5860a..53bb138 100644 --- a/src/components/Dropdown/Dropdown.jsx +++ b/src/components/Dropdown/Dropdown.jsx @@ -75,6 +75,7 @@ const Dropdown = ({ options, filter, selected, defaults, badgeColor, width }) => borderRadius="10rem" fontWeight="normal" px="0.5rem" + py="0.2rem" mr="0.125rem" > {option} diff --git a/src/components/Events/DailyEvent.jsx b/src/components/Events/DailyEvent.jsx index 436dc07..c991c5a 100644 --- a/src/components/Events/DailyEvent.jsx +++ b/src/components/Events/DailyEvent.jsx @@ -18,6 +18,7 @@ const DailyEvent = ({ event }) => { useEffect(() => { setEventData(event); + setConfirmEvent(event.confirmed); if (event.year) { if( event.year.length == 2) @@ -73,11 +74,11 @@ const DailyEvent = ({ event }) => { return ( From 831b37c160afdfd887f5e12577c0965ac2025d8d Mon Sep 17 00:00:00 2001 From: ctc-devops <90984711+ctc-devops@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:30:48 -0700 Subject: [PATCH 4/6] Login Errors + Event Field Terminology (#89) * Create a pull trequest for branch 85-login-errors-event-field-terminology * Fixed login errors, event field terms, added a confirmation screen for forget password * reset + create new pwd, new pwd confirmation, account pending screen * email verification screen * remove createnewpassword from app.jsx --------- Co-authored-by: Lana Ramadan Co-authored-by: michellelin1 <66575725+michellelin1@users.noreply.github.com> --- src/App.jsx | 7 + .../AddEventToPublishedScheduleForm.jsx | 2 +- .../Authentication/AccountPendingApproval.jsx | 33 ++++ .../Authentication/CreateNewPassword.jsx | 145 +++++++++++++++ .../CreateNewPasswordConfirmation.jsx | 33 ++++ src/components/Authentication/EmailAction.jsx | 5 +- .../Authentication/ForgotPassword.jsx | 176 ++++++++++-------- .../ForgotPasswordConfirmation.jsx | 41 ++++ src/components/Authentication/Login.jsx | 17 +- .../Authentication/ResetPassword.jsx | 59 ------ src/components/Authentication/SignUp.jsx | 54 +++--- src/components/Authentication/VerifyEmail.jsx | 62 ++++-- src/pages/Catalog/Catalog.jsx | 4 +- 13 files changed, 448 insertions(+), 190 deletions(-) create mode 100644 src/components/Authentication/AccountPendingApproval.jsx create mode 100644 src/components/Authentication/CreateNewPassword.jsx create mode 100644 src/components/Authentication/CreateNewPasswordConfirmation.jsx create mode 100644 src/components/Authentication/ForgotPasswordConfirmation.jsx delete mode 100644 src/components/Authentication/ResetPassword.jsx diff --git a/src/App.jsx b/src/App.jsx index fdb9d98..c1528d0 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,7 +7,10 @@ import Logout from './components/Authentication/Logout'; import SignUp from './components/Authentication/SignUp'; import ForgotPassword from './components/Authentication/ForgotPassword'; import EmailAction from './components/Authentication/EmailAction'; +import AccountPendingApproval from './components/Authentication/EmailAction'; import AwaitConfirmation from './components/Authentication/AwaitConfirmation'; +import ForgotPasswordConfirmation from './components/Authentication/ForgotPasswordConfirmation'; +import CreateNewPasswordConfirmation from './components/Authentication/CreateNewPasswordConfirmation'; import AUTH_ROLES from './utils/auth_config'; import ProtectedRoute from './utils/ProtectedRoute'; import Catalog from './pages/Catalog/Catalog'; @@ -53,8 +56,12 @@ const App = () => { } /> } /> } /> + } /> } /> } /> + } /> + } /> + { {/* SUBJECT */} - Topic + Subject { + + return ( +
+ + Account Pending Approval +
+ + + +
+
+
+ ) +}; + +export default AccountPendingApproval; diff --git a/src/components/Authentication/CreateNewPassword.jsx b/src/components/Authentication/CreateNewPassword.jsx new file mode 100644 index 0000000..7c55dbc --- /dev/null +++ b/src/components/Authentication/CreateNewPassword.jsx @@ -0,0 +1,145 @@ +import { useState } from 'react'; +import PropTypes from 'prop-types'; +import { confirmNewPassword } from '../../utils/auth_utils'; +import { FormControl, Input, Button, Center, Link, Box, Heading, Text, Alert, AlertDescription} from '@chakra-ui/react'; + +const CreateNewPassword = ({ code }) => { + const [password, setPassword] = useState(''); + const [checkPassword, setCheckPassword] = useState(''); + const [hasError, setHasError] = useState(false); + const [errorMessage, setErrorMessage] = useState(); + + const handleResetPassword = async e => { + try { + e.preventDefault(); + setHasError(false); + if (password !== checkPassword) { + throw new Error("Passwords do not match."); + } + await confirmNewPassword(code, password); + setErrorMessage(''); + setPassword(''); + window.location.replace("/createNewPasswordConfirmation"); + } catch (err) { + setHasError(true); + console.log(err.message); + if (err.code === "auth/weak-password"){ + setErrorMessage("Password must be at least 6 characters."); + } else if (err.code === "auth/invalid-action-code"){ + setErrorMessage("Link has expired."); + } else { + setErrorMessage(err.message); + } + } + }; + return ( + + + { hasError && + + { errorMessage } + + } + + +
+ + Enter New Password + Please enter a new password. +
+ + + setPassword(target.value)} + placeholder="Enter new password" + borderColor={"#CBD5E0"} + borderRadius= '3px' + type="password" + /> + setCheckPassword(target.value)} + placeholder="Re-enter password" + borderColor={"#CBD5E0"} + borderRadius= '3px' + type="password" + /> + + + + + + + + + + +
+
+
+
+ ); +}; + +CreateNewPassword.propTypes = { + code: PropTypes.string.isRequired, +}; + +export default CreateNewPassword; diff --git a/src/components/Authentication/CreateNewPasswordConfirmation.jsx b/src/components/Authentication/CreateNewPasswordConfirmation.jsx new file mode 100644 index 0000000..449f544 --- /dev/null +++ b/src/components/Authentication/CreateNewPasswordConfirmation.jsx @@ -0,0 +1,33 @@ +import { Box, Heading, Button, Center, Link} from '@chakra-ui/react'; + +const CreateNewPasswordConfirmation = () => { + + return ( +
+ + Password Successfully Reset +
+ + + +
+
+
+ ) +}; + +export default CreateNewPasswordConfirmation; diff --git a/src/components/Authentication/EmailAction.jsx b/src/components/Authentication/EmailAction.jsx index 0014d09..d50744e 100644 --- a/src/components/Authentication/EmailAction.jsx +++ b/src/components/Authentication/EmailAction.jsx @@ -1,7 +1,7 @@ // import React from 'react'; import { useLocation, Navigate } from 'react-router-dom'; import PropTypes from 'prop-types'; -import ResetPassword from './ResetPassword'; +import CreateNewPassword from './CreateNewPassword'; import VerifyEmail from './VerifyEmail'; const EmailAction = ({ redirectPath }) => { @@ -12,7 +12,8 @@ const EmailAction = ({ redirectPath }) => { if (code === null) { return ; } - return mode === 'resetPassword' ? : ; + + return mode === 'resetPassword' ? : ; }; EmailAction.propTypes = { diff --git a/src/components/Authentication/ForgotPassword.jsx b/src/components/Authentication/ForgotPassword.jsx index a368cdf..fb76236 100644 --- a/src/components/Authentication/ForgotPassword.jsx +++ b/src/components/Authentication/ForgotPassword.jsx @@ -1,104 +1,124 @@ import { useState } from 'react'; import { sendPasswordReset } from '../../utils/auth_utils'; -import { FormControl, Input, Button, Center, Link, Box, Heading, Text} from '@chakra-ui/react'; +import { FormControl, Input, Button, Center, Link, Box, Heading, Text, Alert, AlertDescription} from '@chakra-ui/react'; const ForgotPassword = () => { - const [email, setEmail] = useState(); + const [email, setEmail] = useState(''); + const [hasError, setHasError] = useState(false); const [errorMessage, setErrorMessage] = useState(); - const [confirmationMessage, setConfirmationMessage] = useState(); const handleForgotPassword = async e => { try { e.preventDefault(); await sendPasswordReset(email); - setConfirmationMessage( - 'If the email entered is associated with an account, you should receive an email to reset your password shortly.', - ); + setHasError(false); setErrorMessage(''); - setEmail(''); + window.location.replace("/forgotPasswordConfirmation"); } catch (err) { - setErrorMessage(err.message); + setHasError(true); + if (err.code === 'auth/invalid-email') { + setErrorMessage("Email could not be found. Please try again."); + } + else { + setErrorMessage(err.message); + } + console.log(err) } }; return ( -
- - Reset Password - Enter email address associated with account - {errorMessage &&

{errorMessage}

} -
- - - setEmail(target.value)} - placeholder="Email Address" - borderColor={"#CBD5E0"} - borderRadius= '3px' - /> - - + + + { hasError && + + { errorMessage } + + } + - - - - + + + + + - - - - -
- {confirmationMessage &&

{confirmationMessage}

} +
+ + + +
- ); }; diff --git a/src/components/Authentication/ForgotPasswordConfirmation.jsx b/src/components/Authentication/ForgotPasswordConfirmation.jsx new file mode 100644 index 0000000..1059667 --- /dev/null +++ b/src/components/Authentication/ForgotPasswordConfirmation.jsx @@ -0,0 +1,41 @@ +import { Button, Center, Link, Box, Heading, Text} from '@chakra-ui/react'; + +const ForgotPasswordConfirmation = () => { + return ( + +
+ + Instructions Sent + Please check inbox for password reset instructions. + + + + +
+
+ ); +}; + +export default ForgotPasswordConfirmation; diff --git a/src/components/Authentication/Login.jsx b/src/components/Authentication/Login.jsx index 54d1f60..44f191d 100644 --- a/src/components/Authentication/Login.jsx +++ b/src/components/Authentication/Login.jsx @@ -4,7 +4,7 @@ import { Cookies, withCookies } from '../../utils/cookie_utils'; import { logInWithEmailAndPassword, useNavigate } from '../../utils/auth_utils'; // import { logInWithEmailAndPassword , signInWithGoogle, useNavigate } from '../utils/auth_utils'; import { Box, Heading, Text, FormControl, Input, Button, Center, Link, Alert, AlertDescription } from '@chakra-ui/react'; -// import styles from +// import styles from const Login = ({ cookies }) => { const navigate = useNavigate(); @@ -20,7 +20,12 @@ const Login = ({ cookies }) => { window.location.reload(true); } catch (err) { setHasError(true); - setErrorMessage(err.message); + if (err.code === 'auth/invalid-credential') { + setErrorMessage("Account could not be found with given information. Please check your username or password and try again."); + } + else { + setErrorMessage(err.message); + } } }; @@ -28,7 +33,7 @@ const Login = ({ cookies }) => { { hasError && - { setEmail(target.value)} placeholder="Email" borderColor={"#CBD5E0"} @@ -68,6 +74,7 @@ const Login = ({ cookies }) => { setPassword(target.value)} placeholder="Password" borderColor={"#CBD5E0"} @@ -97,7 +104,7 @@ const Login = ({ cookies }) => { color={'#155696'} variant='outline' onMouseOver={(e) => { - e.target.style.backgroundColor = '#E0E0E0'; + e.target.style.backgroundColor = '#E0E0E0'; }} onMouseOut={(e) => { e.target.style.backgroundColor = '#FFFFFF'; @@ -119,7 +126,7 @@ const Login = ({ cookies }) => { backgroundColor={'#243268'} color={'#ffffff'} onMouseOver={(e) => { - e.target.style.backgroundColor = '#1A2559'; + e.target.style.backgroundColor = '#1A2559'; }} onMouseOut={(e) => { e.target.style.backgroundColor = '#243268'; diff --git a/src/components/Authentication/ResetPassword.jsx b/src/components/Authentication/ResetPassword.jsx deleted file mode 100644 index 0c1ae26..0000000 --- a/src/components/Authentication/ResetPassword.jsx +++ /dev/null @@ -1,59 +0,0 @@ -import { useState } from 'react'; -import PropTypes from 'prop-types'; -import { confirmNewPassword } from '../../utils/auth_utils'; - -const ResetPassword = ({ code }) => { - const [password, setPassword] = useState(); - const [checkPassword, setCheckPassword] = useState(); - const [errorMessage, setErrorMessage] = useState(); - const [confirmationMessage, setConfirmationMessage] = useState(); - const handleResetPassword = async e => { - try { - e.preventDefault(); - if (password !== checkPassword) { - throw new Error("Passwords don't match"); - } - await confirmNewPassword(code, password); - setConfirmationMessage('Password changed. You can now sign in with your new password.'); - setErrorMessage(''); - setPassword(''); - } catch (err) { - setErrorMessage(err.message); - } - }; - return ( -
-

Reset Password

- {errorMessage &&

{errorMessage}

} - {!confirmationMessage && ( -
- setPassword(target.value)} - placeholder="New Password" - /> -
- setCheckPassword(target.value)} - placeholder="Re-enter Password" - /> -
- -
- )} - {confirmationMessage && ( -
-

{confirmationMessage}

- Back to Login -
- )} -
- ); -}; - -ResetPassword.propTypes = { - code: PropTypes.string.isRequired, -}; - -export default ResetPassword; diff --git a/src/components/Authentication/SignUp.jsx b/src/components/Authentication/SignUp.jsx index 5b9168c..b444fd3 100644 --- a/src/components/Authentication/SignUp.jsx +++ b/src/components/Authentication/SignUp.jsx @@ -6,7 +6,7 @@ import emailtemplate from '../EmailTemplates/emailtemplate'; import { Box, Heading, Text, FormControl, Button, Center, Link, Input, Alert, AlertDescription } from '@chakra-ui/react'; import AUTH_ROLES from '../../utils/auth_config'; -const { ADMIN_ROLE, USER_ROLE } = AUTH_ROLES.AUTH_ROLES; +const { USER_ROLE } = AUTH_ROLES.AUTH_ROLES; const SignUp = () => { const [firstName, setFirstName] = useState(); @@ -21,46 +21,39 @@ const SignUp = () => { const [submitted, setSubmitted] = useState(false); const navigate = useNavigate(); - + const handleSubmit = async (e) => { e.preventDefault(); + setHasError(false); try { - if (firstName === undefined) { - throw new Error("Must enter a first name."); - } - if (lastName === undefined) { - throw new Error("Must enter a last name."); - } - if (email === undefined) { - throw new Error("Must enter an email"); - } - if (password === undefined) { - throw new Error("Must enter a password."); - } if (password !== checkPassword) { throw new Error("Passwords don't match."); } - if (password.length < 6) { - throw new Error("Password must be at least 6 characters."); - } // register email and password - await registerWithEmailAndPassword(email, password, userType, navigate, '/awaitConfirmation', firstName, lastName); + await registerWithEmailAndPassword(email, password, USER_ROLE, navigate, '/awaitConfirmation', firstName, lastName); - // send email to Debbie + // send email to Debbie const subject = "New User Created Account"; const newEmail = email; await sendEmail(subject, newEmail, emailtemplate); - + setSubmitted(true); - } catch (error) { - console.log(error); - setHasError(true) - setErrorMessage(error.message); + } catch (err) { + setHasError(true); + if (err.code === 'auth/email-already-in-use') { + setErrorMessage("Account associated with email exists."); + } + else if (err.code === 'auth/weak-password') { + setErrorMessage("Password must be at least 6 characters."); + } + else { + setErrorMessage(err.message); + } } }; - + if (userType === null) { return (
@@ -86,7 +79,7 @@ const SignUp = () => { }} > + +
+
+ +
+); }; VerifyEmail.propTypes = { diff --git a/src/pages/Catalog/Catalog.jsx b/src/pages/Catalog/Catalog.jsx index 859155c..af22b14 100644 --- a/src/pages/Catalog/Catalog.jsx +++ b/src/pages/Catalog/Catalog.jsx @@ -166,8 +166,8 @@ export default function Catalog({ onDayPlanner, addExistingEventFunc, setCurrEve - - + + Date: Wed, 1 May 2024 12:37:06 -0700 Subject: [PATCH 5/6] Cleaning comments, unused values and eslint ignores (#94) * lots of cleaning comments and unused values Co-authored-by: ThatMegamind Co-authored-by: michellelin1 * fixed ps season bug --------- Co-authored-by: ThatMegamind Co-authored-by: michellelin1 Co-authored-by: michellelin1 --- src/common/AuthContext.jsx | 1 - src/components/AddDayForm/AddDayForm.jsx | 1 - .../AddEventToPublishedScheduleForm.jsx | 14 +---- src/components/Authentication/EmailAction.jsx | 1 - src/components/Authentication/Login.jsx | 2 - src/components/Authentication/Logout.jsx | 1 - src/components/Catalog/CatalogTable.jsx | 21 +------- .../CreateEventForm/CreateEventForm.jsx | 6 --- src/components/Dropdown/Dropdown.jsx | 2 - .../EmailTemplates/EmailSending.jsx | 3 -- .../EmailTemplates/emailtemplate.jsx | 1 - .../Events/PublishedScheduleTable.jsx | 5 +- .../Notifications/AccountNotification.jsx | 27 +--------- src/components/Planner/PlannerContext.jsx | 7 ++- .../Planner/PlannerEvents/PlannerEvents.jsx | 6 --- .../PlannerTimeline/PlannerTimeline.jsx | 7 --- .../Planner/RemoveTimelineEventModal.jsx | 3 -- src/pages/Catalog/Catalog.jsx | 19 ------- src/pages/PublishedSchedule/AddDayModal.jsx | 1 - .../PublishedSchedule/PublishedSchedule.jsx | 54 +++++++++++-------- src/utils/ProtectedRoute.jsx | 1 - src/utils/auth_utils.js | 6 --- 22 files changed, 43 insertions(+), 146 deletions(-) diff --git a/src/common/AuthContext.jsx b/src/common/AuthContext.jsx index 7d09983..88bf597 100644 --- a/src/common/AuthContext.jsx +++ b/src/common/AuthContext.jsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-no-constructed-context-values */ import { createContext, useState, useContext } from 'react'; import PropTypes from 'prop-types'; diff --git a/src/components/AddDayForm/AddDayForm.jsx b/src/components/AddDayForm/AddDayForm.jsx index c9d88f4..805c950 100644 --- a/src/components/AddDayForm/AddDayForm.jsx +++ b/src/components/AddDayForm/AddDayForm.jsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import { Box, FormLabel, diff --git a/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx b/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx index e0af027..cc104e1 100644 --- a/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx +++ b/src/components/AddEventToPublishedScheduleForm/AddEventToPublishedScheduleForm.jsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import { Box, FormLabel, @@ -89,14 +88,10 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { setValue('startTime', eventData.startTime); setValue('endTime', eventData.endTime); } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [eventData]); useEffect(() => { 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)]); - // } const newPlannedEvent = new PlannedEvent( -1, formData.title, @@ -109,7 +104,6 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { } else { setPlannedEvents(plannedEvents.filter(e => e.id != -1)); } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [formData]) const toast = useToast(); @@ -125,8 +119,6 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { const handleCancel = () => { if (isEdit) { - // let reAddedEvent = plannedEvents.filter(e => e.id == -1)[0]; - // reAddedEvent.id = eventData.id; const reAddedEvent = new PlannedEvent( eventData.id, eventData.title, @@ -179,16 +171,12 @@ const AddEventToPublishedScheduleForm = ({ closeForm }) => { const submitData = async (data) => { try { - // eslint-disable-next-line no-unused-vars - const { title, host, description, tentative, startTime, endTime } = data; + const { title, host, description, startTime, endTime } = data; const season = filterValues.season; const eventType = filterValues.eventType; const year = filterValues.year; const subject = filterValues.subject; - console.log('submmitted data', data, season, eventType, year, subject); - toast.closeAll(); - const catalogDataChanged = currentCatalogDataHasChanged(eventData, { title, host, diff --git a/src/components/Authentication/EmailAction.jsx b/src/components/Authentication/EmailAction.jsx index d50744e..b49e140 100644 --- a/src/components/Authentication/EmailAction.jsx +++ b/src/components/Authentication/EmailAction.jsx @@ -1,4 +1,3 @@ -// import React from 'react'; import { useLocation, Navigate } from 'react-router-dom'; import PropTypes from 'prop-types'; import CreateNewPassword from './CreateNewPassword'; diff --git a/src/components/Authentication/Login.jsx b/src/components/Authentication/Login.jsx index 44f191d..c123fd2 100644 --- a/src/components/Authentication/Login.jsx +++ b/src/components/Authentication/Login.jsx @@ -2,9 +2,7 @@ import { useState } from 'react'; import { instanceOf } from 'prop-types'; import { Cookies, withCookies } from '../../utils/cookie_utils'; import { logInWithEmailAndPassword, useNavigate } from '../../utils/auth_utils'; -// import { logInWithEmailAndPassword , signInWithGoogle, useNavigate } from '../utils/auth_utils'; import { Box, Heading, Text, FormControl, Input, Button, Center, Link, Alert, AlertDescription } from '@chakra-ui/react'; -// import styles from const Login = ({ cookies }) => { const navigate = useNavigate(); diff --git a/src/components/Authentication/Logout.jsx b/src/components/Authentication/Logout.jsx index 2186f6d..46e17da 100644 --- a/src/components/Authentication/Logout.jsx +++ b/src/components/Authentication/Logout.jsx @@ -17,7 +17,6 @@ const Logout = ({ cookies }) => { return (
- {/*

Logout

*/} {errorMessage &&

{errorMessage}

}