Skip to content

Commit

Permalink
Merge branch 'master' into 2020-02-11-new-schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
kongtiaowang authored Apr 24, 2020
2 parents a2c99fb + 730af56 commit a948c9e
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 92 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ 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.

### Contributing Code
We are very happy to get code contributions and features from the global LORIS community.


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.
80 changes: 62 additions & 18 deletions htdocs/bootstrap/css/custom-css.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Note: other colors are currenly inherited from Bootstrap default color palette
border-top-right-radius: 0;
border-top-left-radius: 0;
background-color: white;
border: 1px solid #064785;
}

.navbar-nav > li > .dropdown-menu > li > a,
Expand All @@ -34,6 +35,18 @@ Note: other colors are currenly inherited from Bootstrap default color palette
.navbar-nav > li > .dropdown-menu > li > a:hover {
color: #E89A0C;
}
/* For mobile and tablet, repeat the above styling */
@media (max-width: 991px) {
.navbar-default .navbar-nav .open .dropdown-menu >li>a,
.navbar-default .navbar-nav .open .dropdown-menu >li>a:focus {
color: #064785;
background-color: white;
}
.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover {
color: #E89A0C;
background-color: white;
}
}

.navbar-brand {
padding: 16px 15px;
Expand All @@ -53,9 +66,11 @@ Note: other colors are currenly inherited from Bootstrap default color palette
}

