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 &&
|
const isCalculate = (userActions.length === 1 &&
|
||||||
userActions[0][0] === 'Calculate');
|
userActions[0][0] === 'Calculate');
|
||||||
const trivial = isCalculate && sandboxActionBundle.stored.length === 0;
|
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 :
|
const actionNum = trivial ? 0 :
|
||||||
(branch === Branch.Shared ? this._actionHistory.getNextHubActionNum() :
|
(branch === Branch.Shared ? this._actionHistory.getNextHubActionNum() :
|
||||||
@ -226,7 +232,7 @@ export class Sharing {
|
|||||||
const localActionBundle: LocalActionBundle = {
|
const localActionBundle: LocalActionBundle = {
|
||||||
actionNum,
|
actionNum,
|
||||||
// The ActionInfo should go into the envelope that includes all recipients.
|
// The ActionInfo should go into the envelope that includes all recipients.
|
||||||
info: [findOrAddAllEnvelope(sandboxActionBundle.envelopes), info],
|
info: [findOrAddAllEnvelope(sandboxActionBundle.envelopes), attribution],
|
||||||
envelopes: sandboxActionBundle.envelopes,
|
envelopes: sandboxActionBundle.envelopes,
|
||||||
stored: sandboxActionBundle.stored,
|
stored: sandboxActionBundle.stored,
|
||||||
calc: sandboxActionBundle.calc,
|
calc: sandboxActionBundle.calc,
|
||||||
|
Loading…
Reference in New Issue
Block a user