Skip to content
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

CP 7.1 - bug #12638 : Managment rules filter #2322

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public static JsonNode createQueryDSL(
haveOrParameters = true;
break;
case EV_TYPE_PROC:
case RULE_TYPE:
// string equals operation filter as a and
final String ruleType = (String) entry.getValue();
query.add(eq(searchKey, ruleType));
Expand Down Expand Up @@ -182,6 +181,7 @@ public static JsonNode createQueryDSL(

break;
case STATUS:
case RULE_TYPE:
// in list of string operation
final List<String> stringValues = (ArrayList<String>) entry.getValue();
query.add(in(searchKey, stringValues.toArray(new String[] {})));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ export class RuleListComponent extends InfiniteScrollTable<Rule> implements OnDe
ruleType: this.ruleTypes.map((value) => value.label),
};

// tslint:disable-next-line:variable-name
private _filters: string;

ruleMeasurements = RULE_MEASUREMENTS;

@Output() ruleClick = new EventEmitter<Rule>();
Expand Down Expand Up @@ -146,8 +143,8 @@ export class RuleListComponent extends InfiniteScrollTable<Rule> implements OnDe
criteria.RuleId = this._searchText;
}

if (this._filters?.length > 0) {
criteria.RuleType = this._filters;
if (this.filterMap.ruleType.length > 0) {
criteria.RuleType = this.filterMap.ruleType;
}

return criteria;
Expand Down Expand Up @@ -202,10 +199,8 @@ export class RuleListComponent extends InfiniteScrollTable<Rule> implements OnDe
});
}

onFilterChange(key: string, values: string[]) {
onFilterChange(key: string, values: any[]) {
this.filterMap[key] = values;
// TODO: remplacer les checkbox par des radio button ou gérer plusieurs ruleTypes?
this._filters = values[0];
this.filterChange.next(this.filterMap);
}
}
Loading