diff --git a/ui/main/src/app/modules/admin/components/table/perimeters-table.component.ts b/ui/main/src/app/modules/admin/components/table/perimeters-table.component.ts index edab515856..67aa2fb47d 100644 --- a/ui/main/src/app/modules/admin/components/table/perimeters-table.component.ts +++ b/ui/main/src/app/modules/admin/components/table/perimeters-table.component.ts @@ -49,16 +49,44 @@ export class PerimetersTableComponent extends AdminTableDirective implements OnI sortable: false, filter: 'agTextColumnFilter', filterParams: { - valueGetter: (params) => { + textMatcher: (params) => { const currentProcessDef = this.processesDefinition.filter( (processDef) => processDef.id === params.data.process )[0]; let text = ''; params.data.stateRights.forEach((stateRight) => { if (currentProcessDef.states.get(stateRight.state)) - text += currentProcessDef.states.get(stateRight.state).name + ' '; + text += currentProcessDef.states.get(stateRight.state).name.toLocaleLowerCase() + ' '; }); - return text; + + let response = false; + + switch (params.filterOption) { + case 'equals': + response = text.toLocaleLowerCase() === params.filterText; + break; + case 'contains': + response = text.toLocaleLowerCase().indexOf(params.filterText) >= 0; + break; + case 'notContains': + response = text.toLocaleLowerCase().indexOf(params.filterText) < 0; + break; + case 'startsWith': + response = text.toLocaleLowerCase().startsWith(params.filterText); + break; + case 'endsWith': + response = text.toLocaleLowerCase().endsWith(params.filterText); + break; + case 'blank': + response = text.trim().length === 0; + break; + case 'notblank': + response = text.trim().length > 0; + break; + default: + break; + } + return response; } }, wrapText: true,