Skip to content

Commit

Permalink
Fix hiding metrics without issues.
Browse files Browse the repository at this point in the history
Hiding metrics without issues would not hide metrics with deleted issues.

Fixes #8699.
  • Loading branch information
fniessink committed May 18, 2024
1 parent 0864274 commit 8e6ecdf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/frontend/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ sortWithLocaleCompare.propTypes = {
function hideMetric(metric, metricsToHide, hiddenTags) {
const hideBecauseNoActionNeeded =
metricsToHide === "no_action_needed" && ["target_met", "debt_target_met", "informative"].includes(metric.status)
const hideBecauseNoIssues = metricsToHide === "no_issues" && !metric.issue_ids
const hideBecauseNoIssues = metricsToHide === "no_issues" && !metric?.issue_ids?.length
const hideBecauseTagIsHidden =
hiddenTags?.length > 0 &&
hiddenTags?.filter((hiddenTag) => metric.tags?.includes(hiddenTag)).length >= metric.tags?.length
Expand Down
5 changes: 5 additions & 0 deletions components/frontend/src/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ it("hides metrics not requiring action or without issues", () => {
expect(visibleMetrics(metricWithIssue, "no_issues", [])).toStrictEqual(metricWithIssue)
expect(visibleMetrics(metricWithIssue, "none", [])).toStrictEqual(metricWithIssue)
expect(visibleMetrics(metricWithIssue, "all", [])).toStrictEqual({})
const metricWithRemovedIssue = { metric_uuid: { status: "target_met", issue_ids: [] } }
expect(visibleMetrics(metricWithRemovedIssue, "no_action_needed", [])).toStrictEqual({})
expect(visibleMetrics(metricWithRemovedIssue, "no_issues", [])).toStrictEqual({})
expect(visibleMetrics(metricWithRemovedIssue, "none", [])).toStrictEqual(metricWithRemovedIssue)
expect(visibleMetrics(metricWithRemovedIssue, "all", [])).toStrictEqual({})
})

it("hides metrics with hidden tags", () => {
Expand Down
10 changes: 10 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

<!-- The line "## <square-bracket>Unreleased</square-bracket>" is replaced by the release/release.py script with the new release version and release date. -->

## [Unreleased]

### Deployment notes

If your currently installed *Quality-time* version is v4.10.0 or older, please read the v5.0.0 deployment notes first.

### Fixed

- Hiding metrics without issues would not hide metrics with deleted issues. Fixes [#8699](https://github.com/ICTU/quality-time/issues/8699).

## v5.12.0 - 2024-05-17

### Deployment notes
Expand Down

0 comments on commit 8e6ecdf

Please sign in to comment.