|
|
@ -1,4 +1,5 @@ |
|
|
import { getCountryName } from '@ghostfolio/common/helper'; |
|
|
import { getCountryName } from '@ghostfolio/common/helper'; |
|
|
|
|
|
import { Product } from '@ghostfolio/common/interfaces'; |
|
|
import { personalFinanceTools } from '@ghostfolio/common/personal-finance-tools'; |
|
|
import { personalFinanceTools } from '@ghostfolio/common/personal-finance-tools'; |
|
|
import { publicRoutes } from '@ghostfolio/common/routes/routes'; |
|
|
import { publicRoutes } from '@ghostfolio/common/routes/routes'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
@ -91,9 +92,20 @@ export class GfProductPageComponent { |
|
|
|
|
|
|
|
|
protected readonly routerLinkAbout = publicRoutes.about.routerLink; |
|
|
protected readonly routerLinkAbout = publicRoutes.about.routerLink; |
|
|
protected readonly routerLinkFeatures = publicRoutes.features.routerLink; |
|
|
protected readonly routerLinkFeatures = publicRoutes.features.routerLink; |
|
|
|
|
|
|
|
|
protected readonly routerLinkResourcesPersonalFinanceTools = |
|
|
protected readonly routerLinkResourcesPersonalFinanceTools = |
|
|
publicRoutes.resources.subRoutes.personalFinanceTools.routerLink; |
|
|
publicRoutes.resources.subRoutes.personalFinanceTools.routerLink; |
|
|
|
|
|
|
|
|
|
|
|
protected readonly titlePrefix = $localize`The Open Source Alternative to`; |
|
|
|
|
|
|
|
|
|
|
|
protected readonly nextProduct = computed(() => { |
|
|
|
|
|
return personalFinanceTools[this.getCurrentProductIndex() + 1]; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
protected readonly previousProduct = computed(() => { |
|
|
|
|
|
return personalFinanceTools[this.getCurrentProductIndex() - 1]; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
protected readonly tags = computed<string[]>(() => { |
|
|
protected readonly tags = computed<string[]>(() => { |
|
|
const product1 = this.product1(); |
|
|
const product1 = this.product1(); |
|
|
const product2 = this.product2(); |
|
|
const product2 = this.product2(); |
|
|
@ -139,6 +151,27 @@ export class GfProductPageComponent { |
|
|
private readonly dataService = inject(DataService); |
|
|
private readonly dataService = inject(DataService); |
|
|
private readonly route = inject(ActivatedRoute); |
|
|
private readonly route = inject(ActivatedRoute); |
|
|
|
|
|
|
|
|
|
|
|
protected getProductRouterLink(product?: Product) { |
|
|
|
|
|
if (!product) { |
|
|
|
|
|
return this.routerLinkResourcesPersonalFinanceTools; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return [ |
|
|
|
|
|
...this.routerLinkResourcesPersonalFinanceTools, |
|
|
|
|
|
`${publicRoutes.resources.subRoutes.personalFinanceTools.subRoutes.product.path}-${product.alias ?? product.key}` |
|
|
|
|
|
]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected getProductTitle(product?: Product) { |
|
|
|
|
|
return `Ghostfolio: ${this.titlePrefix} ${product?.name ?? ''}`; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private getCurrentProductIndex() { |
|
|
|
|
|
return personalFinanceTools.findIndex(({ key }) => { |
|
|
|
|
|
return key === this.product2().key; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private getSortedTranslations(values?: string[]) { |
|
|
private getSortedTranslations(values?: string[]) { |
|
|
return values |
|
|
return values |
|
|
?.map((value) => { |
|
|
?.map((value) => { |
|
|
|