Change full stack to back end on job apps

This commit is contained in:
Berkeley Martinez
2016-01-05 21:31:48 -08:00
parent b70f301ade
commit f8aa0ec3e5
4 changed files with 39 additions and 28 deletions

View File

@ -17,6 +17,7 @@ export default Actions({
picture, picture,
progressTimestamps = [], progressTimestamps = [],
isFrontEndCert, isFrontEndCert,
isBackEndCert,
isFullStackCert isFullStackCert
}) => { }) => {
return { return {
@ -24,6 +25,7 @@ export default Actions({
picture, picture,
points: progressTimestamps.length, points: progressTimestamps.length,
isFrontEndCert, isFrontEndCert,
isBackEndCert,
isFullStackCert isFullStackCert
}; };
}) })

View File

@ -115,7 +115,7 @@ export default contain({
logo, logo,
company, company,
isFrontEndCert = true, isFrontEndCert = true,
isFullStackCert, isBackEndCert,
isHighlighted, isHighlighted,
isRemoteOk, isRemoteOk,
howToApply howToApply
@ -132,7 +132,7 @@ export default contain({
isRemoteOk: formatValue(isRemoteOk, null, 'bool'), isRemoteOk: formatValue(isRemoteOk, null, 'bool'),
howToApply: formatValue(howToApply, makeRequired(isAscii)), howToApply: formatValue(howToApply, makeRequired(isAscii)),
isFrontEndCert, isFrontEndCert,
isFullStackCert isBackEndCert
}; };
}, },
subscribeOnWillMount() { subscribeOnWillMount() {
@ -154,7 +154,7 @@ export default contain({
isHighlighted: PropTypes.object, isHighlighted: PropTypes.object,
isRemoteOk: PropTypes.object, isRemoteOk: PropTypes.object,
isFrontEndCert: PropTypes.bool, isFrontEndCert: PropTypes.bool,
isFullStackCert: PropTypes.bool, isBackEndCert: PropTypes.bool,
howToApply: PropTypes.object howToApply: PropTypes.object
}, },
@ -171,7 +171,11 @@ export default contain({
} }
}); });
if (!valid || !pros.isFrontEndCert && !pros.isFullStackCert ) { if (
!valid ||
!pros.isFrontEndCert &&
!pros.isBackEndCert
) {
debug('form not valid'); debug('form not valid');
return; return;
} }
@ -188,7 +192,7 @@ export default contain({
logo, logo,
company, company,
isFrontEndCert, isFrontEndCert,
isFullStackCert, isBackEndCert,
isHighlighted, isHighlighted,
isRemoteOk, isRemoteOk,
howToApply howToApply
@ -207,7 +211,7 @@ export default contain({
isRemoteOk: !!isRemoteOk.value, isRemoteOk: !!isRemoteOk.value,
howToApply: inHTMLData(howToApply.value), howToApply: inHTMLData(howToApply.value),
isFrontEndCert, isFrontEndCert,
isFullStackCert isBackEndCert
}; };
const job = Object.keys(jobValues).reduce((accu, prop) => { const job = Object.keys(jobValues).reduce((accu, prop) => {
@ -237,7 +241,7 @@ export default contain({
handleCertClick(name) { handleCertClick(name) {
const { jobActions: { handleForm } } = this.props; const { jobActions: { handleForm } } = this.props;
const otherButton = name === 'isFrontEndCert' ? const otherButton = name === 'isFrontEndCert' ?
'isFullStackCert' : 'isBackEndCert' :
'isFrontEndCert'; 'isFrontEndCert';
handleForm({ handleForm({
@ -259,7 +263,7 @@ export default contain({
isRemoteOk, isRemoteOk,
howToApply, howToApply,
isFrontEndCert, isFrontEndCert,
isFullStackCert, isBackEndCert,
jobActions: { handleForm } jobActions: { handleForm }
} = this.props; } = this.props;
@ -306,13 +310,13 @@ export default contain({
<div className='button-spacer' /> <div className='button-spacer' />
<Row> <Row>
<Button <Button
className={ isFullStackCert ? 'active' : ''} className={ isBackEndCert ? 'active' : ''}
onClick={ () => { onClick={ () => {
if (!isFullStackCert) { if (!isBackEndCert) {
this.handleCertClick('isFullStackCert'); this.handleCertClick('isBackEndCert');
} }
}}> }}>
<h4>Full Stack Development Certified</h4> <h4>Back End Development Certified</h4>
You can expect each applicant to have a code You can expect each applicant to have a code
portfolio using the following technologies: portfolio using the following technologies:
HTML5, CSS, jQuery, API integrations, MVC Framework, HTML5, CSS, jQuery, API integrations, MVC Framework,

View File

@ -9,25 +9,25 @@ import { isJobValid } from '../utils';
function shouldShowApply( function shouldShowApply(
{ {
isFrontEndCert: isFrontEndCertReq = false, isFrontEndCert: isFrontEndCertReq = false,
isFullStackCert: isFullStackCertReq = false isBackEndCert: isBackEndCertReq = false
}, { }, {
isFrontEndCert = false, isFrontEndCert = false,
isFullStackCert = false isBackEndCert = false
} }
) { ) {
return (!isFrontEndCertReq && !isFullStackCertReq) || return (!isFrontEndCertReq && !isBackEndCertReq) ||
(isFullStackCertReq && isFullStackCert) || (isBackEndCertReq && isBackEndCert) ||
(isFrontEndCertReq && isFrontEndCert); (isFrontEndCertReq && isFrontEndCert);
} }
function generateMessage( function generateMessage(
{ {
isFrontEndCert: isFrontEndCertReq = false, isFrontEndCert: isFrontEndCertReq = false,
isFullStackCert: isFullStackCertReq = false isBackEndCert: isBackEndCertReq = false
}, },
{ {
isFrontEndCert = false, isFrontEndCert = false,
isFullStackCert = false, isBackEndCert = false,
isSignedIn = false isSignedIn = false
} }
) { ) {
@ -39,15 +39,15 @@ function generateMessage(
return 'This employer requires Free Code Camps Front ' + return 'This employer requires Free Code Camps Front ' +
'End Development Certification in order to apply'; 'End Development Certification in order to apply';
} }
if (isFullStackCertReq && !isFullStackCert) { if (isBackEndCertReq && !isBackEndCert) {
return 'This employer requires Free Code Camps Full ' + return 'This employer requires Free Code Camps Back ' +
'Stack Development Certification in order to apply'; 'End Development Certification in order to apply';
} }
if (isFrontEndCertReq && isFrontEndCertReq) { if (isFrontEndCertReq && isFrontEndCertReq) {
return 'This employer requires the Front End Development Certification. ' + return 'This employer requires the Front End Development Certification. ' +
"You've earned it, so feel free to apply."; "You've earned it, so feel free to apply.";
} }
return 'This employer requires the Full Stack Development Certification. ' + return 'This employer requires the Back End Development Certification. ' +
"You've earned it, so feel free to apply."; "You've earned it, so feel free to apply.";
} }
@ -58,14 +58,14 @@ export default contain(
map({ map({
username, username,
isFrontEndCert, isFrontEndCert,
isFullStackCert, isBackEndCert,
jobsApp: { currentJob } jobsApp: { currentJob }
}) { }) {
return { return {
username, username,
job: currentJob, job: currentJob,
isFrontEndCert, isFrontEndCert,
isFullStackCert isBackEndCert
}; };
}, },
getPayload({ params: { id } }) { getPayload({ params: { id } }) {
@ -85,7 +85,7 @@ export default contain(
propTypes: { propTypes: {
job: PropTypes.object, job: PropTypes.object,
isFullStackCert: PropTypes.bool, isBackEndCert: PropTypes.bool,
isFrontEndCert: PropTypes.bool, isFrontEndCert: PropTypes.bool,
username: PropTypes.string username: PropTypes.string
}, },
@ -102,7 +102,7 @@ export default contain(
render() { render() {
const { const {
isFullStackCert, isBackEndCert,
isFrontEndCert, isFrontEndCert,
job, job,
username username
@ -116,12 +116,12 @@ export default contain(
const showApply = shouldShowApply( const showApply = shouldShowApply(
job, job,
{ isFrontEndCert, isFullStackCert } { isFrontEndCert, isBackEndCert }
); );
const message = generateMessage( const message = generateMessage(
job, job,
{ isFrontEndCert, isFullStackCert, isSignedIn } { isFrontEndCert, isBackEndCert, isSignedIn }
); );
return ( return (

View File

@ -74,6 +74,11 @@
"defaut": false, "defaut": false,
"description": "Camper must be front end certified to apply" "description": "Camper must be front end certified to apply"
}, },
"isBackEndCert": {
"type": "boolean",
"default": false,
"description": "Camper must be back end certified to apply"
},
"isFullStackCert": { "isFullStackCert": {
"type": "boolean", "type": "boolean",
"default": false, "default": false,