Skip to content

Commit

Permalink
Merge pull request #2322 from ProgrammeVitam/cp_7.1_12638
Browse files Browse the repository at this point in the history
CP 7.1 - bug #12638 : Managment rules filter
  • Loading branch information
hazco75 authored Dec 16, 2024
2 parents 1ef8c1b + 2c9db38 commit 74eaddb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
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);
}
}

0 comments on commit 74eaddb

Please sign in to comment.