From dd2bd506afd23b2d9223210555aa399816479d15 Mon Sep 17 00:00:00 2001 From: rlreamy <34109594+rlreamy@users.noreply.github.com> Date: Thu, 31 Oct 2019 15:11:37 -0400 Subject: [PATCH 01/30] Added badges --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b0e4e75..a28e4c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ +[![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. - - From 7adfb9d641c78510f01d13aeb4b115b039b8b6c8 Mon Sep 17 00:00:00 2001 From: rlreamy <34109594+rlreamy@users.noreply.github.com> Date: Thu, 31 Oct 2019 16:03:35 -0400 Subject: [PATCH 02/30] Added urls to where app is hosted --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a28e4c1..f47a4f7 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,7 @@ # libra-web The web-layer of the KPMP curation tools. + +## Hosted at: +dev-datamanager.kpmp.org +datamanager.kpmp.org From e26c756530a5f148285374d82cc8586bd31e206c Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Fri, 1 Nov 2019 14:12:24 -0400 Subject: [PATCH 03/30] KPMP-1345: Increasing version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7a70b9..b5f42b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libra-web", - "version": "1.1.0", + "version": "1.2.0", "private": true, "dependencies": { "axios": "0.19.0", From 92f6062e48db264c282d48ae8a8e6da44352cc9c Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 8 Jun 2020 15:41:25 -0400 Subject: [PATCH 04/30] KPMP-1883: Added subject id and ran npm audit fix --- package.json | 2 +- src/components/PackageDashboard/PackageTable.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b5f42b5..fd7a53e 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "redux-thunk": "2.3.0" }, "devDependencies": { - "node-sass-chokidar": "1.3.5", + "node-sass-chokidar": "^1.4.0", "npm-run-all": "4.1.5" }, "scripts": { diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 1d081b8..57971a3 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -11,6 +11,7 @@ const SUBMITTER_LABEL = "Submitter"; const TIS_NAME_LABEL = "TIS Name"; const DATE_SUBMITTED_LABEL = "Date Submitted"; const PACKAGE_STATE_LABEL = "Package State"; +const SUBJECT_ID_LABEL = "Subject Id"; const PACKAGE_ID = "_id"; const SUBMITTER_ID = "displayName"; @@ -22,6 +23,7 @@ const DATE_SUBMITTED_ID = "createdAt"; const DATE_FORMAT = "YYYY-MM-DD, h:mm a z"; const PACKAGE_INFO_PROPERTY = "packageInfo"; const PACKAGE_STATE_ID = "state"; +const SUBJECT_ID = "subjectId"; // package id, submitter, package type, tis name, date submitted class PackageTable extends Component { @@ -50,6 +52,11 @@ class PackageTable extends Component { id: PACKAGE_ID, accessor: (row) => row[PACKAGE_INFO_PROPERTY][PACKAGE_ID] }, + { + Header: SUBJECT_ID_LABEL, + id: SUBJECT_ID, + accessor: (row) => row[PACKAGE_INFO_PROPERTY][SUBJECT_ID] + }, { Header: PACKAGE_TYPE_LABEL, id: PACKAGE_TYPE_ID, @@ -85,6 +92,7 @@ class PackageTable extends Component { return "" } } + ]; } From 2d5e1fef56e1c794ac6bf20b5902ec3bb6f7ec4d Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 8 Jun 2020 15:48:38 -0400 Subject: [PATCH 05/30] KPMP-1883: Removed useless test. Removed cgat from mailing list on travis build --- .travis.yml | 1 - src/App.test.js | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 src/App.test.js diff --git a/.travis.yml b/.travis.yml index 4195208..950ab33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,5 +14,4 @@ notifications: email: - rlreamy@umich.edu - zwright@umich.edu - - cgates@umich.edu - rossmith@umich.edu diff --git a/src/App.test.js b/src/App.test.js deleted file mode 100644 index a754b20..0000000 --- a/src/App.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); From 4b986bbdb780cbf1d3e9eaef8ed75f304fd44e69 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Tue, 9 Jun 2020 16:19:53 -0400 Subject: [PATCH 06/30] KPMP-1903: Add link when in metadata recieved state and there is a globus directory present and is large file upload --- .../PackageDashboard/PackageTable.js | 61 ++++++++++++------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 57971a3..b047ab5 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -5,25 +5,27 @@ import PropTypes from 'prop-types'; import Moment from 'moment'; import stateMap from './stateMap'; -const PACKAGE_ID_LABEL = "Package ID"; -const PACKAGE_TYPE_LABEL = "Package Type"; -const SUBMITTER_LABEL = "Submitter"; -const TIS_NAME_LABEL = "TIS Name"; -const DATE_SUBMITTED_LABEL = "Date Submitted"; -const PACKAGE_STATE_LABEL = "Package State"; -const SUBJECT_ID_LABEL = "Subject Id"; +const PACKAGE_ID_LABEL = 'Package ID'; +const PACKAGE_TYPE_LABEL = 'Package Type'; +const SUBMITTER_LABEL = 'Submitter'; +const TIS_NAME_LABEL = 'TIS Name'; +const DATE_SUBMITTED_LABEL = 'Date Submitted'; +const PACKAGE_STATE_LABEL = 'Package State'; +const SUBJECT_ID_LABEL = 'Subject Id'; -const PACKAGE_ID = "_id"; -const SUBMITTER_ID = "displayName"; -const SUBMITTER_FIRST_NAME = "firstName"; -const SUBMITTER_LAST_NAME = "lastName"; -const PACKAGE_TYPE_ID = "packageType"; -const TIS_NAME_ID = "tisName"; -const DATE_SUBMITTED_ID = "createdAt"; -const DATE_FORMAT = "YYYY-MM-DD, h:mm a z"; -const PACKAGE_INFO_PROPERTY = "packageInfo"; -const PACKAGE_STATE_ID = "state"; -const SUBJECT_ID = "subjectId"; +const PACKAGE_ID = '_id'; +const SUBMITTER_ID = 'displayName'; +const SUBMITTER_FIRST_NAME = 'firstName'; +const SUBMITTER_LAST_NAME = 'lastName'; +const PACKAGE_TYPE_ID = 'packageType'; +const TIS_NAME_ID = 'tisName'; +const DATE_SUBMITTED_ID = 'createdAt'; +const DATE_FORMAT = 'YYYY-MM-DD, h:mm a z'; +const PACKAGE_INFO_PROPERTY = 'packageInfo'; +const PACKAGE_STATE_ID = 'state'; +const SUBJECT_ID = 'subjectId'; +const GLOBUS_LINK = 'codicil'; +const LARGE_FILE_UPLOAD = 'largeFilesChecked'; // package id, submitter, package type, tis name, date submitted class PackageTable extends Component { @@ -50,7 +52,20 @@ class PackageTable extends Component { { Header: PACKAGE_ID_LABEL, id: PACKAGE_ID, - accessor: (row) => row[PACKAGE_INFO_PROPERTY][PACKAGE_ID] + accessor: 'link', + Cell: (info) => { + let row = info.original; + let packageId = row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; + let globusDir = row.state[GLOBUS_LINK]; + let isLargeFileUpload = row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD]; + if(isLargeFileUpload && globusDir !== '') { + return ( + {packageId} + ); + } else { + return packageId; + } + } }, { Header: SUBJECT_ID_LABEL, @@ -65,7 +80,7 @@ class PackageTable extends Component { { Header: SUBMITTER_LABEL, id: SUBMITTER_ID, - accessor: (row) => row[PACKAGE_INFO_PROPERTY].submitter && row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] ? row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] : row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_FIRST_NAME] + " " + row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_LAST_NAME] + accessor: (row) => row[PACKAGE_INFO_PROPERTY].submitter && row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] ? row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] : row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_FIRST_NAME] + ' ' + row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_LAST_NAME] }, { Header: TIS_NAME_LABEL, @@ -89,7 +104,7 @@ class PackageTable extends Component { if (row.state && row.state[PACKAGE_STATE_ID]) { return stateMap.has(row.state[PACKAGE_STATE_ID]) ? stateMap.get(row.state[PACKAGE_STATE_ID]) : row.state[PACKAGE_STATE_ID]; } - return "" + return '' } } @@ -139,9 +154,9 @@ class PackageTable extends Component { defaultPageSize={12} defaultFilterMethod={this.defaultFilterMethod} filterable - className="-striped -highlight" + className='-striped -highlight' showPageSizeOptions={false} - noDataText={"No packages found"} + noDataText={'No packages found'} />; } } From a591844f0c01475c998d01fa126ea9411ddab43d Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Tue, 9 Jun 2020 16:26:47 -0400 Subject: [PATCH 07/30] KPMP-1903: Fix codacy errors --- src/components/PackageDashboard/PackageTable.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index b047ab5..023a5d2 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -55,16 +55,13 @@ class PackageTable extends Component { accessor: 'link', Cell: (info) => { let row = info.original; - let packageId = row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; - let globusDir = row.state[GLOBUS_LINK]; - let isLargeFileUpload = row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD]; - if(isLargeFileUpload && globusDir !== '') { - return ( - {packageId} - ); - } else { - return packageId; - } + if(row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD] && row.state[GLOBUS_LINK] !== '') { + return ( + {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} + ); + } else { + return packageId; + } } }, { From f05d3d2e07eae93cd36058f2473c8f68bf5c8161 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Tue, 9 Jun 2020 16:27:49 -0400 Subject: [PATCH 08/30] KPMP-1903: Fix codacy errors --- src/components/PackageDashboard/PackageTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 023a5d2..3a2b324 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -60,7 +60,7 @@ class PackageTable extends Component { {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} ); } else { - return packageId; + return row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; } } }, From ecdac8dee50b7f1fe4da4b9bd1739b3c329dfd98 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Tue, 9 Jun 2020 16:34:53 -0400 Subject: [PATCH 09/30] KPMP-1903: Fix tests --- .../PackageDashboard/packageReducer.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/components/PackageDashboard/packageReducer.test.js diff --git a/src/components/PackageDashboard/packageReducer.test.js b/src/components/PackageDashboard/packageReducer.test.js new file mode 100644 index 0000000..d510e97 --- /dev/null +++ b/src/components/PackageDashboard/packageReducer.test.js @@ -0,0 +1,18 @@ +import { packages } from './packageReducer'; +import actionNames from '../../actions/actionNames'; + +describe('packages', () => { + it('should return the given state if not known action', () => { + let action = { + type: "UNKNOWN" + } + expect(packages([], action)).toEqual([]); + }); + it('should return the new state if known action', () => { + let action = { + type: actionNames.SET_PACKAGES, + payload: 'new stuff' + } + expect(packages([], action)).toEqual('new stuff'); + }); +}); \ No newline at end of file From 03ebbf4e8566113a9ae49dc8b3e765bf253298ff Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Wed, 10 Jun 2020 09:51:06 -0400 Subject: [PATCH 10/30] KPMP-1903: Checking in codacy fixes --- .../PackageDashboard/PackageTable.js | 237 +++++++++--------- 1 file changed, 119 insertions(+), 118 deletions(-) diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 3a2b324..55bed65 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -30,136 +30,137 @@ const LARGE_FILE_UPLOAD = 'largeFilesChecked'; // package id, submitter, package type, tis name, date submitted class PackageTable extends Component { - constructor(props) { - super(props); + constructor(props) { + super(props); - this.getColumns = this.getColumns.bind(this); - this.onSortedChange = this.onSortedChange.bind(this); - this.onFilteredChange = this.onFilteredChange.bind(this); - this.resetFilterAndSort = this.resetFilterAndSort.bind(this); - this.defaultFilterMethod = this.defaultFilterMethod.bind(this); - this.reactTable = React.createRef(); + this.getColumns = this.getColumns.bind(this); + this.onSortedChange = this.onSortedChange.bind(this); + this.onFilteredChange = this.onFilteredChange.bind(this); + this.resetFilterAndSort = this.resetFilterAndSort.bind(this); + this.defaultFilterMethod = this.defaultFilterMethod.bind(this); + this.reactTable = React.createRef(); - this.state = { - sorted: [], - filtered: [], - columns: this.getColumns() - }; - }; + this.state = { + sorted: [], + filtered: [], + columns: this.getColumns() + }; + }; - getColumns() { - return [ - { - Header: PACKAGE_ID_LABEL, - id: PACKAGE_ID, - accessor: 'link', - Cell: (info) => { - let row = info.original; - if(row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD] && row.state[GLOBUS_LINK] !== '') { - return ( - {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} - ); - } else { - return row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; - } - } - }, - { - Header: SUBJECT_ID_LABEL, - id: SUBJECT_ID, - accessor: (row) => row[PACKAGE_INFO_PROPERTY][SUBJECT_ID] - }, - { - Header: PACKAGE_TYPE_LABEL, - id: PACKAGE_TYPE_ID, - accessor: (row) => row[PACKAGE_INFO_PROPERTY][PACKAGE_TYPE_ID] - }, - { - Header: SUBMITTER_LABEL, - id: SUBMITTER_ID, - accessor: (row) => row[PACKAGE_INFO_PROPERTY].submitter && row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] ? row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] : row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_FIRST_NAME] + ' ' + row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_LAST_NAME] - }, - { - Header: TIS_NAME_LABEL, - id: TIS_NAME_ID, - accessor: (row) => row[PACKAGE_INFO_PROPERTY][TIS_NAME_ID] - }, - { - Header: DATE_SUBMITTED_LABEL, - id: DATE_SUBMITTED_ID, - accessor: (row) => { - - return new Moment(row[PACKAGE_INFO_PROPERTY][DATE_SUBMITTED_ID]) - .local() - .format(DATE_FORMAT) - } - }, - { - Header: PACKAGE_STATE_LABEL, - id: PACKAGE_STATE_ID, - accessor: (row) => { - if (row.state && row.state[PACKAGE_STATE_ID]) { - return stateMap.has(row.state[PACKAGE_STATE_ID]) ? stateMap.get(row.state[PACKAGE_STATE_ID]) : row.state[PACKAGE_STATE_ID]; - } - return '' - } - } + getColumns() { + return [ + { + Header: PACKAGE_ID_LABEL, + id: PACKAGE_ID, + accessor: 'link', + Cell: (info) => { + let row = info.original; + // eslint-disable-next-line + let href = 'https://app.globus.org/file-manager?origin_id=936381c8-1653-11ea-b94a-0e16720bb42f&origin_path=/' + row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; + if(row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD]) { + return ( + {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} + ); + } else { + return row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; + } + } + }, + { + Header: SUBJECT_ID_LABEL, + id: SUBJECT_ID, + accessor: (row) => row[PACKAGE_INFO_PROPERTY][SUBJECT_ID] + }, + { + Header: PACKAGE_TYPE_LABEL, + id: PACKAGE_TYPE_ID, + accessor: (row) => row[PACKAGE_INFO_PROPERTY][PACKAGE_TYPE_ID] + }, + { + Header: SUBMITTER_LABEL, + id: SUBMITTER_ID, + accessor: (row) => row[PACKAGE_INFO_PROPERTY].submitter && row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] ? row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] : row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_FIRST_NAME] + ' ' + row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_LAST_NAME] + }, + { + Header: TIS_NAME_LABEL, + id: TIS_NAME_ID, + accessor: (row) => row[PACKAGE_INFO_PROPERTY][TIS_NAME_ID] + }, + { + Header: DATE_SUBMITTED_LABEL, + id: DATE_SUBMITTED_ID, + accessor: (row) => { + return new Moment(row[PACKAGE_INFO_PROPERTY][DATE_SUBMITTED_ID]) + .local() + .format(DATE_FORMAT) + } + }, + { + Header: PACKAGE_STATE_LABEL, + id: PACKAGE_STATE_ID, + accessor: (row) => { + if (row.state && row.state[PACKAGE_STATE_ID]) { + return stateMap.has(row.state[PACKAGE_STATE_ID]) ? stateMap.get(row.state[PACKAGE_STATE_ID]) : row.state[PACKAGE_STATE_ID]; + } + return ''; + } + } - ]; - } + ]; + } - onSortedChange(sorted) { - ReactGA.event({ - category: 'Data Table', - action: 'Sort Data' - }); - this.setState({ - sorted: sorted - }); - } + onSortedChange(sorted) { + ReactGA.event({ + category: 'Data Table', + action: 'Sort Data' + }); + this.setState({ + sorted: sorted + }); + } - onFilteredChange(filtered) { - ReactGA.event({ - category: 'Data Table', - action: 'Filter Data' - }); - this.setState({ - filtered: filtered - }); - } + onFilteredChange(filtered) { + ReactGA.event({ + category: 'Data Table', + action: 'Filter Data' + }); + this.setState({ + filtered: filtered + }); + } - defaultFilterMethod(filter, row, column) { - return row[filter.id] && row[filter.id].toUpperCase().indexOf(filter.value.toUpperCase()) > -1; - } + defaultFilterMethod(filter, row, column) { + return row[filter.id] && row[filter.id].toUpperCase().indexOf(filter.value.toUpperCase()) > -1; + } - resetFilterAndSort() { - this.setState({ - sorted: [], - filtered: [] - }); - } + resetFilterAndSort() { + this.setState({ + sorted: [], + filtered: [] + }); + } - render() { - return ; - } + render() { + return ; + } } PackageTable.propTypes = { - packages: PropTypes.arrayOf(PropTypes.object) + packages: PropTypes.arrayOf(PropTypes.object) }; export default PackageTable; From 1dfe67ad3cb87c61508550a8fed1fa9b3bdb2f44 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Wed, 10 Jun 2020 10:36:38 -0400 Subject: [PATCH 11/30] KPMP-1903: Fix codacy issues. Add css files to gitignore. Change to construct globus link for all large file uploads and always show it --- .gitignore | 1 + src/components/PackageDashboard/PackageTable.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9f12b39..feb4d3a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build/* node_modules node_modules/* .project +*.css diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 55bed65..1d930a8 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -24,7 +24,6 @@ const DATE_FORMAT = 'YYYY-MM-DD, h:mm a z'; const PACKAGE_INFO_PROPERTY = 'packageInfo'; const PACKAGE_STATE_ID = 'state'; const SUBJECT_ID = 'subjectId'; -const GLOBUS_LINK = 'codicil'; const LARGE_FILE_UPLOAD = 'largeFilesChecked'; // package id, submitter, package type, tis name, date submitted @@ -56,7 +55,7 @@ class PackageTable extends Component { Cell: (info) => { let row = info.original; // eslint-disable-next-line - let href = 'https://app.globus.org/file-manager?origin_id=936381c8-1653-11ea-b94a-0e16720bb42f&origin_path=/' + row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; + let href = 'https://app.globus.org/file-manager?origin_id=936381c8-1653-11ea-b94a-0e16720bb42f&origin_path=/PROD_INBOX/' + row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; if(row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD]) { return ( {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} From 2fe36b0bcc66bb6a54b186a0cb28edcb56e34791 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Wed, 10 Jun 2020 10:47:48 -0400 Subject: [PATCH 12/30] KPMP-1903: Fix codacy issues --- src/components/PackageDashboard/PackageTable.js | 3 +++ src/components/PackageDashboard/packageReducer.test.js | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 1d930a8..08069ca 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -56,8 +56,10 @@ class PackageTable extends Component { let row = info.original; // eslint-disable-next-line let href = 'https://app.globus.org/file-manager?origin_id=936381c8-1653-11ea-b94a-0e16720bb42f&origin_path=/PROD_INBOX/' + row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; + // eslint-disable-next-line if(row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD]) { return ( + // eslint-disable-next-line {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} ); } else { @@ -78,6 +80,7 @@ class PackageTable extends Component { { Header: SUBMITTER_LABEL, id: SUBMITTER_ID, + // eslint-disable-next-line accessor: (row) => row[PACKAGE_INFO_PROPERTY].submitter && row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] ? row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_ID] : row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_FIRST_NAME] + ' ' + row[PACKAGE_INFO_PROPERTY].submitter[SUBMITTER_LAST_NAME] }, { diff --git a/src/components/PackageDashboard/packageReducer.test.js b/src/components/PackageDashboard/packageReducer.test.js index d510e97..3644bae 100644 --- a/src/components/PackageDashboard/packageReducer.test.js +++ b/src/components/PackageDashboard/packageReducer.test.js @@ -2,12 +2,14 @@ import { packages } from './packageReducer'; import actionNames from '../../actions/actionNames'; describe('packages', () => { + it('should return the given state if not known action', () => { let action = { - type: "UNKNOWN" - } + type: 'UNKNOWN' + }; expect(packages([], action)).toEqual([]); }); + it('should return the new state if known action', () => { let action = { type: actionNames.SET_PACKAGES, From ee3244df0851ec5cd55dafeab55d7f7b7d6c0d23 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Wed, 10 Jun 2020 10:52:12 -0400 Subject: [PATCH 13/30] KPMP-1903: Fix final? codacy errors --- src/components/PackageDashboard/PackageTable.js | 1 + src/components/PackageDashboard/packageReducer.test.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 08069ca..8d70a03 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -63,6 +63,7 @@ class PackageTable extends Component { {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} ); } else { + // eslint-disable-next-line return row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; } } diff --git a/src/components/PackageDashboard/packageReducer.test.js b/src/components/PackageDashboard/packageReducer.test.js index 3644bae..010f884 100644 --- a/src/components/PackageDashboard/packageReducer.test.js +++ b/src/components/PackageDashboard/packageReducer.test.js @@ -14,7 +14,7 @@ describe('packages', () => { let action = { type: actionNames.SET_PACKAGES, payload: 'new stuff' - } + }; expect(packages([], action)).toEqual('new stuff'); }); }); \ No newline at end of file From 3d67102962e5220bb3a9d9e2c54ad57aa4cf117e Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Thu, 18 Jun 2020 11:32:46 -0400 Subject: [PATCH 14/30] KPMP-1903: Move globus link so user can filter on package id --- .../PackageDashboard/PackageTable.js | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/components/PackageDashboard/PackageTable.js b/src/components/PackageDashboard/PackageTable.js index 8d70a03..bfaf23e 100644 --- a/src/components/PackageDashboard/PackageTable.js +++ b/src/components/PackageDashboard/PackageTable.js @@ -12,6 +12,7 @@ const TIS_NAME_LABEL = 'TIS Name'; const DATE_SUBMITTED_LABEL = 'Date Submitted'; const PACKAGE_STATE_LABEL = 'Package State'; const SUBJECT_ID_LABEL = 'Subject Id'; +const GLOBUS_LINK_LABEL = 'Globus Link'; const PACKAGE_ID = '_id'; const SUBMITTER_ID = 'displayName'; @@ -51,22 +52,7 @@ class PackageTable extends Component { { Header: PACKAGE_ID_LABEL, id: PACKAGE_ID, - accessor: 'link', - Cell: (info) => { - let row = info.original; - // eslint-disable-next-line - let href = 'https://app.globus.org/file-manager?origin_id=936381c8-1653-11ea-b94a-0e16720bb42f&origin_path=/PROD_INBOX/' + row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; - // eslint-disable-next-line - if(row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD]) { - return ( - // eslint-disable-next-line - {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} - ); - } else { - // eslint-disable-next-line - return row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; - } - } + accessor: (row) => row[PACKAGE_INFO_PROPERTY][PACKAGE_ID] }, { Header: SUBJECT_ID_LABEL, @@ -107,6 +93,25 @@ class PackageTable extends Component { } return ''; } + }, { + Header: GLOBUS_LINK_LABEL, + accessor: 'link', + filterable: false, + Cell: (info) => { + let row = info.original; + // eslint-disable-next-line + let href = 'https://app.globus.org/file-manager?origin_id=936381c8-1653-11ea-b94a-0e16720bb42f&origin_path=/PROD_INBOX/' + row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]; + // eslint-disable-next-line + if(row[PACKAGE_INFO_PROPERTY][LARGE_FILE_UPLOAD]) { + return ( + // eslint-disable-next-line + {row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]} + ); + } else { + // eslint-disable-next-line + return ''; + } + } } ]; From 705be8a8df3c90d4e82daeeb8778cbaeba62d8a5 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Fri, 19 Jun 2020 13:42:03 -0400 Subject: [PATCH 15/30] KPMP-1917: Adding file validation form --- package.json | 2 +- src/App.js | 10 +++-- .../PackageDashboard/PackageDashboardPage.js | 14 ++++-- .../Validation/FilenameValidationPage.js | 44 +++++++++++++++++++ .../FilenameValidationPageContainer.js | 10 +++++ 5 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 src/components/Validation/FilenameValidationPage.js create mode 100644 src/components/Validation/FilenameValidationPageContainer.js diff --git a/package.json b/package.json index fd7a53e..34683c0 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "redux-thunk": "2.3.0" }, "devDependencies": { - "node-sass-chokidar": "^1.4.0", + "node-sass-chokidar": "^1.5.0", "npm-run-all": "4.1.5" }, "scripts": { diff --git a/src/App.js b/src/App.js index ae2e820..7495b96 100644 --- a/src/App.js +++ b/src/App.js @@ -13,6 +13,7 @@ import { Route, Switch, Router } from 'react-router-dom'; import ErrorBoundaryContainer from './components/Error/ErrorBoundaryContainer'; import Oops from './components/Error/Oops'; import PackageDashboardPageContainer from './components/PackageDashboard/PackageDashboardPageContainer'; +import FilenameValidationPageContainer from './components/Validation/FilenameValidationPageContainer'; import PermissionDenied from './components/Error/PermissionDenied'; import NotRegistered from './components/Error/NotRegistered'; @@ -63,10 +64,11 @@ class App extends Component { - - - - + + + + + diff --git a/src/components/PackageDashboard/PackageDashboardPage.js b/src/components/PackageDashboard/PackageDashboardPage.js index b127f66..ea12f94 100644 --- a/src/components/PackageDashboard/PackageDashboardPage.js +++ b/src/components/PackageDashboard/PackageDashboardPage.js @@ -1,5 +1,6 @@ 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 { @@ -9,8 +10,15 @@ class PackageDashboardPage extends Component { } render() { - return - + return + + + + + + + + +
+ + + + + + this.packageId = input} /> + + + + + + + +