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

Multi Filtering improvement to current filter plugin #302

Merged
merged 34 commits into from
Mar 25, 2022

Conversation

islarky88
Copy link
Contributor

add multi filters to a column. can ba and or or relation or both.

image

image

Copy link
Collaborator

@m2a2x m2a2x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to remove console.logs

@islarky88 islarky88 marked this pull request as ready for review March 21, 2022 16:04
this.addEventListener('headerclick', headerclick);
this.addEventListener('aftersourceset', aftersourceset);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove this?
it was supposed to filter when we apply new data source if we have any filter

// check is filter event prevented
const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', { collection, itemsToFilter, source: items });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you removed a way to override filter externally, when you removed details

continue;
}
propFilterSatisfiedCount++;
} else if (filterData.relation === 'and') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need else if here? can't it be just else and so if no relation it'll be treated as and?


const aftersourceset = async () => {
const filterCollectionProps = Object.keys(this.filterCollection);
if (filterCollectionProps.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be just filterCollectionProps.length

if (filterCollectionProps.length > 0) {
// handle old way of filtering by reworking FilterCollection to new MultiFilterItem
// since id is generated locally, we don't want to conflict with other filters by starting at 0
let filterIdStart = 1000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to make time based, 1000 seems just a random number

@m2a2x m2a2x merged commit b611f74 into revolist:master Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants