From 890da0400f8657cfa55a3681aee00c96ad3cbbc9 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 31 Jan 2017 16:31:29 -0300 Subject: [PATCH 01/18] Steps --- client/coral-admin/src/AppRouter.js | 2 ++ client/coral-admin/src/actions/install.js | 4 +++ client/coral-admin/src/constants/install.js | 2 ++ .../containers/Install/InstallContainer.js | 30 +++++++++++++++++++ .../src/containers/Install/index.js | 0 .../src/containers/Install/style.css | 0 client/coral-admin/src/reducers/index.js | 4 ++- client/coral-admin/src/reducers/install.js | 21 +++++++++++++ 8 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 client/coral-admin/src/actions/install.js create mode 100644 client/coral-admin/src/constants/install.js create mode 100644 client/coral-admin/src/containers/Install/InstallContainer.js create mode 100644 client/coral-admin/src/containers/Install/index.js create mode 100644 client/coral-admin/src/containers/Install/style.css create mode 100644 client/coral-admin/src/reducers/install.js diff --git a/client/coral-admin/src/AppRouter.js b/client/coral-admin/src/AppRouter.js index 9c0f271cc..ebb79b4e1 100644 --- a/client/coral-admin/src/AppRouter.js +++ b/client/coral-admin/src/AppRouter.js @@ -7,6 +7,7 @@ import Configure from 'containers/Configure/Configure'; import Streams from 'containers/Streams/Streams'; import CommunityContainer from 'containers/Community/CommunityContainer'; import LayoutContainer from 'containers/LayoutContainer'; +import InstallContainer from 'containers/Install/InstallContainer'; const routes = ( @@ -15,6 +16,7 @@ const routes = ( + ); diff --git a/client/coral-admin/src/actions/install.js b/client/coral-admin/src/actions/install.js new file mode 100644 index 000000000..460a36e23 --- /dev/null +++ b/client/coral-admin/src/actions/install.js @@ -0,0 +1,4 @@ +import * as actions from '../constants/install'; + +export const nextStep = () => ({type: actions.NEXT_STEP}); +export const previousStep = () => ({type: actions.PREVIOUS_STEP}); diff --git a/client/coral-admin/src/constants/install.js b/client/coral-admin/src/constants/install.js new file mode 100644 index 000000000..f15a39ed4 --- /dev/null +++ b/client/coral-admin/src/constants/install.js @@ -0,0 +1,2 @@ +export const NEXT_STEP = 'NEXT_STEP'; +export const PREVIOUS_STEP = 'PREVIOUS_STEP'; diff --git a/client/coral-admin/src/containers/Install/InstallContainer.js b/client/coral-admin/src/containers/Install/InstallContainer.js new file mode 100644 index 000000000..de296acc0 --- /dev/null +++ b/client/coral-admin/src/containers/Install/InstallContainer.js @@ -0,0 +1,30 @@ +import React from 'react'; +import {connect} from 'react-redux'; +import styles from './style.css'; +import {nextStep, previousStep} from '../../actions/install' + +const InstallContainer = props => { + const {nextStep, previousStep, install} = props; + + return ( +
+ Install: +

+ {install.step} +

+ + +
+ ); +}; + +const mapStateToProps = state => ({ + install: state.install.toJS() +}); + +const mapDispatchToProps = dispatch => ({ + nextStep: () => dispatch(nextStep()), + previousStep: () => dispatch(previousStep()) +}); + +export default connect(mapStateToProps, mapDispatchToProps)(InstallContainer); diff --git a/client/coral-admin/src/containers/Install/index.js b/client/coral-admin/src/containers/Install/index.js new file mode 100644 index 000000000..e69de29bb diff --git a/client/coral-admin/src/containers/Install/style.css b/client/coral-admin/src/containers/Install/style.css new file mode 100644 index 000000000..e69de29bb diff --git a/client/coral-admin/src/reducers/index.js b/client/coral-admin/src/reducers/index.js index a19a5a087..1943e5976 100644 --- a/client/coral-admin/src/reducers/index.js +++ b/client/coral-admin/src/reducers/index.js @@ -6,6 +6,7 @@ import users from 'reducers/users'; import auth from 'reducers/auth'; import actions from 'reducers/actions'; import assets from 'reducers/assets'; +import install from 'reducers/install'; // Combine all reducers into a main one export default combineReducers({ @@ -15,5 +16,6 @@ export default combineReducers({ auth, actions, assets, - users + users, + install }); diff --git a/client/coral-admin/src/reducers/install.js b/client/coral-admin/src/reducers/install.js new file mode 100644 index 000000000..1b9ae5b28 --- /dev/null +++ b/client/coral-admin/src/reducers/install.js @@ -0,0 +1,21 @@ +import {Map} from 'immutable'; + +import * as actions from '../constants/install'; + +const initialState = Map({ + step: 0 +}); + +export default function auth (state = initialState, action) { + switch (action.type) { + case actions.NEXT_STEP: + console.log(state) + return state + .set('step', state.get('step') + 1); + case actions.PREVIOUS_STEP: + return state + .set('step', state.get('step') - 1); + default : + return state; + } +} From 6a4315d60826fd0f2bfd4a884656cac0f1dd5fa3 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 1 Feb 2017 10:49:16 -0300 Subject: [PATCH 02/18] Working Install Wizard --- client/coral-admin/src/actions/install.js | 1 + client/coral-admin/src/constants/install.js | 1 + .../containers/Install/InstallContainer.js | 29 +++++++++++++------ .../components/Steps/AddOrganizationName.js | 19 ++++++++++++ .../Install/components/Steps/InitialStep.js | 20 +++++++++++++ client/coral-admin/src/reducers/install.js | 3 ++ client/coral-ui/components/Wizard.js | 29 +++++++++++++++++++ client/coral-ui/index.js | 1 + 8 files changed, 94 insertions(+), 9 deletions(-) create mode 100644 client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js create mode 100644 client/coral-admin/src/containers/Install/components/Steps/InitialStep.js create mode 100644 client/coral-ui/components/Wizard.js diff --git a/client/coral-admin/src/actions/install.js b/client/coral-admin/src/actions/install.js index 460a36e23..abaaeceb7 100644 --- a/client/coral-admin/src/actions/install.js +++ b/client/coral-admin/src/actions/install.js @@ -2,3 +2,4 @@ import * as actions from '../constants/install'; export const nextStep = () => ({type: actions.NEXT_STEP}); export const previousStep = () => ({type: actions.PREVIOUS_STEP}); +export const goToStep = step => ({type: actions.GO_TO_STEP, step}); diff --git a/client/coral-admin/src/constants/install.js b/client/coral-admin/src/constants/install.js index f15a39ed4..d33ec4657 100644 --- a/client/coral-admin/src/constants/install.js +++ b/client/coral-admin/src/constants/install.js @@ -1,2 +1,3 @@ export const NEXT_STEP = 'NEXT_STEP'; export const PREVIOUS_STEP = 'PREVIOUS_STEP'; +export const GO_TO_STEP = 'GO_TO_STEP'; diff --git a/client/coral-admin/src/containers/Install/InstallContainer.js b/client/coral-admin/src/containers/Install/InstallContainer.js index de296acc0..bda32bde2 100644 --- a/client/coral-admin/src/containers/Install/InstallContainer.js +++ b/client/coral-admin/src/containers/Install/InstallContainer.js @@ -1,19 +1,29 @@ import React from 'react'; import {connect} from 'react-redux'; import styles from './style.css'; -import {nextStep, previousStep} from '../../actions/install' +import {nextStep, previousStep, goToStep} from '../../actions/install'; +import {Button, Wizard} from 'coral-ui'; + +import InitialStep from './components/Steps/InitialStep' +import AddOrganizationName from './components/Steps/AddOrganizationName' const InstallContainer = props => { - const {nextStep, previousStep, install} = props; + const {nextStep, previousStep, goToStep, install} = props; return (
- Install: -

- {install.step} -

- - +

{install.step}

+ + + + +
); }; @@ -24,7 +34,8 @@ const mapStateToProps = state => ({ const mapDispatchToProps = dispatch => ({ nextStep: () => dispatch(nextStep()), - previousStep: () => dispatch(previousStep()) + previousStep: () => dispatch(previousStep()), + goToStep: step => dispatch(goToStep(step)) }); export default connect(mapStateToProps, mapDispatchToProps)(InstallContainer); diff --git a/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js new file mode 100644 index 000000000..1af4b9839 --- /dev/null +++ b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js @@ -0,0 +1,19 @@ +import React from 'react'; +// import styles from './style.css'; +import {Button} from 'coral-ui'; + +const InitialStep = props => { + const {nextStep, previousStep} = props; + return ( +
+

Welcome to the Coral Project

+

+ Please tell us the name of your organization. This will appear in emails when + inviting new team members +

+ +
+ ); +}; + +export default InitialStep; diff --git a/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js b/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js new file mode 100644 index 000000000..9efdf4ad0 --- /dev/null +++ b/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js @@ -0,0 +1,20 @@ +import React from 'react'; +// import styles from './style.css'; +import {Button} from 'coral-ui'; + +const InitialStep = props => { + const {nextStep} = props; + return ( +
+

Welcome to the Coral Project

+

+ The remainder of the Talk installation will take about ten minutes. + Once you complete the following three steps, you will have a free + installation and provision of Mongo and Redis. +

+ +
+ ); +}; + +export default InitialStep; diff --git a/client/coral-admin/src/reducers/install.js b/client/coral-admin/src/reducers/install.js index 1b9ae5b28..95febb887 100644 --- a/client/coral-admin/src/reducers/install.js +++ b/client/coral-admin/src/reducers/install.js @@ -15,6 +15,9 @@ export default function auth (state = initialState, action) { case actions.PREVIOUS_STEP: return state .set('step', state.get('step') - 1); + case actions.GO_TO_STEP: + return state + .set('step', action.step); default : return state; } diff --git a/client/coral-ui/components/Wizard.js b/client/coral-ui/components/Wizard.js new file mode 100644 index 000000000..1ba6e56a6 --- /dev/null +++ b/client/coral-ui/components/Wizard.js @@ -0,0 +1,29 @@ +import React, {PropTypes} from 'react'; + +const Wizard = (props) => { + const {children, currentStep, nextStep, previousStep, goToStep, className = ''} = props; + return ( +
+ {React.Children.toArray(children) + .filter((child, i) => i === currentStep) + .map((child, i) => + React.cloneElement(child, { + i, + currentStep, + nextStep, + previousStep, + goToStep + }) + )} +
+ ); +}; + +Wizard.propTypes = { + currentStep: PropTypes.number.isRequired, + nextStep: PropTypes.func.isRequired, + previousStep: PropTypes.func.isRequired, + goToStep: PropTypes.func.isRequired +} + +export default Wizard; diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js index 23d5d876a..b58c2a74a 100644 --- a/client/coral-ui/index.js +++ b/client/coral-ui/index.js @@ -14,3 +14,4 @@ export {default as List} from './components/List'; export {default as Item} from './components/Item'; export {default as Card} from './components/Card'; export {default as Pager} from './components/Pager'; +export {default as Wizard} from './components/Wizard'; From 12070309d6bd5db9fdf5e26e702c4fb90327b559 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 1 Feb 2017 12:11:15 -0300 Subject: [PATCH 03/18] Wizard Nav --- .../containers/Install/InstallContainer.js | 29 +++-- .../components/Steps/AddOrganizationName.js | 13 ++- .../Install/components/Steps/InitialStep.js | 13 +-- .../Install/components/Steps/style.css | 30 +++++ .../src/containers/Install/style.css | 12 ++ client/coral-admin/src/reducers/install.js | 1 - client/coral-ui/components/Wizard.js | 4 +- client/coral-ui/components/WizardNav.css | 109 ++++++++++++++++++ client/coral-ui/components/WizardNav.js | 29 +++++ client/coral-ui/index.js | 1 + 10 files changed, 215 insertions(+), 26 deletions(-) create mode 100644 client/coral-admin/src/containers/Install/components/Steps/style.css create mode 100644 client/coral-ui/components/WizardNav.css create mode 100644 client/coral-ui/components/WizardNav.js diff --git a/client/coral-admin/src/containers/Install/InstallContainer.js b/client/coral-admin/src/containers/Install/InstallContainer.js index bda32bde2..8ed0bbf69 100644 --- a/client/coral-admin/src/containers/Install/InstallContainer.js +++ b/client/coral-admin/src/containers/Install/InstallContainer.js @@ -2,24 +2,18 @@ import React from 'react'; import {connect} from 'react-redux'; import styles from './style.css'; import {nextStep, previousStep, goToStep} from '../../actions/install'; -import {Button, Wizard} from 'coral-ui'; +import {Wizard, WizardNav} from 'coral-ui'; -import InitialStep from './components/Steps/InitialStep' -import AddOrganizationName from './components/Steps/AddOrganizationName' +import InitialStep from './components/Steps/InitialStep'; +import AddOrganizationName from './components/Steps/AddOrganizationName'; const InstallContainer = props => { const {nextStep, previousStep, goToStep, install} = props; return (
-

{install.step}

- +

Welcome to the Coral Project

+ { install.step !== 0 ? : null } @@ -28,6 +22,19 @@ const InstallContainer = props => { ); }; +const wizardNavitems = [{ + text: '1. Add Organization Name', + step: 1 +}, +{ + text: '2. Create your account', + step: 2 +}, +{ + text: '3. Invite team members', + step: 3 +}]; + const mapStateToProps = state => ({ install: state.install.toJS() }); diff --git a/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js index 1af4b9839..74f2c3016 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js +++ b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js @@ -1,17 +1,20 @@ import React from 'react'; -// import styles from './style.css'; +import styles from './style.css'; import {Button} from 'coral-ui'; const InitialStep = props => { - const {nextStep, previousStep} = props; + const {nextStep} = props; return ( -
-

Welcome to the Coral Project

+

Please tell us the name of your organization. This will appear in emails when inviting new team members

- +
+ + + +
); }; diff --git a/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js b/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js index 9efdf4ad0..95043b515 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js +++ b/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js @@ -1,18 +1,17 @@ import React from 'react'; -// import styles from './style.css'; +import styles from './style.css'; import {Button} from 'coral-ui'; const InitialStep = props => { const {nextStep} = props; return ( -
-

