mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix filtering regression
Summary: Fixes a recent regression that would cause a record to be erroneously filtered out whenever it was updated from a linked view. Test Plan: Browser test. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4163
This commit is contained in:
@@ -28,11 +28,7 @@ export class SectionFilter extends Disposable {
|
||||
|
||||
private _openFilterOverride: Observable<OpenColumnFilter|null> = Observable.create(this, null);
|
||||
|
||||
constructor(
|
||||
public viewSection: ViewSectionRec,
|
||||
private _tableData: TableData,
|
||||
private _resetExemptRows: () => void,
|
||||
) {
|
||||
constructor(public viewSection: ViewSectionRec, private _tableData: TableData) {
|
||||
super();
|
||||
|
||||
this.sectionFilterFunc = Computed.create(this, this._openFilterOverride, (use, openFilter) => {
|
||||
@@ -65,10 +61,8 @@ export class SectionFilter extends Disposable {
|
||||
* Builds a filter function that combines the filter function of all the columns. You can use
|
||||
* `getFilterFunc(column, colFilter)` to customize the filter func for each column. It calls
|
||||
* `getFilterFunc` right away.
|
||||
* This also immediately resets rows that were temporarily exempted from filtering.
|
||||
*/
|
||||
public buildFilterFunc(getFilterFunc: ColFilterCB, use: UseCB) {
|
||||
this._resetExemptRows();
|
||||
const filters = use(this.viewSection.filters);
|
||||
const funcs: Array<RowFilterFunc<UIRowId> | null> = filters.map(({filter, fieldOrColumn}) => {
|
||||
const colFilter = buildColFilter(use(filter), use(use(fieldOrColumn.origCol).type));
|
||||
|
||||
@@ -802,4 +802,6 @@ export class ExemptFromFilterRowSource extends BaseFilteredRowSource {
|
||||
public reset() {
|
||||
this.onRemoveRows(this.getAllRows());
|
||||
}
|
||||
|
||||
public onUpdateRows() { /* no-op */ }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user