gristlabs_grist-core/app/common
Dmitry S a56714e1ab (core) Implement trigger formulas (generalizing default formulas)
Summary:
Trigger formulas can be calculated for new records, or for new records and
updates to certain fields, or all fields. They do not recalculate on open,
and they MAY be set directly by the user, including for data-cleaning.

- Column metadata now includes recalcWhen and recalcDeps fields.
- Trigger formulas are NOT recalculated on open or on schema changes.
- When recalcWhen is "never", formula isn't calculated even for new records.
- When recalcWhen is "allupdates", formula is calculated for new records and
  any manual (non-formula) updates to the record.
- When recalcWhen is "", formula is calculated for new records, and changes to
  recalcDeps fields (which may be formula fields or column itself).
- A column whose recalcDeps includes itself is a "data-cleaning" column; a
  value set by the user will still trigger the formula.
- All trigger-formulas receive a "value" argument (to support the case above).

Small changes
- Update RefLists (used for recalcDeps) when target rows are deleted.
- Add RecordList.__contains__ (for `rec in refList` or `id in refList` checks)
- Clarify that Calculate action has replaced load_done() in practice,
  and use it in tests too, to better match reality.

Left for later:
- UI for setting recalcWhen / recalcDeps.
- Implementation of actions such as "Recalculate for all cells".
- Allowing trigger-formulas access to the current user's info.

Test Plan: Added a comprehensive python-side test for various trigger combinations

Reviewers: paulfitz, alexmojaki

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2872
2021-06-25 22:53:07 -04:00
..
ACLPermissions.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
ACLRuleCollection.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
ActionBundle.ts (core) discount indirect changes for access control purposes 2021-05-12 11:26:21 -04:00
ActionDispatcher.ts
ActionGroup.ts
ActionRouter.ts
ActionSummary.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
ActiveDocAPI.ts (core) allow undos to be partial, if access control prohibits some part of them 2021-06-10 18:26:11 -04:00
ApiError.ts
arrayToString.ts
AsyncCreate.ts
AsyncFlow.ts
BaseAPI.ts
BasketClientAPI.ts
BigInt.ts
BillingAPI.ts (core) link AppSumo activations with stripe, and support upgrades/downgrades 2021-06-24 10:18:42 -04:00
BinaryIndexedTree.js
BrowserSettings.ts
ColumnFilterFunc.ts (core) Use individual choices for filtering choice lists 2021-06-11 09:34:06 -07:00
ColumnGetters.ts
csvFormat.ts (core) Add our very own implementation of tokenfield (aka pillbox, tag list) 2021-05-03 17:16:24 -04:00
declarations.d.ts
delay.ts
DisposableWithEvents.ts
DocActions.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
DocData.ts
DocListAPI.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
DocSnapshot.ts
emails.ts
EncActionBundle.ts
ErrorWithCode.ts
Features.ts
FilterState.ts (core) Download as CSV button on sections 2021-05-27 15:48:12 +02:00
Formula.ts
GranularAccessClause.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
GristServerAPI.ts
gristTypes.ts (core) Use individual choices for filtering choice lists 2021-06-11 09:34:06 -07:00
gristUrls.ts (core) streamline registration flow for new appsumo users 2021-06-25 10:47:10 -04:00
gutil.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
InactivityTimer.ts
KeyedMutex.ts
KeyedOps.ts
LoginSessionAPI.ts
LoginState.ts
marshal.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
MemBuffer.js
NumberFormat.ts
orgNameUtils.ts (core) complete light sign-up flow for appsumo, and customize summaries 2021-06-25 14:13:13 -04:00
parseDate.ts
plugin.ts
PluginInstance.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
Prefs.ts
RefCountMap.ts
resetOrg.ts
roles.ts
RowFilterFunc.ts (core) Download as CSV button on sections 2021-05-27 15:48:12 +02:00
schema.ts (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
sharing.ts
SortFunc.ts
StringUnion.ts
TableData.ts
TabularDiff.ts
tbind.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
TestState.ts
timeFormat.ts
tpromisified.ts (core) Configure more comprehensive eslint rules for Typescript 2021-04-26 18:54:55 -04:00
tsconfig.json
tsvFormat.ts
uploads.ts
urlUtils.ts
UserAPI.ts (core) Add rules to eslint to better match our coding conventions. 2021-05-24 12:56:18 -04:00
UserConfig.ts
ValueFormatter.ts