Skip to content

Conversation

@driusan
Copy link
Collaborator

@driusan driusan commented Nov 7, 2023

This adds a new widget type, "userpreference" which allows modules to plug content into the user's my_preferences page.

It works similarly to the candidate_profile widget, where it assumes each call will return an array of UserPreferenceWidget's to add to the page, each one denoting a single react component. The UserPreferenceWidget must have:

  1. A title to display as a heading
  2. A URL to get the javascript for the component
  3. The component name to instantiate
  4. React props to pass to the widget

This is useful for ie. the OIDC module adding a widget where the user can link an external openid account to the logged in user, but can also be used for any other modules which have preferences that should be configurable by the user on the my_preferences page.

@laemtl laemtl assigned ridz1208 and laemtl and unassigned ridz1208 Dec 12, 2023
@laemtl
Copy link
Contributor

laemtl commented Jan 16, 2024

@driusan Should we fix the tests?

FILE: .../Loris/modules/my_preferences/php/userpreferencewidget.class.inc
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 23 | ERROR | [ ] Superfluous parameter comment
 24 | ERROR | [ ] Superfluous parameter comment
 25 | ERROR | [ ] Superfluous parameter comment
 [32](https://github.com/aces/Loris/actions/runs/6789898738/job/18458106479?pr=8938#step:11:33) | ERROR | [x] Closing brace must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

* Renders the widget within a preference panel and implements
* the \LORIS\GUI\Widget interface.
*
* @return string the HTML content of the widget to be rendered
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to return an url, not html.

@laemtl laemtl self-requested a review January 16, 2024 18:26
@laemtl laemtl assigned driusan and unassigned laemtl Jan 16, 2024
This adds a new widget type, "userpreference" which allows modules
to plug content into the user's my_preferences page.
@driusan driusan force-pushed the UserPreferenceWidgets branch from 7132a85 to b99b837 Compare January 23, 2024 17:06
@driusan
Copy link
Collaborator Author

driusan commented Jan 23, 2024

Fixed tests and comment

@driusan driusan merged commit d7bef4a into aces:main Jan 23, 2024
@ridz1208 ridz1208 added this to the 26.0.0 milestone Apr 9, 2024
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.

3 participants