Welcome to the Coral Project

+

- The remainder of the Talk installation will take about ten minutes. - Once you complete the following three steps, you will have a free - installation and provision of Mongo and Redis. + The remainder of the Talk installation will take about ten minutes. + Once you complete the following three steps, you will have a free + installation and provision of Mongo and Redis.

- +
); }; diff --git a/client/coral-admin/src/containers/Install/components/Steps/style.css b/client/coral-admin/src/containers/Install/components/Steps/style.css new file mode 100644 index 000000000..5284b3470 --- /dev/null +++ b/client/coral-admin/src/containers/Install/components/Steps/style.css @@ -0,0 +1,30 @@ +.step { + + p { + max-width: 450px; + margin: 10px auto 30px; + } + + > button { + min-width: 140px; + } + + form { + max-width: 300px; + margin: 30px auto; + + label { + text-align: left; + display: block; + } + + input { + border: solid 1px rgba(0, 0, 0, 0.23); + padding: 10px 2px; + border-radius: 3px; + width: 100%; + box-sizing: border-box; + margin: 10px 0; + } + } +} diff --git a/client/coral-admin/src/containers/Install/style.css b/client/coral-admin/src/containers/Install/style.css index e69de29bb..90c62c20e 100644 --- a/client/coral-admin/src/containers/Install/style.css +++ b/client/coral-admin/src/containers/Install/style.css @@ -0,0 +1,12 @@ +.Install { + max-width: 900px; + margin: 0 auto; + text-align: center; + padding: 40px 0; + + h2 { + font-size: 2em; + font-weight: 500; + margin: 0; + } +} diff --git a/client/coral-admin/src/reducers/install.js b/client/coral-admin/src/reducers/install.js index 95febb887..d97c7f236 100644 --- a/client/coral-admin/src/reducers/install.js +++ b/client/coral-admin/src/reducers/install.js @@ -9,7 +9,6 @@ const initialState = Map({ export default function auth (state = initialState, action) { switch (action.type) { case actions.NEXT_STEP: - console.log(state) return state .set('step', state.get('step') + 1); case actions.PREVIOUS_STEP: diff --git a/client/coral-ui/components/Wizard.js b/client/coral-ui/components/Wizard.js index 1ba6e56a6..e598b3c30 100644 --- a/client/coral-ui/components/Wizard.js +++ b/client/coral-ui/components/Wizard.js @@ -3,7 +3,7 @@ import React, {PropTypes} from 'react'; const Wizard = (props) => { const {children, currentStep, nextStep, previousStep, goToStep, className = ''} = props; return ( -
+
{React.Children.toArray(children) .filter((child, i) => i === currentStep) .map((child, i) => @@ -15,7 +15,7 @@ const Wizard = (props) => { goToStep }) )} -
+ ); }; diff --git a/client/coral-ui/components/WizardNav.css b/client/coral-ui/components/WizardNav.css new file mode 100644 index 000000000..12b9b3841 --- /dev/null +++ b/client/coral-ui/components/WizardNav.css @@ -0,0 +1,109 @@ +.WizardNav { + ul { + list-style: none; + } + + li { + border: solid 1px #DFDFDF; + background-color: #F0F0F0; + display: inline-block; + padding: 10px; + margin-right: 10px; + color: #A7A7A7; + position: relative; + padding-left: 40px; + + &:hover { + cursor: pointer; + } + + &.active { + background-color: #FFFFFF; + color: #636363; + font-weight: 500; + + span { + &::after { + border-color: transparent transparent transparent #FFFFFF; + } + } + } + + span { + padding: 10px 20px; + margin-right: 10px; + position: absolute; + top: -1px; + right: -51px; + z-index: 10; + + &::before { + content: ""; + display: inline-block; + position: absolute; + border: 23px solid #DFDFDF; + border-color: transparent transparent transparent #DFDFDF; + top: 0; + left: 0; + } + + &::after { + content: ""; + display: inline-block; + position: absolute; + border: 23px solid white; + border-color: transparent transparent transparent #f0f0f0; + top: 0; + left: -1px; + } + } + + &::before { + content: ""; + display: inline-block; + position: absolute; + border: 23px solid #DFDFDF; + border-color: transparent transparent transparent #DFDFDF; + top: 0; + left: 0; + } + + &::after { + content: ""; + display: inline-block; + position: absolute; + border: 23px solid white; + border-color: transparent transparent transparent #fafafa; + top: 0; + left: -1px; + } +/* + &::before { + position: absolute; + top: 0; + left: -1px; + display: block; + border-left: 23px solid white; + border-top: 23px solid transparent; + border-bottom: 23px solid transparent; + width: 0; + height: 0; + content: " "; + } + + &::after{ + z-index: 1; + position: absolute; + top: 0; + right: -23px; + display: block; + border-left: 23px solid #f0f0f0; + border-top: 23px solid transparent; + border-bottom: 23px solid transparent; + width: 0; + height: 0; + content: " "; + }*/ + + } +} diff --git a/client/coral-ui/components/WizardNav.js b/client/coral-ui/components/WizardNav.js new file mode 100644 index 000000000..200adb216 --- /dev/null +++ b/client/coral-ui/components/WizardNav.js @@ -0,0 +1,29 @@ +import React, {PropTypes} from 'react'; +import styles from './WizardNav.css'; + +const WizardNav = props => { + const {goToStep, currentStep, items} = props; + return ( + + ); +}; + +WizardNav.propTypes = { + goToStep: PropTypes.func.isRequired, + currentStep: PropTypes.number.isRequired +}; + +export default WizardNav; diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js index b58c2a74a..69f63e397 100644 --- a/client/coral-ui/index.js +++ b/client/coral-ui/index.js @@ -15,3 +15,4 @@ export {default as Item} from './components/Item'; export {default as Card} from './components/Card'; export {default as Pager} from './components/Pager'; export {default as Wizard} from './components/Wizard'; +export {default as WizardNav} from './components/WizardNav'; From caa04de09df4c41b47c8e58301ce37889c5ab351 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 1 Feb 2017 12:12:28 -0300 Subject: [PATCH 04/18] linting and proptypes --- client/coral-ui/components/Wizard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-ui/components/Wizard.js b/client/coral-ui/components/Wizard.js index e598b3c30..429bce72c 100644 --- a/client/coral-ui/components/Wizard.js +++ b/client/coral-ui/components/Wizard.js @@ -1,7 +1,7 @@ import React, {PropTypes} from 'react'; const Wizard = (props) => { - const {children, currentStep, nextStep, previousStep, goToStep, className = ''} = props; + const {children, currentStep, nextStep, previousStep, goToStep} = props; return (
{React.Children.toArray(children) @@ -24,6 +24,6 @@ Wizard.propTypes = { nextStep: PropTypes.func.isRequired, previousStep: PropTypes.func.isRequired, goToStep: PropTypes.func.isRequired -} +}; export default Wizard; From 7866d1f8cdd79f6591edbad6cb25d96d4a90bd29 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 1 Feb 2017 15:17:15 -0300 Subject: [PATCH 05/18] Done Wizard mEnu --- client/coral-admin/src/AppRouter.js | 18 ++++---- .../coral-admin/src/components/ui/Header.js | 35 ++++++++++----- .../containers/Install/InstallContainer.js | 25 +++++++---- .../components/Steps/CreateYourAccount.js | 32 +++++++++++++ .../Install/components/Steps/FinalStep.js | 19 ++++++++ .../components/Steps/InviteTeamMembers.js | 35 +++++++++++++++ .../Install/components/Steps/style.css | 5 +++ client/coral-ui/components/WizardNav.css | 45 +++++++------------ client/coral-ui/components/WizardNav.js | 2 +- 9 files changed, 158 insertions(+), 58 deletions(-) create mode 100644 client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js create mode 100644 client/coral-admin/src/containers/Install/components/Steps/FinalStep.js create mode 100644 client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js diff --git a/client/coral-admin/src/AppRouter.js b/client/coral-admin/src/AppRouter.js index ebb79b4e1..bebe6a19b 100644 --- a/client/coral-admin/src/AppRouter.js +++ b/client/coral-admin/src/AppRouter.js @@ -10,14 +10,16 @@ import LayoutContainer from 'containers/LayoutContainer'; import InstallContainer from 'containers/Install/InstallContainer'; const routes = ( - - - - - - - - +
+ + + + + + + + +
); const AppRouter = () => ; diff --git a/client/coral-admin/src/components/ui/Header.js b/client/coral-admin/src/components/ui/Header.js index 4e2b391c8..abfb0ff13 100644 --- a/client/coral-admin/src/components/ui/Header.js +++ b/client/coral-admin/src/components/ui/Header.js @@ -6,19 +6,32 @@ import I18n from 'coral-framework/modules/i18n/i18n'; import translations from '../../translations.json'; import {Logo} from './Logo'; -export default ({handleLogout}) => ( +export default ({handleLogout, restricted = false}) => (
- - {lang.t('configure.moderate')} - {lang.t('configure.community')} - {lang.t('configure.configure')} - {lang.t('configure.streams')} - + { + !restricted ? + + + {lang.t('configure.moderate')} + + + {lang.t('configure.community')} + + + {lang.t('configure.configure')} + + + {lang.t('configure.streams')} + + + : + null + }
  • diff --git a/client/coral-admin/src/containers/Install/InstallContainer.js b/client/coral-admin/src/containers/Install/InstallContainer.js index 8ed0bbf69..aac4654d3 100644 --- a/client/coral-admin/src/containers/Install/InstallContainer.js +++ b/client/coral-admin/src/containers/Install/InstallContainer.js @@ -3,22 +3,31 @@ import {connect} from 'react-redux'; import styles from './style.css'; import {nextStep, previousStep, goToStep} from '../../actions/install'; import {Wizard, WizardNav} from 'coral-ui'; +import {Layout} from '../../components/ui/Layout'; import InitialStep from './components/Steps/InitialStep'; import AddOrganizationName from './components/Steps/AddOrganizationName'; +import CreateYourAccount from './components/Steps/CreateYourAccount'; +import InviteTeamMembers from './components/Steps/InviteTeamMembers'; +import FinalStep from './components/Steps/FinalStep'; const InstallContainer = props => { const {nextStep, previousStep, goToStep, install} = props; return ( -
    -

    Welcome to the Coral Project

    - { install.step !== 0 ? : null } - - - - -
    + +
    +

    Welcome to the Coral Project

    + { install.step !== 0 ? : null } + + + + + + + +
    +
    ); }; diff --git a/client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js b/client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js new file mode 100644 index 000000000..cb29c3429 --- /dev/null +++ b/client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js @@ -0,0 +1,32 @@ +import React from 'react'; +import styles from './style.css'; +import {Button} from 'coral-ui'; + +const InitialStep = props => { + const {nextStep} = props; + return ( +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + +
    +
    + ); +}; + +export default InitialStep; diff --git a/client/coral-admin/src/containers/Install/components/Steps/FinalStep.js b/client/coral-admin/src/containers/Install/components/Steps/FinalStep.js new file mode 100644 index 000000000..0b58508a0 --- /dev/null +++ b/client/coral-admin/src/containers/Install/components/Steps/FinalStep.js @@ -0,0 +1,19 @@ +import React from 'react'; +import styles from './style.css'; +import {Button} from 'coral-ui'; + +const InitialStep = props => { + const {nextStep} = props; + return ( +
    +

    + Thanks for installing Talk! We sent an email to your team member. + While they finish setting up their account, start engaging with your readers now. +

    + + +
    + ); +}; + +export default InitialStep; diff --git a/client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js b/client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js new file mode 100644 index 000000000..99ef84d19 --- /dev/null +++ b/client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js @@ -0,0 +1,35 @@ +import React from 'react'; +import styles from './style.css'; +import {Button} from 'coral-ui'; + +const InviteTeamMembers = props => { + const {nextStep} = props; + return ( +
    +

    Invite Team Members

    +

    + Once registered, new team members will receive an email to Create + their password. +

    +
    +
    + + +
    +
    + + +
    +
    + +
    + +
    +
    + ); +}; + +export default InviteTeamMembers; diff --git a/client/coral-admin/src/containers/Install/components/Steps/style.css b/client/coral-admin/src/containers/Install/components/Steps/style.css index 5284b3470..c7d41aef0 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/style.css +++ b/client/coral-admin/src/containers/Install/components/Steps/style.css @@ -25,6 +25,11 @@ width: 100%; box-sizing: border-box; margin: 10px 0; + transition: border-color 0.2 ease; + + &:focus { + border-color: black; + } } } } diff --git a/client/coral-ui/components/WizardNav.css b/client/coral-ui/components/WizardNav.css index 12b9b3841..90d07af09 100644 --- a/client/coral-ui/components/WizardNav.css +++ b/client/coral-ui/components/WizardNav.css @@ -12,11 +12,23 @@ color: #A7A7A7; position: relative; padding-left: 40px; - + border-radius: 1px; + &:hover { cursor: pointer; } + &.done { + border-color: #00796B; + background-color: #00796B; + color: #ffffff; + span { + &::after { + border-color: transparent transparent transparent #00796B; + } + } + } + &.active { background-color: #FFFFFF; color: #636363; @@ -64,7 +76,7 @@ position: absolute; border: 23px solid #DFDFDF; border-color: transparent transparent transparent #DFDFDF; - top: 0; + top: -1px; left: 0; } @@ -74,36 +86,9 @@ position: absolute; border: 23px solid white; border-color: transparent transparent transparent #fafafa; - top: 0; + top: -1px; left: -1px; } -/* - &::before { - position: absolute; - top: 0; - left: -1px; - display: block; - border-left: 23px solid white; - border-top: 23px solid transparent; - border-bottom: 23px solid transparent; - width: 0; - height: 0; - content: " "; - } - - &::after{ - z-index: 1; - position: absolute; - top: 0; - right: -23px; - display: block; - border-left: 23px solid #f0f0f0; - border-top: 23px solid transparent; - border-bottom: 23px solid transparent; - width: 0; - height: 0; - content: " "; - }*/ } } diff --git a/client/coral-ui/components/WizardNav.js b/client/coral-ui/components/WizardNav.js index 200adb216..b5a8db549 100644 --- a/client/coral-ui/components/WizardNav.js +++ b/client/coral-ui/components/WizardNav.js @@ -10,7 +10,7 @@ const WizardNav = props => { items.map((item, i) => (
  • goToStep(item.step)}> {item.text}
  • From 65aa5e7e92be6ff9d3f396e39796b05abf071306 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Thu, 2 Feb 2017 11:31:43 -0300 Subject: [PATCH 06/18] =?UTF-8?q?=C3=81dding=20Select,=20Options=20to=20Co?= =?UTF-8?q?ral=20Ui=20and=20steps=20with=20formField?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coral-admin/src/components/ui/Header.js | 74 ++++++++++--------- .../containers/Install/InstallContainer.js | 2 +- .../components/Steps/AddOrganizationName.js | 17 +++-- .../components/Steps/CreateYourAccount.js | 50 ++++++++----- .../Install/components/Steps/InitialStep.js | 2 +- .../components/Steps/InviteTeamMembers.js | 45 ++++++----- .../Install/components/Steps/style.css | 52 +++++++++---- .../src/containers/Install/style.css | 2 +- client/coral-ui/components/Option.css | 3 + client/coral-ui/components/Option.js | 14 ++++ client/coral-ui/components/Select.css | 33 +++++++++ client/coral-ui/components/Select.js | 14 ++++ client/coral-ui/components/WizardNav.css | 15 +++- client/coral-ui/components/WizardNav.js | 7 +- client/coral-ui/index.js | 2 + 15 files changed, 230 insertions(+), 102 deletions(-) create mode 100644 client/coral-ui/components/Option.css create mode 100644 client/coral-ui/components/Option.js create mode 100644 client/coral-ui/components/Select.css create mode 100644 client/coral-ui/components/Select.js diff --git a/client/coral-admin/src/components/ui/Header.js b/client/coral-admin/src/components/ui/Header.js index abfb0ff13..3e6598d6e 100644 --- a/client/coral-admin/src/components/ui/Header.js +++ b/client/coral-admin/src/components/ui/Header.js @@ -11,42 +11,44 @@ export default ({handleLogout, restricted = false}) => ( { !restricted ? - - - {lang.t('configure.moderate')} - - - {lang.t('configure.community')} - - - {lang.t('configure.configure')} - - - {lang.t('configure.streams')} - - - : - null - } -
    -
      -
    • -
      - - - Sign Out - -
      -
    • -
    • - {`v${process.env.VERSION}`} -
    • -
    -
    +
    + + + {lang.t('configure.moderate')} + + + {lang.t('configure.community')} + + + {lang.t('configure.configure')} + + + {lang.t('configure.streams')} + + +
    +
      +
    • +
      + + + Sign Out + +
      +
    • +
    • + {`v${process.env.VERSION}`} +
    • +
    +
    +
    + : + null + }
); diff --git a/client/coral-admin/src/containers/Install/InstallContainer.js b/client/coral-admin/src/containers/Install/InstallContainer.js index aac4654d3..350e60709 100644 --- a/client/coral-admin/src/containers/Install/InstallContainer.js +++ b/client/coral-admin/src/containers/Install/InstallContainer.js @@ -18,7 +18,7 @@ const InstallContainer = props => {

Welcome to the Coral Project

- { install.step !== 0 ? : null } + { install.step !== 0 ? : null } diff --git a/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js index 74f2c3016..ff7125ab5 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js +++ b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js @@ -1,6 +1,6 @@ import React from 'react'; import styles from './style.css'; -import {Button} from 'coral-ui'; +import {FormField, Button} from 'coral-ui'; const InitialStep = props => { const {nextStep} = props; @@ -10,11 +10,16 @@ const InitialStep = props => { Please tell us the name of your organization. This will appear in emails when inviting new team members

-
- - - -
+
+
{}}> + + + +
); }; diff --git a/client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js b/client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js index cb29c3429..f245218d8 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js +++ b/client/coral-admin/src/containers/Install/components/Steps/CreateYourAccount.js @@ -1,30 +1,40 @@ import React from 'react'; import styles from './style.css'; -import {Button} from 'coral-ui'; +import {FormField, Button} from 'coral-ui'; const InitialStep = props => { const {nextStep} = props; return (
-
-
- - -
-
- - -
-
- - -
-
- - -
- -
+
+
+ + + + + + + + + + +
); }; diff --git a/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js b/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js index 95043b515..51c40d44d 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js +++ b/client/coral-admin/src/containers/Install/components/Steps/InitialStep.js @@ -11,7 +11,7 @@ const InitialStep = props => { Once you complete the following three steps, you will have a free installation and provision of Mongo and Redis.

- +
); }; diff --git a/client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js b/client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js index 99ef84d19..156916ab0 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js +++ b/client/coral-admin/src/containers/Install/components/Steps/InviteTeamMembers.js @@ -1,6 +1,6 @@ import React from 'react'; import styles from './style.css'; -import {Button} from 'coral-ui'; +import {Button, Select, Option, FormField} from 'coral-ui'; const InviteTeamMembers = props => { const {nextStep} = props; @@ -11,23 +11,32 @@ const InviteTeamMembers = props => { Once registered, new team members will receive an email to Create their password.

-
-
- - -
-
- - -
-
- -
- -
+
+
+ + + + + +
+ + +
+ + + +
); }; diff --git a/client/coral-admin/src/containers/Install/components/Steps/style.css b/client/coral-admin/src/containers/Install/components/Steps/style.css index c7d41aef0..9dd95f90b 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/style.css +++ b/client/coral-admin/src/containers/Install/components/Steps/style.css @@ -1,34 +1,54 @@ .step { + padding: 20px 0; + + h3 { + max-width: 450px; + margin: 0 auto; + text-align: left; + font-size: 1.4em; + font-weight: bold; + } p { max-width: 450px; - margin: 10px auto 30px; + margin: 0 auto 30px; + font-size: 1.1em; + text-align: left; } > button { - min-width: 140px; + min-width: 145px; } - form { + .form { max-width: 300px; margin: 30px auto; - label { - text-align: left; - display: block; + form > button { + margin: 30px 0; } - input { - border: solid 1px rgba(0, 0, 0, 0.23); - padding: 10px 2px; - border-radius: 3px; - width: 100%; - box-sizing: border-box; - margin: 10px 0; - transition: border-color 0.2 ease; + .formField { + label { + text-align: left; + display: block; + margin: 10px 0; + font-weight: 400; + font-size: 1.08em; + } - &:focus { - border-color: black; + > input { + border: solid 1px rgba(0, 0, 0, 0.23); + padding: 10px; + border-radius: 3px; + width: 100%; + box-sizing: border-box; + transition: border-color 0.2s ease; + font-size: 1em; + + &:focus { + border-color: black; + } } } } diff --git a/client/coral-admin/src/containers/Install/style.css b/client/coral-admin/src/containers/Install/style.css index 90c62c20e..62f7ffe04 100644 --- a/client/coral-admin/src/containers/Install/style.css +++ b/client/coral-admin/src/containers/Install/style.css @@ -2,7 +2,7 @@ max-width: 900px; margin: 0 auto; text-align: center; - padding: 40px 0; + padding: 50px 0; h2 { font-size: 2em; diff --git a/client/coral-ui/components/Option.css b/client/coral-ui/components/Option.css new file mode 100644 index 000000000..54784d8fc --- /dev/null +++ b/client/coral-ui/components/Option.css @@ -0,0 +1,3 @@ +.Option { + +} diff --git a/client/coral-ui/components/Option.js b/client/coral-ui/components/Option.js new file mode 100644 index 000000000..d322ef0ef --- /dev/null +++ b/client/coral-ui/components/Option.js @@ -0,0 +1,14 @@ +import React from 'react'; +import {Option as OptionMDL} from 'react-mdl-selectfield'; +import styles from './Option.css'; + +const Option = props => { + const {children, ...attrs} = props; + return ( + + {children} + + ); +}; + +export default Option; diff --git a/client/coral-ui/components/Select.css b/client/coral-ui/components/Select.css new file mode 100644 index 000000000..ac93a843c --- /dev/null +++ b/client/coral-ui/components/Select.css @@ -0,0 +1,33 @@ +.Select { + position: relative; + width: 100%; + height: 40px; + background: #2c2c2c; + padding: 10px 15px; + box-sizing: border-box; + color: white; + border-radius: 2px; + box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12); + + > div { + padding: 0; + } + + i { + position: absolute; + top: 7px; + right: 7px; + } + + input { + padding: 0; + font-size: 13px; + letter-spacing: 0.7px; + font-weight: 400; + } + + &:hover { + cursor: pointer; + } + +} diff --git a/client/coral-ui/components/Select.js b/client/coral-ui/components/Select.js new file mode 100644 index 000000000..731c50ddc --- /dev/null +++ b/client/coral-ui/components/Select.js @@ -0,0 +1,14 @@ +import React from 'react'; +import {SelectField} from 'react-mdl-selectfield'; +import styles from './Select.css'; + +const Select = props => { + const {children, ...attrs} = props; + return ( + + {children} + + ); +}; + +export default Select; diff --git a/client/coral-ui/components/WizardNav.css b/client/coral-ui/components/WizardNav.css index 90d07af09..001ee8603 100644 --- a/client/coral-ui/components/WizardNav.css +++ b/client/coral-ui/components/WizardNav.css @@ -13,7 +13,7 @@ position: relative; padding-left: 40px; border-radius: 1px; - + &:hover { cursor: pointer; } @@ -27,6 +27,10 @@ border-color: transparent transparent transparent #00796B; } } + + i { + opacity: 1; + } } &.active { @@ -41,6 +45,15 @@ } } + i { + transition: opacity 0.2s ease; + opacity: 0; + vertical-align: middle; + font-size: 16px; + margin-top: -5px; + margin-left: 8px; + } + span { padding: 10px 20px; margin-right: 10px; diff --git a/client/coral-ui/components/WizardNav.js b/client/coral-ui/components/WizardNav.js index b5a8db549..9fd9a1f23 100644 --- a/client/coral-ui/components/WizardNav.js +++ b/client/coral-ui/components/WizardNav.js @@ -1,8 +1,9 @@ import React, {PropTypes} from 'react'; import styles from './WizardNav.css'; +import Icon from './Icon'; const WizardNav = props => { - const {goToStep, currentStep, items} = props; + const {goToStep, currentStep, items, icon} = props; return (