From 4f8afc0e9de73f93e7de5418746e32a48849f649 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Wed, 1 Jul 2020 16:40:21 -0400 Subject: [PATCH] KPMP-1919: Address codacy issues --- src/actions/Validation/validationActions.js | 9 ++++----- src/components/Validation/ValidationFailure.js | 2 +- src/components/Validation/ValidationSuccess.js | 2 +- .../Validation/filenameValidationReducer.js | 18 +++++++++--------- src/index.scss | 14 +++++++------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/actions/Validation/validationActions.js b/src/actions/Validation/validationActions.js index 9c0baca..827ab21 100644 --- a/src/actions/Validation/validationActions.js +++ b/src/actions/Validation/validationActions.js @@ -8,17 +8,16 @@ export const setValidationResult = (result) => { return { type: actionNames.SET_VALIDATION_RESULT, payload: result - } + }; } export const validateFilenames = (formData) => { return (dispatch) => { api.post('/api//v1/package/files/validation', formData) - .then(res => { + .then((res) => { dispatch(setValidationResult(res.data)); }) - .catch(error => { - console.log(error); + .catch((error) => { dispatch(sendMessageToBackend(error)); }); } @@ -27,5 +26,5 @@ export const validateFilenames = (formData) => { export const clearValidationResult = () => { return { type: actionNames.CLEAR_VALIDATION_RESULT - } + }; } \ No newline at end of file diff --git a/src/components/Validation/ValidationFailure.js b/src/components/Validation/ValidationFailure.js index 904634a..4ca91e1 100644 --- a/src/components/Validation/ValidationFailure.js +++ b/src/components/Validation/ValidationFailure.js @@ -60,7 +60,7 @@ class ValidationFailure extends Component { alt="Filename mismatch" id="fail-kidneys" className='validationImage' - /> + />

Validation Failed!

diff --git a/src/components/Validation/ValidationSuccess.js b/src/components/Validation/ValidationSuccess.js index 915439d..e511123 100644 --- a/src/components/Validation/ValidationSuccess.js +++ b/src/components/Validation/ValidationSuccess.js @@ -43,7 +43,7 @@ class ValidationSuccess extends Component { alt="Filename match" id="happy-kidneys" className='validationImage' - /> + />

Validation Success!

diff --git a/src/components/Validation/filenameValidationReducer.js b/src/components/Validation/filenameValidationReducer.js index 40b0231..615bf7f 100644 --- a/src/components/Validation/filenameValidationReducer.js +++ b/src/components/Validation/filenameValidationReducer.js @@ -3,13 +3,13 @@ import actionNames from '../../actions/actionNames'; export const filenameValidation = (state = {}, action) => { let newState = {}; - switch (action.type) { - case actionNames.SET_VALIDATION_RESULT: - newState = action.payload; - return newState; - case actionNames.CLEAR_VALIDATION_RESULT: - return newState; - default: - return state; - } + switch (action.type) { + case actionNames.SET_VALIDATION_RESULT: + newState = action.payload; + return newState; + case actionNames.CLEAR_VALIDATION_RESULT: + return newState; + default: + return state; + } } diff --git a/src/index.scss b/src/index.scss index 6582047..f2e68d9 100644 --- a/src/index.scss +++ b/src/index.scss @@ -1,20 +1,20 @@ @import "kpmp-base.scss"; .validationImage { - height: 150px; + height: 150px; } .validationMessage { - vertical-align: bottom; - height: 150px; - display: table-cell; + vertical-align: bottom; + height: 150px; + display: table-cell; } .resultHeader { - background-color: lightgray; - font-weight: 700; + background-color: lightgray; + font-weight: 700; } .heavierText { - font-weight: 700; + font-weight: 700; } \ No newline at end of file