gristlabs_grist-core/app/client
Jarosław Sadziński 1d2cf3de49 (core) Adding backend for 2-way references
Summary:
Adding support for 2-way references in data engine.

- Columns have an `reverseCol` field, which says "this is a reverse of the given column, update me when that one changes".
- At the time of setting `reverseCol`, we ensure that it's symmetrical to make a 2-way reference.
- Elsewhere we just implement syncing in one direction:
  - When `reverseCol` is present, user code is generated with a type like `grist.ReferenceList("Tasks", reverse_of="Assignee")`
  - On updating a ref column, we use `prepare_new_values()` method to generate corresponding updates to any column that's a reverse of it.
  - The `prepare_new_values()` approach is extended to support this.
  - We don't add (or remove) any mappings between rows, and rely on existing mappings (in a ref column's `_relation`) to create reverse updates.

NOTE This is polished version of https://phab.getgrist.com/D4307 with tests and 3 bug fixes
- Column transformation didn't work when transforming RefList to Ref, the reverse column became out of sync
- Tables with reverse columns couldn't be removed
- Setting json arrays to RefList didn't work if arrays contained other things besides ints
Those fixes are covered by new tests.

Test Plan: New tests

Reviewers: georgegevoian, paulfitz, dsagal

Reviewed By: georgegevoian, paulfitz

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D4322
2024-09-11 22:31:36 +02:00
..
aclui (core) Add dropdown conditions 2024-04-26 16:57:55 -04:00
components (core) Adding backend for 2-way references 2024-09-11 22:31:36 +02:00
lib (core) Add Markdown cell format 2024-08-23 11:24:35 -04:00
models (core) Add custom widget gallery 2024-08-14 16:48:36 -04:00
ui (core) Allowing non-owner managers to add other managers 2024-09-09 18:33:03 +02:00
ui2018 (core) Add Markdown cell format 2024-08-23 11:24:35 -04:00
widgets (core) updates from grist-core 2024-09-09 09:14:43 -04:00
apiconsole.ts apiconsole: allow uploads in console 2024-07-26 09:09:11 -04:00
app.css (core) Polish tutorial popups 2023-04-20 12:20:03 -04:00
app.js (core) Improve API Console and link from Document Settings. 2024-01-29 10:08:19 -05:00
billingMain.ts (core) Refactor forms implementation 2024-02-22 08:44:25 -05:00
browserCheck.ts (core) On mobile, only show a warning for older and unknown browsers rather than for all 2023-06-01 11:15:21 -04:00
declarations.d.ts (core) Add support for locales to DateEditor and DateTimeEditor. 2024-09-05 08:35:04 -04:00
DefaultHooks.ts add hooks for tweaking how downloads happen (for grist-static) (#665) 2023-09-09 14:50:32 -04:00
errorMain.ts (core) Refactor forms implementation 2024-02-22 08:44:25 -05:00
exposeModulesForTests.js (core) Improve API Console and link from Document Settings. 2024-01-29 10:08:19 -05:00
formMain.ts (core) Refactor forms implementation 2024-02-22 08:44:25 -05:00
Hooks.ts support other SQLite wrappers, and various hooks needed by grist-static (#516) 2023-05-23 15:17:28 -04:00
logo.css (core) Cleanup removing some old unused files, fixing logo.css, and removing #grist-app. 2020-10-09 17:04:09 -04:00
tsconfig.json (core) Migrate to SRP and add change password dialog 2022-03-16 21:35:06 -07:00