(core) Implement UI for trigger formulas.

Summary:
- Implement UI with "Apply to new records" and "Apply on record changes"
  checkboxes, and options for selecting which changes to recalculate on.
- For consistency, always represent empty RefList as None
- Fix up generated SchemaTypes to remember that values are encoded.

Included test cases for the main planned use cases:
- Auto-filled UUID column
- Data cleaning
- NOW() formula for record's last-updated timestamp.
- Updates that depend on other columns.

Test Plan: Added a browser test.

Reviewers: jarek

Reviewed By: jarek

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D2885
This commit is contained in:
Dmitry S
2021-06-29 00:47:59 -04:00
parent e180641c7d
commit b537539b73
12 changed files with 372 additions and 53 deletions

View File

@@ -1,6 +1,7 @@
import {Command} from 'app/client/components/commands';
import {NeedUpgradeError, reportError} from 'app/client/models/errors';
import {colors, testId, vars} from 'app/client/ui2018/cssVars';
import {cssSelectBtn} from 'app/client/ui2018/select';
import {IconName} from 'app/client/ui2018/IconList';
import {icon} from 'app/client/ui2018/icons';
import {commonUrls} from 'app/common/gristUrls';
@@ -280,24 +281,6 @@ const cssSelectBtnContainer = styled('div', `
width: 100%;
`);
const cssSelectBtn = styled('div', `
width: 100%;
height: 30px;
line-height: 16px;
background-color: white;
font-size: ${vars.mediumFontSize};
padding: 5px;
border: 1px solid ${colors.darkGrey};
color: ${colors.dark};
--icon-color: ${colors.dark};
border-radius: 3px;
cursor: pointer;
outline: none;
-webkit-appearance: none;
-moz-appearance: none;
display: flex;
`);
const cssSelectBtnLink = styled('div', `
display: flex;
align-items: center;