mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Automatically finalize action bundles when unrelated actions/bundles come in.
Summary: Type conversions and formula tranforms wait for the user and bundle multiple actions. When an unrelated action is done (e.g. adding a page widget or a column), we want to finalize the transform before applying it. The approach turns out fairly complicated. There is an implicit queue of bundles (which we don't let grow beyond 2, as that's too abnormal). Bundles may be finalized by a user clicking something, or by an unrelated action/bundle, or (as before) by transform DOM getting disposed. - Updated RecordLayout to use bundleActions() helper - Added support for nesting bundleActions inside another bundle (needed for setting visibleCol during type change) - In an unrelated tweak, when in debug-log in ActiveDoc, use a short representation of result. Test Plan: Added a unittest for action bundling during type transform Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2655
This commit is contained in:
@@ -14,7 +14,6 @@ import remove = require('lodash/remove');
|
||||
import zipObject = require('lodash/zipObject');
|
||||
import * as moment from 'moment-timezone';
|
||||
import * as tmp from 'tmp';
|
||||
import * as util from 'util';
|
||||
|
||||
import {getEnvContent, LocalActionBundle} from 'app/common/ActionBundle';
|
||||
import {SandboxActionBundle, UserActionBundle} from 'app/common/ActionBundle';
|
||||
@@ -1072,7 +1071,7 @@ export class ActiveDoc extends EventEmitter {
|
||||
const result: ApplyUAResult = await new Promise<ApplyUAResult>(
|
||||
(resolve, reject) =>
|
||||
this._sharing!.addUserAction({action, client, resolve, reject}));
|
||||
this.logDebug(docSession, "_applyUserActions returning %s", util.inspect(result));
|
||||
this.logDebug(docSession, "_applyUserActions returning %s", shortDesc(result));
|
||||
|
||||
if (result.isModification) {
|
||||
this._fetchCache.clear(); // This could be more nuanced.
|
||||
|
||||
Reference in New Issue
Block a user