Add available for hire button

This commit is contained in:
padulam
2017-06-17 18:09:43 -04:00
parent 53141040f4
commit ec020ad471
7 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,38 @@
import React, { PropTypes } from 'react';
import { Button, Row, Col } from 'react-bootstrap';
import classnames from 'classnames';
const propTypes = {
isAvailableForHire: PropTypes.bool,
toggle: PropTypes.func.isRequired
};
export default function JobSettings({ isAvailableForHire, toggle }) {
const className = classnames({
active: isAvailableForHire,
'btn-toggle': true
});
return (
<Row>
<Col xs={ 9 }>
<p className='large-p'>
Available for hire?
</p>
</Col>
<Col xs={ 3 }>
<Button
block={ true }
bsSize='lg'
bsStyle='primary'
className={ className }
onClick={ toggle }
>
{ isAvailableForHire ? 'Available' : 'Unavailable' }
</Button>
</Col>
</Row>
);
}
JobSettings.displayName = 'JobSettings';
JobSettings.propTypes = propTypes;

View File

@ -6,6 +6,7 @@ import { Button, Row, Col } from 'react-bootstrap';
import FA from 'react-fontawesome';
import LockedSettings from './Locked-Settings.jsx';
import JobSettings from './Job-Settings.jsx';
import SocialSettings from './Social-Settings.jsx';
import EmailSettings from './Email-Setting.jsx';
import LanguageSettings from './Language-Settings.jsx';
@ -19,6 +20,7 @@ import { toggleNightMode, updateTitle } from '../../../redux/actions.js';
const mapDispatchToProps = {
updateTitle,
toggleNightMode,
toggleIsAvailableForHire: () => toggleUserFlag('isAvailableForHire'),
toggleIsLocked: () => toggleUserFlag('isLocked'),
toggleQuincyEmail: () => toggleUserFlag('sendQuincyEmail'),
toggleNotificationEmail: () => toggleUserFlag('sendNotificationEmail'),
@ -33,6 +35,7 @@ const mapStateToProps = createSelector(
user: {
username,
email,
isAvailableForHire,
isLocked,
isGithubCool,
isTwitter,
@ -47,6 +50,7 @@ const mapStateToProps = createSelector(
showLoading: isSignInAttempted,
username,
email,
isAvailableForHire,
isLocked,
isGithubCool,
isTwitter,
@ -60,6 +64,7 @@ const propTypes = {
children: PropTypes.element,
email: PropTypes.string,
initialLang: PropTypes.string,
isAvailableForHire: PropTypes.bool,
isGithubCool: PropTypes.bool,
isLinkedIn: PropTypes.bool,
isLocked: PropTypes.bool,
@ -69,6 +74,7 @@ const propTypes = {
sendNotificationEmail: PropTypes.bool,
sendQuincyEmail: PropTypes.bool,
showLoading: PropTypes.bool,
toggleIsAvailableForHire: PropTypes.func.isRequired,
toggleIsLocked: PropTypes.func.isRequired,
toggleMonthlyEmail: PropTypes.func.isRequired,
toggleNightMode: PropTypes.func.isRequired,
@ -99,6 +105,7 @@ export class Settings extends React.Component {
const {
children,
username,
isAvailableForHire,
isLocked,
isGithubCool,
isTwitter,
@ -108,6 +115,7 @@ export class Settings extends React.Component {
sendMonthlyEmail,
sendNotificationEmail,
sendQuincyEmail,
toggleIsAvailableForHire,
toggleNightMode,
toggleIsLocked,
toggleQuincyEmail,
@ -219,6 +227,22 @@ export class Settings extends React.Component {
</Col>
</Row>
<div className='spacer' />
<h2 className='text-center'>Job Search Settings</h2>
<Row>
<Col
md={ 6 }
mdOffset={ 3 }
sm={ 8 }
smOffset={ 2 }
xs={ 12 }
>
<JobSettings
isAvailableForHire={ isAvailableForHire }
toggle={ toggleIsAvailableForHire }
/>
</Col>
</Row>
<div className='spacer' />
<h2 className='text-center'>Email Settings</h2>
<Row>
<Col

View File

@ -17,6 +17,7 @@ import combineSagas from '../../../../utils/combine-sagas';
const urlMap = {
isLocked: 'lockdown',
isAvailableForHire: 'available-for-hire',
sendQuincyEmail: 'quincy-email',
sendNotificationEmail: 'notification-email',
sendMonthlyEmail: 'announcement-email'

View File

@ -120,6 +120,11 @@
"description": "Campers profile does not show challenges/certificates to the public",
"default": false
},
"isAvailableForHire": {
"type": "boolean",
"description": "Camper is available for hire",
"default": false
},
"currentChallengeId": {
"type": "string",
"description": "The challenge last visited by the user",

View File

@ -81,6 +81,11 @@ export default function settingsController(app) {
);
}
api.post(
'/toggle-available-for-hire',
ifNoUser401,
toggleUserFlag('isAvailableForHire')
);
api.post(
'/toggle-lockdown',
ifNoUser401,

View File

@ -463,6 +463,7 @@ module.exports = function(app) {
isGithubCool: true,
isCheater: true,
isLocked: true,
isAvailableForHire: true,
isFrontEndCert: true,
isDataVisCert: true,
isBackEndCert: true,

View File

@ -16,6 +16,7 @@ const publicUserProps = [
'isGithubCool',
'isLocked',
'isAvailableForHire',
'isFrontEndCert',
'isBackEndCert',
'isDataVisCert',