Skip to content

More bug fixes for TH 25 #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 47 additions & 44 deletions pages/teams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,53 +150,56 @@ export default function ViewTeams(props: SSRDataAuth<TeamData>['props']) {
<Menu />
<WaveHeader variant="light" />
<div>

<WaveFooter />
<FloatingDiv>
<ContentHeader title="Team" />
{!loading ? (
<form
className={styles.buttonForm}
onClick={async (e) => {
e.preventDefault();
router.push('/teams/create');
}}
>
<RectangleButton
type="submit"
className={styles.newTeamButton}
<div className={styles.dialog}>
<FloatingDiv>
<ContentHeader title="Team" />
{!loading ? (
<form
className={styles.buttonForm}
onClick={async (e) => {
e.preventDefault();
router.push('/teams/create');
}}
>
<RectangleButton
type="submit"
className={styles.newTeamButton}
>
Create new team
</RectangleButton>
</form>
) : null}
<Collapse in={loading}>
<div className={styles.spinnerContainer}>
<CircularProgress />
</div>
</Collapse>
<div className={styles.tableHeader}>
<Typography
variant="h4"
className={styles.tableHeaderText}
>
Create new team
</RectangleButton>
</form>
) : null}
<Collapse in={loading}>
<div className={styles.spinnerContainer}>
<CircularProgress />
Open Teams
</Typography>
</div>
</Collapse>
<div className={styles.tableHeader}>
<Typography
variant="h4"
className={styles.tableHeaderText}
>
Open Teams
</Typography>
</div>
{emptyMessage}
<table className={styles.tableData}>
<tbody>
{teams
.sort((a, b) => +a._id - +b._id)
.map((team, idx) => (
<TeamTableEntry
team={team}
key={idx}
callback={checkJoinErrorCallback}
/>
))}
</tbody>
</table>
</FloatingDiv>
{emptyMessage}
<table className={styles.tableData}>
<tbody>
{teams
.sort((a, b) => +a._id - +b._id)
.map((team, idx) => (
<TeamTableEntry
team={team}
key={idx}
callback={checkJoinErrorCallback}
/>
))}
</tbody>
</table>
</FloatingDiv>
</div>
<Snackbar
open={notify === 'error' || notify === 'success'}
autoHideDuration={5000}
Expand Down
2 changes: 1 addition & 1 deletion pages/teams/details/[teamId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const TeamDescription = () => {
<>
<Menu />
<WaveHeader variant="light" />
<div>
<div className={styles.dialog}>
<WaveFooter />
<FloatingDiv>
{ownTeamFetched && !isOwnTeam ? (
Expand Down
Binary file removed public/THCodeOfConduct.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions src/actions/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export const rejectAll = (): DispatchAction => ({

export const confirm = (
signatureLiability: boolean,
signatureCodeOfConduct: boolean,
willMentor: boolean,
): DispatchAction => ({
type: DispatchActionType.USER_CONFIRM,
Expand All @@ -102,7 +101,6 @@ export const confirm = (
method: 'PUT',
body: {
signatureLiability,
signatureCodeOfConduct,
willMentor,
},
},
Expand Down
8 changes: 8 additions & 0 deletions src/components/admin/AdminDialog/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
@import '~/styles/variables.scss';
@import '~/styles/mixins.scss';

.dialog {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}

.tabs {
width: 100%;
justify-content: space-between;
Expand Down
58 changes: 30 additions & 28 deletions src/components/admin/AdminDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,36 @@ const AdminDialog = (): ReactElement => {
}, []);

return (
<FloatingDiv>
<TabContext value={tabIndex}>
<Box>
<TabList
onChange={(e, newIndex: string) => setTabIndex(newIndex)}
className={styles.tabs}
variant="scrollable"
>
<Tab label="Participants" value="0" />
<Tab label="Recruiters" value="1" />
<Tab label="Sponsors" value="2" />
<Tab label="Analytics" value="3" />
</TabList>
</Box>
<TabPanel value="0" className={styles.tabPanel}>
<ParticipantTable />
</TabPanel>
<TabPanel value="1" className={styles.tabPanel}>
<RecruiterCreationForm />
</TabPanel>
<TabPanel value="2" className={styles.tabPanel}>
<SponsorCreationForm />
</TabPanel>
<TabPanel value="3" className={styles.tabPanel}>
<AnalyticsTab />
</TabPanel>
</TabContext>
</FloatingDiv>
<div className={styles.dialog}>
<FloatingDiv>
<TabContext value={tabIndex}>
<Box>
<TabList
onChange={(e, newIndex: string) => setTabIndex(newIndex)}
className={styles.tabs}
variant="scrollable"
>
<Tab label="Participants" value="0" />
<Tab label="Recruiters" value="1" />
<Tab label="Sponsors" value="2" />
<Tab label="Analytics" value="3" />
</TabList>
</Box>
<TabPanel value="0" className={styles.tabPanel}>
<ParticipantTable />
</TabPanel>
<TabPanel value="1" className={styles.tabPanel}>
<RecruiterCreationForm />
</TabPanel>
<TabPanel value="2" className={styles.tabPanel}>
<SponsorCreationForm />
</TabPanel>
<TabPanel value="3" className={styles.tabPanel}>
<AnalyticsTab />
</TabPanel>
</TabContext>
</FloatingDiv>
</div>
)
}

Expand Down
30 changes: 2 additions & 28 deletions src/components/confirmation/ConfirmationDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Collapse,
FormControlLabel,
FormGroup,
Hidden,
IconButton,
LinearProgress,
Link,
Expand All @@ -26,7 +27,6 @@ const ConfirmationDialog = (): ReactElement => {
const [loading, setLoading] = useState(false);

const [signatureLiability, setSignatureLiability] = useState(false);
const [signatureCodeOfConduct, setSignatureCodeOfConduct] = useState(false);
const [willMentor, setWillMentor] = useState(false);

const confirmTime = useSelector(
Expand All @@ -43,7 +43,6 @@ const ConfirmationDialog = (): ReactElement => {
await dispatch(
actions.user.confirm(
signatureLiability,
signatureCodeOfConduct,
willMentor,
),
);
Expand Down Expand Up @@ -75,6 +74,7 @@ const ConfirmationDialog = (): ReactElement => {
<div className={styles.dialogText}>
<FormGroup className={styles.formGroup}>
<FormControlLabel
sx={{ ".MuiFormControlLabel-asterisk": { display: "none" } }}
control={
<Checkbox
required
Expand All @@ -100,32 +100,6 @@ const ConfirmationDialog = (): ReactElement => {
</Typography>
}
/>
<FormControlLabel
control={
<Checkbox
required
checked={signatureCodeOfConduct}
onChange={(e) =>
setSignatureCodeOfConduct(
e.target.checked,
)
}
/>
}
label={
<Typography>
I agree with the{' '}
<Link
target="_blank"
href="/THCodeOfConduct.pdf"
className={styles.link}
>
TartanHacks Code of Conduct
</Link>
.*
</Typography>
}
/>
<FormControlLabel
control={
<Checkbox
Expand Down
5 changes: 3 additions & 2 deletions src/components/dashboard/DashboardDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ const getDialogText = (status: Status): ReactElement => {
<div className={styles.dialogText}>
<Typography variant="body1">
Non-CMU students need to complete their application by
11:59pm EST, January 19th.
11:59pm EST, January 24th. The deadline to be eligible
for travel reimbursement is January 3rd.
</Typography>
</div>
<div className={styles.dialogText}>
<Typography variant="body1">
CMU students have time until January 26th.
CMU students have until January 31st.
</Typography>
</div>
</>
Expand Down
1 change: 1 addition & 0 deletions src/components/form/ApplicationForm/BasicSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ const BasicSection = ({
error={ageErrorStatus}
helperText={ageHelper}
variant="outlined"
required
fullWidth
value={age}
onChange={(e) => {
Expand Down
16 changes: 15 additions & 1 deletion src/components/form/ApplicationForm/TravelSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,22 @@ const TravelSection = ({
const [wantsTravelReimbursement, setWantsTravelReimbursement] = useState<boolean>(false);
const [travelDetails, setTravelDetails] = useState<string>('');

// Error fields
const [travelInfoErrorStatus, setTravelInfoErrorStatus] = useState(false);
const [travelInfoHelper, setTravelInfoHelper] = useState<string>('');

const validateForm = async () => {
const data: TravelFields = { wantsTravelReimbursement, travelDetails };
await dispatch(actions.application.saveTravel(data));
setValid(true);

let valid = true;
if (wantsTravelReimbursement && travelDetails.length === 0) {
setTravelInfoErrorStatus(true);
setTravelInfoHelper('Please provide travel details if you want to apply for travel reimbursement');
valid = false;
}

setValid(valid);
setValidate(false);
};

Expand Down Expand Up @@ -81,6 +93,8 @@ const TravelSection = ({
<TextField
label="Travel details"
variant="outlined"
error={travelInfoErrorStatus}
helperText={travelInfoHelper}
fullWidth
multiline
value={travelDetails}
Expand Down
8 changes: 8 additions & 0 deletions styles/ViewTeam.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
@import './variables.scss';
@import './mixins.scss';

.dialog {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}

.title {
padding-top: 30px;
font-weight: 600;
Expand Down
8 changes: 8 additions & 0 deletions styles/ViewTeams.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
@import './variables.scss';
@import './mixins.scss';

.dialog {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}

.newTeamButton {
padding: 1em 5em !important;
font-size: large !important;
Expand Down
Loading