From 0008bbb8604eda17fc5777edb91dc3eca50e3676 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Mon, 27 May 2019 20:13:43 +0100 Subject: [PATCH] Lint whitespace, case, prop-types --- app/src/frontend/app.js | 20 +++--- app/src/frontend/building-edit.js | 110 ++++++++++++++++-------------- app/src/frontend/building-view.js | 5 +- app/src/frontend/map.js | 6 +- app/src/frontend/multi-edit.js | 39 ++++++----- 5 files changed, 99 insertions(+), 81 deletions(-) diff --git a/app/src/frontend/app.js b/app/src/frontend/app.js index 32949f09..68f97d50 100644 --- a/app/src/frontend/app.js +++ b/app/src/frontend/app.js @@ -66,10 +66,10 @@ class App extends React.Component { this.setState({user: undefined}); } - increaseRevision(revision_id) { + increaseRevision(revisionId) { // bump revision id, only ever increasing - if (revision_id > this.state.revision_id){ - this.setState({revision_id: revision_id}) + if (revisionId > this.state.revision_id){ + this.setState({revision_id: revisionId}) } } @@ -131,11 +131,11 @@ class App extends React.Component { } } - likeBuilding(building_id) { - fetch(`/building/${building_id}/like.json`, { + likeBuilding(buildingId) { + fetch(`/building/${buildingId}/like.json`, { method: 'POST', headers:{ - 'Content-Type': 'application/json' + 'Content-Type': 'application/json' }, credentials: 'same-origin', body: JSON.stringify({like: true}) @@ -152,12 +152,12 @@ class App extends React.Component { ); } - updateBuilding(building_id, data){ - fetch(`/building/${building_id}.json`, { + updateBuilding(buildingId, data){ + fetch(`/building/${buildingId}.json`, { method: 'POST', body: JSON.stringify(data), headers:{ - 'Content-Type': 'application/json' + 'Content-Type': 'application/json' }, credentials: 'same-origin' }).then( @@ -198,7 +198,7 @@ class App extends React.Component { + /> ) } /> ( { - match? ( - !this.props.inactive? -
- { - this.props.slug === 'location'? - - : null - } - - { - this.props.fields.map((props) => { - switch (props.type) { - case "text": - return + { + this.props.slug === 'location'? + + : null + } + + { + this.props.fields.map((props) => { + switch (props.type) { + case 'text': + return - case "text_list": - return - case "text_long": - return - case "number": - return - case "year_estimator": - return - case "text_multi": - return - case "checkbox": - return - case "like": - return - default: - return null + default: + return null + } + }) } - }) - } - - { - (this.props.slug === 'like')? // special-case for likes - null : -
- -
- } - - :
- - - ) : null + + { + (this.props.slug === 'like')? // special-case for likes + null : +
+ +
+ } + + :
+ + + ) : null } ) @@ -286,8 +286,8 @@ const TextInput = (props) => (