Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Task/change account field to optional in create or update activity dialog (#6371)
Thomas Kaul4897f34d51e0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f4a857ab35..ecd2ce5c8f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## Unreleased+### Changed++- Changed the account field to optional in the create or update activity dialog+### Fixed- Fixed the page size for presets in the historical market data table of the admin control paneldiff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.tsindex 8695f04eda..fc42a504d3 100644--- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts+++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts@@ -188,8 +188,7 @@ export class GfCreateOrUpdateActivityDialogComponent implements OnDestroy {!this.data.activity?.accountId &&this.mode === 'create'? this.data.accounts[0].id- : this.data.activity?.accountId,- Validators.required+ : this.data.activity?.accountId],assetClass: [this.data.activity?.SymbolProfile?.assetClass],assetSubClass: [this.data.activity?.SymbolProfile?.assetSubClass],@@ -365,11 +364,6 @@ export class GfCreateOrUpdateActivityDialogComponent implements OnDestroy {(this.activityForm.get('dataSource').value === 'MANUAL' &&type === 'BUY')) {- this.activityForm- .get('accountId')- .removeValidators(Validators.required);- this.activityForm.get('accountId').updateValueAndValidity();-const currency =this.data.accounts.find(({ id }) => {return id === this.activityForm.get('accountId').value;@@ -397,11 +391,6 @@ export class GfCreateOrUpdateActivityDialogComponent implements OnDestroy {this.activityForm.get('updateAccountBalance').disable();this.activityForm.get('updateAccountBalance').setValue(false);} else if (['FEE', 'INTEREST', 'LIABILITY'].includes(type)) {- this.activityForm- .get('accountId')- .removeValidators(Validators.required);- this.activityForm.get('accountId').updateValueAndValidity();-const currency =this.data.accounts.find(({ id }) => {return id === this.activityForm.get('accountId').value;@@ -447,8 +436,6 @@ export class GfCreateOrUpdateActivityDialogComponent implements OnDestroy {this.activityForm.get('updateAccountBalance').setValue(false);}} else {- this.activityForm.get('accountId').setValidators(Validators.required);- this.activityForm.get('accountId').updateValueAndValidity();this.activityForm.get('dataSource').setValidators(Validators.required);diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.htmlindex 42fbd0ebf2..278ddcbbd3 100644--- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html+++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html@@ -84,12 +84,8 @@><mat-label i18n>Account</mat-label><mat-select formControlName="accountId">- @if (- !activityForm.get('accountId').hasValidator(Validators.required) ||- (!activityForm.get('accountId').value && mode === 'update')- ) {- <mat-option [value]="null" />- }+ <mat-option [value]="null" />+@for (account of data.accounts; track account) {<mat-option [value]="account.id"><div class="d-flex">