Browse Source

Refactoring

pull/3978/head
Thomas Kaul 10 months ago
parent
commit
f8aaa9a657
  1. 12
      apps/api/src/assets/sitemap.xml
  2. 134
      apps/client/src/app/pages/resources/glossary/resources-glossary.component.html
  3. 67
      apps/client/src/app/pages/resources/glossary/resources-glossary.component.ts
  4. 3
      apps/client/src/app/pages/resources/glossary/resources-glossary.module.ts
  5. 38
      apps/client/src/app/pages/resources/guides/resources-guides.component.html
  6. 17
      apps/client/src/app/pages/resources/guides/resources-guides.component.ts
  7. 3
      apps/client/src/app/pages/resources/guides/resources-guides.module.ts
  8. 68
      apps/client/src/app/pages/resources/markets/resources-markets.component.html
  9. 29
      apps/client/src/app/pages/resources/markets/resources-markets.component.ts
  10. 2
      apps/client/src/app/pages/resources/overview/resources-overview.component.html
  11. 17
      apps/client/src/app/pages/resources/overview/resources-overview.component.ts
  12. 15
      apps/client/src/app/pages/resources/resources-page-routing.module.ts
  13. 22
      apps/client/src/app/pages/resources/resources-page.component.ts

12
apps/api/src/assets/sitemap.xml

@ -214,6 +214,18 @@
<loc>https://ghostfol.io/en/resources</loc> <loc>https://ghostfol.io/en/resources</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod> <lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url> </url>
<url>
<loc>https://ghostfol.io/en/resources/glossary</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url>
<url>
<loc>https://ghostfol.io/en/resources/guides</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url>
<url>
<loc>https://ghostfol.io/en/resources/markets</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod>
</url>
<url> <url>
<loc>https://ghostfol.io/en/resources/personal-finance-tools</loc> <loc>https://ghostfol.io/en/resources/personal-finance-tools</loc>
<lastmod>${currentDate}T00:00:00+00:00</lastmod> <lastmod>${currentDate}T00:00:00+00:00</lastmod>

134
apps/client/src/app/pages/resources/glossary/resources-glossary.component.html

@ -2,14 +2,136 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1 class="h3 mb-4 text-center" i18n>Glossary</h1> <h1 class="h3 mb-4 text-center" i18n>Glossary</h1>
<div class="glossary-list"> <div>
@for (item of glossaryItems; track item) { <div class="mb-4 media">
<div class="mb-4"> <div class="media-body">
<h3 class="h5 mt-0">{{ item.term }}</h3> <h3 class="h5 mt-0">Buy and Hold</h3>
<p class="mb-1">{{ item.definition }}</p> <div class="mb-1">
<a target="_blank" [href]="item.link">Learn more →</a> Buy and hold is a passive investment strategy where you buy assets
and hold them for a long period regardless of fluctuations in the
market.
</div>
<div>
<a
href="https://www.investopedia.com/terms/b/buyandhold.asp"
target="_blank"
>Buy and Hold →</a
>
</div>
</div>
</div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">Deflation</h3>
<div class="mb-1">
Deflation is a decrease of the general price level for goods and
services in an economy over a period of time.
</div>
<div>
<a
href="https://www.investopedia.com/terms/d/deflation.asp"
target="_blank"
>Deflation →</a
>
</div>
</div>
</div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">Dollar-Cost Averaging (DCA)</h3>
<div class="mb-1">
Dollar-cost averaging is an investment strategy where you split
the total amount to be invested across periodic purchases of a
target asset to reduce the impact of volatility on the overall
purchase.
</div>
<div>
<a
href="https://www.investopedia.com/terms/d/dollarcostaveraging.asp"
target="_blank"
>Dollar-Cost Averaging →</a
>
</div>
</div>
</div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">Financial Independence</h3>
<div class="mb-1">
Financial independence is the status of having enough income, for
example with a passive income like dividends, to cover your living
expenses for the rest of your life.
</div>
<div>
<a
href="https://en.wikipedia.org/wiki/Financial_independence"
target="_blank"
>Financial Independence →</a
>
</div>
</div>
</div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">FIRE</h3>
<div class="mb-1">
FIRE is a movement that promotes saving and investing to achieve
financial independence and early retirement.
</div>
<div>
<a href="../en/blog/2023/07/exploring-the-path-to-fire">FIRE →</a>
</div>
</div>
</div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">Inflation</h3>
<div class="mb-1">
Inflation is an increase of the general price level for goods and
services in an economy over a period of time.
</div>
<div>
<a
href="https://www.investopedia.com/terms/i/inflation.asp"
target="_blank"
>Inflation →</a
>
</div>
</div>
</div>
@if (hasPermissionForSubscription) {
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">Personal Finance Tools</h3>
<div class="mb-1">
Personal finance tools are software applications that help
individuals manage their money, track expenses, set budgets,
monitor investments, and make informed financial decisions.
</div>
<div>
<a [routerLink]="routerLinkResourcesPersonalFinanceTools"
>Personal Finance Tools →</a
>
</div>
</div>
</div> </div>
} }
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">Stagflation</h3>
<div class="mb-1">
Stagflation describes a situation in which there is a stagnant
economy with high unemployment and high inflation.
</div>
<div>
<a
href="https://www.investopedia.com/terms/s/stagflation.asp"
target="_blank"
>Stagflation →</a
>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

