Browse Source

Merge branch 'main' into task/upgrade-ngx-skeleton-loader-to-version-12.0.0

pull/6304/head
Thomas Kaul 2 months ago
committed by GitHub
parent
commit
63c8aec12b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      README.md
  3. 1
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
  4. 8
      apps/client/src/app/pages/about/overview/about-overview-page.html
  5. 1
      apps/client/src/app/pages/accounts/accounts-page.html
  6. 38
      libs/ui/src/lib/accounts-table/accounts-table.component.html
  7. 3
      libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts
  8. 165
      libs/ui/src/lib/accounts-table/accounts-table.component.ts
  9. 26
      libs/ui/src/lib/activities-table/activities-table.component.stories.ts
  10. 8
      package-lock.json
  11. 2
      package.json

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Upgraded `ngx-skeleton-loader` from version `11.3.0` to `12.0.0`
- Upgraded `twitter-api-v2` from version `1.27.0` to `1.29.0`
## 2.237.0 - 2026-02-08

4
README.md

@ -318,8 +318,8 @@ If you like to support this project, become a [**Sponsor**](https://github.com/s
## Sponsors
<div align="center">
<a href="https://www.testmu.ai?utm_medium=sponsor&utm_source=ghostfolio" target="_blank" title="TestMu AI - AI Powered Testing Tool">
<img alt="TestMu AI Logo" height="45" src="https://assets.testmu.ai/resources/images/logos/logo.svg" />
<a href="https://www.testmuai.com?utm_medium=sponsor&utm_source=ghostfolio" target="_blank" title="TestMu AI - AI Powered Testing Tool">
<img alt="TestMu AI Logo" height="45" src="https://assets.testmuai.com/resources/images/logos/logo.svg" />
</a>
</div>

1
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html

@ -377,7 +377,6 @@
<gf-accounts-table
[accounts]="accounts"
[baseCurrency]="user?.settings?.baseCurrency"
[deviceType]="data.deviceType"
[hasPermissionToOpenDetails]="false"
[locale]="user?.settings?.locale"
[showActivitiesCount]="false"

8
apps/client/src/app/pages/about/overview/about-overview-page.html

@ -209,7 +209,7 @@
<div class="text-center">
<div class="mb-2 small">Browser testing via</div>
<a
href="https://www.testmu.ai?utm_medium=sponsor&utm_source=ghostfolio"
href="https://www.testmuai.com?utm_medium=sponsor&utm_source=ghostfolio"
target="_blank"
title="TestMu AI - AI Powered Testing Tool"
>
@ -217,9 +217,9 @@
alt="TestMu AI Logo"
height="32"
[src]="
user?.settings?.colorScheme === 'LIGHT'
? '../assets/images/sponsors/logo-testmu-dark.svg'
: '../assets/images/sponsors/logo-testmu-light.svg'
user?.settings?.colorScheme === 'DARK'
? '../assets/images/sponsors/logo-testmu-light.svg'
: '../assets/images/sponsors/logo-testmu-dark.svg'
"
/>
</a>

1
apps/client/src/app/pages/accounts/accounts-page.html

@ -6,7 +6,6 @@
[accounts]="accounts"
[activitiesCount]="activitiesCount"
[baseCurrency]="user?.settings?.baseCurrency"
[deviceType]="deviceType"
[locale]="user?.settings?.locale"
[showActions]="
!hasImpersonationId &&

38
libs/ui/src/lib/accounts-table/accounts-table.component.html

@ -1,4 +1,4 @@
@if (showActions) {
@if (showActions()) {
<div class="d-flex justify-content-end">
<button
class="align-items-center d-flex"
@ -79,7 +79,7 @@
{{ element.currency }}
</td>
<td *matFooterCellDef class="d-none d-lg-table-cell px-1" mat-footer-cell>
{{ baseCurrency }}
{{ baseCurrency() }}
</td>
</ng-container>
@ -129,7 +129,7 @@
{{ element.activitiesCount }}
</td>
<td *matFooterCellDef class="px-1 text-right" mat-footer-cell>
{{ activitiesCount }}
{{ activitiesCount() }}
</td>
</ng-container>
@ -150,7 +150,7 @@
<gf-value
class="d-inline-block justify-content-end"
[isCurrency]="true"
[locale]="locale"
[locale]="locale()"
[value]="element.balance"
/>
</td>
@ -162,8 +162,8 @@
<gf-value
class="d-inline-block justify-content-end"
[isCurrency]="true"
[locale]="locale"
[value]="totalBalanceInBaseCurrency"
[locale]="locale()"
[value]="totalBalanceInBaseCurrency()"
/>
</td>
</ng-container>
@ -185,7 +185,7 @@
<gf-value
class="d-inline-block justify-content-end"
[isCurrency]="true"
[locale]="locale"
[locale]="locale()"
[value]="element.value"
/>
</td>
@ -197,8 +197,8 @@
<gf-value
class="d-inline-block justify-content-end"
[isCurrency]="true"
[locale]="locale"
[value]="totalValueInBaseCurrency"
[locale]="locale()"
[value]="totalValueInBaseCurrency()"
/>
</td>
</ng-container>
@ -220,7 +220,7 @@
<gf-value
class="d-inline-block justify-content-end"
[isCurrency]="true"
[locale]="locale"
[locale]="locale()"
[value]="element.valueInBaseCurrency"
/>
</td>
@ -232,8 +232,8 @@
<gf-value
class="d-inline-block justify-content-end"
[isCurrency]="true"
[locale]="locale"
[value]="totalValueInBaseCurrency"
[locale]="locale()"
[value]="totalValueInBaseCurrency()"
/>
</td>
</ng-container>
@ -255,7 +255,7 @@
<gf-value
class="d-inline-block justify-content-end"
[isPercent]="true"
[locale]="locale"
[locale]="locale()"
[precision]="2"
[value]="element.allocationInPercentage"
/>
@ -336,24 +336,24 @@
<td *matFooterCellDef class="px-1" mat-footer-cell></td>
</ng-container>
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr>
<tr *matHeaderRowDef="displayedColumns()" mat-header-row></tr>
<tr
*matRowDef="let row; columns: displayedColumns"
*matRowDef="let row; columns: displayedColumns()"
mat-row
[ngClass]="{
'cursor-pointer': hasPermissionToOpenDetails
'cursor-pointer': hasPermissionToOpenDetails()
}"
(click)="onOpenAccountDetailDialog(row.id)"
></tr>
<tr
*matFooterRowDef="displayedColumns"
*matFooterRowDef="displayedColumns()"
mat-footer-row
[ngClass]="{ 'd-none': isLoading || !showFooter }"
[ngClass]="{ 'd-none': isLoading() || !showFooter() }"
></tr>
</table>
</div>
@if (isLoading) {
@if (isLoading()) {
<ngx-skeleton-loader
animation="pulse"
class="px-4 py-3"

3
libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts

@ -111,7 +111,6 @@ export const Loading: Story = {
args: {
accounts: undefined,
baseCurrency: 'USD',
deviceType: 'desktop',
hasPermissionToOpenDetails: false,
locale: 'en-US',
showActions: false,
@ -129,7 +128,6 @@ export const Default: Story = {
accounts,
activitiesCount: 12,
baseCurrency: 'USD',
deviceType: 'desktop',
hasPermissionToOpenDetails: false,
locale: 'en-US',
showActions: false,
@ -149,7 +147,6 @@ export const WithoutFooter: Story = {
accounts,
activitiesCount: 12,
baseCurrency: 'USD',
deviceType: 'desktop',
hasPermissionToOpenDetails: false,
locale: 'en-US',
showActions: false,

165
libs/ui/src/lib/accounts-table/accounts-table.component.ts

@ -8,12 +8,12 @@ import { CommonModule } from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
EventEmitter,
Input,
OnChanges,
OnDestroy,
Output,
ViewChild
computed,
effect,
inject,
input,
output,
viewChild
} from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';
@ -33,7 +33,6 @@ import {
walletOutline
} from 'ionicons/icons';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { Subject, Subscription } from 'rxjs';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
@ -53,95 +52,94 @@ import { Subject, Subscription } from 'rxjs';
styleUrls: ['./accounts-table.component.scss'],
templateUrl: './accounts-table.component.html'
})
export class GfAccountsTableComponent implements OnChanges, OnDestroy {
@Input() accounts: Account[];
@Input() activitiesCount: number;
@Input() baseCurrency: string;
@Input() deviceType: string;
@Input() hasPermissionToOpenDetails = true;
@Input() locale = getLocale();
@Input() showActions: boolean;
@Input() showActivitiesCount = true;
@Input() showAllocationInPercentage: boolean;
@Input() showBalance = true;
@Input() showFooter = true;
@Input() showValue = true;
@Input() showValueInBaseCurrency = true;
@Input() totalBalanceInBaseCurrency: number;
@Input() totalValueInBaseCurrency: number;
@Output() accountDeleted = new EventEmitter<string>();
@Output() accountToUpdate = new EventEmitter<Account>();
@Output() transferBalance = new EventEmitter<void>();
@ViewChild(MatSort) sort: MatSort;
public dataSource = new MatTableDataSource<Account>();
public displayedColumns = [];
public isLoading = true;
public routeQueryParams: Subscription;
private unsubscribeSubject = new Subject<void>();
public constructor(
private notificationService: NotificationService,
private router: Router
) {
addIcons({
arrowRedoOutline,
createOutline,
documentTextOutline,
ellipsisHorizontal,
eyeOffOutline,
trashOutline,
walletOutline
});
}
public ngOnChanges() {
this.displayedColumns = ['status', 'account', 'platform'];
if (this.showActivitiesCount) {
this.displayedColumns.push('activitiesCount');
export class GfAccountsTableComponent {
public readonly accounts = input.required<Account[] | undefined>();
public readonly activitiesCount = input<number>();
public readonly baseCurrency = input<string>();
public readonly hasPermissionToOpenDetails = input(true);
public readonly locale = input(getLocale());
public readonly showActions = input<boolean>();
public readonly showActivitiesCount = input(true);
public readonly showAllocationInPercentage = input<boolean>();
public readonly showBalance = input(true);
public readonly showFooter = input(true);
public readonly showValue = input(true);
public readonly showValueInBaseCurrency = input(false);
public readonly totalBalanceInBaseCurrency = input<number>();
public readonly totalValueInBaseCurrency = input<number>();
public readonly accountDeleted = output<string>();
public readonly accountToUpdate = output<Account>();
public readonly transferBalance = output<void>();
public readonly sort = viewChild.required(MatSort);
protected readonly dataSource = new MatTableDataSource<Account>([]);
protected readonly displayedColumns = computed(() => {
const columns = ['status', 'account', 'platform'];
if (this.showActivitiesCount()) {
columns.push('activitiesCount');
}
if (this.showBalance) {
this.displayedColumns.push('balance');
if (this.showBalance()) {
columns.push('balance');
}
if (this.showValue) {
this.displayedColumns.push('value');
if (this.showValue()) {
columns.push('value');
}
this.displayedColumns.push('currency');
columns.push('currency');
if (this.showValueInBaseCurrency) {
this.displayedColumns.push('valueInBaseCurrency');
if (this.showValueInBaseCurrency()) {
columns.push('valueInBaseCurrency');
}
if (this.showAllocationInPercentage) {
this.displayedColumns.push('allocation');
if (this.showAllocationInPercentage()) {
columns.push('allocation');
}
this.displayedColumns.push('comment');
columns.push('comment');
if (this.showActions) {
this.displayedColumns.push('actions');
if (this.showActions()) {
columns.push('actions');
}
this.isLoading = true;
return columns;
});
protected readonly isLoading = computed(() => !this.accounts());
private readonly notificationService = inject(NotificationService);
private readonly router = inject(Router);
public constructor() {
addIcons({
arrowRedoOutline,
createOutline,
documentTextOutline,
ellipsisHorizontal,
eyeOffOutline,
trashOutline,
walletOutline
});
this.dataSource = new MatTableDataSource(this.accounts);
this.dataSource.sortingDataAccessor = getLowercase;
this.dataSource.sort = this.sort;
// Reactive data update
effect(() => {
this.dataSource.data = this.accounts();
});
if (this.accounts) {
this.isLoading = false;
}
// Reactive view connection
effect(() => {
this.dataSource.sort = this.sort();
});
}
public onDeleteAccount(aId: string) {
protected onDeleteAccount(aId: string) {
this.notificationService.confirm({
confirmFn: () => {
this.accountDeleted.emit(aId);
@ -151,30 +149,25 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy {
});
}
public onOpenAccountDetailDialog(accountId: string) {
if (this.hasPermissionToOpenDetails) {
protected onOpenAccountDetailDialog(accountId: string) {
if (this.hasPermissionToOpenDetails()) {
this.router.navigate([], {
queryParams: { accountId, accountDetailDialog: true }
});
}
}
public onOpenComment(aComment: string) {
protected onOpenComment(aComment: string) {
this.notificationService.alert({
title: aComment
});
}
public onTransferBalance() {
protected onTransferBalance() {
this.transferBalance.emit();
}
public onUpdateAccount(aAccount: Account) {
protected onUpdateAccount(aAccount: Account) {
this.accountToUpdate.emit(aAccount);
}
public ngOnDestroy() {
this.unsubscribeSubject.next();
this.unsubscribeSubject.complete();
}
}

26
libs/ui/src/lib/activities-table/activities-table.component.stories.ts

@ -59,7 +59,7 @@ const activities: Activity[] = [
SymbolProfile: {
assetClass: 'EQUITY',
assetSubClass: 'ETF',
comment: null,
comment: undefined,
countries: [],
createdAt: new Date('2021-06-06T16:12:20.982Z'),
currency: 'USD',
@ -74,12 +74,12 @@ const activities: Activity[] = [
isin: 'US9220427424',
name: 'Vanguard Total World Stock Index Fund ETF Shares',
updatedAt: new Date('2025-10-01T20:09:39.500Z'),
scraperConfiguration: null,
scraperConfiguration: undefined,
sectors: [],
symbol: 'VT',
symbolMapping: {},
url: 'https://www.vanguard.com',
userId: null,
userId: undefined,
activitiesCount: 267,
dateOfFirstActivity: new Date('2018-05-31T16:00:00.000Z')
},
@ -126,7 +126,7 @@ const activities: Activity[] = [
SymbolProfile: {
assetClass: 'EQUITY',
assetSubClass: 'ETF',
comment: null,
comment: undefined,
countries: [],
createdAt: new Date('2021-06-06T16:12:20.982Z'),
currency: 'USD',
@ -141,12 +141,12 @@ const activities: Activity[] = [
isin: 'US9220427424',
name: 'Vanguard Total World Stock Index Fund ETF Shares',
updatedAt: new Date('2025-10-01T20:09:39.500Z'),
scraperConfiguration: null,
scraperConfiguration: undefined,
sectors: [],
symbol: 'VT',
symbolMapping: {},
url: 'https://www.vanguard.com',
userId: null,
userId: undefined,
activitiesCount: 267,
dateOfFirstActivity: new Date('2018-05-31T16:00:00.000Z')
},
@ -193,7 +193,7 @@ const activities: Activity[] = [
SymbolProfile: {
assetClass: 'LIQUIDITY',
assetSubClass: 'CRYPTOCURRENCY',
comment: null,
comment: undefined,
countries: [],
createdAt: new Date('2024-03-12T15:15:21.217Z'),
currency: 'USD',
@ -208,12 +208,12 @@ const activities: Activity[] = [
isin: 'CA4639181029',
name: 'iShares Bitcoin Trust',
updatedAt: new Date('2025-09-29T03:14:07.742Z'),
scraperConfiguration: null,
scraperConfiguration: undefined,
sectors: [],
symbol: 'IBIT',
symbolMapping: {},
url: 'https://www.ishares.com',
userId: null,
userId: undefined,
activitiesCount: 6,
dateOfFirstActivity: new Date('2024-01-01T08:00:00.000Z')
},
@ -280,7 +280,7 @@ const activities: Activity[] = [
symbol: 'BNDW',
symbolMapping: {},
url: 'https://vanguard.com',
userId: null,
userId: undefined,
activitiesCount: 38,
dateOfFirstActivity: new Date('2022-04-13T20:05:48.742Z')
},
@ -327,7 +327,7 @@ const activities: Activity[] = [
SymbolProfile: {
assetClass: 'EQUITY',
assetSubClass: 'ETF',
comment: null,
comment: undefined,
countries: [],
createdAt: new Date('2021-06-06T16:12:20.982Z'),
currency: 'USD',
@ -342,12 +342,12 @@ const activities: Activity[] = [
isin: 'US9220427424',
name: 'Vanguard Total World Stock Index Fund ETF Shares',
updatedAt: new Date('2025-10-01T20:09:39.500Z'),
scraperConfiguration: null,
scraperConfiguration: undefined,
sectors: [],
symbol: 'VT',
symbolMapping: {},
url: 'https://www.vanguard.com',
userId: null,
userId: undefined,
activitiesCount: 267,
dateOfFirstActivity: new Date('2018-05-31T16:00:00.000Z')
},

8
package-lock.json

@ -88,7 +88,7 @@
"stripe": "20.3.0",
"svgmap": "2.14.0",
"tablemark": "4.1.0",
"twitter-api-v2": "1.27.0",
"twitter-api-v2": "1.29.0",
"yahoo-finance2": "3.13.0",
"zone.js": "0.16.0"
},
@ -33383,9 +33383,9 @@
}
},
"node_modules/twitter-api-v2": {
"version": "1.27.0",
"resolved": "https://registry.npmjs.org/twitter-api-v2/-/twitter-api-v2-1.27.0.tgz",
"integrity": "sha512-hbIFwzg0NeOcFOdmJqtKMCXjLjc0INff/7NwhnZ2zpnw65oku8i+0eMxo5M0iTc1hs+inD/IpDw3S0Xh2c45QQ==",
"version": "1.29.0",
"resolved": "https://registry.npmjs.org/twitter-api-v2/-/twitter-api-v2-1.29.0.tgz",
"integrity": "sha512-v473q5bwme4N+DWSg6qY+JCvfg1nSJRWwui3HUALafxfqCvVkKiYmS/5x/pVeJwTmyeBxexMbzHwnzrH4h6oYQ==",
"license": "Apache-2.0"
},
"node_modules/type-check": {

2
package.json

@ -132,7 +132,7 @@
"stripe": "20.3.0",
"svgmap": "2.14.0",
"tablemark": "4.1.0",
"twitter-api-v2": "1.27.0",
"twitter-api-v2": "1.29.0",
"yahoo-finance2": "3.13.0",
"zone.js": "0.16.0"
},

Loading…
Cancel
Save