mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) attribute Calculate to grist rather than user
Summary: when a document is opened, and Calculate results in a change, that change is not attributed to 'grist' rather than to the user's email. Some minor tweaks included to freshen some related dev scripts. Test Plan: added test Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2679
This commit is contained in:
parent
0289e3ea17
commit
3519d0efce
@ -217,6 +217,12 @@ export class Sharing {
|
||||
const isCalculate = (userActions.length === 1 &&
|
||||
userActions[0][0] === 'Calculate');
|
||||
const trivial = isCalculate && sandboxActionBundle.stored.length === 0;
|
||||
// For Calculate "user" actions, don't attribute any changes to the user who
|
||||
// happens to have opened the document.
|
||||
const attribution = {
|
||||
...info,
|
||||
...isCalculate ? { user: 'grist' } : undefined,
|
||||
};
|
||||
|
||||
const actionNum = trivial ? 0 :
|
||||
(branch === Branch.Shared ? this._actionHistory.getNextHubActionNum() :
|
||||
@ -226,7 +232,7 @@ export class Sharing {
|
||||
const localActionBundle: LocalActionBundle = {
|
||||
actionNum,
|
||||
// The ActionInfo should go into the envelope that includes all recipients.
|
||||
info: [findOrAddAllEnvelope(sandboxActionBundle.envelopes), info],
|
||||
info: [findOrAddAllEnvelope(sandboxActionBundle.envelopes), attribution],
|
||||
envelopes: sandboxActionBundle.envelopes,
|
||||
stored: sandboxActionBundle.stored,
|
||||
calc: sandboxActionBundle.calc,
|
||||
|
Loading…
Reference in New Issue
Block a user