Browse Source

Merge branch 'main' into feature/skip-derived-currencies-in-get-quotes-of-data-provider-service

pull/3610/head
Thomas Kaul 1 year ago
committed by GitHub
parent
commit
13601af772
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 26
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
  3. 15
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html
  4. 13
      libs/common/src/lib/personal-finance-tools.ts

1
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the account selector of the create or update activity dialog
- Improved the handling of the numerical precision in the value component - Improved the handling of the numerical precision in the value component
- Skipped derived currencies in the get quotes functionality of the data provider service - Skipped derived currencies in the get quotes functionality of the data provider service
- Improved the language localization for Spanish (`es`) - Improved the language localization for Spanish (`es`)

26
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts

@ -51,6 +51,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
public filteredTagsObservable: Observable<Tag[]> = of([]); public filteredTagsObservable: Observable<Tag[]> = of([]);
public isLoading = false; public isLoading = false;
public isToday = isToday; public isToday = isToday;
public mode: 'create' | 'update';
public platforms: { id: string; name: string }[]; public platforms: { id: string; name: string }[];
public separatorKeysCodes: number[] = [ENTER, COMMA]; public separatorKeysCodes: number[] = [ENTER, COMMA];
public tags: Tag[] = []; public tags: Tag[] = [];
@ -71,6 +72,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
) {} ) {}
public ngOnInit() { public ngOnInit() {
this.mode = this.data.activity.id ? 'update' : 'create';
this.locale = this.data.user?.settings?.locale; this.locale = this.data.user?.settings?.locale;
this.dateAdapter.setLocale(this.locale); this.dateAdapter.setLocale(this.locale);
@ -92,7 +94,9 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
this.activityForm = this.formBuilder.group({ this.activityForm = this.formBuilder.group({
accountId: [ accountId: [
this.data.accounts.length === 1 && !this.data.activity?.accountId this.data.accounts.length === 1 &&
!this.data.activity?.accountId &&
this.mode === 'create'
? this.data.accounts[0].id ? this.data.accounts[0].id
: this.data.activity?.accountId, : this.data.activity?.accountId,
Validators.required Validators.required
@ -479,29 +483,29 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
}; };
try { try {
if (this.data.activity.id) { if (this.mode === 'create') {
(activity as UpdateOrderDto).id = this.data.activity.id; (activity as CreateOrderDto).updateAccountBalance =
this.activityForm.get('updateAccountBalance').value;
await validateObjectForForm({ await validateObjectForForm({
classDto: UpdateOrderDto, classDto: CreateOrderDto,
form: this.activityForm, form: this.activityForm,
ignoreFields: ['dataSource', 'date'], ignoreFields: ['dataSource', 'date'],
object: activity as UpdateOrderDto object: activity
}); });
this.dialogRef.close(activity as UpdateOrderDto); this.dialogRef.close(activity as CreateOrderDto);
} else { } else {
(activity as CreateOrderDto).updateAccountBalance = (activity as UpdateOrderDto).id = this.data.activity.id;
this.activityForm.get('updateAccountBalance').value;
await validateObjectForForm({ await validateObjectForForm({
classDto: CreateOrderDto, classDto: UpdateOrderDto,
form: this.activityForm, form: this.activityForm,
ignoreFields: ['dataSource', 'date'], ignoreFields: ['dataSource', 'date'],
object: activity object: activity as UpdateOrderDto
}); });
this.dialogRef.close(activity as CreateOrderDto); this.dialogRef.close(activity as UpdateOrderDto);
} }
} catch (error) { } catch (error) {
console.error(error); console.error(error);

15
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html

@ -4,10 +4,10 @@
(keyup.enter)="activityForm.valid && onSubmit()" (keyup.enter)="activityForm.valid && onSubmit()"
(ngSubmit)="onSubmit()" (ngSubmit)="onSubmit()"
> >
@if (data.activity.id) { @if (mode === 'create') {
<h1 i18n mat-dialog-title>Update activity</h1>
} @else {
<h1 i18n mat-dialog-title>Add activity</h1> <h1 i18n mat-dialog-title>Add activity</h1>
} @else {
<h1 i18n mat-dialog-title>Update activity</h1>
} }
<div class="flex-grow-1 py-3" mat-dialog-content> <div class="flex-grow-1 py-3" mat-dialog-content>
<div class="mb-3"> <div class="mb-3">
@ -76,16 +76,17 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div [ngClass]="{ 'mb-3': data.activity.id }"> <div [ngClass]="{ 'mb-3': mode === 'update' }">
<mat-form-field <mat-form-field
appearance="outline" appearance="outline"
class="w-100" class="w-100"
[ngClass]="{ 'mb-1 without-hint': !data.activity.id }" [ngClass]="{ 'mb-1 without-hint': mode === 'create' }"
> >
<mat-label i18n>Account</mat-label> <mat-label i18n>Account</mat-label>
<mat-select formControlName="accountId"> <mat-select formControlName="accountId">
@if ( @if (
!activityForm.get('accountId').hasValidator(Validators.required) !activityForm.get('accountId').hasValidator(Validators.required) ||
(!activityForm.get('accountId').value && mode === 'update')
) { ) {
<mat-option [value]="null" /> <mat-option [value]="null" />
} }
@ -106,7 +107,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="mb-3" [ngClass]="{ 'd-none': data.activity.id }"> <div class="mb-3" [ngClass]="{ 'd-none': mode === 'update' }">
<mat-checkbox color="primary" formControlName="updateAccountBalance" i18n <mat-checkbox color="primary" formControlName="updateAccountBalance" i18n
>Update Cash Balance</mat-checkbox >Update Cash Balance</mat-checkbox
> >

13
libs/common/src/lib/personal-finance-tools.ts

@ -76,7 +76,7 @@ export const personalFinanceTools: Product[] = [
key: 'capmon', key: 'capmon',
name: 'CapMon.org', name: 'CapMon.org',
origin: `Germany`, origin: `Germany`,
note: 'CapMon.org has discontinued in 2023', note: 'CapMon.org was discontinued in 2023',
slogan: 'Next Generation Assets Tracking' slogan: 'Next Generation Assets Tracking'
}, },
{ {
@ -223,7 +223,7 @@ export const personalFinanceTools: Product[] = [
hasSelfHostingAbility: false, hasSelfHostingAbility: false,
key: 'intuit-mint', key: 'intuit-mint',
name: 'Intuit Mint', name: 'Intuit Mint',
note: 'Intuit Mint has discontinued in 2023', note: 'Intuit Mint was discontinued in 2023',
origin: `United States`, origin: `United States`,
pricingPerYear: '$60', pricingPerYear: '$60',
slogan: 'Managing money, made simple' slogan: 'Managing money, made simple'
@ -286,7 +286,7 @@ export const personalFinanceTools: Product[] = [
key: 'maybe-finance', key: 'maybe-finance',
languages: ['English'], languages: ['English'],
name: 'Maybe Finance', name: 'Maybe Finance',
note: 'Maybe Finance has discontinued in 2023', note: 'Maybe Finance was discontinued in 2023',
origin: `United States`, origin: `United States`,
pricingPerYear: '$145', pricingPerYear: '$145',
regions: [`United States`], regions: [`United States`],
@ -386,7 +386,7 @@ export const personalFinanceTools: Product[] = [
hasFreePlan: true, hasFreePlan: true,
key: 'portfoloo', key: 'portfoloo',
name: 'Portfoloo', name: 'Portfoloo',
note: 'Portfoloo has discontinued', note: 'Portfoloo was discontinued',
slogan: slogan:
'Free Stock Portfolio Tracker with unlimited portfolio and stocks for DIY investors' 'Free Stock Portfolio Tracker with unlimited portfolio and stocks for DIY investors'
}, },
@ -451,7 +451,7 @@ export const personalFinanceTools: Product[] = [
hasFreePlan: true, hasFreePlan: true,
key: 'sharesmaster', key: 'sharesmaster',
name: 'SharesMaster', name: 'SharesMaster',
note: 'SharesMaster has discontinued', note: 'SharesMaster was discontinued',
slogan: 'Free Stock Portfolio Tracker' slogan: 'Free Stock Portfolio Tracker'
}, },
{ {
@ -492,7 +492,7 @@ export const personalFinanceTools: Product[] = [
key: 'stockmarketeye', key: 'stockmarketeye',
name: 'StockMarketEye', name: 'StockMarketEye',
origin: `France`, origin: `France`,
note: 'StockMarketEye has discontinued in 2023', note: 'StockMarketEye was discontinued in 2023',
slogan: 'A Powerful Portfolio & Investment Tracking App' slogan: 'A Powerful Portfolio & Investment Tracking App'
}, },
{ {
@ -593,6 +593,7 @@ export const personalFinanceTools: Product[] = [
key: 'yeekatee', key: 'yeekatee',
languages: ['Deutsch', 'English', 'Español', 'Français', 'Italiano'], languages: ['Deutsch', 'English', 'Español', 'Français', 'Italiano'],
name: 'yeekatee', name: 'yeekatee',
note: 'yeekatee was discontinued in 2024',
origin: `Switzerland`, origin: `Switzerland`,
regions: [`Global`], regions: [`Global`],
slogan: 'Connect. Share. Invest.' slogan: 'Connect. Share. Invest.'

Loading…
Cancel
Save