-
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 #103 from KPMP/develop
Release v1.3
- Loading branch information
Showing
15 changed files
with
252 additions
and
165 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
REACT_APP_SEARCH_KEY= | ||
REACT_APP_SEARCH_ENDPOINT="/spatial-viewer/search" | ||
REACT_APP_SEARCH_ENDPOINT="/spatial-viewer/search" | ||
REACT_APP_FILE_ENDPOINT= |
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
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,80 @@ | ||
import React, {Component} from 'react'; | ||
import { Grid, TableFixedColumns, TableHeaderRow, Table} from '@devexpress/dx-react-grid-bootstrap4'; | ||
import { Row, Col } from 'reactstrap'; | ||
|
||
class FilesByExperimentType extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.getColumns = this.getColumns.bind(this); | ||
} | ||
|
||
handleEmptyCounts(count, row){ | ||
return count === 0 ? "0" : this.formatDataTypeValueCell(count, row) | ||
} | ||
|
||
handleDataTypeValueClick(row) { | ||
let linkType = row.linkInformation.linkType; | ||
let linkValue = row.linkInformation.linkValue.replace('&', '%26'); | ||
let mapping = `/repository/?size=n_20_n&filters[0][field]=redcap_id&filters[0][values][0]=${this.props.participantId}&filters[0][type]=any&filters[1][field]=${linkType}&filters[1][values][0]=${linkValue}&filters[1][type]=any`; | ||
if(linkType && linkValue){ | ||
return encodeURI(mapping).replace('%2526', '%26'); | ||
} else { | ||
this.props.history.push('/oops'); | ||
throw new Error('Datatype not found', row.dataType) | ||
} | ||
} | ||
|
||
formatDataTypeValueCell(value, row) { | ||
return ( | ||
<a href={`${this.handleDataTypeValueClick(row)}`}> | ||
<span className="buttonhref"> | ||
{value} | ||
</span> | ||
</a> | ||
); | ||
} | ||
|
||
|
||
getColumnExtensions() { | ||
|
||
return [ | ||
{ columnName: 'dataType', width: 'auto'}, | ||
{ columnName: 'count', width: 'auto', align: 'center'}, | ||
] | ||
} | ||
|
||
getColumns() { | ||
return [ | ||
{ | ||
title: <span className="table-header omics data-type-table-header">Experimental Strategies</span>, | ||
name: 'dataType', | ||
getCellValue: row => <div className='data-type-table-content' style={{'flex': '250 0 auto'}} role='gridcell'>{row.dataType}</div> | ||
|
||
}, | ||
{ | ||
title: <span className="data-type-table-header">Files</span>, | ||
name: 'count', | ||
getCellValue: row => <div className='rt-td data-type-table-content' style={{'flex': '250 0 auto','textAlign': 'center'}} role='gridcell'>{this.handleEmptyCounts(row.count, row)}</div> | ||
} | ||
] | ||
} | ||
|
||
render() { | ||
return ( | ||
<article id='summary-plot'> | ||
<Row className='mt-4'> | ||
<Col xs='12'> | ||
<Grid rows={this.props.experimentalDataCounts} columns={this.getColumns()}> | ||
<Table columnExtensions={this.getColumnExtensions()}/> | ||
<TableHeaderRow/> | ||
<TableFixedColumns/> | ||
</Grid> | ||
</Col> | ||
</Row> | ||
</article> | ||
); | ||
} | ||
} | ||
|
||
export default FilesByExperimentType; |
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.