diff --git a/README.md b/README.md index f47a4f7..3708bba 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ # libra-web The web-layer of the KPMP curation tools. +## How to work with this locally +Libra-web lives atop the DLU ecosystem and uses orion-data as its service layer. +In production, DLU and DMD are served up with the same Apache, but we have not yet confgured our local instance to handle this since it would mean that one of the applications would need to run at a different path, which makes compiling for local and production different. + +Instead, the easiest way to get the DMD running locally is to modify your .env in heavens-docker/orion to set the ENV_REACT_APPDIR to point at your checked out libra-web instead of orion-web + ## Hosted at: dev-datamanager.kpmp.org datamanager.kpmp.org diff --git a/package.json b/package.json index 2818b83..198c05e 100644 --- a/package.json +++ b/package.json @@ -3,25 +3,32 @@ "version": "1.3.0", "private": true, "dependencies": { - "axios": "0.20.0", - "babel-eslint": "10.0.1", + "@fortawesome/fontawesome-svg-core": "^1.2.36", + "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/react-fontawesome": "^0.1.16", + "axios": "^0.24.0", + "babel-eslint": "10.1.0", "babel-polyfill": "6.26.0", "bootstrap-css-only": "4.4.1", - "history": "4.10.1", - "kpmp-custom-react-scripts": "1.1.2", - "moment": "2.24.0", + "history": "5.1.0", + "moment": "2.29.1", + "node-sass-chokidar": "1.5.0", + "npm-run-all": "4.1.5", "prop-types": "15.7.2", "react": "16.9.0", + "react-csv": "^2.0.3", "react-dom": "16.9.0", "react-ga": "2.6.0", - "react-redux": "7.1.1", + "react-redux": "7.2.6", "react-router-dom": "5.0.1", + "react-scripts": "4.0.3", "react-table": "6.10.3", "reactstrap": "8.0.1", - "redux": "4.0.4", - "redux-thunk": "2.3.0" + "redux": "4.1.2", + "redux-thunk": "2.4.0" }, "devDependencies": { + "acorn": "^8.6.0", "node-sass-chokidar": "^1.5.0", "npm-run-all": "4.1.5" }, diff --git a/src/actions/Error/errorActions.js b/src/actions/Error/errorActions.js index f2334a8..73b4735 100644 --- a/src/actions/Error/errorActions.js +++ b/src/actions/Error/errorActions.js @@ -28,7 +28,12 @@ export const sendMessageToBackend = (error) => { return (dispatch) => { api.post('/api/v1/error', errorMessage) .then(res=> { - dispatch(handleError(error.response.status)); + if (error.response) { + dispatch(handleError(error.response.status)); + } else { + dispatch(handleError(error)); + } + }); }; } diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 94a90e3..ebd4e8a 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -3,8 +3,11 @@ import ReactTable from 'react-table'; import ReactGA from 'react-ga'; import PropTypes from 'prop-types'; import Moment from 'moment'; -import { Button } from 'reactstrap'; +import { Row, Col, Button } from 'reactstrap'; import { getStateDisplayText } from './stateDisplayHelper'; +import { faDownload } from '@fortawesome/free-solid-svg-icons'; +import { CSVLink } from 'react-csv'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; const PACKAGE_ID_LABEL = 'Package ID'; const PACKAGE_TYPE_LABEL = 'Package Type'; @@ -49,6 +52,7 @@ class PackageTable extends Component { }; }; + getColumns() { return [ { @@ -168,22 +172,52 @@ class PackageTable extends Component { }); } + prepareData = (packages) => { + return packages.map((pkg) => { + return { + [PACKAGE_ID_LABEL]: pkg[PACKAGE_INFO_PROPERTY][PACKAGE_ID], + [SUBJECT_ID_LABEL]: pkg[PACKAGE_INFO_PROPERTY][SUBJECT_ID], + [PACKAGE_TYPE_LABEL]: pkg[PACKAGE_INFO_PROPERTY][PACKAGE_TYPE_ID], + [SUBMITTER_LABEL]: pkg[PACKAGE_INFO_PROPERTY].submitter && pkg[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] ? pkg[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] : pkg[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_FIRST_NAME] + ' ' + pkg[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_LAST_NAME], + [TIS_NAME_LABEL]: pkg[PACKAGE_INFO_PROPERTY][TIS_NAME_ID], + [DATE_SUBMITTED_LABEL]: new Moment(pkg[PACKAGE_INFO_PROPERTY][DATE_SUBMITTED_ID]).local().format(DATE_FORMAT), + [PACKAGE_STATE_LABEL]: getStateDisplayText(pkg.state, this.props.stateDisplayMap) + } + }); + } + render() { - return ; + return ( +
+ + + + + + + + +
+ ); } }