diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4adade9fa..cb8e85193 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.2.0](https://github.com/hackmcgill/dashboard/tree/2.2.0) - 2020-01-01 + +### Added + +- Add application creation prevention past the deadline + +### Changed + +- Updated layout for confirm email page + ## [2.1.0](https://github.com/hackmcgill/dashboard/tree/2.1.0) - 2019-12-31 ### Added diff --git a/package-lock.json b/package-lock.json index e48826c81..019381e9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hackerapi-frontend", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bc4b69382..88b163baf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hackerapi-frontend", "homepage": "https://app.mchacks.ca", - "version": "2.1.0", + "version": "2.2.0", "private": true, "dependencies": { "@rebass/grid": "^6.0.0-7", diff --git a/src/assets/images/telescope.svg b/src/assets/images/telescope.svg new file mode 100644 index 000000000..4173324ae --- /dev/null +++ b/src/assets/images/telescope.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/config/constants.ts b/src/config/constants.ts index 1117e970a..ac869e30d 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -64,6 +64,9 @@ export const WITHDRAWN_STATUS_TEXT = export const CHECKED_IN_STATUS_TEXT = 'You’re checked-in and ready to go!'; // Application management +export const APPLICATION_CLOSE_TIME = 1578070799000; // Jan 3, 2020 11:59:59PM EST +export const DEADLINE_PASSED_LABEL = + 'Sorry, we are no longer accepting applications at this time.'; export const BARRIERS_LABEL = 'Would you require any accommodations?'; export const BUS_REQUEST_LABEL = 'Will you require a seat on a bus?'; export const BUS_REQUEST_SUBTITLE = diff --git a/src/features/Account/ConfirmAccountContainer.tsx b/src/features/Account/ConfirmAccountContainer.tsx index de3028b65..ec795cf94 100644 --- a/src/features/Account/ConfirmAccountContainer.tsx +++ b/src/features/Account/ConfirmAccountContainer.tsx @@ -25,7 +25,7 @@ interface IConfirmAccountState { class ConfirmAccountContainer extends React.Component< {}, IConfirmAccountState - > { +> { constructor(props: {}) { super(props); this.state = { diff --git a/src/features/Account/ConfirmationEmailSentComponent.tsx b/src/features/Account/ConfirmationEmailSentComponent.tsx index 4f5f21b7d..de059285b 100644 --- a/src/features/Account/ConfirmationEmailSentComponent.tsx +++ b/src/features/Account/ConfirmationEmailSentComponent.tsx @@ -4,7 +4,6 @@ import * as React from 'react'; import Helmet from 'react-helmet'; import { APIResponse, Auth } from '../../api'; -import constructionSVG from '../../assets/images/construction.svg'; import { EMAIL_SENT, HACKATHON_NAME, RESEND_CONF_EMAIL } from '../../config'; import { Button, @@ -16,6 +15,8 @@ import { import ValidationErrorGenerator from '../../shared/Form/validationErrorGenerator'; import WithToasterContainer from '../../shared/HOC/withToaster'; +import telescope from '../../assets/images/telescope.svg'; + interface IConfirmationEmailSentState { buttonDisabled: boolean; } @@ -23,7 +24,7 @@ interface IConfirmationEmailSentState { class ConfirmationEmailSentComponent extends React.Component< {}, IConfirmationEmailSentState -> { + > { private sendDelay: number; constructor(props: {}) { @@ -48,17 +49,17 @@ class ConfirmationEmailSentComponent extends React.Component< -

Confirm your Email

+

Confirm your Email

- - + + Please check your inbox for a confirmation email. Click the link in the email to confirm your email address. diff --git a/src/features/Application/ManageApplicationContainer.tsx b/src/features/Application/ManageApplicationContainer.tsx index 5423b3c6a..9a0c4c4d9 100644 --- a/src/features/Application/ManageApplicationContainer.tsx +++ b/src/features/Application/ManageApplicationContainer.tsx @@ -66,6 +66,7 @@ interface IManageApplicationState { hackerDetails: IHacker; pageNumber: number; resume?: File; + loaded: boolean; } interface IManageApplicationProps { @@ -81,6 +82,7 @@ class ManageApplicationContainer extends React.Component< mode: props.mode, submitted: false, submitting: false, + loaded: false, pageNumber: 1, hackerDetails: { id: '', @@ -147,74 +149,73 @@ class ManageApplicationContainer extends React.Component< this.setState({ mode: ManageApplicationModes.CREATE }); } } + this.setState({ loaded: true }); } public render() { - const { mode, hackerDetails, submitted, pageNumber } = this.state; - return submitted ? ( - - ) : ( - // - - {/* */} - - - - - {mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'}{' '} - Application | {CONSTANTS.HACKATHON_NAME} - - - -

- {mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'} your - Application -

- {CONSTANTS.REQUIRED_DESCRIPTION} + const { mode, hackerDetails, submitted, pageNumber, loaded } = this.state; + return loaded ? ( + // If application creation deadline of Jan 3, 2020 11:59:59PM EST has passed or form is submitted, return user to the home page + (Date.now() > CONSTANTS.APPLICATION_CLOSE_TIME && + mode === ManageApplicationModes.CREATE) || + submitted ? ( + + ) : ( + + + + + + {mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'}{' '} + Application | {CONSTANTS.HACKATHON_NAME} + + + +

+ {mode === ManageApplicationModes.CREATE ? 'Create' : 'Edit'} your + Application +

+ {CONSTANTS.REQUIRED_DESCRIPTION} +
+
- -
- //
- ); + ) + ) : null; } /** diff --git a/src/features/Nav/Navbar.tsx b/src/features/Nav/Navbar.tsx index cb27e8321..b28e70137 100644 --- a/src/features/Nav/Navbar.tsx +++ b/src/features/Nav/Navbar.tsx @@ -1,5 +1,6 @@ // import { Box } from '@rebass/grid'; import * as React from 'react'; +import * as CONSTANTS from '../../config/constants'; import { slide as Menu } from 'react-burger-menu'; import { Hacker } from '../../api'; @@ -31,7 +32,7 @@ interface INavbarState { export default class Navbar extends React.Component< INavbarProps, INavbarState - > { +> { constructor(props: INavbarProps) { super(props); this.state = { @@ -97,12 +98,17 @@ export default class Navbar extends React.Component< > Profile - - Application - + {Date.now() < CONSTANTS.APPLICATION_CLOSE_TIME || + status !== HackerStatus.HACKER_STATUS_NONE ? ( + + Application + + ) : null} ); } diff --git a/src/features/Status/StatusPage.tsx b/src/features/Status/StatusPage.tsx index f6f874b35..9e234160d 100644 --- a/src/features/Status/StatusPage.tsx +++ b/src/features/Status/StatusPage.tsx @@ -63,7 +63,7 @@ class StatusPage extends React.Component { - ) : ( + ) : Date.now() < CONSTANTS.APPLICATION_CLOSE_TIME ? ( { + ) : ( + + + {CONSTANTS.DEADLINE_PASSED_LABEL} + + )} ) : (