From fafac3b4128a0993b0de1c6e8ca3062bf1ccc14e Mon Sep 17 00:00:00 2001 From: Roald de Vries Date: Thu, 8 Dec 2016 16:59:09 +0100 Subject: Revert "[#801] Merge branch 'signup'" This reverts commit d10f607a4d40587510b0dc31b31fe4750bf4a3a3, reversing changes made to c28abba2f5b1186c671ebef508d40ffaae6d5bc5. --- web-ui/src/images/LOADING-transparent.gif | Bin 16170 -> 0 bytes web-ui/src/images/fa-sent.svg | 15 -- web-ui/src/images/favicon.png | Bin 592 -> 0 bytes web-ui/src/images/logo.svg | 30 --- web-ui/src/images/pixelated-logo-orange.svg | 29 --- .../pixelated-symbol-blue-transparent-01.png | Bin 9075 -> 0 bytes web-ui/src/images/sent_email.png | Bin 9160 -> 0 bytes web-ui/src/js/index.js | 235 --------------------- 8 files changed, 309 deletions(-) delete mode 100644 web-ui/src/images/LOADING-transparent.gif delete mode 100644 web-ui/src/images/fa-sent.svg delete mode 100644 web-ui/src/images/favicon.png delete mode 100644 web-ui/src/images/logo.svg delete mode 100644 web-ui/src/images/pixelated-logo-orange.svg delete mode 100644 web-ui/src/images/pixelated-symbol-blue-transparent-01.png delete mode 100644 web-ui/src/images/sent_email.png delete mode 100644 web-ui/src/js/index.js (limited to 'web-ui/src') diff --git a/web-ui/src/images/LOADING-transparent.gif b/web-ui/src/images/LOADING-transparent.gif deleted file mode 100644 index ac9abcde..00000000 Binary files a/web-ui/src/images/LOADING-transparent.gif and /dev/null differ diff --git a/web-ui/src/images/fa-sent.svg b/web-ui/src/images/fa-sent.svg deleted file mode 100644 index a4b4bea4..00000000 --- a/web-ui/src/images/fa-sent.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - fa-sent - Created with Sketch. - - - - - - - - - - \ No newline at end of file diff --git a/web-ui/src/images/favicon.png b/web-ui/src/images/favicon.png deleted file mode 100644 index e14841c7..00000000 Binary files a/web-ui/src/images/favicon.png and /dev/null differ diff --git a/web-ui/src/images/logo.svg b/web-ui/src/images/logo.svg deleted file mode 100644 index 6c2d8989..00000000 --- a/web-ui/src/images/logo.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/web-ui/src/images/pixelated-logo-orange.svg b/web-ui/src/images/pixelated-logo-orange.svg deleted file mode 100644 index 7e0ef43d..00000000 --- a/web-ui/src/images/pixelated-logo-orange.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/web-ui/src/images/pixelated-symbol-blue-transparent-01.png b/web-ui/src/images/pixelated-symbol-blue-transparent-01.png deleted file mode 100644 index 96b92155..00000000 Binary files a/web-ui/src/images/pixelated-symbol-blue-transparent-01.png and /dev/null differ diff --git a/web-ui/src/images/sent_email.png b/web-ui/src/images/sent_email.png deleted file mode 100644 index ddaa11d0..00000000 Binary files a/web-ui/src/images/sent_email.png and /dev/null differ diff --git a/web-ui/src/js/index.js b/web-ui/src/js/index.js deleted file mode 100644 index 8e66db06..00000000 --- a/web-ui/src/js/index.js +++ /dev/null @@ -1,235 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import {createStore} from 'redux'; -import {Map} from 'immutable'; -import 'whatwg-fetch'; - - -class PixelatedComponent extends React.Component { - _updateStateFromStore() { - this.setState(this.props.store.getState().toJS()); - } - - componentWillMount() { - this.unsubscribe = this.props.store.subscribe(() => this._updateStateFromStore()); - this._updateStateFromStore(); - } - - componentWillUnmount() { - this.unsubscribe(); - } -} - - -class PixelatedForm extends PixelatedComponent { - _fetchAndDispatch(url, actionProperties) { - const immutableActionProperties = new Map(actionProperties); - this.props.store.dispatch(immutableActionProperties.merge({status: 'STARTED'}).toJS()); - fetch(url).then((response) => { - return response.json(); - }).then((json) => { - setTimeout(() => { - this.props.store.dispatch(immutableActionProperties.merge({status: 'SUCCESS', json: json}).toJS()); - }, 3000); - }).catch((error) => { - console.error('something went wrong', error); - this.props.store.dispatch(immutableActionProperties.merge({status: 'ERROR', error: error}).toJS()); - }); - } -} - - -class InviteCodeForm extends PixelatedForm { - render() { - let className = "blue-button validation-link"; - - if(!this.state.inviteCodeValidation) { - className = className + " disabled"; - } - - return ( -
-
- - -
- -
- ); - } - - _handleClick(event) { - event.stopPropagation(); - event.preventDefault(); - this.props.store.dispatch({type: 'SUBMIT_INVITE_CODE', inviteCode: event.target['invite-code'].value}); - } - - _handleInputEmpty(event) { - this.props.store.dispatch({type: 'VALIDATE_INVITE_CODE', inviteCode: event.target.value}); - } -} - - -class CreateAccountForm extends PixelatedForm { - render() { - return ( -
- @domain.com -
- - -
- -
- - -
- - -
- ); - } - - _handleClick(event) { - event.stopPropagation(); - event.preventDefault(); - this.props.store.dispatch({type: 'SUBMIT_CREATE_ACCOUNT', username: event.target.username.value, password: event.target.password.value}); - } -} - - -class BackupEmailForm extends PixelatedForm { - render() { - return ( -
-
- - -
- - -

- I didn't receive anything. Send the email again -

-
- ); - } - - _handleClick(event) { - event.stopPropagation(); - event.preventDefault(); - this._fetchAndDispatch('dummy.json', {type: 'SUBMIT_BACKUP_EMAIL', backupEmail: event.target['backup-email'].value}); - } -} - - -class BackupEmailSentForm extends PixelatedForm { - render() { - return ( -
- {this.state.isFetching || I received the codes.
Go to my inbox
} -

- I didn't receive anything. Send the email again -

-
- ); - } - - _handleClick(event) { - event.stopPropagation(); - event.preventDefault(); - } -} - - -class SignUp extends PixelatedComponent { - render() { - return ( -
-
-

{this.state.header}

- {this.state.icon} -

{this.state.summary}

-
-
- {this._form()} -
-
- ); - } - - _form() { - switch(this.state.form) { - case 'invite_code': return ; - case 'create_account': return ; - case 'backup_email': return ; - case 'backup_email_sent': return ; - default: throw Error('TODO'); - } - } -} - - -const initialState = new Map({ - isFetching: false, - form: 'invite_code', - header: 'Welcome', - icon: null, - summary: ['Do you have an invite code?',
, 'Type it below'], -}); - - -const store = createStore((state=initialState, action) => { - switch (action.type) { - case 'SUBMIT_INVITE_CODE': - return state.merge({ - inviteCode: action.inviteCode, - form: 'create_account', - header: 'Create your account', - summary: 'Choose your username, and be careful about your password, it must be strong and easy to remember. If you have a password manager, we strongly advise you to use one.', - }); - case 'SUBMIT_CREATE_ACCOUNT': - return state.merge({ - username: action.username, - password: action.password, - form: 'backup_email', - header: 'In case you lose your password...', - summary: 'Set up a backup email account. You\'ll receive an email with a code so you can recover your account in the future, other will be sent to your account administrator.', - }); - case 'SUBMIT_BACKUP_EMAIL': - switch (action.status) { - case 'STARTED': - return state.merge({ - isFetching: true, - backupEmail: action.backupEmail, - form: 'backup_email_sent', - icon:

, - summary: 'An email was sent to the email you provided. Check your spam folder, just in case.', - }); - case 'SUCCESS': - return state.merge({ - isFetching: false, - }); - case 'ERROR': - return state.merge({ - isFetching: false, - }); - default: - return state; - } - case 'SUBMIT_BACKUP_EMAIL_SENT': - return state.merge({}); - case 'VALIDATE_INVITE_CODE': - return state.merge({ - inviteCodeValidation: Boolean(action.inviteCode) - }); - default: - return state; - } -}); - - -ReactDOM.render( - , - document.getElementById('app') -); -- cgit v1.2.3