mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
Split _importFileAsNewTable method for grist-static
This commit is contained in:
parent
efa734da71
commit
25f7a89442
@ -286,12 +286,20 @@ export class ActiveDocImport {
|
||||
*/
|
||||
private async _importFileAsNewTable(docSession: OptDocSession, tmpPath: string,
|
||||
importOptions: FileImportOptions): Promise<ImportResult> {
|
||||
const {originalFilename, parseOptions, mergeOptionsMap, isHidden, uploadFileIndex,
|
||||
transformRuleMap} = importOptions;
|
||||
const {originalFilename, parseOptions} = importOptions;
|
||||
log.info("ActiveDoc._importFileAsNewTable(%s, %s)", tmpPath, originalFilename);
|
||||
if (!this._activeDoc.docPluginManager) { throw new Error('no plugin manager available'); }
|
||||
if (!this._activeDoc.docPluginManager) {
|
||||
throw new Error('no plugin manager available');
|
||||
}
|
||||
const optionsAndData: ParseFileResult =
|
||||
await this._activeDoc.docPluginManager.parseFile(tmpPath, originalFilename, parseOptions);
|
||||
return this._importParsedFileAsNewTable(docSession, optionsAndData, importOptions);
|
||||
}
|
||||
|
||||
private async _importParsedFileAsNewTable(
|
||||
docSession: OptDocSession, optionsAndData: ParseFileResult, importOptions: FileImportOptions
|
||||
): Promise<ImportResult> {
|
||||
const {originalFilename, mergeOptionsMap, isHidden, uploadFileIndex, transformRuleMap} = importOptions;
|
||||
const options = optionsAndData.parseOptions;
|
||||
|
||||
const parsedTables = optionsAndData.tables;
|
||||
|
Loading…
Reference in New Issue
Block a user