-
Notifications
You must be signed in to change notification settings - Fork 42
Fix: Make case-insensitive search for the usergroup and multi selection columns #2446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| */ | ||
| import { AbstractUsergroupColumn } from '../columnClass.js' | ||
| import { ColumnTypes } from '../columnHandler.js' | ||
| import { FilterIds } from '../filter.js' | ||
|
|
||
| export default class UsergroupColumn extends AbstractUsergroupColumn { | ||
|
|
||
|
|
@@ -29,7 +30,7 @@ export default class UsergroupColumn extends AbstractUsergroupColumn { | |
| ret += ', ' + obj.id | ||
| } | ||
| }) | ||
| return ret | ||
| return ret.toLowerCase() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it intentional that the search is case insentive but the other filters aren't? |
||
| } | ||
|
|
||
| getObjects(values) { | ||
|
|
@@ -44,4 +45,18 @@ export default class UsergroupColumn extends AbstractUsergroupColumn { | |
| return super.isSearchStringFound(this.getValueString(cell), cell, searchString) | ||
| } | ||
|
|
||
| isFilterFound(cell, filter) { | ||
| const filterValue = filter.magicValuesEnriched ? filter.magicValuesEnriched : filter.value | ||
| const valueString = this.getValueString(cell) | ||
|
|
||
| const filterMethod = { | ||
| [FilterIds.Contains]() { return valueString?.toLowerCase().includes(filterValue.toLowerCase()) }, | ||
| [FilterIds.DoesNotContain]() { return !valueString?.toLowerCase().includes(filterValue.toLowerCase()) }, | ||
| [FilterIds.IsEqual]() { return valueString === filterValue }, | ||
| [FilterIds.IsNotEqual]() { return valueString !== filterValue }, | ||
| [FilterIds.IsEmpty]() { return !valueString }, | ||
| }[filter.operator.id] | ||
| return super.isFilterFound(filterMethod, cell) | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At https://github.com/nextcloud/tables/blob/main/src/shared/components/ncTable/partials/TableHeaderColumnOptions.vue#L315, there’s a small check meant to stop adding the same Contains or Does not contain filter twice. I think that conflicts with this?