Skip to content

feat(IdeasSummary): Keep ideas with 0 students at bottom when sorting by student count - #2358

Merged
hirokiterashima merged 2 commits into
developfrom
ideas-summary-table-no-students-at-bottom
Oct 16, 2026
Merged

hirokiterashima merged 2 commits into
developfrom
ideas-summary-table-no-students-at-bottom

Conversation

@breity

@breity breity commented Oct 16, 2026

Copy link
Copy Markdown
Member

Changes

When sorting # of students in the Ideas Summary table in the Teacher Tools, keep all ideas with 0 students below the ideas with at least 1 student.

  • Configure custom sortData on dataSource so ideas with 0 students always remain below ideas with at least 1 student in both ascending and descending sorts.
  • Maintain standard sorting behavior for idea column.
  • Add unit tests verifying ascending and descending count sorting and idea text sorting.
  • Disable clear sorting for student count column.

Test

  • Make sure that sorting by Students column (either ascending or descending) always keeps the ideas with 0 at the bottom.
  • Make sure that sorting by Idea still works as before (alphanumerically).

…g by student count

- Configure custom `sortData` on `dataSource` so ideas with 0 students always remain below ideas with at least 1 student in both ascending and descending sorts.
- Maintain standard sorting behavior for idea column.
- Add unit tests verifying ascending and descending count sorting and idea text sorting.
- Disable clear sorting for student count column.
@breity breity self-assigned this Oct 16, 2026
@breity breity added the enhancement New feature of any size or improvement (UI, performance, security) label Oct 16, 2026
@qltysh

qltysh Bot commented Oct 16, 2026

Copy link
Copy Markdown

❌ 5 blocking issues (5 total)

Tool Category Rule Count
qlty Duplication Found 56 lines of similar code in 2 locations (mass = 189) 2 ❌
qlty Structure Function with high complexity (count = 38): setupDataSource 2 ❌
qlty Structure Function with many returns (count = 7): setupDataSource 1 ❌

direction: 'asc'
} as any);

expect(sortedAsc.map((r) => r.count)).toEqual([1, 3, 5, 0, 0]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 56 lines of similar code in 2 locations (mass = 189) [qlty:similar-code]

direction: 'desc'
} as any);

expect(sortedDesc.map((r) => r.count)).toEqual([5, 3, 1, 0, 0]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 56 lines of similar code in 2 locations (mass = 189) [qlty:similar-code]


if (this.sort) {
this.dataSource.sort = this.sort;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues:

1. Function with many returns (count = 7): setupDataSource [qlty:return-statements]


2. Function with high complexity (count = 38): setupDataSource [qlty:function-complexity]

comparatorResult = -1;
}
return comparatorResult * (direction === 'asc' ? 1 : -1);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 32): sortData [qlty:function-complexity]

@qltysh

qltysh Bot commented Oct 16, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
New file Coverage rating: B
...acher-summary-display/ideas-summary/ideas-summary.component.ts64.3%235-240
Total64.3%
🤖 Increase coverage with AI coding...
In the `ideas-summary-table-no-students-at-bottom` branch, add test coverage for this new code:

- `src/assets/wise5/directives/teacher-summary-display/ideas-summary/ideas-summary.component.ts` -- Line 235-240

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@breity breity changed the title feat(Ideas Summary): Keep ideas with 0 students at bottom when sorting by student count feat(IdeasSummary): Keep ideas with 0 students at bottom when sorting by student count Oct 16, 2026

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@hirokiterashima
hirokiterashima merged commit 979174b into develop Oct 16, 2026
4 checks passed
@hirokiterashima
hirokiterashima deleted the ideas-summary-table-no-students-at-bottom branch October 16, 2026 18:33
@hirokiterashima

Copy link
Copy Markdown
Member

🎉 This PR is included in version 5.246.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature of any size or improvement (UI, performance, security) released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants