(core) Adding Skip options when importing multiple tables.

Summary:
Adding new destination "Skip" for multiple table imports.
Selecting this destination skips the import and makes the preview grayed out.

Test Plan: New Tests

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3181
This commit is contained in:
Jarosław Sadziński
2021-12-13 10:11:18 +01:00
parent d99db8d016
commit 1ae586cf42
3 changed files with 41 additions and 15 deletions

View File

@@ -5,7 +5,8 @@ import * as _ from 'underscore';
import {ColumnDelta, createEmptyActionSummary} from 'app/common/ActionSummary';
import {ApplyUAResult, DataSourceTransformed, ImportOptions, ImportResult, ImportTableResult,
MergeOptions, MergeOptionsMap, MergeStrategy, TransformColumn, TransformRule,
MergeOptions, MergeOptionsMap, MergeStrategy, SKIP_TABLE, TransformColumn,
TransformRule,
TransformRuleMap} from 'app/common/ActiveDocAPI';
import {ApiError} from 'app/common/ApiError';
import {BulkColValues, CellValue, fromTableDataAction, TableRecordValue} from 'app/common/DocActions';
@@ -329,6 +330,10 @@ export class ActiveDocImport {
createdTableId = hiddenTableId;
} else {
if (destTableId === SKIP_TABLE) {
await this._activeDoc.applyUserActions(docSession, [['RemoveTable', hiddenTableId]]);
continue;
}
// Do final import
const mergeOptions = mergeOptionsMap[origTableName] ?? null;
const intoNewTable: boolean = destTableId ? false : true;