67
apps/client/src/app/pages/resources/glossary/resources-glossary.component.ts

@ -1,53 +1,30 @@
import { Component } from '@angular/core'; import { DataService } from '@ghostfolio/client/services/data.service';
import { InfoItem } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Component, OnInit } from '@angular/core';
@Component({ @Component({
selector: 'gf-resources-glossary', selector: 'gf-resources-glossary',
styleUrls: ['./resources-glossary.component.scss'], styleUrls: ['./resources-glossary.component.scss'],
templateUrl: './resources-glossary.component.html' templateUrl: './resources-glossary.component.html'
}) })
export class ResourcesGlossaryPageComponent { export class ResourcesGlossaryPageComponent implements OnInit {
public glossaryItems = [ public hasPermissionForSubscription: boolean;
{ public info: InfoItem;
term: 'Buy and Hold', public routerLinkResourcesPersonalFinanceTools = [
definition: '/' + $localize`:snake-case:resources`,
'Buy and hold is a passive investment strategy where you buy assets and hold them for a long period regardless of fluctuations in the market.', 'personal-finance-tools'
link: 'https://www.investopedia.com/terms/b/buyandhold.asp'
},
{
term: 'Deflation',
definition:
'Deflation is a decrease of the general price level for goods and services in an economy over a period of time.',
link: 'https://www.investopedia.com/terms/d/deflation.asp'
},
{
term: 'Dollar-Cost Averaging (DCA)',
definition:
'Dollar-cost averaging is an investment strategy where you split the total amount to be invested across periodic purchases of a target asset to reduce the impact of volatility on the overall purchase.',
link: 'https://www.investopedia.com/terms/d/dollarcostaveraging.asp'
},
{
term: 'Financial Independence',
definition:
'Financial independence is the status of having enough income, for example with a passive income like dividends, to cover your living expenses for the rest of your life.',
link: 'https://en.wikipedia.org/wiki/Financial_independence'
},
{
term: 'FIRE',
definition:
'FIRE is a movement that promotes saving and investing to achieve financial independence and early retirement.',
link: '../en/blog/2023/07/exploring-the-path-to-fire'
},
{
term: 'Inflation',
definition:
'Inflation is an increase of the general price level for goods and services in an economy over a period of time.',
link: 'https://www.investopedia.com/terms/i/inflation.asp'
},
{
term: 'Stagflation',
definition:
'Stagflation describes a situation in which there is a stagnant economy with high unemployment and high inflation.',
link: 'https://www.investopedia.com/terms/s/stagflation.asp'
}
]; ];
public constructor(private dataService: DataService) {
this.info = this.dataService.fetchInfo();
}
public ngOnInit() {
this.hasPermissionForSubscription = hasPermission(
this.info?.globalPermissions,
permissions.enableSubscription
);
}
} }

3
apps/client/src/app/pages/resources/glossary/resources-glossary.module.ts

