Skip to content

Commit

Permalink
Merge branch 'master' into 2020-01-21-GetCandidateAge
Browse files Browse the repository at this point in the history
  • Loading branch information
ridz1208 authored Jul 16, 2020
2 parents 43377b1 + ac4222d commit 275f194
Show file tree
Hide file tree
Showing 719 changed files with 24,503 additions and 30,136 deletions.
17 changes: 14 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
},
"rules": {
"extends": ["eslint:recommended", "plugin:react/recommended", "google"],
"max-len": [1, 80, 2, {"ignoreComments": true}],
"max-len": [2, 80, 2, {
"ignoreComments": true
}],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"prefer-rest-params": "warn",
"prefer-rest-params": "error",
"array-callback-return": 0,
"require-jsdoc": "warn",
"require-jsdoc": "error",
"no-implicit-globals": 0,
"no-invalid-this": 0,
"no-alert": 0,
Expand All @@ -33,6 +35,15 @@
"allow": ["info", "warn", "error"]
}]
},
"overrides": [
{
"files": ["modules/**"],
"rules": {
"max-len": [1, 80, 2, {"ignoreComments": true}],
"require-jsdoc": "warn"
}
}
],
"globals": {
"React": true,
"ReactDOM": true,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ project-*
tools/*.txt
htdocs/phpunit_codecoverage/
htdocs/my_tests/
htdocs/vendor/js/react/*
docs/css/
docs/dashboard.html
docs/fonts/
Expand Down
5 changes: 4 additions & 1 deletion .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
"dead_code_detection" => false,
// FIXME: We should add this. Note that dead_code_detection also covers
// unused_variable_detection. It might be a good idea to enable this first.
"unused_variable_detection" => false,
"unused_variable_detection" => true,
"suppress_issue_types" => [
"PhanUnusedVariable",
"PhanUnusedPublicMethodParameter",
"PhanUnusedPublicNoOverrideMethodParameter",
"PhanTypePossiblyInvalidDimOffset",
"PhanUndeclaredMethod",
"PhanTypeMismatchArgument",
Expand Down
26 changes: 15 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
sudo: required

# any language should do it
language: php

php:
- 7.3
- 7.4

matrix:
include:
- php: "7.3"
- php: "7.4"
fast_finish: true

env:
- TEST_SUITE=static
- TEST_SUITE=unit
- TEST_SUITE=integration

services:
- docker
Expand All @@ -18,11 +24,9 @@ install:
- sudo apt-get install npm
- make dev

before_script:
- sed -i "s/7.3/$TRAVIS_PHP_VERSION/g" Dockerfile.test.php7
script: "npm run tests:$TEST_SUITE"

script:
# Unable to initialize database, use the following code to debug. - docker-compose up --build
# docker-compose up --build
- make checkstatic
- docker-compose run -e HEADLESS=true -T --rm integration-tests vendor/bin/phpunit --configuration test/phpunit.xml
# This should improve build time by caching composer files.
cache:
directories:
- $HOME/.composer/cache/files
111 changes: 93 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## CHANGELOG
# CHANGELOG

- ***When adding content to this document, make sure to create a section for each module
if the changes only impact a single module and that section does not already exist in
Expand All @@ -8,33 +8,108 @@ core section.***
- ***When possible please provide the number of the pull request(s) containing the
changes in the following format: PR #1234***

### LORIS 23.0 (Released: ??)
##LORIS 24.0 (Release Date: ??)
### Core
#### Features
- *Add item here*
#### Updates and Improvements
- Module-specific permissions added for Survey Accounts, Imaging Behavioural
Quality Control, and Behavioural Quality Control. (PR #6041)
- Candidate's age can be retrieved from the Candidate class in days, months, and years (PR #5945)
#### Bug Fixes
- *Add item here*
### Modules
#### Issue Tracker
- Readability of comments and history was improved. (PR #6138)
### Clean Up
- *Add item here*
### Notes For Existing Projects
- *Add item here*
### Notes For Developers
- *Add item here*


## LORIS 23.0.0 (Release Date: 2020-06-12)

### Core
#### Features
- Add configuration option to specify the format in which dates are displayed. (PR #5004)
- Configurable upload directory for data_release and document_repository modules (PR #5815)
- New radio components for forms. (PR #5846)

#### Core
#### Updates and Improvements
- PHP minimum requirements raised to PHP 7.3 (PR #5723)
- Menus are now maintained by modules and no longer in the SQL database (PR #5839)
- Very old instruments relying on QuickForm may have issues due to code changes (PR #4928)
- Unix user permissions have been updated which may affect access to files. New
documentation for file permissions has been added to the README.md file (PR #5323)
- Candidate's age can be retrieved from the Candidate class in days, months, and years (PR #5945)
- New script created for streamlining instantiation of the Raisinbread demonstration
database (PR #5260)
- New documentation for file permissions has been added to the README.md file. (PR #5323)
- Dashboard study progression section performance improvement (PR #5887)

#### Bug Fixes
- Fix edge-case that gave a confusing error message when changing password (PR #5956)
- Fix bug where examiner form field was incorrectly hidden (PR #6085)
- Fix special character double escaping in instruments (PR #6223)

#### Modules
### Modules
#### Candidate Profile
- New module created to provide dashboard of a single candidate's data across all
modules. (Various PRs)

##### Issue Tracker
- The issue_tracker module now has the feature of uploading attachments to new or existing issues.
- The issue_tracker module now has the feature of uploading attachments to new or existing issues. (PR #5394)
- All sites now appear in the dropdown for site, not only study sites. (PR #6135)

##### Battery Manager
- New module created to manage the entries in the test_battery table of the database.
This allows projects to modify their instrument battery without requiring backend access.
#### Battery Manager
- New module created to manage the entries in the `test_battery` table of the database.
This allows projects to modify their instrument battery without requiring backend access.
(PR #4221)

#### Module Manager
- New module created to manage the status of installed modules. (PR #6015)

##### Module Manager
- New module created to manage the status of installed modules (PR #6015)
#### Electrophysiology Browser
- New module created to view electrophysiology data within LORIS. (PR #5230)

##### Electrophysiology Browser
- New module created to view electrophysiology data within LORIS. (PR #5230)
#### Candidate Parameters
- Add tab to view and edit a candidate's date of birth. (PR #4915)
- Add date of death feature for LORIS. Store and calculate age based on a date of
death for candidates. (PR #4929)

#### Create Timepoint
- Add language parameter when creating a new timepoint for multilingual studies. (PR #4976)

#### Data Release
- Add filters to data release module. (PR #5224)

#### Clean Up
#### MRI Violations
- Add support for multiple MRI protocols (PR #4321)

### Clean Up
- New tool for detection of multiple first visits for a candidate (prevents a database
exception). It is recommended to run this tool for existing projects (PR #5270)
- Heroku postdeploy script cleanup (PR #5275)
- Vagrantfile Deprecation (PR #5319)
- The `data_integrity_flag` module was removed. (PR #5824)

### Notes For Existing Projects
- PHP should be upgraded to 7.3 to before upgrading LORIS.
- For dev instances, php7.3-curl is now a required dependency.
- Legacy Quickform instruments may have issues due to code changes (PR #4928)
- Customized entries in the `LorisMenu` and `LorisMenuPermissions` tables need to be
transferred to the new module table and handled accordingly. (PR #5839)
- Change of name from `quatUser` and `quatPassword` to `adminUser` and `adminPassword` (PR #5785)
- The `data_integrity_flag` module was removed. Projects still using the module should
copy the code into the override directory and re-add the necessary SQL to add it to
the list of modules.(PR #5824)
- New tool for detection of multiple first visits for a candidate (prevents a database
exception). It is recommended to run this tool for existing projects (PR #5270)
exception). It is recommended to run this tool for existing projects (PR #5270)
- New tool for automatically adding modules to the modules table. This tool should
be used by projects having custom modules not in LORIS. (PR #5913)
- Duplicate filenames in the data release module will cause an error when downloading. Make sure to remove all filename duplications before upgrading to this version. (PR #6461)
- New tool for detecting and reporting the presence of double escaped special characters in the database instruments (PR #6477)

### Notes For Developers
- The tool `phpstan` has been added to our automated test suite. (PR #4928)
- Config files for static analysis have been moved to the `test/` directory. (PR #5871)
- Dashboard was refactored to turn panels into module widgets. (PR #5896)
- Add CSSGrid component type (PR #6090)
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ issues and/or Redmine tickets (if applicable).
4. For SQL patches that are _optional_ (e.g. those that perform some
cleanup), place them in `SQL/Cleanup_patches/`.
5. The files for our test database (Raisinbread) must be updated if they were modified.
Detailed instructions for this step can be found [here](https://github.com/aces/Loris/tree/minor/raisinbread#exporting-rb).
Detailed instructions for this step can be found in the Raisin Bread [README.md](./raisinbread/README.md#exporting-rb).
* Include a test for any new module in the `modules/MODULENAME/test/`
directory. You can look at other modules for examples of how to
write tests.
Expand All @@ -75,6 +75,7 @@ request description and tag it with **Caveat for Existing Projects**.
This helps us to document our release notes.
* You can run the command `make checklanguage` to ensure that documentation
you've contributed contains language that is friendly and accessible.
* Be sure to modify the `CHANGELOG.md` file.

If you're unsure about any of the above, feel free to ask us for
clarification via the mailing list.
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile.test.db
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,4 @@ RUN echo "Use LorisTest;" | cat - \

RUN echo "Use LorisTest;" >> /docker-entrypoint-initdb.d/0001-paths.sql
RUN echo "UPDATE Config SET Value='${BASE_DIR}/' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='base');" >> /docker-entrypoint-initdb.d/0001-paths.sql
RUN echo "UPDATE Config SET Value='http://web:8000' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='url');" >> /docker-entrypoint-initdb.d/0001-paths.sql

RUN echo "GRANT UPDATE,INSERT,SELECT,DELETE,DROP,CREATE TEMPORARY TABLES ON LorisTest.* TO 'SQLTestUser'@'%' IDENTIFIED BY 'TestPassword' WITH GRANT OPTION;" >> /docker-entrypoint-initdb.d/0004-sql-user.sql
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ clean:
rm -f smarty/templates_c/*
rm -f VERSION
rm -rf vendor
rm -rf node_modules
rm package-lock.json

# Perform static analysis checks
checkstatic: phpdev
npm run lint:php
npm run lint:javascript
vendor/bin/phan
npm run lint:javascript

# The 'alex' tool scans documentation for condescending language.
# Arguments:
Expand Down
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img src="./htdocs/images/LORIS_logo.svg" width="35%">

[![Build Status](https://travis-ci.org/aces/Loris.svg?branch=master)](https://travis-ci.org/aces/Loris)
[![Build Status](https://travis-ci.org/aces/Loris.svg?branch=master)](https://travis-ci.org/aces/Loris)
[![Minimum PHP Version](https://img.shields.io/travis/php-v/aces/loris/master?color=787CB5)](https://php.net/)
[![Documentation Status](https://readthedocs.org/projects/acesloris/badge/?version=latest)](https://acesloris.readthedocs.io/en/latest/?badge=latest)

Expand All @@ -10,10 +10,11 @@ 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 the LORIS <b>v22.*</b> release on <b>Ubuntu</b>.
([CentOS Readme also available](./docs/wiki/00%20-%20SERVER%20INSTALL%20AND%20CONFIGURATION/01%20-%20LORIS%20Install/CentOS/README.CentOS7.md)).
This Readme covers installation of LORIS version <b>23</b> on <b>Ubuntu</b>.

Please consult the [LORIS Wiki Setup Guide](https://github.com/aces/Loris/wiki/Setup) notes on this [Install process](https://github.com/aces/Loris/wiki/Installing-Loris) for more information.
([CentOS Readme also available](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/CentOS/README.md)).

Please consult the [Ubuntu Installation guide](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/Ubuntu/README.md) or [CentOS Installation guide](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/CentOS/README.md) for more information. These installation instructions and more LORIS documentation for developers can also be found on the [LORIS ReadTheDocs website](https://acesloris.readthedocs.io/en/latest/).

#### Heroku

Expand All @@ -29,7 +30,7 @@ Deploy and log in with username *admin* and the password that's set up during de
#### System Requirements

* Apache **2.4** or higher
* MySQL >= 5.7 (or MariaDB >= 10.3)
* MySQL >= 5.7 (or MariaDB >= 10.3)
* PHP <b>7.3</b> or higher
* [Composer](https://getcomposer.org/) <b>1.4</b> or higher
* NodeJS <b>8.0</b> or higher
Expand All @@ -40,7 +41,7 @@ These dependencies are subject to change so be sure to verify your version of My

### Install Steps

Consult the [LORIS Wiki](https://github.com/aces/Loris/wiki/Setup) page on this [Install process](https://github.com/aces/Loris/wiki/Installing-Loris) for more information.
Consult the [Ubuntu Installation guide](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/Ubuntu/README.md) or [CentOS Installation guide](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/CentOS/README.md) for more information.

1. Set up LINUX user and group lorisadmin and create LORIS base directory:

Expand All @@ -66,7 +67,7 @@ Download the latest release from the [releases page](https://github.com/aces/Lor

3. Run installer script to install core code, and libraries. The script will prompt for information and so that it can create directories automatically.

For more information, please read the [Installing Loris wiki page](https://github.com/aces/Loris/wiki/Installing-Loris).
For more information, please read the [Ubuntu Installation guide](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/Ubuntu/README.md) or [CentOS Installation guide](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/CentOS/README.md).

```bash
cd /var/www/$projectname/tools
Expand All @@ -82,15 +83,15 @@ For more information, please read the [Installing Loris wiki page](https://githu
5. Apache configuration

If your apache configuration was not completed by the Install script, run the following enable rewriting of LORIS, enable your `$projectname` site, and restart apache: (run by user who has root privileges)

```bash
sudo a2enmod rewrite
sudo a2dissite default
sudo a2ensite $projectname
sudo service apache2 reload
```
6. Go to http://localhost/installdb.php and follow the instructions to finalize LORIS installation, then restart apache.

6. Open your browser and go to: `<loris-url>/installdb.php`. This web page will prompt you for your mysql connection information. Follow the instructions to finalize LORIS installation, then restart apache.

If you use MySQL 8, please read [this link](https://www.php.net/manual/en/mysqli.requirements.php) and also [this](https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password-compatible-connectors).

Expand All @@ -99,24 +100,25 @@ If you use MySQL 8, please read [this link](https://www.php.net/manual/en/mysqli
## Community

### Get in touch
For questions and troubleshooting guidance beyond what is covered in our GitHub Wiki, please subscribe to the [LORIS Developers mailing list](http://www.bic.mni.mcgill.ca/mailman/listinfo/loris-dev) and email us there.
For questions and troubleshooting guidance beyond what is covered in our documentation, please subscribe to the [LORIS Developers mailing list](http://www.bic.mni.mcgill.ca/mailman/listinfo/loris-dev) and email us there.

### GitHub Issues
### Support and GitHub Issues
For troubleshooting specific installation issues or errors, please see the [Installation troubleshooting guide](docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/01_LORIS_Install/Troubleshooting.md), and then contact us via the [LORIS Developers mailing list](http://www.bic.mni.mcgill.ca/mailman/listinfo/loris-dev).
For bug reporting and new feature requests, please search and report via our GitHub Issues.

Please include details such as the version of LORIS you're using as well as information
such as the OS you're using, your PHP and Apache versions, etc.

## Contributing

The [LORIS team](http://loris.ca) at the Montreal Neurological Institute (MNI) is very happy to get code contributions and features from the global LORIS community.
We are very happy to get code contributions and features from the global LORIS community.

### Contributing Code
If you would like to contribute to LORIS development, please consult our [Contributing Guide](./CONTRIBUTING.md).

## Powered by MCIN

LORIS is made by staff developers at the McGill Centre for Integrative Neuroscience ([MCIN.ca](www.mcin.ca)), led by Alan Evans and Samir Das at the Montreal Neurological Institute.
LORIS is made by staff developers at the [McGill Centre for Integrative Neuroscience](http://www.mcin.ca), led by Alan Evans and Samir Das at The Neuro (Montreal Neurological Institute-Hospital).

See [LORIS.ca](www.loris.ca) for our current team, the history of LORIS, and our **Technical Papers**.
Visit [the LORIS website](https://loris.ca) for the history of LORIS and our **Technical Papers**.

The original (pre-GitHub) LORIS development team from 1999-2010 included: Dario Vins, Alex Zijdenbos, Jonathan Harlap, Matt Charlet, Andrew Corderey, Sebastian Muehlboeck, and Samir Das.
The original (pre-GitHub) LORIS development team from 1999-2010 included: Dario Vins, Alex Zijdenbos, Jonathan Harlap, Matt Charlet, Andrew Corderey, Sebastian Muehlboeck, James McKinney, and Samir Das.
Loading

0 comments on commit 275f194

Please sign in to comment.