gristlabs_grist-core/app/client/models/entities
Cyprien P 4b54c7d99b (core) Fix column and view fields mismatch in filters
Summary:
The problem manifested while filtering by a column, closing the filter
would change the set of rows visible on the table. This would happen
only for rare table.

What caused that problem was that the filter being edited was wrongly
applyed also to another column, so depending on the content of the
column, it would entail unexpected behaviour.

The cause of that wrong association, was a mistakingly comparing the
id of two different type of thing: column and view field. The problem
would manifest if in the same section there were a view fields with
same row id as the column being filtered.

What made that confusion possible is the `.fieldOrColumn:
ViewFieldRec|ColumnRec` property of the FileInfo object, which could
hold either a view fields or a column record and was initialized with
view fields or columns if view fields was not found (ie: hidden
column).

Solution was to make sure FieldInfo is initialized with ColumnRec
alwasy (even for hidden column).

I'm not sure what is the reason why FilterInfo needed to support both
column record and view field record in the past, but it looks like
this is not needed anymore.

As a followup commit I think it would be worth the effort to refactor
FileInfo to accept only ColumnRec.

Test Plan: Includes new regression test

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3463
2022-06-07 10:26:15 +02:00
..
ACLRuleRec.ts (core) make AccessRules and FullCopies effective 2021-03-25 15:05:26 -04:00
ColumnRec.ts (core) New type conversion in the backend 2022-02-04 20:28:13 +02:00
DocInfoRec.ts (core) Filter out pages for hidden views from the page list. 2021-08-27 13:51:57 -04:00
FilterRec.ts (core) Allow filtering hidden columns 2021-11-22 10:26:08 -08:00
PageRec.ts (core) Raw renames 2022-04-27 22:21:55 +02:00
TabBarRec.ts (core) move client code to core 2020-10-02 13:24:21 -04:00
TableRec.ts (core) Raw renames 2022-04-27 22:21:55 +02:00
ValidationRec.ts (core) move client code to core 2020-10-02 13:24:21 -04:00
ViewFieldRec.ts (core) Adding font options to the style picker 2022-04-07 20:35:03 +02:00
ViewRec.ts (core) Initial data tables page 2022-02-10 12:46:19 +02:00
ViewSectionRec.ts (core) Fix column and view fields mismatch in filters 2022-06-07 10:26:15 +02:00