-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from KPMP/develop
DMD Release 1.2
- Loading branch information
Showing
26 changed files
with
792 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ build/* | |
node_modules | ||
node_modules/* | ||
.project | ||
*.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,4 @@ notifications: | |
email: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/812f2e5d255f453e8021519d2a4c7056)](https://www.codacy.com/manual/rlreamy/libra-web?utm_source=github.com&utm_medium=referral&utm_content=KPMP/libra-web&utm_campaign=Badge_Grade) | ||
[![Build Status](https://travis-ci.org/KPMP/libra-web.svg?branch=develop)](https://travis-ci.org/KPMP/libra-web) | ||
|
||
# libra-web | ||
The web-layer of the KPMP curation tools. | ||
|
||
|
||
## Hosted at: | ||
dev-datamanager.kpmp.org | ||
datamanager.kpmp.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import actionNames from '../actionNames'; | ||
import Api from '../../helpers/Api'; | ||
import { sendMessageToBackend } from '../Error/errorActions'; | ||
|
||
const api = Api.getInstance(); | ||
|
||
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) => { | ||
dispatch(setValidationResult(res.data)); | ||
}) | ||
.catch((error) => { | ||
dispatch(sendMessageToBackend(error)); | ||
}); | ||
} | ||
} | ||
|
||
export const clearValidationResult = () => { | ||
return { | ||
type: actionNames.CLEAR_VALIDATION_RESULT | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import actionNames from '../actionNames'; | ||
import { setValidationResult, clearValidationResult } from './validationActions'; | ||
|
||
describe('setValidationResult', () => { | ||
it('should return the result in the correct structure', () => { | ||
let expectedResult = { | ||
type: actionNames.SET_VALIDATION_RESULT, | ||
payload: { 'key': 'value' } | ||
}; | ||
|
||
let result = setValidationResult({ 'key': 'value' }); | ||
|
||
expect(result).toEqual(expectedResult); | ||
}); | ||
}); | ||
describe('clearValidationResult', () => { | ||
it('should return the result in the correct structure', () => { | ||
let expectedResult = { | ||
type: actionNames.CLEAR_VALIDATION_RESULT | ||
}; | ||
|
||
let result = clearValidationResult(); | ||
|
||
expect(result).toEqual(expectedResult); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
const actionNames = { | ||
RESET_STATE: 'RESET_STATE', | ||
SET_PACKAGES: 'SET_PACKAGES', | ||
GET_PACKAGES: 'GET_PACKAGES' | ||
CLEAR_VALIDATION_RESULT: 'CLEAR_VALIDATION_RESULT', | ||
GET_PACKAGES: 'GET_PACKAGES', | ||
RESET_STATE: 'RESET_STATE', | ||
SET_PACKAGES: 'SET_PACKAGES', | ||
SET_VALIDATION_RESULT: 'SET_VALIDATION_RESULT' | ||
}; | ||
|
||
export default actionNames; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
import React, { Component } from 'react'; | ||
import { Container, Row, Col } from 'reactstrap'; | ||
import { Container, Row, Col, Button } from 'reactstrap'; | ||
import { Link } from 'react-router-dom'; | ||
import PackageTable from './PackageTable'; | ||
|
||
class PackageDashboardPage extends Component { | ||
|
||
componentDidMount() { | ||
this.props.getPackages(); | ||
} | ||
componentDidMount() { | ||
this.props.getPackages(); | ||
} | ||
|
||
render() { | ||
return <Container id="package-dashboard-page"> | ||
<Row> | ||
<Col sm={12}> | ||
<PackageTable | ||
packages={this.props.packages} | ||
/> | ||
</Col> | ||
</Row> | ||
</Container>; | ||
} | ||
render() { | ||
return ( | ||
<Container id='package-dashboard-page'> | ||
<Row className='mt-3'> | ||
<Col sm={12}> | ||
<Link className='float-right' to='/filenameValidation'> | ||
<Button color="primary">Validate Filenames</Button> | ||
</Link> | ||
</Col> | ||
</Row> | ||
<Row className='mt-3'> | ||
<Col sm={12}> | ||
<PackageTable | ||
packages={this.props.packages} movePackageFiles={this.props.movePackageFiles} | ||
/> | ||
</Col> | ||
</Row> | ||
</Container> | ||
); | ||
} | ||
} | ||
|
||
export default PackageDashboardPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.