Skip to content

Commit 8fbc01a

Browse files
authored
Merge pull request #8086 from ridz1208/PUSH_24.0-release_INTO_MAIN_AGAIN
Push 24.0 release into main again
2 parents b8d5a8a + 826575f commit 8fbc01a

File tree

36 files changed

+362
-157
lines changed

36 files changed

+362
-157
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ core section.***
88
- ***When possible please provide the number of the pull request(s) containing the
99
changes in the following format: PR #1234***
1010

11-
## LORIS 24.0 (Release Date: ??)
11+
## LORIS 24.0 (Release Date: 2022-03-24)
1212
### Core
1313
#### Features
1414
- Data tables may now stream data as they're loading rather than waiting
@@ -75,7 +75,10 @@ scanner candidates. This prevents an error from being thrown in the candidate pa
7575
- Download CSV fix to remove duplicates and entries that partially match the filtering criteria (PR #7242)
7676
- Partially fix instrument escaping issues by reloading instrument and its data upon successful save (PR #7776)
7777
- Fix recognition of null sessionID in NDB_BVL_Instrument (PR #8031)
78-
78+
- Fix delete_candidate.php / delete_timepoint.php failing because of json instruments / instruments with different table name than test_name (PR #8070)
79+
- Fix bug where server_processes_manager had a timeout (PR #8071)
80+
- Candidate profile page loads with only the visits listed that a user has access to
81+
if a candidate has some visits that the user should not see. Fixes error where page was not loading for this use case (PR #8072)
7982

8083
### Modules
8184
#### API

SQL/0000-00-05-ElectrophysiologyTables.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ CREATE TABLE `physiological_annotation_archive` (
265265
CREATE TABLE `physiological_annotation_parameter` (
266266
`AnnotationParameterID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
267267
`AnnotationFileID` INT(10) UNSIGNED NOT NULL,
268-
`Description` TEXT NOT NULL,
268+
`Description` TEXT DEFAULT NULL,
269269
`Sources` VARCHAR(255),
270270
`Author` VARCHAR(255),
271271
PRIMARY KEY (`AnnotationParameterID`),
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE `physiological_annotation_parameter`
2+
MODIFY COLUMN `Description` text DEFAULT NULL
3+
;

jsx/Form.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,10 @@ class EmailElement extends Component {
12951295
<div className={inputClass}>
12961296
<input
12971297
type="email"
1298+
pattern={'/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[' +
1299+
'a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-' +
1300+
']{0,61}[a-zA-Z0-9])?)*$/'}
1301+
title="Please provide a valid email address!"
12981302
className="form-control"
12991303
name={this.props.name}
13001304
id={this.props.id}

modules/behavioural_qc/php/behavioural.class.inc

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace LORIS\behavioural_qc;
44

55
use LORIS\behavioural_qc\Provisioners\BehaviouralProvisioner;
66
use \LORIS\Data\Filters\HasAnyPermissionOrUserSiteMatch;
7+
use LORIS\Data\Filters\UserProjectMatch;
78
use \Psr\Http\Message\ServerRequestInterface;
89
use \Psr\Http\Message\ResponseInterface;
910
use \LORIS\Middleware\ETagCalculator;
@@ -54,9 +55,11 @@ class Behavioural extends \NDB_Page implements ETagCalculator
5455
private function _handleGET(ServerRequestInterface $request) : ResponseInterface
5556
{
5657
$filter = new HasAnyPermissionOrUserSiteMatch(
57-
['access_all_profiles', 'behavioural_quality_control_view']
58+
['access_all_profiles']
5859
);
59-
$provisioner = (new BehaviouralProvisioner())->filter($filter);
60+
$provisioner = (new BehaviouralProvisioner())
61+
->filter($filter)
62+
->filter(new UserProjectMatch());
6063
$user = $request->getAttribute('user');
6164
$data = (new \LORIS\Data\Table())
6265
->withDataFrom($provisioner)
@@ -69,6 +72,16 @@ class Behavioural extends \NDB_Page implements ETagCalculator
6972
return new \LORIS\Http\Response\JsonResponse($body);
7073
}
7174

75+
/**
76+
* Use project for filtering projects.
77+
*
78+
* @return bool
79+
*/
80+
public function useProjectFilter() : bool
81+
{
82+
return true;
83+
}
84+
7285
/**
7386
* Provide the field options for the behavioural form.
7487
*
@@ -79,16 +92,21 @@ class Behavioural extends \NDB_Page implements ETagCalculator
7992
private function _getFieldOptions(
8093
ServerRequestInterface $request
8194
) : array {
82-
$user = $request->getAttribute('user');
83-
$visit_array = \Utility::getVisitList();
95+
$user = $request->getAttribute('user');
96+
$visit_array = \Utility::getVisitList();
97+
$userProjects = $user->getProjects();
98+
$projects = [];
99+
foreach ($userProjects as $project) {
100+
$projects[$project->getId()->__toString()] = $project->getName();
101+
}
84102
// centerID
85103
$list_of_sites = $user->hasPermission('access_all_profiles')
86104
? \Utility::getSiteList()
87105
: $user->getStudySites();
88106
return (new \LORIS\behavioural_qc\Views\Behavioral(
89107
$visit_array,
90108
\Utility::getAllInstruments(),
91-
\Utility::getProjectList(),
109+
$projects,
92110
\Utility::getSubprojectList(),
93111
$list_of_sites
94112
))->toArray();

modules/behavioural_qc/php/conflicts.class.inc

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace LORIS\behavioural_qc;
44

55
use LORIS\behavioural_qc\Provisioners\ConflictsProvisioner;
66
use LORIS\Data\Filters\HasAnyPermissionOrUserSiteMatch;
7+
use LORIS\Data\Filters\UserProjectMatch;
78
use \Psr\Http\Message\ServerRequestInterface;
89
use \Psr\Http\Message\ResponseInterface;
910
use \LORIS\Middleware\ETagCalculator;
@@ -54,9 +55,11 @@ class Conflicts extends \NDB_Page implements ETagCalculator
5455
private function _handleGET(ServerRequestInterface $request) : ResponseInterface
5556
{
5657
$filter = new HasAnyPermissionOrUserSiteMatch(
57-
['access_all_profiles', 'behavioural_quality_control_view']
58+
['access_all_profiles']
5859
);
59-
$provisioner = (new ConflictsProvisioner())->filter($filter);
60+
$provisioner = (new ConflictsProvisioner())
61+
->filter($filter)
62+
->filter(new UserProjectMatch());
6063

6164
$user = $request->getAttribute('user');
6265

@@ -71,6 +74,16 @@ class Conflicts extends \NDB_Page implements ETagCalculator
7174
return new \LORIS\Http\Response\JsonResponse($body);
7275
}
7376

77+
/**
78+
* Use project for filtering projects.
79+
*
80+
* @return bool
81+
*/
82+
public function useProjectFilter() : bool
83+
{
84+
return true;
85+
}
86+
7487
/**
7588
* Provide the field options for the Conflicts form.
7689
*
@@ -81,16 +94,21 @@ class Conflicts extends \NDB_Page implements ETagCalculator
8194
private function _getFieldOptions(
8295
ServerRequestInterface $request
8396
) : array {
84-
$user = $request->getAttribute('user');
85-
$visit_array = \Utility::getVisitList();
97+
$user = $request->getAttribute('user');
98+
$visit_array = \Utility::getVisitList();
99+
$userProjects = $user->getProjects();
100+
$projects = [];
101+
foreach ($userProjects as $project) {
102+
$projects[$project->getId()->__toString()] = $project->getName();
103+
}
86104
// centerID
87105
$list_of_sites = $user->hasPermission('access_all_profiles')
88106
? \Utility::getSiteList()
89107
: $user->getStudySites();
90108
return (new \LORIS\behavioural_qc\Views\Conflicts(
91109
$visit_array,
92110
\Utility::getAllInstruments(),
93-
\Utility::getProjectList(),
111+
$projects,
94112
\Utility::getSubprojectList(),
95113
$list_of_sites
96114
))->toArray();

modules/behavioural_qc/php/incomplete.class.inc

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace LORIS\behavioural_qc;
44

55
use LORIS\behavioural_qc\Provisioners\IncompleteProvisioner;
66
use LORIS\Data\Filters\HasAnyPermissionOrUserSiteMatch;
7+
use LORIS\Data\Filters\UserProjectMatch;
78
use \Psr\Http\Message\ServerRequestInterface;
89
use \Psr\Http\Message\ResponseInterface;
910
use \LORIS\Middleware\ETagCalculator;
@@ -54,9 +55,11 @@ class Incomplete extends \NDB_Page implements ETagCalculator
5455
private function _handleGET(ServerRequestInterface $request) : ResponseInterface
5556
{
5657
$filter = new HasAnyPermissionOrUserSiteMatch(
57-
['access_all_profiles', 'behavioural_quality_control_view']
58+
['access_all_profiles']
5859
);
59-
$provisioner = (new IncompleteProvisioner())->filter($filter);
60+
$provisioner = (new IncompleteProvisioner())
61+
->filter($filter)
62+
->filter(new UserProjectMatch());
6063

6164
$user = $request->getAttribute('user');
6265

@@ -71,6 +74,16 @@ class Incomplete extends \NDB_Page implements ETagCalculator
7174
return new \LORIS\Http\Response\JsonResponse($body);
7275
}
7376

77+
/**
78+
* Use project for filtering projects.
79+
*
80+
* @return bool
81+
*/
82+
public function useProjectFilter() : bool
83+
{
84+
return true;
85+
}
86+
7487
/**
7588
* Provide the field options for the incomplete form.
7689
*
@@ -81,9 +94,13 @@ class Incomplete extends \NDB_Page implements ETagCalculator
8194
private function _getFieldOptions(
8295
ServerRequestInterface $request
8396
) : array {
84-
$user = $request->getAttribute('user');
85-
$visit_array = \Utility::getVisitList();
86-
$projects = \Utility::getProjectList();
97+
$user = $request->getAttribute('user');
98+
$visit_array = \Utility::getVisitList();
99+
$userProjects = $user->getProjects();
100+
$projects = [];
101+
foreach ($userProjects as $project) {
102+
$projects[$project->getId()->__toString()] = $project->getName();
103+
}
87104
// centerID
88105
$list_of_sites = $user->hasPermission('access_all_profiles')
89106
? \Utility::getSiteList()

modules/behavioural_qc/php/models/behaviouraldto.class.inc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ namespace LORIS\behavioural_qc\Models;
1717
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
1818
* @link https://github.com/aces/Loris-Trunk
1919
*/
20-
class BehaviouralDTO implements \LORIS\Data\DataInstance
20+
class BehaviouralDTO implements \LORIS\Data\DataInstance,
21+
\LORIS\StudyEntities\SiteHaver
2122
{
2223
/**
2324
* The instrument
@@ -117,6 +118,28 @@ class BehaviouralDTO implements \LORIS\Data\DataInstance
117118
*/
118119
private $_feedback_status = '';
119120

121+
/**
122+
* Returns the CenterID for this instance, for filters such as
123+
* \LORIS\Data\Filters\UserSiteMatch to match against.
124+
*
125+
* @return \CenterID
126+
*/
127+
public function getCenterID(): \CenterID
128+
{
129+
return new \CenterID($this->_site);
130+
}
131+
132+
/**
133+
* Returns the ProjectID for this row, for filters such as
134+
* \LORIS\Data\Filters\UserProjectMatch to match again.
135+
*
136+
* @return \ProjectID
137+
*/
138+
public function getProjectID(): \ProjectID
139+
{
140+
return new \ProjectID($this->_project);
141+
}
142+
120143
/**
121144
* Implements \LORIS\Data\DataInstance interface for this row.
122145
*

modules/behavioural_qc/php/models/conflictsdto.class.inc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ namespace LORIS\behavioural_qc\Models;
1717
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
1818
* @link https://github.com/aces/Loris-Trunk
1919
*/
20-
class ConflictsDTO implements \LORIS\Data\DataInstance
20+
class ConflictsDTO implements \LORIS\Data\DataInstance,
21+
\LORIS\StudyEntities\SiteHaver
2122
{
2223
/**
2324
* The instrument
@@ -103,6 +104,28 @@ class ConflictsDTO implements \LORIS\Data\DataInstance
103104
*/
104105
private $_commentID = '';
105106

107+
/**
108+
* Returns the CenterID for this instance, for filters such as
109+
* \LORIS\Data\Filters\UserSiteMatch to match against.
110+
*
111+
* @return \CenterID
112+
*/
113+
public function getCenterID(): \CenterID
114+
{
115+
return new \CenterID($this->_site);
116+
}
117+
118+
/**
119+
* Returns the ProjectID for this row, for filters such as
120+
* \LORIS\Data\Filters\UserProjectMatch to match again.
121+
*
122+
* @return \ProjectID
123+
*/
124+
public function getProjectID(): \ProjectID
125+
{
126+
return new \ProjectID($this->_project);
127+
}
128+
106129
/**
107130
* Implements \LORIS\Data\DataInstance interface for this row.
108131
*

modules/behavioural_qc/php/models/incompletedto.class.inc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ namespace LORIS\behavioural_qc\Models;
1717
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
1818
* @link https://github.com/aces/Loris-Trunk
1919
*/
20-
class IncompleteDTO implements \LORIS\Data\DataInstance
20+
class IncompleteDTO implements \LORIS\Data\DataInstance,
21+
\LORIS\StudyEntities\SiteHaver
2122
{
2223
/**
2324
* The instrument
@@ -103,6 +104,28 @@ class IncompleteDTO implements \LORIS\Data\DataInstance
103104
*/
104105
private $_commentID = '';
105106

107+
/**
108+
* Returns the CenterID for this instance, for filters such as
109+
* \LORIS\Data\Filters\UserSiteMatch to match against.
110+
*
111+
* @return \CenterID
112+
*/
113+
public function getCenterID(): \CenterID
114+
{
115+
return new \CenterID($this->_site);
116+
}
117+
118+
/**
119+
* Returns the ProjectID for this row, for filters such as
120+
* \LORIS\Data\Filters\UserProjectMatch to match again.
121+
*
122+
* @return \ProjectID
123+
*/
124+
public function getProjectID(): \ProjectID
125+
{
126+
return new \ProjectID($this->_project);
127+
}
128+
106129
/**
107130
* Implements \LORIS\Data\DataInstance interface for this row.
108131
*

0 commit comments

Comments
 (0)