Skip to content

Commit

Permalink
Fix eslint errors requiring manual intervention
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoesel committed May 9, 2017
1 parent 231e8ef commit 9ba54c1
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/first */
import React from 'react';
import '../node_modules/font-awesome/css/font-awesome.css';
import './styles/App.css';
Expand Down
2 changes: 1 addition & 1 deletion src/components/builder/BuilderPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class BuilderPage extends Component {
if (elementIndex !== undefined) {
// get relevant parameter
const paramIndex = elements[elementIndex].parameters.findIndex(
param => state.hasOwnProperty(param.id) === true);
param => Object.prototype.hasOwnProperty.call(state, param.id));

// edit element with new value using immutability-helper
const editedElements = update(elements, {
Expand Down
5 changes: 3 additions & 2 deletions src/components/builder/BuilderTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ const spec = {

/*
On drop, copy the element to create a new TemplateInstance.
TODO: clone is required because we are setting value on the parameter. this may not be the best approach
TODO: clone is required because we are setting value on the parameter.
This may not be the best approach
*/
const clone = JSON.parse(JSON.stringify(item));
clone.uniqueId = _.uniqueId(clone.id);
clone.parameters.forEach((param) => {
param.value = '';
param.value = ''; // eslint-disable-line no-param-reassign
});
props.updateTemplateInstances(props.templateInstances.concat(clone));
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/builder/TemplateInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TemplateInstance extends Component {
updateInstance={this.updateInstance} />
);
default:
return null;
return undefined;
}
}

Expand Down
11 changes: 7 additions & 4 deletions src/components/builder/parameters/StringParameter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ class StringParameter extends Component {
render() {
const id = _.uniqueId('parameter-');
const helpId = _.uniqueId('parameter-help-');
let validityClassName = null;
if (this.state.valid) {
validityClassName = 'form__group-valid';
} else if (this.state.valid === false) {
validityClassName = 'form__group-invalid';
}

return (
<div className={`form__group ${
(this.state.valid) ? 'form__group-valid'
: (this.state.valid === false) ? 'form__group-invalid' : null
}`}>
<div className={`form__group ${validityClassName}`}>
<label htmlFor={id}>
{this.props.name}:

Expand Down
12 changes: 10 additions & 2 deletions src/data/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,21 @@ module.exports = [
// id: 2,
// icon: 'stethoscope',
// name: 'Diagnoses',
// entries: ['Myocardial Infarction', 'Cerebrovascular disease, Stroke, TIA', 'Atherosclerosis and Peripheral Arterial Disease', 'Ischemic heart disease or coronary occlusion, rupture, or thrombosis', 'Stable and Unstable Angina', 'Hypertension', 'Diabetes', 'Familial Hypercholesterolemia'],
// entries: [
// 'Myocardial Infarction', 'Cerebrovascular disease, Stroke, TIA',
// 'Atherosclerosis and Peripheral Arterial Disease',
// 'Ischemic heart disease or coronary occlusion, rupture, or thrombosis',
// 'Stable and Unstable Angina', 'Hypertension', 'Diabetes',
// 'Familial Hypercholesterolemia'
// ],
// },
// {
// id: 3,
// icon: 'flask',
// name: 'Lab Results',
// entries: ['Total Cholesterol', 'HDL Cholesterol', 'Systolic Blood Pressure', 'LDL Cholesterol'],
// entries: [
// 'Total Cholesterol', 'HDL Cholesterol', 'Systolic Blood Pressure', 'LDL Cholesterol'
// ],
// },
// {
// id: 4,
Expand Down
4 changes: 1 addition & 3 deletions src/helpers/test_fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,4 @@ const droppedElements = [
}
];

export {
droppedElements
};
export default droppedElements;

0 comments on commit 9ba54c1

Please sign in to comment.