Skip to content

Commit

Permalink
Merge branch 'main' into 2023-02-02-acknowledgements-dataframework
Browse files Browse the repository at this point in the history
  • Loading branch information
kongtiaowang authored Nov 18, 2024
2 parents 4d6d91b + 464dd8b commit 4f4b890
Show file tree
Hide file tree
Showing 970 changed files with 24,870 additions and 19,701 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"tabWidth": 2,
"ignoreComments": true
}],
"indent": ["error", 2],
"no-unexpected-multiline": "off",
"no-unused-vars": "error",
"no-useless-escape": "off",
Expand Down Expand Up @@ -110,8 +111,9 @@
}}
],
"jsdoc/require-param-description": "error",
"jsdoc/require-returns": "error",
"jsdoc/require-returns-description": "error",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns-type": "off",
"no-undef": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off"
Expand Down
51 changes: 22 additions & 29 deletions .github/workflows/loristest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
EEG_VIS_ENABLED: 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install EEG package dependencies
# We only need to install protobuf-compiler
Expand All @@ -36,13 +36,13 @@ jobs:
- name: Create node_modules tarball
run: tar cfvz node_modules.tar.gz node_modules

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload node_modules artifact
with:
name: node_modules
path: node_modules.tar.gz

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload lorisjs.tar.gz artifact
with:
name: lorisjs
Expand All @@ -52,9 +52,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2', '8.3']
php: ['8.3']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Create vendor tarball
run: tar cfvz vendor-php${{matrix.php}}.tar.gz vendor

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload vendor-php${{matrix.php}}.tar.gz artifact
with:
name: vendor-php${{matrix.php}}
Expand All @@ -104,33 +104,34 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']
php: ['8.3']
apiversion: ['v0.0.3', 'v0.0.4-dev']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
name: Download node_modules artifact
# Cache node_modules to avoid downloading dependencies if already cached
- name: Cache node_modules
uses: actions/cache@v3
with:
name: node_modules
path: .

- uses: actions/download-artifact@v3
name: Download compiled LORIS javascript artifact
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Download and extract compiled LORIS JavaScript artifact (from build job)
- name: Download compiled LORIS javascript artifact
uses: actions/download-artifact@v4
with:
name: lorisjs
path: .

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download PHP dependencies artifact
with:
name: vendor-php${{matrix.php}}
path: .


- name: Extract node_modules
run: tar xfvz node_modules.tar.gz

- name: Extract compiled JS
run: tar xfvz lorisjs.tar.gz

Expand Down Expand Up @@ -209,28 +210,20 @@ jobs:
fail-fast: false
matrix:
testsuite: ['integration']
php: ['8.1','8.2', '8.3']
php: ['8.3']
ci_node_index: [0,1,2,3]

include:
# add a variable but do not display it in the job's name
- ci_node_total: 4

