From 8818e09be8ffbe123c81fd17fc9938fe56d9761f Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 31 Dec 2022 17:06:15 +0100 Subject: [PATCH 1/8] Feature/add prefix to coupon codes (#1562) * Add prefix * Update changelog --- CHANGELOG.md | 6 ++++++ .../components/admin-overview/admin-overview.component.ts | 6 +++++- libs/common/src/lib/config.ts | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 939f5ea5d..134f7d431 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 prefix to the codes of the coupon system + ## 1.222.0 - 2022-12-29 ### Added diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts index f629b620d..e528e748b 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts +++ b/apps/client/src/app/components/admin-overview/admin-overview.component.ts @@ -4,6 +4,7 @@ import { CacheService } from '@ghostfolio/client/services/cache.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { + ghostfolioPrefix, PROPERTY_COUPONS, PROPERTY_CURRENCIES, PROPERTY_IS_READ_ONLY_MODE, @@ -97,7 +98,10 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { public onAddCoupon() { const coupons = [ ...this.coupons, - { code: this.generateCouponCode(16), duration: this.couponDuration } + { + code: `${ghostfolioPrefix}${this.generateCouponCode(14)}`, + duration: this.couponDuration + } ]; this.putAdminSetting({ key: PROPERTY_COUPONS, value: coupons }); } diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index 7b34aaf33..5c8529231 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -4,7 +4,8 @@ import ms from 'ms'; export const DEMO_USER_ID = '9b112b4d-3b7d-4bad-9bdd-3b0f7b4dac2f'; -export const ghostfolioScraperApiSymbolPrefix = '_GF_'; +export const ghostfolioPrefix = 'GF'; +export const ghostfolioScraperApiSymbolPrefix = `_${ghostfolioPrefix}_`; export const ghostfolioCashSymbol = `${ghostfolioScraperApiSymbolPrefix}CASH`; export const ghostfolioFearAndGreedIndexDataSource = DataSource.RAPID_API; export const ghostfolioFearAndGreedIndexSymbol = `${ghostfolioScraperApiSymbolPrefix}FEAR_AND_GREED_INDEX`; From 0509f0101ff1e64d63a2333d3877b5f13b87e852 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 1 Jan 2023 09:22:38 +0100 Subject: [PATCH 2/8] Feature/add student discount (#1563) * Add student discount * Update changelog --- CHANGELOG.md | 1 + apps/client/src/app/pages/pricing/pricing-page.html | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 134f7d431..d3d5c5c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added a student discount to the pricing page - Added a prefix to the codes of the coupon system ## 1.222.0 - 2022-12-29 diff --git a/apps/client/src/app/pages/pricing/pricing-page.html b/apps/client/src/app/pages/pricing/pricing-page.html index d8ddeedc3..7a9604300 100644 --- a/apps/client/src/app/pages/pricing/pricing-page.html +++ b/apps/client/src/app/pages/pricing/pricing-page.html @@ -18,7 +18,9 @@ >contact us to use our referral link and get a Ghostfolio Premium membership for - one year. + one year. Looking for a student discount? Request it + here with + your university email address.
If you prefer to run Ghostfolio on your own infrastructure, please
From eb4d088a80ca2311a75795479ded497f6d03128e Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sun, 1 Jan 2023 09:57:27 +0100
Subject: [PATCH 3/8] Feature/optimize page title for mobile (#1564)
* Optimize page title for mobile
* Update changelog
---
CHANGELOG.md | 4 +
apps/client/src/app/app.component.html | 1 +
apps/client/src/app/app.component.ts | 23 +++-
.../components/header/header.component.html | 7 +-
.../app/components/header/header.component.ts | 1 +
.../components/home-market/home-market.html | 2 +-
.../components/home-summary/home-summary.html | 4 +-
.../src/app/pages/about/about-page.html | 2 +-
.../privacy-policy/privacy-policy-page.html | 2 +-
.../src/app/pages/account/account-page.html | 2 +-
.../src/app/pages/accounts/accounts-page.html | 4 +-
.../pages/admin/admin-page-routing.module.ts | 19 ++-
apps/client/src/app/pages/blog/blog-page.html | 2 +-
apps/client/src/app/pages/faq/faq-page.html | 4 +-
.../src/app/pages/features/features-page.html | 2 +-
.../pages/home/home-page-routing.module.ts | 26 +++-
.../src/app/pages/landing/landing-page.html | 2 +-
.../portfolio/activities/activities-page.html | 2 +-
.../allocations/allocations-page.html | 2 +-
.../portfolio/analysis/analysis-page.html | 2 +-
.../app/pages/portfolio/fire/fire-page.html | 6 +-
.../portfolio/holdings/holdings-page.html | 2 +-
.../src/app/pages/pricing/pricing-page.html | 4 +-
.../public/public-page-routing.module.ts | 3 +-
.../app/pages/resources/resources-page.html | 2 +-
apps/client/src/locales/messages.de.xlf | 116 ++++++++++++------
apps/client/src/locales/messages.es.xlf | 116 ++++++++++++------
apps/client/src/locales/messages.it.xlf | 116 ++++++++++++------
apps/client/src/locales/messages.nl.xlf | 116 ++++++++++++------
apps/client/src/locales/messages.xlf | 112 +++++++++++------
libs/ui/src/lib/logo/logo.component.html | 2 +-
libs/ui/src/lib/logo/logo.component.scss | 24 ++--
.../ui/src/lib/logo/logo.component.stories.ts | 6 +-
libs/ui/src/lib/logo/logo.component.ts | 12 +-
libs/ui/src/lib/logo/logo.module.ts | 1 -
.../no-transactions-info.component.html | 6 +-
36 files changed, 487 insertions(+), 270 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3d5c5c30..24149c9b6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a student discount to the pricing page
- Added a prefix to the codes of the coupon system
+### Changed
+
+- Optimized the page titles in the header for mobile
+
## 1.222.0 - 2022-12-29
### Added
diff --git a/apps/client/src/app/app.component.html b/apps/client/src/app/app.component.html
index 4525930cf..cdf0ba6b5 100644
--- a/apps/client/src/app/app.component.html
+++ b/apps/client/src/app/app.component.html
@@ -3,6 +3,7 @@
class="position-fixed w-100"
[currentRoute]="currentRoute"
[info]="info"
+ [pageTitle]="pageTitle"
[user]="user"
(signOut)="onSignOut()"
>
diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts
index 957dc8f5a..a412a8054 100644
--- a/apps/client/src/app/app.component.ts
+++ b/apps/client/src/app/app.component.ts
@@ -5,7 +5,13 @@ import {
OnDestroy,
OnInit
} from '@angular/core';
-import { NavigationEnd, PRIMARY_OUTLET, Router } from '@angular/router';
+import { Title } from '@angular/platform-browser';
+import {
+ ActivatedRoute,
+ NavigationEnd,
+ PRIMARY_OUTLET,
+ Router
+} from '@angular/router';
import {
primaryColorHex,
secondaryColorHex,
@@ -36,6 +42,7 @@ export class AppComponent implements OnDestroy, OnInit {
public currentYear = new Date().getFullYear();
public deviceType: string;
public info: InfoItem;
+ public pageTitle: string;
public user: User;
public version = environment.version;
@@ -47,6 +54,7 @@ export class AppComponent implements OnDestroy, OnInit {
private deviceService: DeviceDetectorService,
private materialCssVarsService: MaterialCssVarsService,
private router: Router,
+ private title: Title,
private tokenStorageService: TokenStorageService,
private userService: UserService
) {
@@ -66,6 +74,19 @@ export class AppComponent implements OnDestroy, OnInit {
this.currentRoute = urlSegments[0].path;
this.info = this.dataService.fetchInfo();
+
+ if (this.deviceType === 'mobile') {
+ setTimeout(() => {
+ const index = this.title.getTitle().indexOf('–');
+ const title =
+ index === -1
+ ? ''
+ : this.title.getTitle().substring(0, index).trim();
+ this.pageTitle = title.length <= 15 ? title : 'Ghostfolio';
+
+ this.changeDetectorRef.markForCheck();
+ });
+ }
});
this.userService.stateChanged
diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html
index ce3b98dff..5e060972b 100644
--- a/apps/client/src/app/components/header/header.component.html
+++ b/apps/client/src/app/components/header/header.component.html
@@ -5,7 +5,7 @@
mat-button
[routerLink]="['/']"
>
-
Ghostfolio is a lightweight wealth management application for
diff --git a/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.html b/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.html
index 44f76264e..3dff9fd8b 100644
--- a/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.html
+++ b/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.html
@@ -1,7 +1,7 @@
Check out the numerous features of Ghostfolio to
diff --git a/apps/client/src/app/pages/home/home-page-routing.module.ts b/apps/client/src/app/pages/home/home-page-routing.module.ts
index c0e64715d..5463f0777 100644
--- a/apps/client/src/app/pages/home/home-page-routing.module.ts
+++ b/apps/client/src/app/pages/home/home-page-routing.module.ts
@@ -13,14 +13,28 @@ const routes: Routes = [
canActivate: [AuthGuard],
children: [
{ path: '', redirectTo: 'overview', pathMatch: 'full' },
- { path: 'overview', component: HomeOverviewComponent },
- { path: 'holdings', component: HomeHoldingsComponent },
- { path: 'summary', component: HomeSummaryComponent },
- { path: 'market', component: HomeMarketComponent }
+ {
+ path: 'overview',
+ component: HomeOverviewComponent
+ },
+ {
+ path: 'holdings',
+ component: HomeHoldingsComponent,
+ title: $localize`Holdings`
+ },
+ {
+ path: 'summary',
+ component: HomeSummaryComponent,
+ title: $localize`Summary`
+ },
+ {
+ path: 'market',
+ component: HomeMarketComponent,
+ title: $localize`Markets`
+ }
],
component: HomePageComponent,
- path: '',
- title: $localize`Overview`
+ path: ''
}
];
diff --git a/apps/client/src/app/pages/landing/landing-page.html b/apps/client/src/app/pages/landing/landing-page.html
index 48b448dca..0c8f20bce 100644
--- a/apps/client/src/app/pages/landing/landing-page.html
+++ b/apps/client/src/app/pages/landing/landing-page.html
@@ -256,7 +256,7 @@
Ghostfolio X-ray uses static analysis to identify potential issues and
risks in your portfolio.
diff --git a/apps/client/src/app/pages/portfolio/holdings/holdings-page.html b/apps/client/src/app/pages/portfolio/holdings/holdings-page.html
index 4c8e5b9e5..77696fcbd 100644
--- a/apps/client/src/app/pages/portfolio/holdings/holdings-page.html
+++ b/apps/client/src/app/pages/portfolio/holdings/holdings-page.html
@@ -1,7 +1,7 @@
Our official Ghostfolio Premium cloud offering is the easiest way to
diff --git a/apps/client/src/app/pages/public/public-page-routing.module.ts b/apps/client/src/app/pages/public/public-page-routing.module.ts
index a648bed2a..d4c22c112 100644
--- a/apps/client/src/app/pages/public/public-page-routing.module.ts
+++ b/apps/client/src/app/pages/public/public-page-routing.module.ts
@@ -8,8 +8,7 @@ const routes: Routes = [
{
canActivate: [AuthGuard],
component: PublicPageComponent,
- path: ':id',
- title: $localize`Portfolio`
+ path: ':id'
}
];
diff --git a/apps/client/src/app/pages/resources/resources-page.html b/apps/client/src/app/pages/resources/resources-page.html
index d3d7fa74e..32223b6cf 100644
--- a/apps/client/src/app/pages/resources/resources-page.html
+++ b/apps/client/src/app/pages/resources/resources-page.html
@@ -1,7 +1,7 @@
Markets
+ Markets
Summary
About Ghostfolio
+ About Ghostfolio
Privacy Policy
+ Privacy Policy
Account
+ Account
Accounts
+ Accounts
Blog
+ Blog
Frequently Asked Questions (FAQ)
+
+ Frequently Asked Questions (FAQ)
+
Features
+ Features
Activities
+ Activities
Allocations
+ Allocations
Analysis
+ Analysis
FIRE
+ FIRE
Calculator
- X-ray
-
+ X-ray
Holdings
+ Holdings
- Pricing Plans
-
+ Pricing Plans
Resources
+ Resources
Guides