Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@NadaElmasry
Copy link
Contributor

@NadaElmasry NadaElmasry commented Oct 22, 2024

Description

This PR introduces a Project Affiliations menu to the application's main interface, mirroring the existing Site Affiliations menu.


Changes Implemented

  1. User Class Enhancements

    • Fetch Projects by User ID:
      • Updated the User class to retrieve associated projects using the user's ID using user_projects_query.
  2. Template Modifications

    • Added a new Project Affiliations menu item to the main template.
    • Expanded the existing Affiliations Menu to include a Project Affiliations section.
  3. Middleware Adjustments

    • User Page Middleware Integration:
      • Updated the user page middleware to incorporate the newly fetched project affiliations from the User class.using getProjectIDs() and >getProjectNames()).

GUI

Affiliations Menus with single project or site

projectaffiliations1

projectaffiliations2

Affiliations Menus with multiple projects or sites

projectaffiliationsmultipleprojects

siteaffiliationsmultiplesites

Suggested Changes

Affiliations drop-down menu with fixed hieight and scrollable option

siteaffiliationsscrollable

Removed separate Project and Sites Menus

siteaffiliationsscrollable2


Related Issue

Store examiner's centerID with active status and radiologist flag,
ensuring centerID is a string
*/
$examiner_info[(string)$val['centerID']] = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need that change? Does it solve an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was to stay consistent with my changes when I used to cast the projects and sites into strings but it doesn't affect functionality so it can removed.

if (!empty($examiner_check) && !is_null($examiner_check)) {
$examiner_info = [];

if (!empty($examiner_check)&& !is_null($examiner_check)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add back the space before &&

@christinerogers
Copy link
Contributor

christinerogers commented Oct 25, 2024

Notes from Oct. 25 EEG meeting discussion :

  • hide Project Affiliations: 1 and Site Affiliations: 1 elements -- just leave the one drop-down.
  • Limit the height of the drop-down, make it scrollable -- see Laetitia
  • add a screenshot to show what it looks like with multiple site and multiple projects
  • add note in the PR header to explain why changes (very important for merge)

);
} else {
return $this->userInfo[$var];
return $this->userInfo[$var] ?? null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the reasoning behind this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's to prevent an error if the key doesn't exist in the userinfo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a change like this impacts many more modules -- it was designed to return the empty string for other modules.
this change isn't needed -- please error-check returns where needed.

@christinerogers christinerogers requested review from jeffersoncasimir and laemtl and removed request for jeffersoncasimir October 28, 2024 20:41
Copy link
Contributor

@jeffersoncasimir jeffersoncasimir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I will pull and test after code changes are made

$tpl_data['user'] = [];
$tpl_data['user']['Real_name'] = $this->user->getFullName();
$tpl_data['user']['permissions'] = $this->user->getPermissions();
$tpl_data['user']['user_from_study_site'] = $oneIsStudySite;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$tpl_data['user']['user_from_study_site'] = $oneIsStudySite;
$tpl_data['user']['user_from_study_site'] = $this->user->hasStudySite();

Copy link
Contributor

@jeffersoncasimir jeffersoncasimir Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can and should be inlined (includes deleting a line above)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a quick 2 line change

Copy link
Contributor

@christinerogers christinerogers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still to do:

  • revert comment changes where it's not for code you change
  • minimize changes to User class per others' review comments

@christinerogers christinerogers removed the request for review from CamilleBeau November 4, 2024 21:21
@christinerogers
Copy link
Contributor

christinerogers commented Nov 4, 2024

HI @NadaElmasry 2 things to tidy up this thread as we prepare to merge:

  1. Please edit the PR description to remove screenshots that don't show just either Before or after,

  2. please check boxes below to show what's been addressed from above.

Notes from Oct. 25 EEG meeting discussion :

  • hide Project Affiliations: 1 and Site Affiliations: 1 elements -- just leave the one drop-down.
  • Limit the height of the drop-down, make it scrollable -- see Laetitia
  • add a screenshot to show what it looks like with multiple site and multiple projects
  • add note in the PR header to explain why changes (very important for merge)

nov.1 still to do:

  • revert comment changes where it's not for code you change
  • minimize changes to User class per others' review comments

@CamilleBeau
Copy link
Collaborator

@NadaElmasry Can you fix the tests and then @jeffersoncasimir can you re-review?

@christinerogers
Copy link
Contributor

@jeffersoncasimir is this ready for re-review ?
If it seems like a quick merge could you try finding a reviewer and update here?

@christinerogers christinerogers added the 26.0.0-bugs Issues that were raised during the release testing for 26.0.0 label Feb 21, 2025
@christinerogers christinerogers added this to the 27.0.0 milestone Feb 21, 2025
@christinerogers christinerogers removed the 26.0.0-bugs Issues that were raised during the release testing for 26.0.0 label Feb 21, 2025
@christinerogers
Copy link
Contributor

christinerogers commented Feb 21, 2025

@jeffersoncasimir per testing meeting feb. 21
clean out the auto changes to reduce the diff to something reasonable and then re-review it yourself

@jeffersoncasimir jeffersoncasimir dismissed stale reviews from christinerogers and themself February 24, 2025 14:58

Addressed

Copy link
Contributor

@jeffersoncasimir jeffersoncasimir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature works as expected!

I made some minor css tweaks and minimized the diff by reverting some comment changes and other differences that did not directly contribute to the feature

@driusan driusan merged commit fa8c490 into aces:main Feb 24, 2025
19 checks passed
@christinerogers
Copy link
Contributor

The feature works as expected!

I made some minor css tweaks and minimized the diff by reverting some comment changes and other differences that did not directly contribute to the feature

Thanks @NadaElmasry - Jefferson has completed the touch-ups and we've merged your feature contribution for the 27 LORIS release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants