View Issue Details

IDProjectCategoryView StatusLast Update
0026888mantisbtcode cleanuppublic2021-03-07 18:29
Reporterdregad Assigned Todregad  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Target Version2.25.0Fixed in Version2.25.0 
Summary0026888: Refactor printing of project selection menus
Description

While working on fixing 0026887, I realized that the code to display the project name and link to set_project.php in the project selection menu (layout_navbar_projects_menu()) and the project menu bar print_project_menu_bar() is very similar, and repeated several times (as we need to handle the ALL_PROJECTS and subprojects cases).

It would make sense to move the logic to a dedicated function to reduce code duplication.

Additional Information

This was inspired by the analysis for 0026886:0063843.

TagsNo tags attached.

Relationships

related to 0026886 closeddregad How to add new issue count to the projects bar? 
related to 0026887 closeddregad Project Menu Bar does not indent subprojects properly 
related to 0027375 closeddregad search field at project-selection is not working anymore 

Activities

Related Changesets

MantisBT: master edb40eab

2020-04-18 06:41:44

dregad

Details Diff
Function to display formatted project selection links

New project_link_for_menu() function added to Project API, to avoid code
duplication when displaying project selection links in the navbar menu
and the project menu bar.

Handles the indentation logic based on the subproject's level in the
hierarchy, selection of the active project as well as context-specific
formatting ($p_class parameter).

Fixes 0026887, 0026888
Affected Issues
0026887, 0026888
mod - core/html_api.php Diff File
mod - core/layout_api.php Diff File
mod - core/project_api.php Diff File

MantisBT: master aaa5807d

2020-10-06 04:34:10

dregad

Details Diff
Fix search in project selector

Commit edb40eabd5299d5fe4c4a23865ff3523d020b6f5 (issue 0026888) introduced
a regression causing the filtered projects list to always be empty,
regardless of what the user typed in the Search field.

The bug was caused by a typo in CSS class name (`project_link` instead
of `project-link`).

Fixes 0027375
Affected Issues
0026888, 0027375
mod - core/layout_api.php Diff File