(core) Fix adding multiple fields when editing card layout

Summary:
Bug reported by user (https://gristlabs.getgrist.com/k1f3bMzUvitZ/User-Feedback#a1.s3.r408.c8)
Also make the test of editing RecordLayout work better (it was failing on Mac even on master)

Test Plan: Added a test case for adding multiple fields

Reviewers: alexmojaki

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D3219
This commit is contained in:
Dmitry S 2022-01-15 14:42:02 -05:00
parent 4976dc2ace
commit f9f4245466

View File

@ -254,7 +254,9 @@ RecordLayout.prototype.saveLayoutSpec = async function(layoutSpec) {
// with items which require new columns first. // with items which require new columns first.
let callbacks = addedCallbacks.concat(hiddenCallbacks); let callbacks = addedCallbacks.concat(hiddenCallbacks);
let positions = addedPositions.concat(hiddenPositions); let positions = addedPositions.concat(hiddenPositions);
let addActions = gutil.arrayRepeat(addColNum, addColAction);
// Use separate copies of addColAction, since sendTableActions modified each in-place.
let addActions = gutil.arrayRepeat(addColNum, 0).map(() => addColAction.slice());
await docData.bundleActions('Updating record layout.', () => { await docData.bundleActions('Updating record layout.', () => {
return Promise.try(() => { return Promise.try(() => {