Skip to content

Commit

Permalink
Merge pull request #9013 from driusan/Pushv2416Tov25
Browse files Browse the repository at this point in the history
Push v24.1.6 changes into 25 branch
  • Loading branch information
driusan authored Jan 16, 2024
2 parents 7b74d57 + 4f75d4f commit ea3cd85
Show file tree
Hide file tree
Showing 20 changed files with 326 additions and 117 deletions.
8 changes: 8 additions & 0 deletions SQL/New_patches/2023-04-25-FixIssueWrongModuleID.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- NOTE: This SQL patch follows up the running of single use tool `tools/single_use/Convert_LorisMenuID_to_ModuleID.php`
-- that was necessary to upgrade the `issues` table from LORIS version 22 to version 23. The tool forgot
-- to include an upgrade of the `issues_history` table, which is now tackled by this SQL patch.

-- delete from issues_history any orphaned module IDs
DELETE FROM issues_history WHERE fieldChanged='module' AND issueID IN (SELECT issueID FROM issues WHERE module IS NULL);
-- set issues history module ID to correct moduleID, replacing old LorisMenu ID
UPDATE issues_history ih SET newValue=(SELECT i.module FROM issues i WHERE i.issueID=ih.issueID) WHERE fieldChanged='module';
39 changes: 24 additions & 15 deletions modules/behavioural_qc/jsx/tabs_content/behaviouralFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,32 @@ class BehaviouralFeedback extends Component {
);
break;
case 'Feedback Level':
rowData['Instrument'] ? reactElement = (
let bvlLink = '';
let bvlLevel = '';
if (rowData['Instrument']) {
bvlLink = this.props.baseURL +
'/instruments/' +
rowData['Test Name'] +
'/?candID=' +
rowData['DCCID'] +
'&sessionID=' +
rowData['sessionID'] +
'&commentID=' +
rowData['commentID'];
bvlLevel ='Instrument : ' + rowData['Instrument'];
} else if (rowData['Visit']) {
bvlLink = this.props.baseURL +
'/instrument_list/' +
'?candID=' +
rowData['DCCID'] +
'&sessionID=' +
rowData['sessionID'];
bvlLevel ='Visit : ' + rowData['Visit'];
}
reactElement = (
<td>
<a href={this.props.baseURL +
'/instruments/' +
rowData['Test Name'] +
'/?candID=' +
rowData['DCCID'] +
'&sessionID=' +
rowData['sessionID'] +
'&commentID=' +
rowData['commentID']
}>
{'Instrument : ' + rowData['Instrument']}
</a>
<a href={bvlLink}>{bvlLevel}</a>
</td>
) : reactElement = (
<td>{''}</td>
);
break;
default:
Expand Down
12 changes: 10 additions & 2 deletions modules/genomic_browser/jsx/tabs_content/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Files extends Component {
},
};
this.fetchData = this.fetchData.bind(this);
this.formatColumn = this.formatColumn.bind(this);
this.openFileUploadModal = this.openFileUploadModal.bind(this);
this.closeFileUploadModal = this.closeFileUploadModal.bind(this);
this.renderFileUploadForm = this.renderFileUploadForm.bind(this);
Expand Down Expand Up @@ -149,9 +150,16 @@ class Files extends Component {
formatColumn(column, cell, rowData, rowHeaders) {
let reactElement;
switch (column) {
case 'Name':
const fileName = rowData.Name.split('/').pop();
const url =
`${this.props.baseURL
}/genomic_browser/FileManager?filename=${fileName}`;
reactElement = <td><a href={url}>{fileName}</a></td>;
break;
case 'PSCID':
const url = `${this.props.baseURL}/${rowData.DCCID}/`;
reactElement = <td><a href={url}>{rowData.PSCID}</a></td>;
const urlPscid = `${this.props.baseURL}/${rowData.DCCID}/`;
reactElement = <td><a href={urlPscid}>{rowData.PSCID}</a></td>;
break;
case 'Cohort':
reactElement = <td>{this.state.data.cohorts[parseInt(cell)]}</td>;
Expand Down
27 changes: 27 additions & 0 deletions modules/genomic_browser/php/filemanager.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,33 @@ class FileManager extends \NDB_Page implements ETagCalculator
*/
private function _handleGET(ServerRequestInterface $request) : ResponseInterface
{
// Parse GET query params.
$values = $request->getQueryParams();
// GET request for downloading file by ID.
if ($values['filename']) {
$factory = \NDB_Factory::singleton();
$config = $factory->config();
$filesDir = \Utility::appendForwardSlash(
$config->getSetting('GenomicDataPath')
);
try {
$downloadhandler = new \LORIS\FilesDownloadHandler(
new \SplFileInfo($filesDir)
);
$request = $request->withAttribute(
'filename',
$values['filename']
);
return $downloadhandler->handle($request);
} catch (\LorisException $e) {
// FilesUploadHandler throws an exception if there's a problem with
// the downloaddir.
return new \LORIS\Http\Response\JSON\InternalServerError(
$e->getMessage()
);
}
}

$provisioner = new FilesProvisioner();
$user = $request->getAttribute('user');

Expand Down
6 changes: 4 additions & 2 deletions modules/genomic_browser/php/uploading/genomicfile.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,10 @@ class Genomicfile
function setFullPath(&$fileToUpload) : void
{
$config = \NDB_Config::singleton();
$genomic_data_dir = rtrim($config->getSetting('GenomicDataPath'), '/')
. '/genomic_uploader/';
$genomic_data_dir = rtrim(
$config->getSetting('GenomicDataPath'),
'/'
) . '/';

$fileToUpload->full_path = $genomic_data_dir
. $fileToUpload->file_name;
Expand Down
2 changes: 1 addition & 1 deletion modules/issue_tracker/jsx/IssueForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class IssueForm extends Component {
super(props);

this.state = {
Data: [],
Data: {},
formData: {},
submissionResult: null,
errorMessage: null,
Expand Down
Loading

0 comments on commit ea3cd85

Please sign in to comment.