From b259ab7b0c62b4b261831a1acb7073f4252d51fe Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sun, 30 Jul 2023 18:49:38 +0200
Subject: [PATCH] Feature/add step by step introduction for new users (#2191)
* Add introduction for new users
* Update changelog
---
CHANGELOG.md | 6 +
apps/api/src/app/user/user.service.ts | 26 +++-
.../home-overview/home-overview.html | 145 ++++++++++++------
.../home-overview/home-overview.module.ts | 2 +
.../home-overview/home-overview.scss | 4 +
apps/client/src/locales/messages.de.xlf | 100 +++++++++++-
apps/client/src/locales/messages.es.xlf | 100 +++++++++++-
apps/client/src/locales/messages.fr.xlf | 100 +++++++++++-
apps/client/src/locales/messages.it.xlf | 100 +++++++++++-
apps/client/src/locales/messages.nl.xlf | 100 +++++++++++-
apps/client/src/locales/messages.pt.xlf | 100 +++++++++++-
apps/client/src/locales/messages.xlf | 90 ++++++++++-
12 files changed, 780 insertions(+), 93 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 255d9012..606cc970 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Added
+
+- Added a step by step introduction for new users
+
## 1.294.0 - 2023-07-29
### Changed
diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts
index 19ead8bd..3c1e42ab 100644
--- a/apps/api/src/app/user/user.service.ts
+++ b/apps/api/src/app/user/user.service.ts
@@ -14,6 +14,7 @@ import {
import { UserWithSettings } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { Prisma, Role, User } from '@prisma/client';
+import { differenceInDays } from 'date-fns';
import { sortBy } from 'lodash';
const crypto = require('crypto');
@@ -165,11 +166,26 @@ export class UserService {
user.subscription =
this.subscriptionService.getSubscription(Subscription);
- if (
- Analytics?.activityCount % 5 === 0 &&
- user.subscription?.type === 'Basic'
- ) {
- currentPermissions.push(permissions.enableSubscriptionInterstitial);
+ if (user.subscription?.type === 'Basic') {
+ const daysSinceRegistration = differenceInDays(
+ new Date(),
+ user.createdAt
+ );
+ let frequency = 20;
+
+ if (daysSinceRegistration > 180) {
+ frequency = 3;
+ } else if (daysSinceRegistration > 60) {
+ frequency = 5;
+ } else if (daysSinceRegistration > 30) {
+ frequency = 10;
+ } else if (daysSinceRegistration > 15) {
+ frequency = 15;
+ }
+
+ if (Analytics?.activityCount % frequency === 1) {
+ currentPermissions.push(permissions.enableSubscriptionInterstitial);
+ }
}
if (user.subscription?.type === 'Premium') {
diff --git a/apps/client/src/app/components/home-overview/home-overview.html b/apps/client/src/app/components/home-overview/home-overview.html
index 6c064402..c1173415 100644
--- a/apps/client/src/app/components/home-overview/home-overview.html
+++ b/apps/client/src/app/components/home-overview/home-overview.html
@@ -1,57 +1,110 @@
-
-
-
-
-
-
-
-
+
+
+ [locale]="user?.settings?.locale"
+ [performance]="performance"
+ [showDetails]="showDetails"
+ >
+
+
+
-
+
diff --git a/apps/client/src/app/components/home-overview/home-overview.module.ts b/apps/client/src/app/components/home-overview/home-overview.module.ts
index 68dbe6c5..e838775f 100644
--- a/apps/client/src/app/components/home-overview/home-overview.module.ts
+++ b/apps/client/src/app/components/home-overview/home-overview.module.ts
@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
+import { MatButtonModule } from '@angular/material/button';
import { RouterModule } from '@angular/router';
import { GfPortfolioPerformanceModule } from '@ghostfolio/client/components/portfolio-performance/portfolio-performance.module';
import { GfToggleModule } from '@ghostfolio/client/components/toggle/toggle.module';
@@ -16,6 +17,7 @@ import { HomeOverviewComponent } from './home-overview.component';
GfNoTransactionsInfoModule,
GfPortfolioPerformanceModule,
GfToggleModule,
+ MatButtonModule,
RouterModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
diff --git a/apps/client/src/app/components/home-overview/home-overview.scss b/apps/client/src/app/components/home-overview/home-overview.scss
index 92f086c5..9f8a1ce4 100644
--- a/apps/client/src/app/components/home-overview/home-overview.scss
+++ b/apps/client/src/app/components/home-overview/home-overview.scss
@@ -31,4 +31,8 @@
top: 0;
}
}
+
+ .introduction {
+ max-width: 50rem;
+ }
}
diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf
index a44079f7..bfed5626 100644
--- a/apps/client/src/locales/messages.de.xlf
+++ b/apps/client/src/locales/messages.de.xlf
@@ -978,7 +978,7 @@
apps/client/src/app/pages/public/public-page.html
- 140
+ 149
@@ -1954,7 +1954,7 @@
Nach Konto
apps/client/src/app/pages/portfolio/allocations/allocations-page.html
- 278
+ 287
@@ -2002,7 +2002,7 @@
Nach Land
apps/client/src/app/pages/portfolio/allocations/allocations-page.html
- 255
+ 264
@@ -2140,6 +2140,10 @@
Add activity
Aktivität hinzufügen
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 58
+
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html
8
@@ -2318,7 +2322,7 @@
Ghostfolio verschafft Ihnen den Überblick über Ihr Vermögen.
apps/client/src/app/pages/public/public-page.html
- 135,137
+ 144,146
@@ -2798,7 +2802,7 @@
Filtern nach Konto, Währung, Symbol oder Typ...
libs/ui/src/lib/activities-table/activities-table.component.ts
- 418
+ 419
@@ -3870,7 +3874,7 @@
Nach ETF-Anbieter
apps/client/src/app/pages/portfolio/allocations/allocations-page.html
- 298
+ 307
@@ -7085,6 +7089,90 @@
16
+
+ Welcome to Ghostfolio
+ Herzlich willkommen bei Ghostfolio
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 9
+
+
+
+ Setup your accounts
+ Konten einrichten
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 17
+
+
+
+ Get a comprehensive financial overview by adding your bank and brokerage accounts.
+ Verschaffe dir einen umfassenden Überblick, indem du deine Bank- und Wertpapierkonten hinzufügst.
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 19,20
+
+
+
+ Capture your activities
+ Aktivitäten erfassen
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 26
+
+
+
+ Record your investment activities to keep your portfolio up to date.
+ Erfasse deine Investitionsaktivitäten, um dein Portfolio auf dem neuesten Stand zu halten.
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 28,29
+
+
+
+ Monitor and analyze your portfolio
+ Portfolio überwachen und analysieren
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 35
+
+
+
+ Track your progress in real-time with comprehensive analysis and insights.
+ Verfolge die Entwicklung in Echtzeit mit umfassenden Analysen und Einblicken.
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 37,38
+
+
+
+ No data available
+ Keine Daten verfügbar
+
+ apps/client/src/app/pages/portfolio/allocations/allocations-page.html
+ 251
+
+
+ apps/client/src/app/pages/public/public-page.html
+ 120
+
+
+
+ Ready to take control of your personal finances?
+ Bist du bereit, die Kontrolle über deine Finanzen zu übernehmen?
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 10
+
+
+
+ Setup accounts
+ Konten einrichten
+
+ apps/client/src/app/components/home-overview/home-overview.html
+ 50
+
+