mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) fix up newRec when column names change; autocomplete after newRec
Summary: This treats newRec in the same way as rec in access formulas. Test Plan: updated test for column renames; autocomplete checked manually. Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2810
This commit is contained in:
@@ -47,7 +47,7 @@ export function aclFormulaEditor(options: ACLFormulaOptions) {
|
||||
// Some grist-specific constants:
|
||||
'OWNER', 'EDITOR', 'VIEWER',
|
||||
// The common variables.
|
||||
'user', 'rec',
|
||||
'user', 'rec', 'newRec',
|
||||
// Other completions that depend on doc schema or other rules.
|
||||
...options.getSuggestions(prefix),
|
||||
];
|
||||
|
||||
@@ -1091,6 +1091,7 @@ class ObsRulePart extends Disposable {
|
||||
private _completions = Computed.create<string[]>(this, (use) => [
|
||||
...use(this._ruleSet.accessRules.userAttrChoices).map(opt => opt.label),
|
||||
...this._ruleSet.getValidColIds().map(colId => `rec.${colId}`),
|
||||
...this._ruleSet.getValidColIds().map(colId => `newRec.${colId}`),
|
||||
]);
|
||||
|
||||
// The permission bits.
|
||||
|
||||
Reference in New Issue
Block a user