chore: implement import csv ui (#2710)

* chore: implement import csv ui

* feat: support importing CSV

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
Nathan.fooo
2023-06-05 18:29:52 +08:00
committed by GitHub
parent 5b59800449
commit e24a8aabeb
10 changed files with 77 additions and 42 deletions

View File

@ -85,10 +85,7 @@ fn database_from_fields_and_rows(
CSVFormat::META => {
//
match serde_json::from_str(&field_meta) {
Ok(field) => {
//
field
},
Ok(field) => field,
Err(e) => {
dbg!(e);
default_field(field_meta, index == 0)
@ -197,4 +194,13 @@ mod tests {
println!("{:?}", result);
}
#[test]
fn import_empty_csv_data_test() {
let s = r#""#;
let importer = CSVImporter;
let result =
importer.import_csv_from_string(gen_database_view_id(), s.to_string(), CSVFormat::Original);
assert!(result.is_err());
}
}