Browse Source

Feature/add currency suffix to emergency fund dialog (#7969)

* Add currency suffix to emergency fund dialog

* Update changelog
pull/7971/head
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
cce3f7bdc4
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 3
      apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
  3. 1
      libs/ui/src/lib/notifications/interfaces/interfaces.ts
  4. 3
      libs/ui/src/lib/notifications/notification.service.ts
  5. 1
      libs/ui/src/lib/notifications/prompt-dialog/interfaces/interfaces.ts
  6. 5
      libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts
  7. 3
      libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.html

1
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Extended the emergency fund dialog in the portfolio summary to include the currency suffix
- Migrated the client to the code generated by the new `prisma-client` generator of _Prisma_ - Migrated the client to the code generated by the new `prisma-client` generator of _Prisma_
## 3.75.0 - 2026-09-28 ## 3.75.0 - 2026-09-28

3
apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts

@ -201,7 +201,8 @@ export class GfPortfolioSummaryComponent implements OnChanges {
}, },
confirmLabel: $localize`Save`, confirmLabel: $localize`Save`,
defaultValue: this.summary.emergencyFund?.total?.toString() ?? '0', defaultValue: this.summary.emergencyFund?.total?.toString() ?? '0',
title: $localize`Please set the amount of your emergency fund.` title: $localize`Please set the amount of your emergency fund.`,
valueSuffix: this.baseCurrency
}); });
} }

1
libs/ui/src/lib/notifications/interfaces/interfaces.ts

@ -26,4 +26,5 @@ export interface PromptParams {
discardLabel?: string; discardLabel?: string;
title: string; title: string;
valueLabel?: string; valueLabel?: string;
valueSuffix?: string;
} }

3
libs/ui/src/lib/notifications/notification.service.ts

@ -87,7 +87,8 @@ export class NotificationService {
defaultValue: aParams.defaultValue, defaultValue: aParams.defaultValue,
discardLabel: aParams.discardLabel, discardLabel: aParams.discardLabel,
title: aParams.title, title: aParams.title,
valueLabel: aParams.valueLabel valueLabel: aParams.valueLabel,
valueSuffix: aParams.valueSuffix
}); });
return dialog.afterClosed().subscribe((result: string) => { return dialog.afterClosed().subscribe((result: string) => {

1
libs/ui/src/lib/notifications/prompt-dialog/interfaces/interfaces.ts

@ -4,4 +4,5 @@ export interface PromptDialogParams {
discardLabel: string; discardLabel: string;
title: string; title: string;
valueLabel?: string; valueLabel?: string;
valueSuffix?: string;
} }

5
libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts

@ -26,6 +26,7 @@ export class GfPromptDialogComponent {
public formControl = new FormControl(''); public formControl = new FormControl('');
public title: string; public title: string;
public valueLabel?: string; public valueLabel?: string;
public valueSuffix?: string;
protected readonly dialogRef = protected readonly dialogRef =
inject<MatDialogRef<GfPromptDialogComponent>>(MatDialogRef); inject<MatDialogRef<GfPromptDialogComponent>>(MatDialogRef);
@ -35,7 +36,8 @@ export class GfPromptDialogComponent {
defaultValue, defaultValue,
discardLabel, discardLabel,
title, title,
valueLabel valueLabel,
valueSuffix
}: PromptDialogParams) { }: PromptDialogParams) {
this.confirmLabel = confirmLabel; this.confirmLabel = confirmLabel;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
@ -43,5 +45,6 @@ export class GfPromptDialogComponent {
this.formControl.setValue(defaultValue ?? null); this.formControl.setValue(defaultValue ?? null);
this.title = title; this.title = title;
this.valueLabel = valueLabel; this.valueLabel = valueLabel;
this.valueSuffix = valueSuffix;
} }
} }

3
libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.html

@ -8,6 +8,9 @@
<mat-label>{{ valueLabel }}</mat-label> <mat-label>{{ valueLabel }}</mat-label>
} }
<input matInput [formControl]="formControl" /> <input matInput [formControl]="formControl" />
@if (valueSuffix) {
<span class="ml-2" matTextSuffix>{{ valueSuffix }}</span>
}
</mat-form-field> </mat-form-field>
</div> </div>

Loading…
Cancel
Save