Skip to content

Commit a980239

Browse files
authored
Release/2.2.0 (#785)
1 parent fdc93d5 commit a980239

10 files changed

Lines changed: 139 additions & 83 deletions

File tree

docs/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.2.0](https://github.com/hackmcgill/dashboard/tree/2.2.0) - 2020-01-01
9+
10+
### Added
11+
12+
- Add application creation prevention past the deadline
13+
14+
### Changed
15+
16+
- Updated layout for confirm email page
17+
818
## [2.1.0](https://github.com/hackmcgill/dashboard/tree/2.1.0) - 2019-12-31
919

1020
### Added

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hackerapi-frontend",
33
"homepage": "https://app.mchacks.ca",
4-
"version": "2.1.0",
4+
"version": "2.2.0",
55
"private": true,
66
"dependencies": {
77
"@rebass/grid": "^6.0.0-7",

src/assets/images/telescope.svg

Lines changed: 21 additions & 0 deletions
Loading

src/config/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export const WITHDRAWN_STATUS_TEXT =
6464
export const CHECKED_IN_STATUS_TEXT = 'You’re checked-in and ready to go!';
6565

6666
// Application management
67+
export const APPLICATION_CLOSE_TIME = 1578070799000; // Jan 3, 2020 11:59:59PM EST
68+
export const DEADLINE_PASSED_LABEL =
69+
'Sorry, we are no longer accepting applications at this time.';
6770
export const BARRIERS_LABEL = 'Would you require any accommodations?';
6871
export const BUS_REQUEST_LABEL = 'Will you require a seat on a bus?';
6972
export const BUS_REQUEST_SUBTITLE =

src/features/Account/ConfirmAccountContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface IConfirmAccountState {
2525
class ConfirmAccountContainer extends React.Component<
2626
{},
2727
IConfirmAccountState
28-
> {
28+
> {
2929
constructor(props: {}) {
3030
super(props);
3131
this.state = {

src/features/Account/ConfirmationEmailSentComponent.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as React from 'react';
44
import Helmet from 'react-helmet';
55

66
import { APIResponse, Auth } from '../../api';
7-
import constructionSVG from '../../assets/images/construction.svg';
87
import { EMAIL_SENT, HACKATHON_NAME, RESEND_CONF_EMAIL } from '../../config';
98
import {
109
Button,
@@ -16,14 +15,16 @@ import {
1615
import ValidationErrorGenerator from '../../shared/Form/validationErrorGenerator';
1716
import WithToasterContainer from '../../shared/HOC/withToaster';
1817

18+
import telescope from '../../assets/images/telescope.svg';
19+
1920
interface IConfirmationEmailSentState {
2021
buttonDisabled: boolean;
2122
}
2223

2324
class ConfirmationEmailSentComponent extends React.Component<
2425
{},
2526
IConfirmationEmailSentState
26-
> {
27+
> {
2728
private sendDelay: number;
2829

2930
constructor(props: {}) {
@@ -48,17 +49,17 @@ class ConfirmationEmailSentComponent extends React.Component<
4849
<Flex alignItems={'center'} flexDirection={'column'}>
4950
<Box>
5051
<Image
51-
src={constructionSVG}
52-
imgHeight={'6rem'}
53-
padding={'0.5rem'}
52+
src={telescope}
53+
imgHeight={'11rem'}
54+
padding={'0 0 30px 0'}
5455
/>
5556
</Box>
5657
<Box>
57-
<H1 fontSize={'48px'}>Confirm your Email</H1>
58+
<H1 fontSize={'48px'} textAlign={'center'}>Confirm your Email</H1>
5859
</Box>
5960
</Flex>
60-
<MaxWidthBox width={1} fontSize={[2, 3, 4]} mb={'20px'}>
61-
<Paragraph paddingBottom={'32px'} textAlign={'center'}>
61+
<MaxWidthBox width={1} fontSize={[2, 3, 4]} mb={'28px'}>
62+
<Paragraph textAlign={'center'}>
6263
Please check your inbox for a confirmation email. Click the link in
6364
the email to confirm your email address.
6465
</Paragraph>

src/features/Application/ManageApplicationContainer.tsx

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ interface IManageApplicationState {
6666
hackerDetails: IHacker;
6767
pageNumber: number;
6868
resume?: File;
69+
loaded: boolean;
6970
}
7071

7172
interface IManageApplicationProps {
@@ -81,6 +82,7 @@ class ManageApplicationContainer extends React.Component<
8182
mode: props.mode,
8283
submitted: false,
8384
submitting: false,
85+
loaded: false,
8486
pageNumber: 1,
8587
hackerDetails: {
8688
id: '',
@@ -147,74 +149,73 @@ class ManageApplicationContainer extends React.Component<
147149
this.setState({ mode: ManageApplicationModes.CREATE });
148150
}
149151
}
152+
this.setState({ loaded: true });
150153
}
151154

152155
public render() {
153-
const { mode, hackerDetails, submitted, pageNumber } = this.state;
154-
return submitted ? (
155-
<Redirect to={FrontendRoute.HOME_PAGE} />
156-
) : (
157-
// <HorizontalSpacer paddingLeft={'20%'}>
158-
<MaxWidthBox m={'auto'} maxWidth={'500px'}>
159-
{/* <Sidebar
160-
currentPage="Application"
161-
status={this.state.hackerDetails.status}
162-
confirmed={true}
163-
/> */}
164-
<BackgroundImage
165-
right={'10%'}
166-
top={'178px'}
167-
src={Drone}
168-
imgHeight={'133px'}
169-
position={'fixed' as 'fixed'}
170-
/>
171-
<BackgroundImage
172-
left={'5%'}
173-
bottom={'5%'}
174-
src={Bulby}
175-
imgHeight={'290px'}
176-
position={'fixed' as 'fixed'}
177-
/>
178-
<Helmet>
179-
<title>
180-
{mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'}{' '}
181-
Application | {CONSTANTS.HACKATHON_NAME}
182-
</title>
183-
</Helmet>
184-
<MaxWidthBox maxWidth={'500px'} m={'auto'}>
185-
<H1
186-
color={theme.colors.red}
187-
fontSize={'30px'}
188-
textAlign={'left'}
189-
marginTop={'0px'}
190-
marginBottom={'20px'}
191-
marginLeft={'0px'}
192-
paddingBottom={'20px'}
193-
paddingTop={'70px'}
194-
>
195-
{mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'} your
196-
Application
197-
</H1>
198-
<FormDescription>{CONSTANTS.REQUIRED_DESCRIPTION}</FormDescription>
156+
const { mode, hackerDetails, submitted, pageNumber, loaded } = this.state;
157+
return loaded ? (
158+
// If application creation deadline of Jan 3, 2020 11:59:59PM EST has passed or form is submitted, return user to the home page
159+
(Date.now() > CONSTANTS.APPLICATION_CLOSE_TIME &&
160+
mode === ManageApplicationModes.CREATE) ||
161+
submitted ? (
162+
<Redirect to={FrontendRoute.HOME_PAGE} />
163+
) : (
164+
<MaxWidthBox m={'auto'} maxWidth={'500px'}>
165+
<BackgroundImage
166+
right={'10%'}
167+
top={'178px'}
168+
src={Drone}
169+
imgHeight={'133px'}
170+
position={'fixed' as 'fixed'}
171+
/>
172+
<BackgroundImage
173+
left={'5%'}
174+
bottom={'5%'}
175+
src={Bulby}
176+
imgHeight={'290px'}
177+
position={'fixed' as 'fixed'}
178+
/>
179+
<Helmet>
180+
<title>
181+
{mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'}{' '}
182+
Application | {CONSTANTS.HACKATHON_NAME}
183+
</title>
184+
</Helmet>
185+
<MaxWidthBox maxWidth={'500px'} m={'auto'}>
186+
<H1
187+
color={theme.colors.red}
188+
fontSize={'30px'}
189+
textAlign={'left'}
190+
marginTop={'0px'}
191+
marginBottom={'20px'}
192+
marginLeft={'0px'}
193+
paddingBottom={'20px'}
194+
paddingTop={'70px'}
195+
>
196+
{mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'} your
197+
Application
198+
</H1>
199+
<FormDescription>{CONSTANTS.REQUIRED_DESCRIPTION}</FormDescription>
200+
</MaxWidthBox>
201+
<Formik
202+
enableReinitialize={true}
203+
initialValues={{
204+
hacker: hackerDetails,
205+
resume: this.state.resume ? this.state.resume : undefined,
206+
pageNumber,
207+
}}
208+
onSubmit={this.handleSubmit}
209+
onReset={this.previousPage}
210+
render={this.renderFormik}
211+
validationSchema={getValidationSchema(
212+
mode === ManageApplicationModes.CREATE,
213+
this.state.pageNumber
214+
)}
215+
/>
199216
</MaxWidthBox>
200-
<Formik
201-
enableReinitialize={true}
202-
initialValues={{
203-
hacker: hackerDetails,
204-
resume: this.state.resume ? this.state.resume : undefined,
205-
pageNumber,
206-
}}
207-
onSubmit={this.handleSubmit}
208-
onReset={this.previousPage}
209-
render={this.renderFormik}
210-
validationSchema={getValidationSchema(
211-
mode === ManageApplicationModes.CREATE,
212-
this.state.pageNumber
213-
)}
214-
/>
215-
</MaxWidthBox>
216-
// </HorizontalSpacer>
217-
);
217+
)
218+
) : null;
218219
}
219220

220221
/**

src/features/Nav/Navbar.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// import { Box } from '@rebass/grid';
22
import * as React from 'react';
3+
import * as CONSTANTS from '../../config/constants';
34

45
import { slide as Menu } from 'react-burger-menu';
56
import { Hacker } from '../../api';
@@ -31,7 +32,7 @@ interface INavbarState {
3132
export default class Navbar extends React.Component<
3233
INavbarProps,
3334
INavbarState
34-
> {
35+
> {
3536
constructor(props: INavbarProps) {
3637
super(props);
3738
this.state = {
@@ -97,12 +98,17 @@ export default class Navbar extends React.Component<
9798
>
9899
Profile
99100
</NavLink>
100-
<NavLink
101-
href={route[2]}
102-
className={this.props.activePage === 'application' ? 'active' : ''}
103-
>
104-
Application
105-
</NavLink>
101+
{Date.now() < CONSTANTS.APPLICATION_CLOSE_TIME ||
102+
status !== HackerStatus.HACKER_STATUS_NONE ? (
103+
<NavLink
104+
href={route[2]}
105+
className={
106+
this.props.activePage === 'application' ? 'active' : ''
107+
}
108+
>
109+
Application
110+
</NavLink>
111+
) : null}
106112
</>
107113
);
108114
}

src/features/Status/StatusPage.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class StatusPage extends React.Component<IStatusPageProps, {}> {
6363
<Button type="button">View/Edit Application</Button>
6464
</LinkDuo>
6565
</Flex>
66-
) : (
66+
) : Date.now() < CONSTANTS.APPLICATION_CLOSE_TIME ? (
6767
<Flex
6868
flexDirection={'column'}
6969
style={{ marginTop: '1em' }}
@@ -80,6 +80,20 @@ class StatusPage extends React.Component<IStatusPageProps, {}> {
8080
<Button type="button">Apply</Button>
8181
</LinkDuo>
8282
</Flex>
83+
) : (
84+
<Flex
85+
flexDirection={'column'}
86+
style={{ marginTop: '1em' }}
87+
alignItems={'center'}
88+
>
89+
<Paragraph
90+
color={theme.colors.black80}
91+
textAlign={'center'}
92+
marginBottom={'3rem'}
93+
>
94+
{CONSTANTS.DEADLINE_PASSED_LABEL}
95+
</Paragraph>
96+
</Flex>
8397
)}
8498
</div>
8599
) : (

0 commit comments

Comments
 (0)