@ -1,11 +1,12 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { ResourcesGlossaryRoutingModule } from './resources-glossary-routing.module'; import { ResourcesGlossaryRoutingModule } from './resources-glossary-routing.module';
import { ResourcesGlossaryPageComponent } from './resources-glossary.component'; import { ResourcesGlossaryPageComponent } from './resources-glossary.component';
@NgModule({ @NgModule({
declarations: [ResourcesGlossaryPageComponent], declarations: [ResourcesGlossaryPageComponent],
imports: [CommonModule, ResourcesGlossaryRoutingModule] imports: [CommonModule, ResourcesGlossaryRoutingModule, RouterModule]
}) })
export class ResourcesGlossaryPageModule {} export class ResourcesGlossaryPageModule {}

38
apps/client/src/app/pages/resources/guides/resources-guides.component.html

@ -2,14 +2,38 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1 class="h3 mb-4 text-center" i18n>Guides</h1> <h1 class="h3 mb-4 text-center" i18n>Guides</h1>
<div class="guides-list"> <div class="mb-5">
@for (guide of guides; track guide) { <div class="mb-4 media">
<div class="mb-4"> <div class="media-body">
<h3 class="h5 mt-0">{{ guide.title }}</h3> <h3 class="h5 mt-0">Boringly Getting Rich</h3>
<p class="mb-1">{{ guide.description }}</p> <div class="mb-1">
<a target="_blank" [href]="guide.link">Read more →</a> The <i>Boringly Getting Rich</i> guide supports you to get started
with investing. It introduces a strategy utilizing a broadly
diversified, low-cost portfolio excluding the risks of individual
stocks.
</div>
<div>
<a href="https://herget.me/investing-guide" target="_blank"
>Boringly Getting Rich →</a
>
</div>
</div> </div>
} </div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">How do I get my finances in order?</h3>
<div class="mb-1">
Before you can think of long-term investing, you have to get your
finances in order. Learn how you can reach your financial goals
easier and faster in this guide.
</div>
<div>
<a href="../en/blog/2022/07/how-do-i-get-my-finances-in-order"
>How do I get my finances in order? →</a
>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

17
apps/client/src/app/pages/resources/guides/resources-guides.component.ts

@ -5,19 +5,4 @@ import { Component } from '@angular/core';
styleUrls: ['./resources-guides.component.scss'], styleUrls: ['./resources-guides.component.scss'],
templateUrl: './resources-guides.component.html' templateUrl: './resources-guides.component.html'
}) })
export class ResourcesGuidesComponent { export class ResourcesGuidesComponent {}
public guides = [
{
title: 'Boringly Getting Rich',
description:
'The Boringly Getting Rich guide supports you to get started with investing. It introduces a strategy utilizing a broadly diversified, low-cost portfolio excluding the risks of individual stocks.',
link: 'https://herget.me/investing-guide'
},
{
title: 'How do I get my finances in order?',
description:
'Before you can think of long-term investing, you have to get your finances in order. Learn how you can reach your financial goals easier and faster in this guide.',
link: '../en/blog/2022/07/how-do-i-get-my-finances-in-order'
}
];
}

3
apps/client/src/app/pages/resources/guides/resources-guides.module.ts

@ -1,11 +1,12 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { ResourcesGuidesRoutingModule } from './resources-guides-routing.module'; import { ResourcesGuidesRoutingModule } from './resources-guides-routing.module';
import { ResourcesGuidesComponent } from './resources-guides.component'; import { ResourcesGuidesComponent } from './resources-guides.component';
@NgModule({ @NgModule({
declarations: [ResourcesGuidesComponent], declarations: [ResourcesGuidesComponent],
imports: [CommonModule, ResourcesGuidesRoutingModule] imports: [CommonModule, ResourcesGuidesRoutingModule, RouterModule]
}) })
export class ResourcesGuidesModule {} export class ResourcesGuidesModule {}

68
apps/client/src/app/pages/resources/markets/resources-markets.component.html

