mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add TSV and DSV import/export
Summary: Adds support for importing .dsv files (an April Fools 2024 easter egg), and options for exporting .dsv and .tsv files from the Share menu. Test Plan: Browser and server tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4210
This commit is contained in:
1245
test/fixtures/export-dsv/CCTransactions.dsv
vendored
Normal file
1245
test/fixtures/export-dsv/CCTransactions.dsv
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
test/fixtures/export-dsv/text.dsv
vendored
Normal file
4
test/fixtures/export-dsv/text.dsv
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
Foo💩Bar💩Id is Baz Label is this💩Link💩Formula
|
||||
1💩a💩hello💩grist https://www.getgrist.com/💩a --- grist https://www.getgrist.com/
|
||||
2💩b ,d💩world💩https://www.getgrist.com/💩b ,d --- https://www.getgrist.com/
|
||||
3💩"the ""quote marks"" ?"💩💩💩"the ""quote marks"" ? --- "
|
||||
1245
test/fixtures/export-tsv/CCTransactions.tsv
vendored
Normal file
1245
test/fixtures/export-tsv/CCTransactions.tsv
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
test/fixtures/export-tsv/text.tsv
vendored
Normal file
4
test/fixtures/export-tsv/text.tsv
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
Foo Bar Id is Baz Label is this Link Formula
|
||||
1 a hello grist https://www.getgrist.com/ a --- grist https://www.getgrist.com/
|
||||
2 b ,d world https://www.getgrist.com/ b ,d --- https://www.getgrist.com/
|
||||
3 "the ""quote marks"" ?" "the ""quote marks"" ? --- "
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { assert } from 'mocha-webdriver';
|
||||
import { assert, driver } from 'mocha-webdriver';
|
||||
import { $, gu, test } from 'test/nbrowser/gristUtil-nbrowser';
|
||||
|
||||
const fse = require('fs-extra');
|
||||
@@ -35,7 +35,10 @@ describe('Export.ntest', function() {
|
||||
await $('.test-tb-share').click();
|
||||
// Once the menu opens, get the href of the link.
|
||||
await $('.grist-floating-menu').wait();
|
||||
const href = await $('.grist-floating-menu a:contains(CSV)').wait().getAttribute('href');
|
||||
const submenu = $('.test-tb-share-option:contains(Export as...)');
|
||||
await driver.withActions(a => a.move({origin: submenu.elem()}));
|
||||
const href = await $('.grist-floating-menu a:contains(Comma Separated Values)').wait()
|
||||
.getAttribute('href');
|
||||
// Download the data at the link and compare to expected.
|
||||
const resp = await axios.get(href, {responseType: 'text', headers});
|
||||
assert.equal(resp.headers['content-disposition'],
|
||||
@@ -50,7 +53,10 @@ describe('Export.ntest', function() {
|
||||
await $('.test-tb-share').click();
|
||||
// Once the menu opens, get the href of the link.
|
||||
await $('.grist-floating-menu').wait();
|
||||
const href = await $('.grist-floating-menu a:contains(CSV)').wait().getAttribute('href');
|
||||
const submenu = $('.test-tb-share-option:contains(Export as...)');
|
||||
await driver.withActions(a => a.move({origin: submenu.elem()}));
|
||||
const href = await $('.grist-floating-menu a:contains(Comma Separated Values)').wait()
|
||||
.getAttribute('href');
|
||||
// Download the data at the link and compare to expected.
|
||||
const resp = await axios.get(href, {responseType: 'text', headers});
|
||||
assert.equal(resp.data, dataExpected.sorted);
|
||||
|
||||
Reference in New Issue
Block a user