Skip to content

Commit

Permalink
KPMP-1919: Address codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rlreamy committed Jul 1, 2020
1 parent 02e2d80 commit 4f8afc0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
9 changes: 4 additions & 5 deletions src/actions/Validation/validationActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
}
Expand All @@ -27,5 +26,5 @@ export const validateFilenames = (formData) => {
export const clearValidationResult = () => {
return {
type: actionNames.CLEAR_VALIDATION_RESULT
}
};
}
2 changes: 1 addition & 1 deletion src/components/Validation/ValidationFailure.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ValidationFailure extends Component {
alt="Filename mismatch"
id="fail-kidneys"
className='validationImage'
/>
/>
</Col>
<Col sm={10}>
<h3 className='validationMessage'>Validation Failed!</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Validation/ValidationSuccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ValidationSuccess extends Component {
alt="Filename match"
id="happy-kidneys"
className='validationImage'
/>
/>
</Col>
<Col sm={10}>
<h3 className='validationMessage'>Validation Success!</h3>
Expand Down
18 changes: 9 additions & 9 deletions src/components/Validation/filenameValidationReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
14 changes: 7 additions & 7 deletions src/index.scss
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 4f8afc0

Please sign in to comment.