Remove lowercasing of display text match when generating label filter options (#16176)
## Addresses #15894    ## Checklist for submitter - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
co-authored by
Jacob Shandling
parent
58487c584a
commit
58043c9d27
@@ -0,0 +1 @@
|
||||
- Fix a bug where capital characters would not match labels containing them
|
||||
@@ -30,7 +30,7 @@ export interface ILabel extends ILabelSummary {
|
||||
uuid?: string;
|
||||
query: string;
|
||||
label_membership_type: LabelMembershipType;
|
||||
hosts_count: number;
|
||||
host_count?: number; // returned for built-in labels but not custom labels
|
||||
display_text: string;
|
||||
count: number; // seems to be a repeat of hosts_count issue #1618
|
||||
host_ids: number[] | null;
|
||||
|
||||
@@ -34,7 +34,8 @@ const createCustomLabelOptions = (labels: ILabel[], query: string) => {
|
||||
customLabelGroupOptions = [NO_LABELS_OPTION];
|
||||
} else {
|
||||
const matchingLabels = customLabels.filter((label) =>
|
||||
label.display_text.toLowerCase().includes(query)
|
||||
// case-insensitive matching
|
||||
label.display_text.toLowerCase().includes(query.toLowerCase())
|
||||
);
|
||||
customLabelGroupOptions =
|
||||
matchingLabels.length !== 0 ? matchingLabels : [EMPTY_OPTION];
|
||||
|
||||
Reference in New Issue
Block a user