Skip to content

[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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Apr 17, 2025

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

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
@github-actions github-actions bot added Language: SQL PR or issue that update SQL code Language: PHP PR or issue that update PHP code Module: statistics PR or issue related to statistics module Module: issue_tracker PR or issue related to issue tracker module Module: dqt PR or issue related to (old) dqt module 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: datadict PR or issue related to (old) datadict module Module: dictionary PR or issue related to (new) dictionary module Module: document_repository PR or issue related to documen_repository 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: 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 labels Apr 17, 2025
@github-actions github-actions bot added 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: survey_accounts PR or issue related to the survey_accounts module Module: user_accounts PR or issue related to the user_accounts module Module: dicom_archive PR or issue related to dicom_archive module Module: data_release PR or issue related to data_release module Module: dataquery PR or issue related to (new) dataquery module labels Apr 17, 2025
@driusan driusan added Release: Add to release notes PR whose changes should be highlighted in the release notes Area: UI PR or issue related to the user interface Project: C-BIG Issue or PR related to the C-BIG project Difficulty: Simple PR or issue that should be easy to implement, review, or test labels Apr 17, 2025
public function getLink() : string
{
return $this->link;
public function __construct(
Copy link
Collaborator Author

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Menu order inconsistent between languages
1 participant