@ -1,12 +1,64 @@
<div class="container"> <div class="container">
<h1 class="h3 mb-4 text-center" i18n>Markets</h1> <h1 class="h3 mb-4 text-center" i18n>Markets</h1>
<div class="market-resources"> <div class="mb-5">
@for (resource of marketResources; track resource) { <div class="mb-4 media">
<div class="mb-4"> <div class="media-body">
<h3 class="h5 mt-0">{{ resource.title }}</h3> <h3 class="h5 mt-0">Crypto Coins Heatmap</h3>
<p class="mb-1">{{ resource.description }}</p> <div class="mb-1">
<a target="_blank" [href]="resource.link">View resource →</a> With the <i>Crypto Coins Heatmap</i> you can track the daily market
</div> movements of cryptocurrencies as a visual snapshot.
} </div>
<div>
<a href="https://www.tradingview.com/heatmap/crypto" target="_blank"
>Crypto Coins Heatmap →</a
>
</div>
</div>
</div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">Fear & Greed Index</h3>
<div class="mb-1">
The fear and greed index was developed by <i>CNNMoney</i> to measure
the primary emotions (fear and greed) that influence how much
investors are willing to pay for stocks.
</div>
<div>
<a href="https://money.cnn.com/data/fear-and-greed/" target="_blank"
>Fear & Greed Index →</a
>
</div>
</div>
</div>
<div class="media">
<div class="mb-4 media">
<h3 class="h5 mt-0">Inflation Chart</h3>
<div class="mb-1">
<i>Inflation Chart</i> helps you find the intrinsic value of stock
markets, stock prices, goods and services by adjusting them to the
amount of the money supply (M0, M1, M2) or price of other goods (food
or oil).
</div>
<div>
<a href="https://inflationchart.com" target="_blank"
>Inflation Chart →</a
>
</div>
</div>
</div>
<div class="media">
<div class="media-body">
<h3 class="h5 mt-0">Stock Heatmap</h3>
<div class="mb-1">
With the <i>Stock Heatmap</i> you can track the daily market movements
of stocks as a visual snapshot.
</div>
<div>
<a href="https://www.tradingview.com/heatmap/stock" target="_blank"
>Stock Heatmap →</a
>
</div>
</div>
</div>
</div> </div>
</div> </div>

29
apps/client/src/app/pages/resources/markets/resources-markets.component.ts

@ -5,31 +5,4 @@ import { Component } from '@angular/core';
styleUrls: ['./resources-markets.component.scss'], styleUrls: ['./resources-markets.component.scss'],
templateUrl: './resources-markets.component.html' templateUrl: './resources-markets.component.html'
}) })
export class ResourcesMarketsComponent { export class ResourcesMarketsComponent {}
public marketResources = [
{
title: 'Crypto Coins Heatmap',
description:
'With the Crypto Coins Heatmap you can track the daily market movements of cryptocurrencies as a visual snapshot.',
link: 'https://www.tradingview.com/heatmap/crypto'
},
{
title: 'Fear & Greed Index',
description:
'The fear and greed index was developed by CNNMoney to measure the primary emotions (fear and greed) that influence how much investors are willing to pay for stocks.',
link: 'https://money.cnn.com/data/fear-and-greed/'
},
{
title: 'Inflation Chart',
description:
'Inflation Chart helps you find the intrinsic value of stock markets, stock prices, goods and services by adjusting them to the amount of the money supply (M0, M1, M2) or price of other goods (food or oil).',
link: 'https://inflationchart.com'
},
{
title: 'Stock Heatmap',
description:
'With the Stock Heatmap you can track the daily market movements of stocks as a visual snapshot.',
link: 'https://www.tradingview.com/heatmap/stock'
}
];
}

2
apps/client/src/app/pages/resources/overview/resources-overview.component.html

@ -7,7 +7,7 @@
<div class="mb-4"> <div class="mb-4">
<h3 class="h5 mt-0">{{ item.title }}</h3> <h3 class="h5 mt-0">{{ item.title }}</h3>
<p class="mb-1">{{ item.description }}</p> <p class="mb-1">{{ item.description }}</p>
<a [routerLink]="item.link">Explore →</a> <a [routerLink]="item.link">Explore {{ item.title }} </a>
</div> </div>
} }
</div> </div>

17
apps/client/src/app/pages/resources/overview/resources-overview.component.ts

