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

FIX: Adding/deleting a row took a long time when the filters were open #1943

Merged
merged 1 commit into from Sep 21, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion frontend-html/src/model/entities/FilterConfiguration.ts
Expand Up @@ -39,6 +39,11 @@ export class FilterConfiguration implements IFilterConfiguration {
implicitFilters: IImplicitFilter[];
@observable activeFilters: IFilter[] = [];

@computed
get activeCompleteFilters(){
return this.activeFilters.filter(x=> x.setting.isComplete);
}

registerFilteringOnOffHandler(handler: (filteringOn: boolean) => void) {
this.filteringOnOffHandlers.push(handler);
}
Expand Down Expand Up @@ -107,7 +112,7 @@ export class FilterConfiguration implements IFilterConfiguration {
return false;
}
}
for (let term of this.activeFilters) {
for (let term of this.activeCompleteFilters) {
if ((!ignorePropertyId || ignorePropertyId !== term.propertyId) &&
!this.userFilterPredicate(row, term)) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion frontend-html/src/model/entities/ListRowContainer.ts
Expand Up @@ -90,7 +90,7 @@ export class ListRowContainer implements IRowsContainer {
.map(ordering => this.getOrderingProperty(dataView, ordering))
.filter((prop) => prop.column === "ComboBox");

const filterComboProps = this.filterConfiguration.activeFilters
const filterComboProps = this.filterConfiguration.activeCompleteFilters
.map((term) => getDataViewPropertyById(this.filterConfiguration, term.propertyId)!)
.filter((prop) => prop.column === "ComboBox");
const allComboProps = Array.from(new Set(filterComboProps.concat(orderingComboProps)));
Expand Down
Expand Up @@ -29,6 +29,7 @@ export interface IFilterConfiguration extends IFilterConfigurationData {

isFilterControlsDisplayed: boolean;
activeFilters: IFilter[];
activeCompleteFilters: IFilter[];

filteringFunction(ignorePropertyId?: string): (row: any[], forceRowId?: string) => boolean;

Expand Down