mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
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:
@ -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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user