Skip to content

Commit

Permalink
feat(sessions): add questionnaire view to sessions ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Apr 17, 2019
1 parent a20c63e commit efe407e
Show file tree
Hide file tree
Showing 21 changed files with 1,464 additions and 30 deletions.
6 changes: 5 additions & 1 deletion src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const API_ENDPOINTS = {
updateApplicationSharing: `${BASE_API}/applications/{}/sharing/`,
createApplication: `${BASE_API}/applications/`,
editApplication: `${BASE_API}/applications/{}/`,
deleteApplication: `${BASE_API}/applications/{}/`
deleteApplication: `${BASE_API}/applications/{}/`,
getQuestionnaires: `${BASE_API}/questionnaires/`,
getQuestionnaireInfo: `${BASE_API}/questionnaires/{}/`,
updateQuestionnaire: `${BASE_API}/questionnaires/{}/`,
createQuestionnaire: `${BASE_API}/questionnaires/`,
};

export { API_ENDPOINTS };
2 changes: 1 addition & 1 deletion src/assets/sass/partials/_checkbox-radio-switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

.radio input[type="radio"]:checked:not(:disabled):hover + label::after,
.radio input[type="radio"]:checked + label::after {
color: $color-azure;
color: $secondary-color;
}

.radio input[type="radio"]:disabled + label {
Expand Down
4 changes: 4 additions & 0 deletions src/assets/sass/partials/_misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,8 @@ legend {
/* 10. Global Backgrounds */
.bg-white {
background: $color-white !important;
}

.inline-block {
display: inline-block !important;
}
2 changes: 1 addition & 1 deletion src/assets/sass/partials/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,4 @@
.new-session-content {
margin-top: 10%;
}
}
}
9 changes: 4 additions & 5 deletions src/elements/custom-radio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import PropTypes from 'prop-types';

const CustomRadio = (props) => {
const {
id, label, option, name, inline, ...rest
id, label, option, name, inline, additionalClasses, checked, ...rest
} = props;

const mainClasses = inline ? 'radio radio-inline':'radio';
return (
<div className={inline ? 'radio custom-radio-inline' : 'radio'}>
<div className={mainClasses + ' ' + additionalClasses}>
<input id={id} name={name} type="radio" value={option} {...rest} checked={checked}/>
<label htmlFor={id}>
<input id={id} name={name} type="radio" value={option} {...rest} />
{label}
</label>
</div>
Expand All @@ -29,7 +29,6 @@ CustomRadio.propTypes = {
PropTypes.bool,
]).isRequired,
name: PropTypes.string.isRequired,
inline: PropTypes.bool,
checked: PropTypes.bool.isRequired,
};

Expand Down
10 changes: 7 additions & 3 deletions src/forms/applications/create-application/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ function submit(values, dispatch, props) {
public_sharing: values.sharing? values.sharing: false
};

if (props.config && props.config.mode === 'create') dispatch(createApplication(body));
else if (props.config && props.config.mode === 'edit') dispatch(editApplication(body));
else dispatch(createApplication(body));
if (props.config && props.config.mode === 'create') {
dispatch(createApplication(body));
} else if (props.config && props.config.mode === 'edit') {
dispatch(editApplication(body));
} else {
dispatch(createApplication(body));
}

dispatch(closeModal({ modalKey: createApplicationModalKey }));
}
Expand Down
1 change: 1 addition & 0 deletions src/forms/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './auth';
export * from './applications';
export * from './sessions';
Loading

0 comments on commit efe407e

Please sign in to comment.