Browse Source

Bugfix/missing loading indicator in benchmarks table on markets page (#7634)

* Fix missing loading indicator in benchmark component

* Update changelog
pull/7629/head^2
Thomas Kaul 3 days ago
committed by GitHub
parent
commit
aeaec40c8f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 11
      apps/client/src/app/components/home-watchlist/home-watchlist.component.ts
  3. 11
      apps/client/src/app/components/markets/markets.component.ts
  4. 2
      apps/client/src/app/components/markets/markets.html
  5. 2
      libs/ui/src/lib/benchmark/benchmark.component.html
  6. 13
      libs/ui/src/lib/benchmark/benchmark.component.ts

2
CHANGELOG.md

@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed the missing currency conversion of the dividends on the analysis page - Fixed the missing currency conversion of the dividends on the analysis page
- Fixed the missing error state in the watchlist
- Fixed the missing loading indicator in the benchmarks of the markets overview
## 3.51.0 - 2026-08-14 ## 3.51.0 - 2026-08-14

11
apps/client/src/app/components/home-watchlist/home-watchlist.component.ts

@ -128,10 +128,17 @@ export class GfHomeWatchlistComponent implements OnInit {
this.dataService this.dataService
.fetchWatchlist() .fetchWatchlist()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ watchlist }) => { .subscribe({
this.watchlist = watchlist; error: () => {
this.watchlist = [];
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
},
next: ({ watchlist }) => {
this.watchlist = watchlist ?? [];
this.changeDetectorRef.markForCheck();
}
}); });
} }

11
apps/client/src/app/components/markets/markets.component.ts

@ -43,7 +43,7 @@ import { DeviceDetectorService } from 'ngx-device-detector';
templateUrl: './markets.html' templateUrl: './markets.html'
}) })
export class GfMarketsComponent implements OnInit { export class GfMarketsComponent implements OnInit {
protected readonly benchmarks = signal<Benchmark[]>([]); protected readonly benchmarks = signal<Benchmark[] | undefined>(undefined);
protected readonly deviceType = computed( protected readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType () => this.deviceDetectorService.deviceInfo().deviceType
@ -117,8 +117,13 @@ export class GfMarketsComponent implements OnInit {
this.dataService this.dataService
.fetchBenchmarks() .fetchBenchmarks()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ benchmarks }) => { .subscribe({
this.benchmarks.set(benchmarks); error: () => {
this.benchmarks.set([]);
},
next: ({ benchmarks }) => {
this.benchmarks.set(benchmarks ?? []);
}
}); });
} }

2
apps/client/src/app/components/markets/markets.html

@ -56,7 +56,7 @@
[showSymbol]="false" [showSymbol]="false"
[user]="user" [user]="user"
/> />
@if (benchmarks()?.length > 0) { @if (benchmarks()?.length) {
<div <div
class="gf-text-wrap-balance line-height-1 mt-3 text-center text-muted" class="gf-text-wrap-balance line-height-1 mt-3 text-center text-muted"
> >

2
libs/ui/src/lib/benchmark/benchmark.component.html

@ -216,7 +216,7 @@
</table> </table>
</div> </div>
@if (isLoading) { @if (isLoading()) {
<ngx-skeleton-loader <ngx-skeleton-loader
animation="pulse" animation="pulse"
class="px-4 py-3" class="px-4 py-3"

13
libs/ui/src/lib/benchmark/benchmark.component.ts

@ -63,7 +63,7 @@ import { BenchmarkDetailDialogParams } from './benchmark-detail-dialog/interface
templateUrl: './benchmark.component.html' templateUrl: './benchmark.component.html'
}) })
export class GfBenchmarkComponent { export class GfBenchmarkComponent {
public readonly benchmarks = input.required<Benchmark[]>(); public readonly benchmarks = input<Benchmark[]>();
public readonly deviceType = input.required<string>(); public readonly deviceType = input.required<string>();
public readonly hasPermissionToDeleteItem = input<boolean>(); public readonly hasPermissionToDeleteItem = input<boolean>();
public readonly locale = input(getLocale()); public readonly locale = input(getLocale());
@ -76,6 +76,7 @@ export class GfBenchmarkComponent {
protected readonly sort = viewChild(MatSort); protected readonly sort = viewChild(MatSort);
protected readonly dataSource = new MatTableDataSource<Benchmark>([]); protected readonly dataSource = new MatTableDataSource<Benchmark>([]);
protected readonly displayedColumns = computed(() => { protected readonly displayedColumns = computed(() => {
return [ return [
...(this.showIcon() ? ['icon'] : []), ...(this.showIcon() ? ['icon'] : []),
@ -89,7 +90,11 @@ export class GfBenchmarkComponent {
'actions' 'actions'
]; ];
}); });
protected isLoading = true;
protected readonly isLoading = computed(() => {
return !this.benchmarks();
});
protected readonly isNumber = isNumber; protected readonly isNumber = isNumber;
protected readonly resolveMarketCondition = resolveMarketCondition; protected readonly resolveMarketCondition = resolveMarketCondition;
protected readonly round = round; protected readonly round = round;
@ -110,8 +115,8 @@ export class GfBenchmarkComponent {
this.dataSource.sortingDataAccessor = getLowercase; this.dataSource.sortingDataAccessor = getLowercase;
this.dataSource.sort = this.sort() ?? null; this.dataSource.sort = this.sort() ?? null;
} else {
this.isLoading = false; this.dataSource.data = [];
} }
}); });

Loading…
Cancel
Save