Skip to content

Commit

Permalink
Merge remote-tracking branch 'aces/26.0-release' into 26ToMain
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave MacFarlane committed Oct 2, 2024
2 parents ca334d6 + 85645d1 commit 89d3fde
Show file tree
Hide file tree
Showing 18 changed files with 172 additions and 63 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ core section.***
- ***When possible please provide the number of the pull request(s) containing the
changes in the following format: PR #1234***

## LORIS 26.0 (Release Date: ????-??-??)
## LORIS 26.0 (Release Date: 2024-06-13)
### Core
#### Features
- Add OpenID Connect authorization support to LORIS (PR #8255)
Expand All @@ -26,7 +26,7 @@ changes in the following format: PR #1234***
- While proposing a project or editing a project in publications module, prevent indefinite "File to upload" fields from being added if files are browsed then cancelled (PR #9179)
- Conflict resolver fixed when Test_name is not equal to table name. This is done be replacing the "TableName" variable with "TestName" everywhere in resolved & unresolved conflicts tables as well as modules (PR #9270)

## LORIS 25.0 (Release Date: ????-??-??)
## LORIS 25.0 (Release Date: 2023-07-17)
### Core
#### Features
- Added new interface intended to be used for querying module data from PHP (PR #8215)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LORIS (Longitudinal Online Research and Imaging System) is a self-hosted web app

* Try the LORIS demo instance at https://demo.loris.ca.

This Readme covers installation of LORIS version <b>25.0</b> on <b>Ubuntu</b>.
This Readme covers installation of LORIS version <b>26.0</b> on <b>Ubuntu</b>.

([CentOS Readme also available](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/CentOS/README.md)).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ For further details on the install process, please see the LORIS GitHub Wiki Cen
# System Requirements - Install dependencies

Default dependencies installed by CentOS 7.x may not meet the version requirements for LORIS deployment or development:
* MariaDB 10.3 is supported for LORIS 25.
* MariaDB 10.3 is supported for LORIS 26.

* PHP 8.1 (or higher) is supported for LORIS 25.
* PHP 8.2 (or higher) is supported for LORIS 26.

In addition to the above, the following packages should be installed with `yum` and may also differ from the packages referenced in the main (Ubuntu) [LORIS Readme](../../../../../README.md). Detailed command examples are provided below (`sudo` privilege may be required depending on your system).
* Apache 2.4 or higher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class Qc extends Endpoint implements \LORIS\Middleware\ETagCalculator
);
}

$inputqcstatus = $data['QCStatus'] ?? null;
$inputqcstatus = $data['QC'] ?? null;
$inputselected = $data['Selected'] ?? null;

// TODO :: This is (and was) not checking or handling Caveats
Expand Down
4 changes: 4 additions & 0 deletions modules/candidate_parameters/jsx/DiagnosisEvolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class DiagnosisEvolution extends Component {
formattedDiagnosisEvolution() {
const dxEvolution = this.state.data.diagnosisEvolution;
let formattedDxEvolution = [];
try {
dxEvolution.map((record) => {
let formattedDiagnosis = [];
Object.entries(JSON.parse(record.Diagnosis)).map((entry, index) => {
Expand Down Expand Up @@ -94,6 +95,9 @@ class DiagnosisEvolution extends Component {
]
);
});
} catch (error) {
console.error('Error parsing JSON:', error);
}
return formattedDxEvolution;
}

Expand Down
12 changes: 11 additions & 1 deletion modules/electrophysiology_uploader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

## Purpose

The electrophysiology uploader is intended to allow users to upload and browse electrophysiology files.
The electrophysiology uploader is intended to allow users to upload electrophysiology files.

**LORIS 26 Beta Note:** Files uploaded in this module will not be viewable
in
the Electrophysiology Browser module.
This feature is under construction for the next release. Please get in
touch with the LORIS team to configure this for your project.


## Intended Users
Expand All @@ -26,6 +32,7 @@ EEG recordings can be re-uploaded multiple times. Previous upload attempts will
Permission `electrophysiology_browser_view_allsites` or `electrophysiology_browser_view_site`
is necessary to have access to the module and gives the user the ability to
upload and browse all recordings uploaded to the database.
Permission `monitor_eeg_uploads` is necessary to receive EEG upload notifications.

#### Filesystem Permission

Expand All @@ -49,3 +56,6 @@ EEGUploadIncomingPath - This setting determines where on the filesystem the
`EEGUploadIncomingPath` following a successful archival and insertion
through the LORIS-MRI pipeline.

### Caveat

Archive extraction and EEG insertion have to be performed manually at the moment.
35 changes: 22 additions & 13 deletions modules/electrophysiology_uploader/jsx/ElectrophysiologyUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,28 @@ export default function ElectrophysiologyUploader(props) {
];

return (
<Tabs tabs={tabList} defaultTab='browse' updateURL={true}>
<TabPane TabId={tabList[0].id}>
<UploadViewer
data={data.Data}
fieldOptions={data.fieldOptions}
/>
</TabPane>
<TabPane TabId={tabList[1].id}>
<UploadForm
uploadURL={`${props.DataURL}/upload`}
/>
</TabPane>
</Tabs>
<>
<div className="alert alert-warning" role="alert">
<strong>LORIS 26 Beta Note:</strong> Files uploaded in this module
will not be viewable in the Electrophysiology Browser
module. This feature is under construction for the next release.
Please get in touch with the LORIS team to configure this for your
project.
</div>
<Tabs tabs={tabList} defaultTab='browse' updateURL={true}>
<TabPane TabId={tabList[0].id}>
<UploadViewer
data={data.Data}
fieldOptions={data.fieldOptions}
/>
</TabPane>
<TabPane TabId={tabList[1].id}>
<UploadForm
uploadURL={`${props.DataURL}/upload`}
/>
</TabPane>
</Tabs>
</>
);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/imaging_uploader/php/imaging_uploader.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Imaging_Uploader extends \NDB_Menu_Filter_Form
$upload_max_size = \Utility::getMaxUploadSize();
$error_message = "Please make sure files are not larger than " .
$upload_max_size;
http_response_code(400);
http_response_code(413);
$errors = [
'IsPhantom' => [],
'candID' => [],
Expand Down
73 changes: 73 additions & 0 deletions modules/media/test/MediaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,41 @@ function testLoadsWithPermissionRead()
"An error occured while loading the page.",
$bodyText
);
$bodyText = $this->safeFindElement(
WebDriverBy::cssSelector("#dynamictable > thead > tr")
)->getText();
$this->assertStringNotContainsString("Edit Metadata", $bodyText);

$this->resetPermissions();
}
/**
* Tests that the page does not load if the user does not have correct
* permissions
*
* @return void
*/
function testLoadsWithPermissionWrite()
{
$this->setupPermissions(["media_write"]);
$this->safeGet($this->url . "/media/");
$bodyText = $this->safeFindElement(
WebDriverBy::cssSelector("body")
)->getText();
$this->assertStringNotContainsString(
"You do not have access to this page.",
$bodyText
);
$this->assertStringNotContainsString(
"An error occured while loading the page.",
$bodyText
);
$bodyText = $this->safeFindElement(
WebDriverBy::cssSelector("#dynamictable > thead > tr")
)->getText();
$this->assertStringContainsString("Edit Metadata", $bodyText);
$this->resetPermissions();
}
/**
/**
* Tests that the page does not load if the user does not have correct
* permissions
Expand Down Expand Up @@ -185,5 +218,45 @@ function _testFilter($element,$table,$records,$value)
);
$this->assertEquals("", $inputText);
}
/**
* Testing Browse tab and coulumn clicking
*
* @return void
*/
function testBrowseTab()
{
$this->safeGet($this->url . "/media/");

$this->checkColumn(2, "DCC090_V1_bmi.txt");
$this->checkColumn(3, "DCC090");
$this->checkColumn(4, "V1");
$this->checkColumn(5, "");
$this->checkColumn(6, "");
$this->checkColumn(7, "Data Coordinating Center");
$this->checkColumn(8, "Pumpernickel");
}
/**
* Test Browse tab and coulumn clicking-middleware
*
* @param int $columnNumber columnNumber
* @param string $expectedText expectedText
*
* @return void
*/
function checkColumn($columnNumber, $expectedText)
{
$this->safeClick(
WebDriverBy::cssSelector(
"#dynamictable > thead > tr > th:nth-child($columnNumber)"
)
);
$bodyText = $this->safeFindElement(
WebDriverBy::cssSelector(
"#dynamictable > tbody > tr:nth-child(1)".
" > td:nth-child($columnNumber)"
)
)->getText();
$this->assertEquals($expectedText, $bodyText);
}
}

4 changes: 2 additions & 2 deletions modules/media/test/TestPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Media module allows users to upload, browse and edit media files associated with a specific timepoint in Loris.

### 🔒 Permissions
### 🔒 Permissions [Automation Testing]

In order to use the media module the user might need one or both of the following permissions:

Expand Down Expand Up @@ -60,7 +60,7 @@ is selected, the file name should should start with [PSCID]\_[Visit Label]\_[Ins
7. Once the file finished uploading, a modal containing a success message should appear with an 'OK' button.
8. Click on the 👉 **OK** button and the page should refresh to the browse tab. Make sure the file you just uploaded is shown in the data table.

**Test file browsing**
**Test file browsing** [Automation Testing]
1. After a couple of files are uploaded, make sure they are properly displayed in the data table
2. Make sure that information in the data table corresponds to the information in the database (media table)
3. Click on 👉 **column headers** to make sure sorting functionality is working as expected (Ascending/Descending)
Expand Down
6 changes: 5 additions & 1 deletion modules/mri_violations/php/mri_violations.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ class Mri_Violations extends \DataFrameworkMenu
);
default:
return (new Provisioner())
->filter(new UserCenterMatchOrNull())
->filter(
new UserCenterMatchOrNullOrAnyPermission(
$this->allSitePermissionNames(),
)
)
->filter(new UserProjectMatchOrNull());
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/statistics/php/charts.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Charts extends \NDB_Page

$recruitmentBySiteData[] = [
"label" => $siteName,
"total" => intval($data[$siteID]) ?? 0,
"total" => intval($data[$siteID] ?? 0),
];
}
return new \LORIS\Http\Response\JsonResponse($recruitmentBySiteData);
Expand Down
2 changes: 1 addition & 1 deletion modules/statistics/php/statistics_dd_site.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Statistics_DD_Site extends statistics_site
function _getResults(
?\CenterID $centerID,
?\ProjectID $projectID,
$instrument
string $instrument
) {
$this->_checkCriteria($centerID, $projectID);
$DB = $this->loris->getDatabaseConnection();
Expand Down
4 changes: 2 additions & 2 deletions modules/statistics/php/statistics_mri_site.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Statistics_Mri_Site extends Statistics_Site
function _completeCount(
?\CenterID $centerID,
?\ProjectID $projectID,
$issue
string $issue
): ?string {
return null;
}
Expand All @@ -96,7 +96,7 @@ class Statistics_Mri_Site extends Statistics_Site
function _getResults(
?\CenterID $centerID,
?\ProjectID $projectID,
$issue
string $issue
) {
$this->_checkCriteria($centerID, $projectID);
$DB = $this->loris->getDatabaseConnection();
Expand Down
61 changes: 35 additions & 26 deletions modules/statistics/php/statistics_site.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,20 @@ class Statistics_Site extends \NDB_Menu
$this->_checkCriteria($centerID, $projectID);
$DB = $this->loris->getDatabaseConnection();
$count = $DB->pselectOne(
"SELECT count(s.CandID) FROM session s,
candidate c, flag f, {$instrument} i
WHERE s.ID=f.SessionID AND f.CommentID=i.CommentID
AND s.CandID=c.CandID
AND s.Active='Y'
AND s.CenterID <> '1'
$this->query_criteria
AND f.Data_entry='Complete'
AND s.Current_stage <> 'Recycling Bin'
AND f.Administration='All'
AND i.CommentID NOT LIKE 'DDE%'",
$this->query_vars
"SELECT COUNT(DISTINCT s.CandID) FROM
flag f
JOIN session s ON (s.ID=f.SessionID)
JOIN candidate c ON (c.CandID=s.CandID)
WHERE
s.Active='Y' AND s.CenterID <> '1'
AND c.Active='Y'
$this->query_criteria
AND f.Data_entry='Complete'
AND s.Current_stage <> 'Recycling Bin'
AND f.Administration='All'
AND f.CommentID NOT LIKE 'DDE%'
AND f.Test_name=:instrument",
['instrument' => $instrument, ...$this->query_vars]
);
return $count;
}
Expand All @@ -218,24 +220,31 @@ class Statistics_Site extends \NDB_Menu
*
* @return array
*/
function _getResults(?\CenterID $centerID, ?\ProjectID $projectID, $instrument)
{
function _getResults(
?\CenterID $centerID,
?\ProjectID $projectID,
string $instrument
) {
$this->_checkCriteria($centerID, $projectID);
$DB = $this->loris->getDatabaseConnection();
$result = $DB->pselect(
"SELECT s.CandID, f.SessionID, i.CommentID, c.PSCID,
"SELECT DISTINCT s.CandID,
f.SessionID,
f.CommentID,
c.PSCID,
s.Visit_label
FROM session s, candidate c, flag f,
{$instrument} i
WHERE s.ID=f.SessionID AND f.CommentID=i.CommentID
AND s.CandID=c.CandID
AND s.Active='Y'
AND s.CenterID <> '1'
AND s.Current_stage <> 'Recycling Bin'
$this->query_criteria
AND (f.Data_entry is NULL OR f.Data_entry<>'Complete')
AND i.CommentID NOT LIKE 'DDE%' ORDER BY s.Visit_label, c.PSCID",
$this->query_vars
FROM flag f
JOIN session s ON (s.ID=f.SessionID)
JOIN candidate c ON (c.CandID=s.CandID)
WHERE s.Active='Y' AND c.Active='Y'
AND s.CenterID <> '1'
AND s.Current_stage <> 'Recycling Bin'
$this->query_criteria
AND f.Test_name=:instrument
AND (f.Data_entry is NULL OR f.Data_entry<>'Complete')
AND f.CommentID NOT LIKE 'DDE%'
ORDER BY s.Visit_label, c.PSCID",
['instrument'=>$instrument, ...$this->query_vars]
);
return iterator_to_array($result);
}
Expand Down
Loading

0 comments on commit 89d3fde

Please sign in to comment.