-
Notifications
You must be signed in to change notification settings - Fork 181
[Core] Add the ability to sort menu categories #9759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
driusan
wants to merge
1
commit into
aces:main
Choose a base branch
from
driusan:SortableMenuCategories
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds the ability to sort the top-level menus via a new "menu_categories" table. GetMenuCategory returns a new MenuCategory class rather than a string, which permits us to store the metadata that the UserPageDecoration needs for sorting. A new (fairly trivial) middleware is added to populate the MenuCategory::singleton's cache and if a module uses a menu category that is not in the menu_categories table an exception is thrown. This is intended to prevent typos and ensure that all modules use a valid / existing menu category. Within each dropdown, the sorting is still alphabetical and there is no frontend for customizing it. The default is the same as our current almost-alphabetical sorting. Resolves aces#9748
driusan
commented
Apr 17, 2025
public function getLink() : string | ||
{ | ||
return $this->link; | ||
public function __construct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to mention in the description--I also simplified/cleaned up the existing LorisMenu class with more modern PHP features (constructor property promotion and read-only properties) while I was there.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: UI
PR or issue related to the user interface
Difficulty: Simple
PR or issue that should be easy to implement, review, or test
Language: PHP
PR or issue that update PHP code
Language: SQL
PR or issue that update SQL code
Module: acknowledgements
PR or issue related to acknowledgements module
Module: api_docs
PR or issue related to api_docs module
Module: battery_manager
PR or issue related to battery_manager module
Module: behavioural_qc
PR or issue related behavioural_qc module
Module: candidate_list
PR or issue related to candidate_list module
Module: configuration
PR or issue related to configuration module
Module: conflict_resolver
PR or issue related to conflict_resolver module
Module: data_release
PR or issue related to data_release module
Module: datadict
PR or issue related to (old) datadict module
Module: dataquery
PR or issue related to (new) dataquery module
Module: dicom_archive
PR or issue related to dicom_archive module
Module: dictionary
PR or issue related to (new) dictionary module
Module: document_repository
PR or issue related to documen_repository module
Module: dqt
PR or issue related to (old) dqt module
Module: electrophysiology_browser
PR or issue related to electrophysiology_browser module
Module: electrophysiology_uploader
PR or issue related to electrophysiology_uploader
Module: examiner
PR or issue related to examiner module
Module: genomic_browser
PR or issue related to genomic_browser module
Module: help_editor
PR or issue related to help_editor module
Module: imaging_browser
PR or issue related to imaging_browser module
Module: imaging_qc
PR or issue related to imaging_qc module
Module: imaging_uploader
PR or issue related to imaging_uploader module
Module: instrument_builder
PR or issue related to instrument_builder module
Module: instrument_manager
PR or issue related to instrument_manager module
Module: issue_tracker
PR or issue related to issue tracker module
Module: media
PR or issue related to media module
Module: module_manager
PR or issue related to module_manager module
Module: mri_violations
PR or issue related to mri_violations module
Module: new_profile
PR or issue related to new_profile module
Module: publication
PR or issue related to the publication module
Module: schedule_module
PR or issue related to the schedule_manager module
Module: server_processes_manager
PR or issue related to the server_processes_manger
Module: statistics
PR or issue related to statistics module
Module: survey_accounts
PR or issue related to the survey_accounts module
Module: user_accounts
PR or issue related to the user_accounts module
Project: C-BIG
Issue or PR related to the C-BIG project
Release: Add to release notes
PR whose changes should be highlighted in the release notes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the ability to sort the top-level menus via a new "menu_categories" table. GetMenuCategory returns a new MenuCategory class rather than a string, which permits us to store the metadata that the UserPageDecoration needs for sorting.
A new (fairly trivial) middleware is added to populate the MenuCategory::singleton's cache and if a module uses a menu category that is not in the menu_categories table an exception is thrown. This is intended to prevent typos and ensure that all modules use a valid / existing menu category. It also takes the sorting out of the individual module's hands so that there are no inconsistencies between where any given module thinks the category should be sorted.
Within each dropdown, the sorting is still alphabetical and there is no frontend for customizing it. The default should be the same as our current almost-alphabetical sorting.
Resolves #9748