From af4c2044e4e82e2cab78fa220893f14d643e6d3a Mon Sep 17 00:00:00 2001 From: ctc-devops <90984711+ctc-devops@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:50:17 -0700 Subject: [PATCH] Bug batch 4 fixed break time <5 issue, email template, and both option (#78) * bug 1 - only breaks w/ 5+ diff and bug 3 - taking out the both option only junior/senior * Fixed email for new user acc creation * removed console statements --------- Co-authored-by: subinqkim Co-authored-by: michellelin1 --- src/components/Authentication/SignUp.jsx | 2 +- .../Catalog/SearchFilter/filterOptions.js | 1 - src/components/EmailTemplates/emailtemplate.jsx | 8 +++++--- src/components/Events/Events.jsx | 13 ++++++++++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/Authentication/SignUp.jsx b/src/components/Authentication/SignUp.jsx index 5d68d11..95a1c98 100644 --- a/src/components/Authentication/SignUp.jsx +++ b/src/components/Authentication/SignUp.jsx @@ -48,7 +48,7 @@ const SignUp = () => { await registerWithEmailAndPassword(email, password, USER_ROLE, navigate, '/awaitConfirmation', firstName, lastName); // send email to Debbie - const subject = "placeholder"; + const subject = "New User Created Account"; const newEmail = email; await sendEmail(subject, newEmail, emailtemplate); diff --git a/src/components/Catalog/SearchFilter/filterOptions.js b/src/components/Catalog/SearchFilter/filterOptions.js index 7ef251c..f32aefd 100644 --- a/src/components/Catalog/SearchFilter/filterOptions.js +++ b/src/components/Catalog/SearchFilter/filterOptions.js @@ -6,7 +6,6 @@ const seasonOptions = [ const yearOptions = [ { value: 'junior', name: 'Junior' }, { value: 'senior', name: 'Senior' }, - { value: 'both', name: 'Both' }, ]; const subjectOptions = [ { value: 'life skills', name: 'Life Skills' }, diff --git a/src/components/EmailTemplates/emailtemplate.jsx b/src/components/EmailTemplates/emailtemplate.jsx index cafbeab..f5bf224 100644 --- a/src/components/EmailTemplates/emailtemplate.jsx +++ b/src/components/EmailTemplates/emailtemplate.jsx @@ -1,13 +1,15 @@ //import React from 'react'; -import { Email, Item, Span, A } from 'react-html-email'; +import { Email, Item, Span } from 'react-html-email'; const emailTemplate = ({newEmail}) => ( Hello Debbie, - A user with the email {newEmail} has created an account and is waiting for your approval. - react-html-email. + + A user with the email {newEmail} has created an account and is waiting for your approval. + + Thank you. diff --git a/src/components/Events/Events.jsx b/src/components/Events/Events.jsx index fd3a462..85b4938 100644 --- a/src/components/Events/Events.jsx +++ b/src/components/Events/Events.jsx @@ -36,7 +36,18 @@ const Events = ({ eventData }) => { eventDataWithBreaks.push(currentEvent); const currEnd = currentEvent.endTime.split(':').slice(0,2).join(":"); const nextStart = nextEvent.startTime.split(':').slice(0,2).join(":"); - if (currEnd < nextStart) { + + const endHour = currEnd.split(':')[0] + const endMin = currEnd.split(':')[1] + const convertTimeToMin = (hour, min) => { + return parseInt(hour) * 60 + parseInt(min); + }; + const startHour = nextStart.split(':')[0] + const startMin = nextStart.split(':')[1] + + const timeDiff = convertTimeToMin(startHour, startMin) - convertTimeToMin(endHour, endMin); + if (currEnd < nextStart && timeDiff >= 5) { + console.log("break"); eventDataWithBreaks.push({ id: maxId, startTime: currentEvent.endTime,