diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f3ea41d6..b0c305d66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Extended the validation message of the import functionality for transactions + ## 1.61.0 - 15.10.2021 ### Added diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 4c7a99d33..59df401bd 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -94,7 +94,9 @@ export class ImportService { ]); if (result[symbol] === undefined) { - throw new Error(`${symbol} is not a valid symbol for ${dataSource}`); + throw new Error( + `orders.${index}.symbol ("${symbol}") is not valid for the specified data source ("${dataSource}")` + ); } } } diff --git a/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.component.ts b/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.component.ts index f5ccf8f26..ac7832ff5 100644 --- a/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.component.ts @@ -16,6 +16,8 @@ import { ImportTransactionDialogParams } from './interfaces/interfaces'; templateUrl: 'import-transaction-dialog.html' }) export class ImportTransactionDialog implements OnDestroy { + public details: any[] = []; + private unsubscribeSubject = new Subject(); public constructor( @@ -23,7 +25,19 @@ export class ImportTransactionDialog implements OnDestroy { public dialogRef: MatDialogRef ) {} - public ngOnInit() {} + public ngOnInit() { + for (const message of this.data.messages) { + if (message.includes('orders.')) { + let [index] = message.split(' '); + index = index.replace('orders.', ''); + [index] = index.split('.'); + + this.details.push(this.data.orders[index]); + } else { + this.details.push(''); + } + } + } public onCancel(): void { this.dialogRef.close(); diff --git a/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.html b/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.html index 28e2a7f50..604eb7c06 100644 --- a/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.html +++ b/apps/client/src/app/pages/portfolio/transactions/import-transaction-dialog/import-transaction-dialog.html @@ -6,14 +6,27 @@ >
-
    -
  • -
    - -
    -
    {{ message }}
    -
  • -
+ + + + +
+
+ +
+
{{ message }}
+
+
+
+
{{ details[i] | json }}
+
+