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 #2523 from kongtiaowang/2017-01-18-mri_protocol_vi…
…olations [Mri violations]Update react table mri protocol violations - rebase
- Loading branch information
Showing
5 changed files
with
77 additions
and
40 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
modules/mri_violations/js/mri_protocol_violations_columnFormatter.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
modules/mri_violations/jsx/mri_protocol_violations_columnFormatter.js
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,34 @@ | ||
/** | ||
* Modify behaviour of specified column cells in the Data Table component | ||
* @param {string} column - column name | ||
* @param {string} cell - cell content | ||
* @param {arrray} rowData - array of cell contents for a specific row | ||
* @param {arrray} rowHeaders - array of table headers (column names) | ||
* @return {*} a formated table cell for a given column | ||
*/ | ||
function formatColumn(column, cell, rowData, rowHeaders) { | ||
var url; | ||
if (loris.hiddenHeaders.indexOf(column) > -1) { | ||
return null; | ||
} | ||
// Create the mapping between rowHeaders and rowData in a row object. | ||
var row = {}; | ||
rowHeaders.forEach(function(header, index) { | ||
row[header] = rowData[index]; | ||
}, this); | ||
|
||
if (column === 'PatientName') { | ||
url = loris.BaseURL + "/dicom_archive/viewDetails/?tarchiveID=" + | ||
row.TarchiveID; | ||
return <td> | ||
<a href ={url}>{cell}</a> | ||
</td>; | ||
} | ||
|
||
return <td>{cell}</td>; | ||
} | ||
|
||
window.formatColumn = formatColumn; | ||
|
||
export default formatColumn; | ||
|
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