[COMMS-915] Count work package summary versions from target_versions#24400
Open
akabiru wants to merge 4 commits into
Open
[COMMS-915] Count work package summary versions from target_versions#24400akabiru wants to merge 4 commits into
akabiru wants to merge 4 commits into
Conversation
The version summary counted through the deprecated version_id column, which holds only the first target version, so work packages with several target versions were undercounted and did not match the drill-down list (already filtered on target_versions).
The category headings rendered human_attribute_name(report_type), bypassing each report's #title, so the version heading never reflected the multiple versions feature. Rendering report.title lets the version report show Target versions when the feature is on, and drops the raw report_type shown as the drill-down legend.
akabiru
force-pushed
the
implementation/comms-915-adjust-workpackage-summary-page-to-use-target_versions
branch
from
July 22, 2026 18:29
f749032 to
4288dd4
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
The summary groups work packages under each target version (and each subproject), so a section heading names a single one and reads better alongside its singular siblings. Adds a singular target_version label for the multiple-versions case and folds the version count query's kind literal into the WorkPackageVersion enum constant.
akabiru
commented
Jul 23, 2026
|
|
||
| def title | ||
| I18n.t(:label_subproject_plural) | ||
| I18n.t(:label_subproject) |
Member
Author
There was a problem hiding this comment.
ℹ️ This change is due to the change in _report_cateogy.html.erb to use title instead of the duplicate WorkPackage.human_attribute_name(report.report_type) calls. Titles in the work package summary page are generally singular.
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
Switch the target-version count query to sanitize_sql_array with named placeholders so the project id and kind are bound rather than interpolated, clearing the SQL injection warning.
akabiru
marked this pull request as ready for review
July 23, 2026 08:55
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
COMMS-915
The work package summary page counted versions through the deprecated
version_idcolumn, which only ever holds a work package's first target version. Work packages assigned to several target versions were therefore counted under a single version, and the totals no longer matched the filtered list a cell links to (that drill-down already filters ontarget_versions). The summary now counts through thework_package_versionstarget associations, so each work package is counted under every version it targets and the counts agree with the list behind them. The section heading also follows the multiple versions feature flag, reading "Target versions" when it is on, matching how the rest of the UI labels the field.Before

After