mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Duplicate page should copy filters.
Summary: Duplicate page also copies filters for all sections. Test Plan: nbrowser tests Reviewers: cyprien, alexmojaki Reviewed By: cyprien, alexmojaki Subscribers: alexmojaki Differential Revision: https://phab.getgrist.com/D3203
This commit is contained in:
@@ -26,7 +26,7 @@ import {
|
||||
summarizePermissionSet
|
||||
} from 'app/common/ACLPermissions';
|
||||
import {ACLRuleCollection, SPECIAL_RULES_TABLE_ID} from 'app/common/ACLRuleCollection';
|
||||
import {BulkColValues, RowRecord, UserAction} from 'app/common/DocActions';
|
||||
import {BulkColValues, getColValues, RowRecord, UserAction} from 'app/common/DocActions';
|
||||
import {
|
||||
FormulaProperties,
|
||||
getFormulaProperties,
|
||||
@@ -1371,26 +1371,6 @@ function syncRecords(tableData: TableData, newRecords: RowRecord[],
|
||||
return {userActions, rowIdMap};
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a list of rows into an object with columns of values, used for
|
||||
* BulkAddRecord/BulkUpdateRecord actions.
|
||||
*/
|
||||
function getColValues(records: RowRecord[]): BulkColValues {
|
||||
const colIdSet = new Set<string>();
|
||||
for (const r of records) {
|
||||
for (const c of Object.keys(r)) {
|
||||
if (c !== 'id') {
|
||||
colIdSet.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
const result: BulkColValues = {};
|
||||
for (const colId of colIdSet) {
|
||||
result[colId] = records.map(r => r[colId]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a list of [before, after] rows into an object of changes, skipping columns which
|
||||
* haven't changed.
|
||||
|
||||
Reference in New Issue
Block a user