TICKET-614: Add case sensitivy to group search#7938
Conversation
Coverage Report for CI Build 26381691124Coverage increased (+0.03%) to 90.285%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
donny-wong
left a comment
There was a problem hiding this comment.
Thank you @Naragod , looks good. Please update branch and I will approve it at that time. Thank you.
00a015a to
9765181
Compare
david-yz-liu
left a comment
There was a problem hiding this comment.
@Naragod Nice work! Sorry I took a while to review this. The UI is very nice and I appreciate the attention to consistency across components.
I left two comments, one of which is describes a change to the approach that causes a bit of work but I think will result in a nice simplification of these changes. Please feel free to message on Slack if you'd like to chat further about this.
e4623a5 to
34449a4
Compare
donny-wong
left a comment
There was a problem hiding this comment.
Looks good @Naragod. Please resolve branch conflicts. Thanks.
david-yz-liu
left a comment
There was a problem hiding this comment.
@Naragod nice work, the change ended up being even simpler than I thought! I left a few more comments about functionality and some code cleanup. As Donny noted, please do also update with master and resolve the conflict.
| this.state = { | ||
| applications: null, | ||
| details: false, | ||
| columns: this.getColumns(), |
There was a problem hiding this comment.
Because you've changed the approach to have the filter state not be stored here, most of the changes in this file should be reverted to what we currently have in master. The only thing that needs to change is in the column definition for group_name is to update the filter and filterMethod values. No other changes are necessary; please revert them.
| super(props); | ||
| this.state = { | ||
| filtered: [], | ||
| columns: this.getColumns(props.showSections, props.sections, props.showCoverage), |
There was a problem hiding this comment.
These changes are not necessary. Please keep the changes to just the filter and filterMethod properties for the column with the new case-(in)sensitive filter.
| Header: I18n.t("activerecord.models.group.one"), | ||
| accessor: "group_name", | ||
| id: "group_name", | ||
| Filter: caseSensitiveTextFilter, |
There was a problem hiding this comment.
Same comment as above
| this.createChannelSubscriptions(); | ||
| } | ||
|
|
||
| groupNameFilter = (filter, row) => { |
There was a problem hiding this comment.
Keep the original method. The only thing that needs to change is adding const {filterValue, caseSensitive} = filter.value; and then replacing the uses of filter.value throughout. The structure should remain the same; don't rewrite it.
| * against them. | ||
| */ | ||
| export function caseSensitiveIncludes(haystack, needle, caseSensitive) { | ||
| const a = haystack == null ? "" : String(haystack); |
There was a problem hiding this comment.
I don't like using == as it introduces type coercion. Please use the more explicit haystack === null || haystack === undefined instead.
| */ | ||
| export function caseSensitiveTextFilter({filter, onChange, column}) { | ||
| const filterValue = filter ? filter.value.filterValue : ""; | ||
| const caseSensitive = filter ? filter.value.caseSensitive : true; |
There was a problem hiding this comment.
let's make the default false (this is the most typical usecase)
Proposed Changes
Add case sensitivity to group search.
Screenshots of your changes (if applicable)
Screen.Recording.2026-05-08.at.5.04.27.PM.mov
Associated documentation repository pull request (if applicable)
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)