Display invalid activity in csv import (#2460)

* Display invalid activity in csv import

* Update changelog
pull/2522/head
Don L 1 year ago committed by GitHub
parent 6a19eab425
commit ac0ad48a65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the error message in the activities import for `csv` files
- Allowed to edit todays historical market data in the asset profile details dialog of the admin control panel
## 2.13.0 - 2023-10-20

@ -267,6 +267,8 @@ export class ImportActivitiesDialog implements OnDestroy {
return;
} else if (file.name.endsWith('.csv')) {
const content = fileContent.split('\n').slice(1);
try {
const data = await this.importActivitiesService.importCsv({
fileContent,
@ -277,7 +279,7 @@ export class ImportActivitiesDialog implements OnDestroy {
} catch (error) {
console.error(error);
this.handleImportError({
activities: error?.activities ?? [],
activities: error?.activities ?? content,
error: {
error: { message: error?.error?.message ?? [error?.message] }
}

@ -0,0 +1,5 @@
Date,Code,Currency,Price,Quantity,Action,Fee,Note
16-09-2021,MSFT,USD,298.580,5,buy,19.00,My first order 🤓
17/11/2021,MSFT,USD,0.62,5,dividend,0.00
01.01.2022,Penthouse Apartment,USD,500000.0,1,<invalid>,0.00
20500606,MSFT,USD,0.00,0,buy,0.00
1 Date,Code,Currency,Price,Quantity,Action,Fee,Note
2 16-09-2021,MSFT,USD,298.580,5,buy,19.00,My first order 🤓
3 17/11/2021,MSFT,USD,0.62,5,dividend,0.00
4 01.01.2022,Penthouse Apartment,USD,500000.0,1,<invalid>,0.00
5 20500606,MSFT,USD,0.00,0,buy,0.00
Loading…
Cancel
Save