@ -11,25 +11,34 @@ export class ResourcesOverviewComponent {
title: 'Frequently Asked Questions (FAQ)', title: 'Frequently Asked Questions (FAQ)',
description: description:
'Find quick answers to commonly asked questions about Ghostfolio in our Frequently Asked Questions (FAQ) section.', 'Find quick answers to commonly asked questions about Ghostfolio in our Frequently Asked Questions (FAQ) section.',
link: '/faq' link: ['/' + $localize`:snake-case:faq`]
}, },
{ {
title: 'Guides', title: 'Guides',
description: description:
'Explore our guides to help you get started with investing and managing your finances.', 'Explore our guides to help you get started with investing and managing your finances.',
link: '/resources/guides' link: [
'/' + $localize`:snake-case:resources`,
$localize`:snake-case:guides`
]
}, },
{ {
title: 'Markets', title: 'Markets',
description: description:
'Access various market resources and tools to stay informed about financial markets.', 'Access various market resources and tools to stay informed about financial markets.',
link: '/resources/markets' link: [
'/' + $localize`:snake-case:resources`,
$localize`:snake-case:markets`
]
}, },
{ {
title: 'Glossary', title: 'Glossary',
description: description:
'Learn key financial terms and concepts in our comprehensive glossary.', 'Learn key financial terms and concepts in our comprehensive glossary.',
link: '/resources/glossary' link: [
'/' + $localize`:snake-case:resources`,
$localize`:snake-case:glossary`
]
} }
]; ];
} }

15
apps/client/src/app/pages/resources/resources-page-routing.module.ts

@ -18,26 +18,33 @@ const routes: Routes = [
) )
}, },
{ {
path: 'glossary', path: $localize`:snake-case:glossary`,
loadChildren: () => loadChildren: () =>
import('./glossary/resources-glossary.module').then( import('./glossary/resources-glossary.module').then(
(m) => m.ResourcesGlossaryPageModule (m) => m.ResourcesGlossaryPageModule
) )
}, },
{ {
path: 'guides', path: $localize`:snake-case:guides`,
loadChildren: () => loadChildren: () =>
import('./guides/resources-guides.module').then( import('./guides/resources-guides.module').then(
(m) => m.ResourcesGuidesModule (m) => m.ResourcesGuidesModule
) )
}, },
{ {
path: 'markets', path: $localize`:snake-case:markets`,
loadChildren: () => loadChildren: () =>
import('./markets/resources-markets.module').then( import('./markets/resources-markets.module').then(
(m) => m.ResourcesMarketsModule (m) => m.ResourcesMarketsModule
) )
} },
...['personal-finance-tools'].map((path) => ({
path,
loadChildren: () =>
import(
'./personal-finance-tools/personal-finance-tools-page.module'
).then((m) => m.PersonalFinanceToolsPageModule)
}))
], ],
path: '' path: ''
} }

22
apps/client/src/app/pages/resources/resources-page.component.ts

@ -1,7 +1,3 @@
import { DataService } from '@ghostfolio/client/services/data.service';
import { InfoItem } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
@ -14,13 +10,6 @@ import { Subject } from 'rxjs';
}) })
export class ResourcesPageComponent implements OnInit { export class ResourcesPageComponent implements OnInit {
public deviceType: string; public deviceType: string;
public hasPermissionForSubscription: boolean;
public info: InfoItem;
public routerLinkFaq = ['/' + $localize`:snake-case:faq`];
public routerLinkResourcesPersonalFinanceTools = [
'/' + $localize`:snake-case:resources`,
'personal-finance-tools'
];
public tabs = [ public tabs = [
{ {
path: '.', path: '.',
@ -46,19 +35,10 @@ export class ResourcesPageComponent implements OnInit {
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();
public constructor( public constructor(private deviceService: DeviceDetectorService) {}
private dataService: DataService,
private deviceService: DeviceDetectorService
) {
this.info = this.dataService.fetchInfo();
}
public ngOnInit() { public ngOnInit() {
this.deviceType = this.deviceService.getDeviceInfo().deviceType; this.deviceType = this.deviceService.getDeviceInfo().deviceType;
this.hasPermissionForSubscription = hasPermission(
this.info?.globalPermissions,
permissions.enableSubscription
);
} }
public ngOnDestroy() { public ngOnDestroy() {

Loading…
Cancel
Save