Skip to content

Commit f63d171

Browse files
authored
Feature/improve usability of no activities info (ghostfolio#4382)
* Improve usability * Update changelog
1 parent 3b68400 commit f63d171

File tree

7 files changed

+35
-15
lines changed

7 files changed

+35
-15
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
- Optimized the asynchronous operations using `Promise.all()` in the portfolio service (`getPerformance`)
1818
- Improved the symbol lookup in the _Trackinsight_ data enhancer for asset profile data
19+
- Removed the no transactions info component from the holdings table on the home page
20+
- Refactored the show condition of the step by step introduction for new users using the activities count
1921
- Upgraded `color` from version `4.2.3` to `5.0.0`
2022
- Upgraded `prisma` from version `6.3.0` to `6.4.1`
2123

Diff for: apps/client/src/app/components/home-holdings/home-holdings.html

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ <h1 class="d-none d-sm-block h3 mb-3 text-center" i18n>Holdings</h1>
4848
<gf-holdings-table
4949
[baseCurrency]="user?.settings?.baseCurrency"
5050
[deviceType]="deviceType"
51-
[hasPermissionToCreateActivity]="hasPermissionToCreateOrder"
5251
[holdings]="holdings"
5352
[locale]="user?.settings?.locale"
5453
(holdingClicked)="onHoldingClicked($event)"

Diff for: apps/client/src/app/components/home-overview/home-overview.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div
22
class="align-items-center container d-flex flex-column h-100 justify-content-center overview p-0 position-relative"
33
>
4-
@if (hasPermissionToCreateOrder && historicalDataItems?.length === 0) {
4+
@if (hasPermissionToCreateOrder && user?.activitiesCount === 0) {
55
<div class="justify-content-center row w-100">
66
<div class="col introduction">
77
<h4 i18n>Welcome to Ghostfolio</h4>

Diff for: apps/client/src/app/pages/portfolio/activities/activities-page.component.ts

+29-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
125125
this.dataSource = new MatTableDataSource(activities);
126126
this.totalItems = count;
127127

128-
if (this.hasPermissionToCreateActivity && this.totalItems <= 0) {
128+
if (
129+
this.hasPermissionToCreateActivity &&
130+
this.user?.activitiesCount === 0
131+
) {
129132
this.router.navigate([], { queryParams: { createDialog: true } });
130133
}
131134

@@ -160,6 +163,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
160163
})
161164
.pipe(takeUntil(this.unsubscribeSubject))
162165
.subscribe(() => {
166+
this.userService
167+
.get(true)
168+
.pipe(takeUntil(this.unsubscribeSubject))
169+
.subscribe();
170+
163171
this.fetchActivities();
164172
});
165173
}
@@ -169,6 +177,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
169177
.deleteActivity(aId)
170178
.pipe(takeUntil(this.unsubscribeSubject))
171179
.subscribe(() => {
180+
this.userService
181+
.get(true)
182+
.pipe(takeUntil(this.unsubscribeSubject))
183+
.subscribe();
184+
172185
this.fetchActivities();
173186
});
174187
}
@@ -230,6 +243,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
230243
.afterClosed()
231244
.pipe(takeUntil(this.unsubscribeSubject))
232245
.subscribe(() => {
246+
this.userService
247+
.get(true)
248+
.pipe(takeUntil(this.unsubscribeSubject))
249+
.subscribe();
250+
233251
this.fetchActivities();
234252
});
235253
}
@@ -248,6 +266,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
248266
.afterClosed()
249267
.pipe(takeUntil(this.unsubscribeSubject))
250268
.subscribe(() => {
269+
this.userService
270+
.get(true)
271+
.pipe(takeUntil(this.unsubscribeSubject))
272+
.subscribe();
273+
251274
this.fetchActivities();
252275
});
253276
}
@@ -333,6 +356,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
333356
if (transaction) {
334357
this.dataService.postOrder(transaction).subscribe({
335358
next: () => {
359+
this.userService
360+
.get(true)
361+
.pipe(takeUntil(this.unsubscribeSubject))
362+
.subscribe();
363+
336364
this.fetchActivities();
337365
}
338366
});

Diff for: apps/client/src/app/pages/portfolio/activities/activities-page.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ <h1 class="d-none d-sm-block h3 mb-3 text-center" i18n>Activities</h1>
66
[baseCurrency]="user?.settings?.baseCurrency"
77
[dataSource]="dataSource"
88
[deviceType]="deviceType"
9-
[hasPermissionToCreateActivity]="hasPermissionToCreateActivity"
9+
[hasPermissionToCreateActivity]="
10+
hasPermissionToCreateActivity && user?.activitiesCount === 0
11+
"
1012
[hasPermissionToDeleteActivity]="hasPermissionToDeleteActivity"
1113
[hasPermissionToExportActivities]="!hasImpersonationId"
1214
[locale]="user?.settings?.locale"

Diff for: libs/ui/src/lib/holdings-table/holdings-table.component.html

-8
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,3 @@
198198
</button>
199199
</div>
200200
}
201-
202-
@if (
203-
dataSource.data.length === 0 && hasPermissionToCreateActivity && !isLoading
204-
) {
205-
<div class="p-3 text-center">
206-
<gf-no-transactions-info-indicator [hasBorder]="false" />
207-
</div>
208-
}

Diff for: libs/ui/src/lib/holdings-table/holdings-table.component.ts

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
AssetProfileIdentifier,
66
PortfolioPosition
77
} from '@ghostfolio/common/interfaces';
8-
import { GfNoTransactionsInfoComponent } from '@ghostfolio/ui/no-transactions-info';
98
import { GfValueComponent } from '@ghostfolio/ui/value';
109

1110
import { CommonModule } from '@angular/common';
@@ -34,7 +33,6 @@ import { Subject, Subscription } from 'rxjs';
3433
imports: [
3534
CommonModule,
3635
GfAssetProfileIconComponent,
37-
GfNoTransactionsInfoComponent,
3836
GfSymbolModule,
3937
GfValueComponent,
4038
MatButtonModule,
@@ -52,7 +50,6 @@ import { Subject, Subscription } from 'rxjs';
5250
export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
5351
@Input() baseCurrency: string;
5452
@Input() deviceType: string;
55-
@Input() hasPermissionToCreateActivity: boolean;
5653
@Input() hasPermissionToOpenDetails = true;
5754
@Input() hasPermissionToShowValues = true;
5855
@Input() holdings: PortfolioPosition[];

0 commit comments

Comments
 (0)