- testsuite: 'static'
php: '8.1'
- testsuite: 'static'
php: '8.2'
- testsuite: 'static'
php: '8.3'
- testsuite: 'unit'
php: '8.1'
- testsuite: 'unit'
php: '8.2'
- testsuite: 'unit'
php: '8.3'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
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
21 changes: 13 additions & 8 deletions SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ CREATE TABLE `instrument_data` (
CREATE TABLE `flag` (
`ID` int(10) unsigned NOT NULL auto_increment,
`SessionID` int(10) unsigned NOT NULL,
`Test_name` varchar(255) NOT NULL default '',
`TestID` int(10) unsigned NOT NULL,
`CommentID` varchar(255) NOT NULL default '',
`Data_entry` enum('In Progress','Complete') default NULL,
`Required_elements_completed` enum('Y','N') NOT NULL default 'N',
Expand All @@ -305,15 +305,14 @@ CREATE TABLE `flag` (
PRIMARY KEY (`CommentID`),
KEY `flag_ID` (`ID`),
KEY `flag_SessionID` (`SessionID`),
KEY `flag_Test_name` (`Test_name`),
KEY `flag_Exclusion` (`Exclusion`),
KEY `flag_Data_entry` (`Data_entry`),
KEY `flag_Validity` (`Validity`),
KEY `flag_Administration` (`Administration`),
KEY `flag_UserID` (`UserID`),
CONSTRAINT `FK_flag_1` FOREIGN KEY (`SessionID`) REFERENCES `session` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_flag_2` FOREIGN KEY (`Test_name`) REFERENCES `test_names` (`Test_name`),
CONSTRAINT `FK_flag_3` FOREIGN KEY (`DataID`) REFERENCES `instrument_data` (`ID`)
CONSTRAINT `FK_flag_3` FOREIGN KEY (`DataID`) REFERENCES `instrument_data` (`ID`),
CONSTRAINT `FK_ibfk_1` FOREIGN KEY (`TestID`) REFERENCES `test_names` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `history` (
Expand Down Expand Up @@ -342,6 +341,7 @@ CREATE TABLE `test_battery` (
`CenterID` int(11) default NULL,
`firstVisit` enum('Y','N') default NULL,
`instr_order` tinyint(4) default NULL,
`DoubleDataEntryEnabled` enum('Y','N') default 'N',
PRIMARY KEY (`ID`),
KEY `age_test` (`AgeMinDays`,`AgeMaxDays`,`Test_name`),
KEY `FK_test_battery_1` (`Test_name`),
Expand Down Expand Up @@ -1529,6 +1529,7 @@ CREATE TABLE `issues` (
`candID` int(6) DEFAULT NULL,
`category` varchar(255) DEFAULT NULL,
`description` longtext DEFAULT NULL,
`instrument` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`issueID`),
KEY `fk_issues_1` (`reporter`),
KEY `fk_issues_2` (`assignee`),
Expand All @@ -1537,20 +1538,22 @@ CREATE TABLE `issues` (
KEY `fk_issues_5` (`centerID`),
KEY `fk_issues_6` (`lastUpdatedBy`),
KEY `fk_issues_8` (`category`),
KEY `fk_issues_instrument` (`instrument`),
CONSTRAINT `fk_issues_8` FOREIGN KEY (`category`) REFERENCES `issues_categories` (`categoryName`),
CONSTRAINT `fk_issues_1` FOREIGN KEY (`reporter`) REFERENCES `users` (`UserID`),
CONSTRAINT `fk_issues_2` FOREIGN KEY (`assignee`) REFERENCES `users` (`UserID`),
CONSTRAINT `fk_issues_3` FOREIGN KEY (`candID`) REFERENCES `candidate` (`CandID`),
CONSTRAINT `fk_issues_4` FOREIGN KEY (`sessionID`) REFERENCES `session` (`ID`),
CONSTRAINT `fk_issues_5` FOREIGN KEY (`centerID`) REFERENCES `psc` (`CenterID`),
CONSTRAINT `fk_issues_6` FOREIGN KEY (`lastUpdatedBy`) REFERENCES `users` (`UserID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CONSTRAINT `fk_issues_6` FOREIGN KEY (`lastUpdatedBy`) REFERENCES `users` (`UserID`),
CONSTRAINT `fk_issues_instrument` FOREIGN KEY (`instrument`) REFERENCES `test_names` (`ID`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `issues_history` (
`issueHistoryID` int(11) unsigned NOT NULL AUTO_INCREMENT,
`newValue` longtext NOT NULL,
`dateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`fieldChanged` enum('assignee','status','comment','sessionID','centerID','title','category','module','lastUpdatedBy','priority','candID', 'description','watching') NOT NULL DEFAULT 'comment',
`fieldChanged` enum('assignee','status','comment','sessionID','centerID','title','category','module','lastUpdatedBy','priority','candID', 'description','watching','instrument') NOT NULL DEFAULT 'comment',
`issueID` int(11) unsigned NOT NULL,
`addedBy` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`issueHistoryID`),
Expand Down Expand Up @@ -2096,7 +2099,9 @@ CREATE TABLE `data_release` (
`file_name` varchar(255),
`version` varchar(255),
`upload_date` date,
PRIMARY KEY (`id`)
`ProjectID` INT(10) UNSIGNED NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (ProjectID) REFERENCES Project (ProjectID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `data_release_permissions` (
Expand Down
3 changes: 2 additions & 1 deletion SQL/0000-00-03-ConfigTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType,
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'useConsent', 'Enable if the study uses the loris architecture for consent', 1, 0, 'boolean', ID, 'Use consent', 16 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'additional_user_info', 'Display additional user profile fields on the User accounts page (e.g. Institution, Position, Country, Address)', 1, 0, 'boolean', ID, 'Additional user information', 17 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'excluded_instruments', "Instruments to be excluded from the Data Dictionary and download via the Data Query Tool", 1, 1, 'instrument', ID, 'Excluded instruments', 18 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'DoubleDataEntryInstruments', "Instruments for which double data entry should be enabled", 1, 1, 'instrument', ID, 'Double data entry instruments', 19 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'InstrumentResetting', 'Allows resetting of instrument data', 1, 0, 'boolean', ID, 'Instrument Resetting', 20 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'SupplementalSessionStatus', 'Display supplemental session status information on Timepoint List page', 1, 0, 'boolean', ID, 'Use Supplemental Session Status', 21 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'useScanDone', 'Used for identifying timepoints that have (or should have) imaging data', 1, 0, 'boolean', ID, 'Use Scan Done', 22 FROM ConfigSettings WHERE Name="study";
Expand All @@ -63,6 +62,7 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType,
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'dateDisplayFormat', 'The date format to use throughout LORIS for displaying date information - formats for date inputs are browser- and locale-dependent.', 1, 0, 'text', ID, 'Date display format', 28 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'adminContactEmail', 'An email address that users can write to in order to report issues or ask question', 1, 0, 'text', ID, 'Administrator Email', 29 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'UserMaximumDaysInactive', 'The maximum number of days since last login before making a user inactive', 1, 0, 'text', ID, 'Maximum Days Before Making User Inactive', 30 FROM ConfigSettings WHERE Name="study";
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'useDoB', 'Use DoB (Date of Birth)', 1, 0, 'boolean', ID, 'Use DoB', 31 FROM ConfigSettings WHERE Name="study";

INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('paths', 'Specify directories where LORIS-related files are stored or created. Take care when editing these fields as changing them incorrectly can cause certain modules to lose functionality.', 1, 0, 'Paths', 2);
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'imagePath', 'Path to images for display in Imaging Browser (e.g. /data/$project/data/) ', 1, 0, 'text', ID, 'Images', 9 FROM ConfigSettings WHERE Name="paths";
Expand Down Expand Up @@ -188,6 +188,7 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, "Example Study" FROM ConfigSetti
INSERT INTO Config (ConfigID, Value) SELECT ID, "<h3>Example Study Description</h3>\r\n <p>This is a sample description for this study, because it is a new LORIS install that has not yet customized this text.</p>\r\n <p>A LORIS administrator can customize this text in the configuration module, under the configuration option labeled \"Study Description\"</p>\r\n <h3>Useful Links</h3>\r\n <ul>\r\n <li><a href=\"https://github.com/aces/Loris\" >LORIS GitHub Repository</a></li>\r\n <li><a href=\"https://github.com/aces/Loris/wiki/Setup\" >LORIS Setup Guide</a></li>\r\n <li><a href=\"https://www.youtube.com/watch?v=2Syd_BUbl5A\" >A video of a loris on YouTube</a></li>\r\n </ul>" FROM ConfigSettings WHERE Name="StudyDescription";
INSERT INTO Config (ConfigID, Value) SELECT ID, "images/neurorgb_web.jpg" FROM ConfigSettings WHERE Name="studylogo";
INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="useEDC";
INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="useDoB";
INSERT INTO Config (ConfigID, Value) SELECT ID, 8 FROM ConfigSettings WHERE Name="ageMin";
INSERT INTO Config (ConfigID, Value) SELECT ID, 11 FROM ConfigSettings WHERE Name="ageMax";
INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="useFamilyID";
Expand Down
2 changes: 2 additions & 0 deletions SQL/Cleanup_patches/2024-09-13-NoTestName.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE flag DROP CONSTRAINT FK_flag_2;
ALTER TABLE flag DROP COLUMN test_name;
2 changes: 2 additions & 0 deletions SQL/New_patches/2023-12-08_useDoB.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'useDoB', 'Use DoB (Date of Birth)', 1, 0, 'boolean', ID, 'Use DoB', 31 FROM ConfigSettings WHERE Name="study";
INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="useDoB";
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALTER TABLE `issues`
ADD `instrument` int(10) unsigned DEFAULT NULL
AFTER `description`;

ALTER TABLE `issues`
ADD CONSTRAINT `fk_issues_instrument`
FOREIGN KEY (`instrument`) REFERENCES `test_names` (`ID`)
ON DELETE RESTRICT ON UPDATE CASCADE;

ALTER TABLE `issues_history`
MODIFY `fieldChanged` enum('assignee','status','comment','sessionID','centerID','title','category','module','lastUpdatedBy','priority','candID', 'description','watching','instrument') NOT NULL DEFAULT 'comment';
6 changes: 6 additions & 0 deletions SQL/New_patches/2024-09-13-TestID.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE flag ADD COLUMN TestID int(10) unsigned AFTER test_name;
ALTER TABLE flag ADD CONSTRAINT FOREIGN KEY (TestID) REFERENCES test_names(ID);

UPDATE flag f SET TestID=(SELECT ID FROM test_names tn WHERE f.test_name=tn.test_name);

ALTER TABLE flag MODIFY COLUMN TestID int(10) unsigned NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE data_release
ADD COLUMN ProjectID INT(10) UNSIGNED NULL DEFAULT NULL,
ADD CONSTRAINT FK_ProjectID
FOREIGN KEY (ProjectID) REFERENCES Project (ProjectID);
9 changes: 9 additions & 0 deletions SQL/New_patches/2024_05_13_Add_DDE_To_Battery.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ALTER TABLE test_battery ADD COLUMN DoubleDataEntryEnabled enum("Y", "N") DEFAULT "N";

UPDATE test_battery SET DoubleDataEntryEnabled = 'Y' WHERE Test_name IN (
SELECT Value from Config WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'DoubleDataEntryInstruments')
);

DELETE FROM Config WHERE ConfigID IN (SELECT ID FROM ConfigSettings WHERE Name = 'DoubleDataEntryInstruments');

DELETE FROM ConfigSettings WHERE Name = 'DoubleDataEntryInstruments';
62 changes: 2 additions & 60 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: '3.8'
services:
db:
build:
Expand All @@ -13,12 +13,9 @@ services:
- MYSQL_RANDOM_ROOT_PASSWORD=yes

selenium:
image: selenium/standalone-firefox-debug:3.141.59-zirconium
volumes:
- /dev/shm:/dev/shm
image: selenium/standalone-firefox:4.25
ports:
- "5900:5900"

web:
build:
context: .
Expand Down Expand Up @@ -62,58 +59,3 @@ services:
- selenium
- web
entrypoint: /app/test/wait-for-services.sh

selenium-debug:
image: selenium/standalone-firefox-debug:3.141.59-zirconium
links:
- web-debug:web
ports:
- "5901:5900"

web-debug:
build:
context: .
dockerfile: Dockerfile.test.php8.debug
volumes:
- ./:/app
- ./test/test_instrument:/app/project/instruments
environment:
- LORIS_DB_CONFIG=/app/test/config.xml
- XDEBUG_CONFIG=remote_host=${XDEBUG_REMOTE_HOST}
- PHP_IDE_CONFIG=serverName=LorisTests
depends_on:
- db
command: php -S 0.0.0.0:8000 -t /app/htdocs /app/htdocs/router.php

unit-tests-debug:
build:
context: .
dockerfile: Dockerfile.test.php8.debug
volumes:
- ./:/app
working_dir: /app
environment:
- LORIS_DB_CONFIG=test/config.xml
- XDEBUG_CONFIG=remote_host=${XDEBUG_REMOTE_HOST}
- PHP_IDE_CONFIG=serverName=LorisTests
depends_on:
- db
entrypoint: /app/test/wait-for-services.sh

integration-tests-debug:
build:
context: .
dockerfile: Dockerfile.test.php8.debug
volumes:
- ./:/app
working_dir: /app
environment:
- LORIS_DB_CONFIG=test/config.xml
- SELENIUM_REQUIRED=true
- XDEBUG_CONFIG=remote_host=${XDEBUG_REMOTE_HOST}
- PHP_IDE_CONFIG=serverName=LorisTests
links:
- db
- selenium-debug:selenium
- web-debug:web
entrypoint: /app/test/wait-for-services.sh
Loading

0 comments on commit 4f4b890

Please sign in to comment.