This repository has been archived by the owner on May 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
222 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ '/usr/local/Cellar/node/6.2.0/bin/node', | ||
1 verbose cli '/usr/local/bin/npm', | ||
1 verbose cli 'run', | ||
1 verbose cli 'start' ] | ||
2 info using npm@3.10.6 | ||
3 info using node@v6.2.0 | ||
4 verbose run-script [ 'prestart', 'start', 'poststart' ] | ||
5 info lifecycle etudiant-entrepreneur@0.0.1~prestart: etudiant-entrepreneur@0.0.1 | ||
6 verbose lifecycle etudiant-entrepreneur@0.0.1~prestart: unsafe-perm in lifecycle true | ||
7 verbose lifecycle etudiant-entrepreneur@0.0.1~prestart: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/nbr/projects/sgmap/etudiant-entrepreneur/client/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/nbr/projects/sgmap/etudiant-entrepreneur/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/nbr/projects/sgmap/etudiant-entrepreneur/node_modules/.bin:/usr/local/Cellar/node/6.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin | ||
8 verbose lifecycle etudiant-entrepreneur@0.0.1~prestart: CWD: /Users/nbr/projects/sgmap/etudiant-entrepreneur/client | ||
9 silly lifecycle etudiant-entrepreneur@0.0.1~prestart: Args: [ '-c', 'babel-node tools/startMessage.js' ] | ||
10 silly lifecycle etudiant-entrepreneur@0.0.1~prestart: Returned: code: 0 signal: null | ||
11 info lifecycle etudiant-entrepreneur@0.0.1~start: etudiant-entrepreneur@0.0.1 | ||
12 verbose lifecycle etudiant-entrepreneur@0.0.1~start: unsafe-perm in lifecycle true | ||
13 verbose lifecycle etudiant-entrepreneur@0.0.1~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/nbr/projects/sgmap/etudiant-entrepreneur/client/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/nbr/projects/sgmap/etudiant-entrepreneur/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/nbr/projects/sgmap/etudiant-entrepreneur/node_modules/.bin:/usr/local/Cellar/node/6.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin | ||
14 verbose lifecycle etudiant-entrepreneur@0.0.1~start: CWD: /Users/nbr/projects/sgmap/etudiant-entrepreneur/client | ||
15 silly lifecycle etudiant-entrepreneur@0.0.1~start: Args: [ '-c', | ||
15 silly lifecycle 'npm-run-all --parallel test:watch open:src lint:watch' ] | ||
16 silly lifecycle etudiant-entrepreneur@0.0.1~start: Returned: code: 1 signal: null | ||
17 info lifecycle etudiant-entrepreneur@0.0.1~start: Failed to exec start script | ||
18 verbose stack Error: etudiant-entrepreneur@0.0.1 start: `npm-run-all --parallel test:watch open:src lint:watch` | ||
18 verbose stack Exit status 1 | ||
18 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) | ||
18 verbose stack at emitTwo (events.js:106:13) | ||
18 verbose stack at EventEmitter.emit (events.js:191:7) | ||
18 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) | ||
18 verbose stack at emitTwo (events.js:106:13) | ||
18 verbose stack at ChildProcess.emit (events.js:191:7) | ||
18 verbose stack at maybeClose (internal/child_process.js:850:16) | ||
18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) | ||
19 verbose pkgid etudiant-entrepreneur@0.0.1 | ||
20 verbose cwd /Users/nbr/projects/sgmap/etudiant-entrepreneur/client | ||
21 error Darwin 15.6.0 | ||
22 error argv "/usr/local/Cellar/node/6.2.0/bin/node" "/usr/local/bin/npm" "run" "start" | ||
23 error node v6.2.0 | ||
24 error npm v3.10.6 | ||
25 error code ELIFECYCLE | ||
26 error etudiant-entrepreneur@0.0.1 start: `npm-run-all --parallel test:watch open:src lint:watch` | ||
26 error Exit status 1 | ||
27 error Failed at the etudiant-entrepreneur@0.0.1 start script 'npm-run-all --parallel test:watch open:src lint:watch'. | ||
27 error Make sure you have the latest version of node.js and npm installed. | ||
27 error If you do, this is most likely a problem with the etudiant-entrepreneur package, | ||
27 error not with npm itself. | ||
27 error Tell the author that this fails on your system: | ||
27 error npm-run-all --parallel test:watch open:src lint:watch | ||
27 error You can get information on how to open an issue for this project with: | ||
27 error npm bugs etudiant-entrepreneur | ||
27 error Or if that isn't available, you can get their info via: | ||
27 error npm owner ls etudiant-entrepreneur | ||
27 error There is likely additional logging output above. | ||
28 verbose exit [ 1, true ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
client/src/components/application/Contact/RenewContainer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { PropTypes } from 'react' | ||
import { connect } from 'react-redux' | ||
import { bindActionCreators } from 'redux' | ||
import toastr from 'toastr' | ||
|
||
import * as contactActions from '../../../actions/contactActions' | ||
import RenewForm from './RenewForm' | ||
|
||
export class RenewContainer extends React.Component { | ||
constructor(props, context) { | ||
super(props, context) | ||
this.state = { | ||
oldLink: '', | ||
error: '', | ||
renewId: '' | ||
} | ||
this.onOldLinkChange = this.onOldLinkChange.bind(this) | ||
this.onCopyApplicationClick = this.onCopyApplicationClick.bind(this) | ||
} | ||
|
||
onOldLinkChange(event) { | ||
const oldLink = event.target.value | ||
this.setState({ oldLink }) | ||
this.validateOldLink(oldLink) | ||
} | ||
|
||
validateOldLink(oldLink) { | ||
const regex = /^(.*\/application\/)?([a-f\d]{24})$/i | ||
const match = regex.exec(oldLink) | ||
if (match && match[2]) { | ||
this.setState({ error: '', renewId: match[2] }) | ||
} else { | ||
this.setState({ error: 'Ton lien n\'est pas valide', renewId: '' }) | ||
} | ||
} | ||
|
||
onCopyApplicationClick(event) { | ||
event.preventDefault() | ||
this.props.copyApplication(this.state.renewId).then(() => { | ||
toastr.success('Candidature copiée') | ||
}) | ||
.catch((err) => { | ||
if (err.response && err.response.data && err.response.data.reason) { | ||
toastr.error(err.response.data.reason) | ||
} else { | ||
toastr.error(err) | ||
} | ||
}) | ||
} | ||
|
||
render() { | ||
return ( | ||
<RenewForm | ||
onOldLinkChange={this.onOldLinkChange} | ||
onCopyApplicationClick={this.onCopyApplicationClick} | ||
oldLink={this.state.oldLink} | ||
error={this.state.error} /> | ||
) | ||
} | ||
} | ||
|
||
RenewContainer.propTypes = { | ||
copyApplication: PropTypes.func.isRequired | ||
} | ||
|
||
export default RenewContainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React, { PropTypes } from 'react' | ||
import { FormGroup, ControlLabel, Panel, InputGroup, FormControl, HelpBlock } from 'react-bootstrap' | ||
import ValidatedComponent from '../../common/ValidatedComponent' | ||
|
||
const RenewForm = ({ oldLink, error, onOldLinkChange, onCopyApplicationClick }) => { | ||
return ( | ||
<Panel bsStyle="primary" header="Repartir de ma candidature de l'année passée"> | ||
<form> | ||
<FormGroup> | ||
<ControlLabel>Lien de ta candidature</ControlLabel> | ||
<ValidatedComponent error={error}> | ||
<InputGroup> | ||
<InputGroup.Addon>{`${window.location.protocol}//`}</InputGroup.Addon> | ||
<FormControl name="oldLink" type="text" placeholder={`${window.location.host}/application/xxxxxxx`} onChange={onOldLinkChange} value={oldLink} /> | ||
</InputGroup> | ||
</ValidatedComponent> | ||
<HelpBlock>Retrouve ce lien dans le mail de ta candidature de l'année passée</HelpBlock> | ||
</FormGroup> | ||
<button type="button" className="btn btn-success" disabled={!oldLink && !!error} onClick={onCopyApplicationClick}>Copier</button> | ||
</form> | ||
</Panel> | ||
) | ||
} | ||
|
||
RenewForm.propTypes = { | ||
oldLink: PropTypes.string.isRequired, | ||
onOldLinkChange: PropTypes.func.isRequired, | ||
onCopyApplicationClick: PropTypes.func.isRequired, | ||
error: PropTypes.string | ||
} | ||
|
||
export default RenewForm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters