Skip to content

Commit ea3cd85

Browse files
authored
Merge pull request #9013 from driusan/Pushv2416Tov25
Push v24.1.6 changes into 25 branch
2 parents 7b74d57 + 4f75d4f commit ea3cd85

File tree

20 files changed

+326
-117
lines changed

20 files changed

+326
-117
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- NOTE: This SQL patch follows up the running of single use tool `tools/single_use/Convert_LorisMenuID_to_ModuleID.php`
2+
-- that was necessary to upgrade the `issues` table from LORIS version 22 to version 23. The tool forgot
3+
-- to include an upgrade of the `issues_history` table, which is now tackled by this SQL patch.
4+
5+
-- delete from issues_history any orphaned module IDs
6+
DELETE FROM issues_history WHERE fieldChanged='module' AND issueID IN (SELECT issueID FROM issues WHERE module IS NULL);
7+
-- set issues history module ID to correct moduleID, replacing old LorisMenu ID
8+
UPDATE issues_history ih SET newValue=(SELECT i.module FROM issues i WHERE i.issueID=ih.issueID) WHERE fieldChanged='module';

modules/behavioural_qc/jsx/tabs_content/behaviouralFeedback.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,32 @@ class BehaviouralFeedback extends Component {
107107
);
108108
break;
109109
case 'Feedback Level':
110-
rowData['Instrument'] ? reactElement = (
110+
let bvlLink = '';
111+
let bvlLevel = '';
112+
if (rowData['Instrument']) {
113+
bvlLink = this.props.baseURL +
114+
'/instruments/' +
115+
rowData['Test Name'] +
116+
'/?candID=' +
117+
rowData['DCCID'] +
118+
'&sessionID=' +
119+
rowData['sessionID'] +
120+
'&commentID=' +
121+
rowData['commentID'];
122+
bvlLevel ='Instrument : ' + rowData['Instrument'];
123+
} else if (rowData['Visit']) {
124+
bvlLink = this.props.baseURL +
125+
'/instrument_list/' +
126+
'?candID=' +
127+
rowData['DCCID'] +
128+
'&sessionID=' +
129+
rowData['sessionID'];
130+
bvlLevel ='Visit : ' + rowData['Visit'];
131+
}
132+
reactElement = (
111133
<td>
112-
<a href={this.props.baseURL +
113-
'/instruments/' +
114-
rowData['Test Name'] +
115-
'/?candID=' +
116-
rowData['DCCID'] +
117-
'&sessionID=' +
118-
rowData['sessionID'] +
119-
'&commentID=' +
120-
rowData['commentID']
121-
}>
122-
{'Instrument : ' + rowData['Instrument']}
123-
</a>
134+
<a href={bvlLink}>{bvlLevel}</a>
124135
</td>
125-
) : reactElement = (
126-
<td>{''}</td>
127136
);
128137
break;
129138
default:

modules/genomic_browser/jsx/tabs_content/files.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Files extends Component {
3434
},
3535
};
3636
this.fetchData = this.fetchData.bind(this);
37+
this.formatColumn = this.formatColumn.bind(this);
3738
this.openFileUploadModal = this.openFileUploadModal.bind(this);
3839
this.closeFileUploadModal = this.closeFileUploadModal.bind(this);
3940
this.renderFileUploadForm = this.renderFileUploadForm.bind(this);
@@ -149,9 +150,16 @@ class Files extends Component {
149150
formatColumn(column, cell, rowData, rowHeaders) {
150151
let reactElement;
151152
switch (column) {
153+
case 'Name':
154+
const fileName = rowData.Name.split('/').pop();
155+
const url =
156+
`${this.props.baseURL
157+
}/genomic_browser/FileManager?filename=${fileName}`;
158+
reactElement = <td><a href={url}>{fileName}</a></td>;
159+
break;
152160
case 'PSCID':
153-
const url = `${this.props.baseURL}/${rowData.DCCID}/`;
154-
reactElement = <td><a href={url}>{rowData.PSCID}</a></td>;
161+
const urlPscid = `${this.props.baseURL}/${rowData.DCCID}/`;
162+
reactElement = <td><a href={urlPscid}>{rowData.PSCID}</a></td>;
155163
break;
156164
case 'Cohort':
157165
reactElement = <td>{this.state.data.cohorts[parseInt(cell)]}</td>;

modules/genomic_browser/php/filemanager.class.inc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,33 @@ class FileManager extends \NDB_Page implements ETagCalculator
5454
*/
5555
private function _handleGET(ServerRequestInterface $request) : ResponseInterface
5656
{
57+
// Parse GET query params.
58+
$values = $request->getQueryParams();
59+
// GET request for downloading file by ID.
60+
if ($values['filename']) {
61+
$factory = \NDB_Factory::singleton();
62+
$config = $factory->config();
63+
$filesDir = \Utility::appendForwardSlash(
64+
$config->getSetting('GenomicDataPath')
65+
);
66+
try {
67+
$downloadhandler = new \LORIS\FilesDownloadHandler(
68+
new \SplFileInfo($filesDir)
69+
);
70+
$request = $request->withAttribute(
71+
'filename',
72+
$values['filename']
73+
);
74+
return $downloadhandler->handle($request);
75+
} catch (\LorisException $e) {
76+
// FilesUploadHandler throws an exception if there's a problem with
77+
// the downloaddir.
78+
return new \LORIS\Http\Response\JSON\InternalServerError(
79+
$e->getMessage()
80+
);
81+
}
82+
}
83+
5784
$provisioner = new FilesProvisioner();
5885
$user = $request->getAttribute('user');
5986

modules/genomic_browser/php/uploading/genomicfile.class.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,10 @@ class Genomicfile
468468
function setFullPath(&$fileToUpload) : void
469469
{
470470
$config = \NDB_Config::singleton();
471-
$genomic_data_dir = rtrim($config->getSetting('GenomicDataPath'), '/')
472-
. '/genomic_uploader/';
471+
$genomic_data_dir = rtrim(
472+
$config->getSetting('GenomicDataPath'),
473+
'/'
474+
) . '/';
473475

474476
$fileToUpload->full_path = $genomic_data_dir
475477
. $fileToUpload->file_name;

modules/issue_tracker/jsx/IssueForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class IssueForm extends Component {
2626
super(props);
2727

2828
this.state = {
29-
Data: [],
29+
Data: {},
3030
formData: {},
3131
submissionResult: null,
3232
errorMessage: null,

0 commit comments

Comments
 (0)