Change full stack to back end on job apps

pull/5871/head
Berkeley Martinez 2016-01-05 21:31:48 -08:00
parent 5ef6a7f11e
commit 1fb321332b
4 changed files with 39 additions and 28 deletions

View File

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

View File

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

View File

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

View File

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