patternfly / angular-patternfly

This repo contains instructions and the code for a set of Angular 1 components for the PatternFly project.
http://www.patternfly.org/angular-patternfly/
MIT License
122 stars 90 forks source link

Filtering does not work consistently and provides unexpected results #727

Closed julienlim closed 6 years ago

julienlim commented 6 years ago

Noting here that there's a bug with the filtering component in that it does not work consistently and provides unexpected results -- see https://github.com/Tendrl/ui/issues/866#event-1515448349 for additional details.

dtaylor113 commented 6 years ago

Hi @julienlim, can you please elaborate on what the issue is? I see from #866 that you entered a '1' and then a '4912'; where you expecting a single result?
Just FYI, the logic to apply the filter to the results set is done in the application code, not patternfly itself, to that end, could you please supply a link to the code which runs the filter shown in #866 -thanks!

a2batic commented 6 years ago

@dtaylor113, we have implemented the filter component according to the example provided here[1]. The filter is accepting multiple values for 'text' filters, which is giving unexpected results. The code file for #866 is [2].

[1] https://www.patternfly.org/angular-patternfly/#/api/patternfly.filters.component:pfFilter [2] https://github.com/Tendrl/ui/blob/master/src/modules/hosts/host-list/host-list.js#L108

dtaylor113 commented 6 years ago

Hi @a2batic, multiple 'text' filter values are AND'ed together, so in the example below Name needs to contain 'F' AND 'Fred': image

In your example you entered a '1' and `49152' for the Brick Path, I can't tell from the screenshots if there are Brick Paths which contain a '1' AND also '49152'.

a2batic commented 6 years ago

Hi @dtaylor113, yeah, so in the Brick Paths '1' is there but '49152' isnt there, so the AND of the two value resulted in false. For ex:- screenshot from 2018-03-13 23-54-36

dtaylor113 commented 6 years ago

Hi @a2batic, ok, so is there an issue?

dtaylor113 commented 6 years ago

We do have the pfFilterPanel if you want to OR values together. aka. Checkbox Filter

dtaylor113 commented 6 years ago

Hi @julienlim, so is there an issue with angular-patternfly's filter component?

julienlim commented 6 years ago

@dtaylor113 The problem seems not to be with the angular-patternfly filter component. Thank you for your help!

a2batic commented 6 years ago

Thankyou @dtaylor113, we did not look into checkbox filter !