Skip to content

Commit

Permalink
KPMP-1903: Move globus link so user can filter on package id
Browse files Browse the repository at this point in the history
  • Loading branch information
rlreamy committed Jun 18, 2020
1 parent ee3244d commit 3d67102
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions src/components/PackageDashboard/PackageTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
<a target='_blank' rel='noopener noreferrer' href={href}>{row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]}</a>
);
} else {
// eslint-disable-next-line
return row[PACKAGE_INFO_PROPERTY][PACKAGE_ID];
}
}
accessor: (row) => row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]
},
{
Header: SUBJECT_ID_LABEL,
Expand Down Expand Up @@ -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
<a target='_blank' rel='noopener noreferrer' href={href}>{row[PACKAGE_INFO_PROPERTY][PACKAGE_ID]}</a>
);
} else {
// eslint-disable-next-line
return '';
}
}
}

];
Expand Down

0 comments on commit 3d67102

Please sign in to comment.