Skip to content

Commit

Permalink
Merge branch 'dev' into 71-notifications-should-use-users-names
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatMegamind authored Apr 18, 2024
2 parents af63463 + 457301b commit c967ec3
Show file tree
Hide file tree
Showing 15 changed files with 267 additions and 117 deletions.
File renamed without changes
3 changes: 3 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.Windows-PSOption {
color: black;
}
2 changes: 1 addition & 1 deletion src/components/Authentication/SignUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions src/components/Catalog/DeleteEventModal/DeleteEventModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ const DeleteEventModal = ({ isOpen, onClose, deleteItemId, setDataShouldRevalida
<Modal isOpen={isOpen} onClose={onClose}>
<ModalOverlay />
<ModalContent>
<ModalHeader>Confirm Delete</ModalHeader>
<ModalHeader>Remove Event?</ModalHeader>
<ModalCloseButton />
<ModalBody>Are you sure you want to delete this row?</ModalBody>
<ModalBody>Are you sure you want to delete this event? You cannot undo this action afterward.</ModalBody>
<ModalFooter>
<Button onClick={() => handleConfirmDelete(deleteItemId)}>Delete</Button>
<Button onClick={onClose}>Cancel</Button>
<Button onClick={onClose} mr={2}>Cancel</Button>
<Button onClick={() => handleConfirmDelete(deleteItemId)} colorScheme='red'>Delete</Button>
</ModalFooter>
</ModalContent>
</Modal>
Expand Down
1 change: 0 additions & 1 deletion src/components/Catalog/SearchFilter/filterOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
8 changes: 5 additions & 3 deletions src/components/EmailTemplates/emailtemplate.jsx
Original file line number Diff line number Diff line change
@@ -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}) => (
<Email title="New User Account Approval">
<Item align="center">
<Span fontSize={20}>
Hello Debbie,
A user with the email {newEmail} has created an account and is waiting for your approval.
<A href="https://github.com/chromakode/react-html-email">react-html-email</A>.

A user with the email {newEmail} has created an account and is waiting for your approval.

Thank you.
</Span>
</Item>
</Email>
Expand Down
6 changes: 5 additions & 1 deletion src/components/Events/DailyEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import PropTypes from 'prop-types';
import { Box, Flex, Text, Grid, Button, Spacer } from '@chakra-ui/react';
import { useState } from 'react';
import { NPOBackend } from '../../utils/auth_utils.js';
import AUTH_ROLES from '../../utils/auth_config.js';
import { useAuthContext } from '../../common/AuthContext.jsx';
const { USER_ROLE } = AUTH_ROLES.AUTH_ROLES;

const DailyEvent = ({ id, startTime, endTime, eventTitle, confirmed, description }) => {
const [confirmEvent, setConfirmEvent] = useState(confirmed);
const {currentUser} = useAuthContext();

let border_color = '#2B93D1';
let background_color = '#F7FAFC';
Expand Down Expand Up @@ -55,7 +59,7 @@ const DailyEvent = ({ id, startTime, endTime, eventTitle, confirmed, description
<Grid gap={2}>
<div></div>
<div></div>
<Button bg="#FBD38D" textColor="#2D3748" size="sm" onClick={handleConfirm}>
<Button bg="#FBD38D" textColor="#2D3748" size="sm" onClick={handleConfirm} visibility={currentUser.type == USER_ROLE ? 'hidden' : 'visible'}>
Confirm
</Button>
</Grid>
Expand Down
8 changes: 6 additions & 2 deletions src/components/Events/EventInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import { DeleteIcon } from '@chakra-ui/icons';
import { LuPen } from 'react-icons/lu';
import PlannerModal from '../Planner/PlannerModal';
import { NPOBackend } from '../../utils/auth_utils';
import AUTH_ROLES from '../../utils/auth_config.js';
import { useAuthContext } from '../../common/AuthContext.jsx';
const { USER_ROLE } = AUTH_ROLES.AUTH_ROLES;

const EventInfo = ({ dayId, eventDate, day, startTime, endTime, location, notes, setShouldDataRevalidate }) => {
const { isOpen: isOpenPlanner, onOpen: onOpenPlanner, onClose: onClosePlanner } = useDisclosure();
const { isOpen: isOpenDelete, onOpen: onOpenDelete, onClose: onCloseDelete } = useDisclosure();
const toast = useToast();
const {currentUser} = useAuthContext();

const handlePlannerClose = () => {
setShouldDataRevalidate(true);
Expand Down Expand Up @@ -49,10 +53,10 @@ const EventInfo = ({ dayId, eventDate, day, startTime, endTime, location, notes,
<Text whiteSpace="pre-wrap" mb="2rem">{notes ? notes : 'No notes.'}</Text>

<HStack mt="auto">
<IconButton bg="white" onClick={onOpenPlanner}>
<IconButton bg="white" onClick={onOpenPlanner} visibility={currentUser.type === USER_ROLE ? 'hidden' : 'visible'}>
<LuPen color='#A0AEC0'/>
</IconButton>
<IconButton bg="white" onClick={onOpenDelete}>
<IconButton bg="white" onClick={onOpenDelete} visibility={currentUser.type === USER_ROLE ? 'hidden' : 'visible'}>
<DeleteIcon color='#A0AEC0'/>
</IconButton>
</HStack>
Expand Down
13 changes: 12 additions & 1 deletion src/components/Events/Events.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Navbar = ({ hasLoaded, isAdmin }) => {
position={'sticky'}
as={'nav'}
>
<Image src="src/Logo.svg" marginRight={'48px'}></Image>
<Image src="/Logo.svg" marginRight={'48px'}></Image>
{makeNavTabs('Schedule', '/publishedSchedule')}
{makeNavTabs('Catalog', '/catalog')}
{makeNavTabs('Accounts', '/accounts')}
Expand All @@ -68,7 +68,7 @@ const Navbar = ({ hasLoaded, isAdmin }) => {
position={'sticky'}
as={'nav'}
>
<Image src="src/Logo.svg" marginRight={'48px'}></Image>
<Image src="/Logo.svg" marginRight={'48px'}></Image>
{makeNavTabs('Schedule', '/publishedSchedule')}

<Spacer />
Expand Down
Loading

0 comments on commit c967ec3

Please sign in to comment.