/* Show submenu when hovering on menu item */
.dropdown:hover .dropdown-menu {
/* If hover functionality exists and window size larger than tablet */
@media (hover: hover) and (min-width: 992px) {
.dropdown:hover .dropdown-menu {
display: block;
border: 1px solid #064785;
}
}

/* Loris logo */
Expand All @@ -73,30 +88,46 @@ Note: other colors are currenly inherited from Bootstrap default color palette
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

.navbar-default .navbar-nav > li:hover > a,
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-nav > li > a:active {
color: #064785;
background-color: white;
/* Styling for clicking on menu items */
.navbar-default .navbar-nav > li.dropdown > a:focus,
.navbar-default .navbar-nav > li.dropdown > a:active {
background-color: transparent;
}

.navbar-default .navbar-right > li.dropdown:hover > a,
.navbar-default .navbar-right > li.dropdown > a:hover,
.navbar-default .navbar-right > li.dropdown > a:focus,
.navbar-default .navbar-right > li.dropdown > a:active {
/* Styling for opened submenu dropdowns - order matters */
.navbar-default .navbar-nav > li.open > a,
.navbar-default .navbar-nav > li.open > a:focus,
.navbar-default .navbar-nav > li.open > a:active {
color: #064785;
background-color: white;
}
@media (hover: hover) {
/* Styling for hovering over menu items - order matters */
.navbar-default .navbar-nav > li.dropdown:hover > a,
.navbar-default .navbar-nav > li.dropdown > a:hover {
color: #064785;
background-color: white;
}
}
/* Styling for chevron icon to toggle collapsible navigation bar */
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #064785;
}

/* Submenu items*/
/* Submenu items */
.dropdown-menu {
padding: 5px 1px;
border-top-color: transparent !important;
box-shadow: 6px 8px 8px 1px rgba(0,0,0,0.175);
}

/* For mobile and tablet, submenu items */
@media (max-width: 991px) {
.dropdown-menu {
padding: 0px;
border-top-color: transparent !important;
}
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover {
color: #246EB6;
Expand All @@ -112,6 +143,8 @@ Note: other colors are currenly inherited from Bootstrap default color palette
cursor: pointer;
}

/* Styling for right hand side of nav bar */

/* Question mark */
.nav > li > a > img {
padding-bottom: 3px;
Expand All @@ -122,10 +155,21 @@ Note: other colors are currenly inherited from Bootstrap default color palette
padding: 5px 8px;
}

.navbar-default .navbar-right > li:hover > a,
.navbar-default .navbar-right > li > a:hover,
/* Styling for clicking on menu items */
.navbar-default .navbar-right > li > a:focus,
.navbar-default .navbar-right > li > a:active{
.navbar-default .navbar-right > li > a:active {
background-color: transparent;
}
/* Styling for clicking on Question mark - order matters */
.navbar-default .navbar-right > li > a.help-open,
.navbar-default .navbar-right > li > a.help-open:focus,
.navbar-default .navbar-right > li > a.help-open:active {
color: white;
background-color: #246EB6;
}
/* Styling for hovering over menu items - order matters */
.navbar-default .navbar-right > li:hover > a,
.navbar-default .navbar-right > li > a:hover {
color: white;
background-color: #246EB6;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/css/simple-sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@

#sidebar-wrapper {
left: 0;
color: white;
color: #064785;
}

.wrapper.active {
Expand Down
6 changes: 6 additions & 0 deletions htdocs/js/helpHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ $(document).ready(function() {
$('.wrapper').toggleClass('active');
});
$('.help-button').click(function(e) {
if ($(this).hasClass('help-open')) {
$(this).removeClass('help-open');
} else {
$(this).addClass('help-open');
}
let helpContent = $('div.help-content');
if (helpContent.length) {
helpContent.toggle();
Expand Down Expand Up @@ -68,6 +73,7 @@ $(document).ready(function() {
$(div).addClass('visible');
btn.addEventListener('click', function(e) {
$(div).hide();
$('.help-button').removeClass('help-open');
e.preventDefault();
});
e.preventDefault();
Expand Down
1 change: 0 additions & 1 deletion htdocs/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ html, body {
#page {
min-height: 100vh;
position: relative;
padding-top: 50px;
}


Expand Down
7 changes: 7 additions & 0 deletions modules/candidate_profile/help/candidate_profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Candidate Profile

This module allows you to see a summary of a candidate's information
across all modules.

Click on the visit link in the "Candidate Info" card in order to access
that visit for the candidate.
6 changes: 3 additions & 3 deletions modules/candidate_profile/php/candidate_profile.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Candidate_Profile extends \NDB_Page
return new \LORIS\BreadcrumbTrail(
new \LORIS\Breadcrumb(
'Access Profile',
'/candidate_list'
'/candidate_list/?betaprofile=1'
),
);
}
Expand All @@ -140,11 +140,11 @@ class Candidate_Profile extends \NDB_Page
return new \LORIS\BreadcrumbTrail(
new \LORIS\Breadcrumb(
'Access Profile',
'/candidate_list'
'/candidate_list/?betaprofile=1'
),
new \LORIS\Breadcrumb(
"Candidate Dashboard $candid / $pscid",
"/$candid"
"/candidate_profile/$candid"
)
);
}
Expand Down
35 changes: 27 additions & 8 deletions modules/electrophysiology_browser/php/sessions.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Sessions extends \NDB_Page

public $skipTemplate = true; // stops from looking for a smarty template
protected $timepoint;
protected $sessionID;

/**
* Determine whether the user has permission to view this page
Expand Down Expand Up @@ -82,6 +83,7 @@ class Sessions extends \NDB_Page
$this->timepoint = \NDB_Factory::singleton()->timepoint(
$session_id
);
$this->sessionID = $session_id;
} catch(\LorisException $e) {
return (new \LORIS\Middleware\PageDecorationMiddleware($user))
->process(
Expand Down Expand Up @@ -126,19 +128,18 @@ class Sessions extends \NDB_Page
));
}

return $this->getSessionData($session_id, $outputType);
return $this->getSessionData($outputType);
}


/**
* Get the session data information.
*
* @param int $sessionID ID of the session to display
* @param string $outputType output type to be displayed
*
* @return ResponseInterface The JSON response
*/
function getSessionData($sessionID, $outputType)
function getSessionData($outputType)
{
$db = \NDB_Factory::singleton()->database();

Expand All @@ -161,10 +162,10 @@ class Sessions extends \NDB_Page
$sessions = array_column($sessions, 'SessionID');
$response['patient'] = $this->getSubjectData($outputType);
$response['database'] = array_values(
$this->getFilesData($sessionID, $outputType)
$this->getFilesData($outputType)
);
$response['sessions'] = $sessions;
$currentIndex = array_search($sessionID, $sessions);
$currentIndex = array_search($this->sessionID, $sessions);
$response['nextSession'] = $sessions[$currentIndex+1] ?? '';
$response['prevSession'] = $sessions[$currentIndex-1] ?? '';

Expand Down Expand Up @@ -204,18 +205,17 @@ class Sessions extends \NDB_Page
/**
* Get the list of electrophysiology recordings with their recording information.
*
* @param int $sessionID ID of the electrophysiology session
* @param string $outputType output type to be displayed
*
* @return array with the file collection
*/
function getFilesData(int $sessionID, string $outputType)
function getFilesData(string $outputType)
{
$db = \NDB_Factory::singleton()->database();

$fileCollection = array();
$params = array();
$params['SID'] = $sessionID;
$params['SID'] = $this->sessionID;
$query = 'SELECT
pf.PhysiologicalFileID,
pf.FilePath
Expand Down Expand Up @@ -458,4 +458,23 @@ class Sessions extends \NDB_Page
return $depends;
}

/**
* Generate a breadcrumb trail for this page.
*
* @return \LORIS\BreadcrumbTrail
*/
public function getBreadcrumbs(): \LORIS\BreadcrumbTrail
{
return new \LORIS\BreadcrumbTrail(
new \LORIS\Breadcrumb(
'Electrophysiology Browser',
'/electrophysiology_browser'
),
new \LORIS\Breadcrumb(
'View Session',
"/electrophysiology_browser/sessions/$this->sessionID"
)
);
}

}
10 changes: 7 additions & 3 deletions modules/issue_tracker/test/issue_tracker_test_plan.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Issue Tracker Filter Form [Automation Testing]
1. User can access the page iff they have issue tracker reporter or developer permission
1. A user can access the module only if they have one or more of the `issue_tracker_reporter` or `issue_tracker_developer` permissions.
2. User can see data from other sites iff they have access_all_profiles permission
3. Test that all filters work. Nothing should be filtered at first loading.
4. Test that all tabs (with filters) work and redirect to the correct table. My issues should be missing assignee filter and closed issues should be missing status filter.
Expand All @@ -14,7 +14,8 @@ Issue Tracker Create New Issue [Manual Testing]
4. Submit invalid and valid PSCID and visit label pairs. Error messages should respond accordingly. Not that you cannot submit PSCIDs from other sites unless you have access all profiles permission
5. Submit just a visit label - this should give an error message.
6. Check that all values are propagated and saved correctly.
7. Check that watching logging is working - turn it off and on for your current user, and for other watchers on the issue
7. Add an attachment to the new issue and make sure that it is successfully uploaded.
8. Check that watching logging is working - turn it off and on for your current user, and for other watchers on the issue

Issue Tracker Edit Existing Issue [Manual Testing]
1. User can access the page if they have (developer or reporter permission) and (they have either access_all_profiles or are a member of the site of the issue or the site has no issue).
Expand All @@ -24,7 +25,10 @@ Issue Tracker Edit Existing Issue [Manual Testing]
5. Submit just a visit label - this should give an error message.
6. Check that all values are propagated and saved correctly.
7. Check that watching logging is working - turn it off and on for your current user, and for other watchers on the issue

8. Check that an attachment can be adding to an existing issue.
9. Test if users assigned to issues can upload attachments.
10. Test if users can delete their own uploaded attachments.
11. Test if user assigned to issue cannot delete attachments of issue owner.

Permissions [Automation Testing]
1. Remove access all profile permission.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Mri_Protocol_Check_Violations extends \NDB_Menu_Filter
'ValidRange',
'ValidRegex',
'SeriesUID',
'TarchiveID'
);
$this->tpl_data['hiddenHeaders'] = json_encode(['TarchiveID']);
$this->validFilters = array(
Expand Down
4 changes: 2 additions & 2 deletions modules/publication/jsx/projectFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ class ProjectFormFields extends React.Component {
// Create download link & edit fields for existing files
if (this.props.files) {
this.props.files.forEach(function(f) {
let downloadURL = loris.BaseURL + '/publication/ajax/FileDownload.php?File=' + encodeURIComponent(f.URL);
let downloadURL = loris.BaseURL + '/publication/ajax/FileDownload.php?File=' + encodeURIComponent(f.Filename);
let link = (
<span>
<a href={downloadURL}>{f.URL}</a>
<a href={downloadURL}>{f.Filename}</a>
&nbsp;&nbsp;
<span
className="glyphicon glyphicon-remove"
Expand Down
4 changes: 2 additions & 2 deletions modules/publication/jsx/viewProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class ViewProject extends React.Component {
let files = this.state.files;
let toReturn = [];
files.forEach(function(f) {
let download = loris.BaseURL + '/publication/ajax/FileDownload.php?File=' + f.URL;
let link = <a href={download}>{f.URL}</a>;
let download = loris.BaseURL + '/publication/ajax/FileDownload.php?File=' + f.Filename;
let link = <a href={download}>{f.Filename}</a>;
let uploadType = this.state.uploadTypes[f.PublicationUploadTypeID];
toReturn.push(
<StaticElement
Expand Down
Loading

0 comments on commit a948c9e

Please sign in to comment.