From 9562139fa6586f7c2f5d4b8e1ee577b82e30603a Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 1 Oct 2022 09:42:07 +0200 Subject: [PATCH 1/5] Feature/upgrade prisma to version 4.4.0 (#1304) * Upgrade prisma to version 4.4.0 * Update changelog --- CHANGELOG.md | 4 ++++ package.json | 4 ++-- yarn.lock | 36 ++++++++++++++++++------------------ 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b84ad5cce..3a7d19a45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added an _As seen in_ section to the landing page +### Changed + +- Upgraded `prisma` from version `4.1.1` to `4.4.0` + ## 1.199.1 - 27.09.2022 ### Added diff --git a/package.json b/package.json index 8b37a47e5..a4a6d697b 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@nestjs/schedule": "2.1.0", "@nestjs/serve-static": "3.0.0", "@nrwl/angular": "14.6.4", - "@prisma/client": "4.1.1", + "@prisma/client": "4.4.0", "@simplewebauthn/browser": "5.2.1", "@simplewebauthn/server": "5.2.1", "@stripe/stripe-js": "1.22.0", @@ -119,7 +119,7 @@ "passport": "0.6.0", "passport-google-oauth20": "2.0.0", "passport-jwt": "4.0.0", - "prisma": "4.1.1", + "prisma": "4.4.0", "reflect-metadata": "0.1.13", "rxjs": "7.5.6", "stripe": "8.199.0", diff --git a/yarn.lock b/yarn.lock index 5f9f2f169..7179980cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3839,22 +3839,22 @@ schema-utils "^3.0.0" source-map "^0.7.3" -"@prisma/client@4.1.1": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.1.1.tgz#dcb1118397deb8247fbe39a1f3eee5606648adf8" - integrity sha512-2pXuIUYxHv5H9o6QTa1VIsl4yMgsAjKQOitlo8WVTB+vo73rmMJITBPavdGUZSWUc7adMkFzEV3y5rVTUQr77Q== +"@prisma/client@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.4.0.tgz#45f59c172dd3621ecc92d7cf9bc765d85e6c7d56" + integrity sha512-ciKOP246x1xwr04G9ajHlJ4pkmtu9Q6esVyqVBO0QJihaKQIUvbPjClp17IsRJyxqNpFm4ScbOc/s9DUzKHINQ== dependencies: - "@prisma/engines-version" "4.1.0-48.8d8414deb360336e4698a65aa45a1fbaf1ce13d8" + "@prisma/engines-version" "4.4.0-66.f352a33b70356f46311da8b00d83386dd9f145d6" -"@prisma/engines-version@4.1.0-48.8d8414deb360336e4698a65aa45a1fbaf1ce13d8": - version "4.1.0-48.8d8414deb360336e4698a65aa45a1fbaf1ce13d8" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.1.0-48.8d8414deb360336e4698a65aa45a1fbaf1ce13d8.tgz#ce00e6377126e491a8b1e0e2039c97e2924bd6d9" - integrity sha512-cRRJwpHFGFJZvtHbY3GZjMffNBEjjZk68ztn+S2hDgPCGB4H66IK26roK94GJxBodSehwRJ0wGyebC2GoIH1JQ== +"@prisma/engines-version@4.4.0-66.f352a33b70356f46311da8b00d83386dd9f145d6": + version "4.4.0-66.f352a33b70356f46311da8b00d83386dd9f145d6" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.4.0-66.f352a33b70356f46311da8b00d83386dd9f145d6.tgz#00875863bb30b670a586a5b5794a000f7f3ad976" + integrity sha512-P5v/PuEIJLYXZUZBvOLPqoyCW+m6StNqHdiR6te++gYVODpPdLakks5HVx3JaZIY+LwR02juJWFlwpc9Eog/ug== -"@prisma/engines@4.1.1": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-4.1.1.tgz#a6a75870618bbd19ff734c51af7dbe9f362c3265" - integrity sha512-DCw8L/SS0IXqmj5IW/fMxOXiifnsfjBzDfRhf0j3NFWqvMCh9OtfjmXQZxVgI2mwvJLc/5jzXhkiWT39qS09dA== +"@prisma/engines@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-4.4.0.tgz#6ca7d3ce8eee08dcfa82311b0a02f5ccaac7dc0c" + integrity sha512-Fpykccxlt9MHrAs/QpPGpI2nOiRxuLA+LiApgA59ibbf24YICZIMWd3SI2YD+q0IAIso0jCGiHhirAIbxK3RyQ== "@rollup/plugin-babel@^5.3.0": version "5.3.1" @@ -16763,12 +16763,12 @@ pretty-hrtime@^1.0.3: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A== -prisma@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.1.1.tgz#41c2e19896357f484ef21567165d762908376fca" - integrity sha512-yw50J8If2dKP4wYIi695zthsCASQFHiogGvUHHWd3falx/rpsD6Sb1LMLRV9nO3iGG3lozxNJ2PSINxK7xwdpg== +prisma@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.4.0.tgz#0c53324bf6a29474636b3e1964e0d72e0277bf8f" + integrity sha512-l/QKLmLcKJQFuc+X02LyICo0NWTUVaNNZ00jKJBqwDyhwMAhboD1FWwYV50rkH4Wls0RviAJSFzkC2ZrfawpfA== dependencies: - "@prisma/engines" "4.1.1" + "@prisma/engines" "4.4.0" prismjs@^1.27.0, prismjs@^1.28.0: version "1.28.0" From 8d3954304ef2396df0b75a194dfb6586ee9afec8 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 1 Oct 2022 11:16:43 +0200 Subject: [PATCH 2/5] Feature/add statistics section to landing page (#1306) * Add pulls on Docker Hub to statistics * Add statistics to landing page * Update changelog --- CHANGELOG.md | 2 + apps/api/src/app/info/info.service.ts | 24 ++++ .../pages/landing/landing-page.component.ts | 16 ++- .../src/app/pages/landing/landing-page.html | 53 +++++++- .../app/pages/landing/landing-page.module.ts | 2 + apps/client/src/styles.scss | 5 + .../lib/interfaces/statistics.interface.ts | 1 + libs/ui/src/lib/value/value.component.html | 128 +++++++++--------- libs/ui/src/lib/value/value.component.scss | 2 +- libs/ui/src/lib/value/value.component.ts | 1 + libs/ui/src/lib/value/value.module.ts | 4 +- 11 files changed, 169 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a7d19a45..4d08790e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added a mini statistics section to the landing page including pulls on _Docker Hub_ - Added an _As seen in_ section to the landing page +- Added support for an icon in the value component ### Changed diff --git a/apps/api/src/app/info/info.service.ts b/apps/api/src/app/info/info.service.ts index e4f906b9a..8ed589cb5 100644 --- a/apps/api/src/app/info/info.service.ts +++ b/apps/api/src/app/info/info.service.ts @@ -145,6 +145,27 @@ export class InfoService { }); } + private async countDockerHubPulls(): Promise { + try { + const get = bent( + `https://hub.docker.com/v2/repositories/ghostfolio/ghostfolio`, + 'GET', + 'json', + 200, + { + 'User-Agent': 'request' + } + ); + + const { pull_count } = await get(); + return pull_count; + } catch (error) { + Logger.error(error, 'InfoService'); + + return undefined; + } + } + private async countGitHubContributors(): Promise { try { const get = bent( @@ -245,6 +266,8 @@ export class InfoService { const activeUsers1d = await this.countActiveUsers(1); const activeUsers30d = await this.countActiveUsers(30); const newUsers30d = await this.countNewUsers(30); + + const dockerHubPulls = await this.countDockerHubPulls(); const gitHubContributors = await this.countGitHubContributors(); const gitHubStargazers = await this.countGitHubStargazers(); const slackCommunityUsers = await this.countSlackCommunityUsers(); @@ -252,6 +275,7 @@ export class InfoService { statistics = { activeUsers1d, activeUsers30d, + dockerHubPulls, gitHubContributors, gitHubStargazers, newUsers30d, diff --git a/apps/client/src/app/pages/landing/landing-page.component.ts b/apps/client/src/app/pages/landing/landing-page.component.ts index 26f27d991..7fef8b092 100644 --- a/apps/client/src/app/pages/landing/landing-page.component.ts +++ b/apps/client/src/app/pages/landing/landing-page.component.ts @@ -1,4 +1,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; +import { DataService } from '@ghostfolio/client/services/data.service'; +import { Statistics } from '@ghostfolio/common/interfaces/statistics.interface'; +import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { format } from 'date-fns'; import { Subject } from 'rxjs'; @@ -11,6 +14,8 @@ import { Subject } from 'rxjs'; export class LandingPageComponent implements OnDestroy, OnInit { public currentYear = format(new Date(), 'yyyy'); public demoAuthToken: string; + public hasPermissionForStatistics: boolean; + public statistics: Statistics; public testimonials = [ { author: 'Philipp', @@ -36,7 +41,16 @@ export class LandingPageComponent implements OnDestroy, OnInit { private unsubscribeSubject = new Subject(); - public constructor() {} + public constructor(private dataService: DataService) { + const { globalPermissions, statistics } = this.dataService.fetchInfo(); + + this.hasPermissionForStatistics = hasPermission( + globalPermissions, + permissions.enableStatistics + ); + + this.statistics = statistics; + } public ngOnInit() {} diff --git a/apps/client/src/app/pages/landing/landing-page.html b/apps/client/src/app/pages/landing/landing-page.html index a10e64671..9ddd83106 100644 --- a/apps/client/src/app/pages/landing/landing-page.html +++ b/apps/client/src/app/pages/landing/landing-page.html @@ -42,7 +42,52 @@ -
+ + +
As seen in
- 360° View + 360° View Get the full picture of your personal finances across multiple platforms.
- Web3 Ready + Web3 Ready Use Ghostfolio anonymously and own your financial data.
- Open Source + Open Source Benefit from continuous improvements through a strong community.
diff --git a/apps/client/src/app/pages/landing/landing-page.module.ts b/apps/client/src/app/pages/landing/landing-page.module.ts index 2116d972d..37c67f270 100644 --- a/apps/client/src/app/pages/landing/landing-page.module.ts +++ b/apps/client/src/app/pages/landing/landing-page.module.ts @@ -4,6 +4,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { RouterModule } from '@angular/router'; import { GfLogoModule } from '@ghostfolio/ui/logo'; +import { GfValueModule } from '@ghostfolio/ui/value'; import { LandingPageRoutingModule } from './landing-page-routing.module'; import { LandingPageComponent } from './landing-page.component'; @@ -13,6 +14,7 @@ import { LandingPageComponent } from './landing-page.component'; imports: [ CommonModule, GfLogoModule, + GfValueModule, LandingPageRoutingModule, MatButtonModule, MatCardModule, diff --git a/apps/client/src/styles.scss b/apps/client/src/styles.scss index 932c548f5..ae0ef8c40 100644 --- a/apps/client/src/styles.scss +++ b/apps/client/src/styles.scss @@ -18,6 +18,7 @@ $mat-css-light-theme-selector: '.is-light-theme'; :root { --dark-background: rgb(39, 39, 39); + --font-family-sans-serif: Roboto, 'Helvetica Neue', sans-serif; --light-background: rgb(255, 255, 255); } @@ -146,6 +147,10 @@ ngx-skeleton-loader { @include gf-table; } +.lead { + font-weight: unset; +} + .mat-card { &:not([class*='mat-elevation-z']) { border: 1px solid rgba(var(--dark-dividers)); diff --git a/libs/common/src/lib/interfaces/statistics.interface.ts b/libs/common/src/lib/interfaces/statistics.interface.ts index ba3f0a1d9..f39529426 100644 --- a/libs/common/src/lib/interfaces/statistics.interface.ts +++ b/libs/common/src/lib/interfaces/statistics.interface.ts @@ -1,6 +1,7 @@ export interface Statistics { activeUsers1d: number; activeUsers30d: number; + dockerHubPulls: number; gitHubContributors: number; gitHubStargazers: number; newUsers30d: number; diff --git a/libs/ui/src/lib/value/value.component.html b/libs/ui/src/lib/value/value.component.html index 9a08ad813..80b6a09fa 100644 --- a/libs/ui/src/lib/value/value.component.html +++ b/libs/ui/src/lib/value/value.component.html @@ -1,67 +1,73 @@ - - -
- - -
+
-
-
-
-
- {{ formattedValue }}% -
-
- - *** - - - {{ formattedValue }} +
+ +
+
+ + +
+ + +
+
+
-
+
+ {{ formattedValue }}% +
+
+ + *** + + + {{ formattedValue }} + +
+ + {{ currency }} + +
+ {{ currency }} +
+
+ +
+ {{ formattedValue | titlecase }} +
+
+
+ +
+ + {{ subLabel }}
- - {{ currency }} + + -
- {{ currency }} -
- -
- {{ formattedValue | titlecase }} -
-
-
- -
- - {{ subLabel }} -
- - -
-
- + +
diff --git a/libs/ui/src/lib/value/value.component.scss b/libs/ui/src/lib/value/value.component.scss index 04c8fe3ff..f690dc46c 100644 --- a/libs/ui/src/lib/value/value.component.scss +++ b/libs/ui/src/lib/value/value.component.scss @@ -1,6 +1,6 @@ :host { display: flex; - flex-direction: column; + flex-direction: row; font-variant-numeric: tabular-nums; .h2 { diff --git a/libs/ui/src/lib/value/value.component.ts b/libs/ui/src/lib/value/value.component.ts index f05e53551..d92d87cb1 100644 --- a/libs/ui/src/lib/value/value.component.ts +++ b/libs/ui/src/lib/value/value.component.ts @@ -16,6 +16,7 @@ import { isNumber } from 'lodash'; export class ValueComponent implements OnChanges { @Input() colorizeSign = false; @Input() currency = ''; + @Input() icon = ''; @Input() isAbsolute = false; @Input() isCurrency = false; @Input() isDate = false; diff --git a/libs/ui/src/lib/value/value.module.ts b/libs/ui/src/lib/value/value.module.ts index 9d3c9aedb..1cb91050e 100644 --- a/libs/ui/src/lib/value/value.module.ts +++ b/libs/ui/src/lib/value/value.module.ts @@ -1,5 +1,5 @@ import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { ValueComponent } from './value.component'; @@ -8,6 +8,6 @@ import { ValueComponent } from './value.component'; declarations: [ValueComponent], exports: [ValueComponent], imports: [CommonModule, NgxSkeletonLoaderModule], - providers: [] + schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class GfValueModule {} From cf234003ec1753d4a6d1c7e0ec164b8d0c550240 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 1 Oct 2022 11:18:15 +0200 Subject: [PATCH 3/5] Release 1.200.0 (#1307) --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d08790e8..716692095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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 +## 1.200.0 - 01.10.2022 ### Added diff --git a/package.json b/package.json index a4a6d697b..cac3f8828 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "1.199.1", + "version": "1.200.0", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "scripts": { From a6186c23e268666c0ee6189ae0f07633cd25ec42 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 1 Oct 2022 13:53:43 +0200 Subject: [PATCH 4/5] Feature/improve usage of value component (#1308) * Improve usage of value component * Update changelog --- CHANGELOG.md | 10 +++++++++ .../admin-overview/admin-overview.html | 21 ++++++++++++++----- .../allocations/allocations-page.html | 6 +++--- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 716692095..df7830ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ 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 + +### Changed + +- Improved the usage of the value component in the admin control panel + +### Fixed + +- Fixed the usage of the value component on the allocations page + ## 1.200.0 - 01.10.2022 ### Added diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html index 768a14937..97be48141 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -5,15 +5,26 @@
User Count
-
{{ userCount }}
+
+ +
Activity Count
- - {{ transactionCount }} ({{ transactionCount / userCount | number - : '1.2-2' }} per User) - + +
+ {{ transactionCount / userCount | number : '1.2-2' }} + per User +
diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html index 36e98011c..0265d4d71 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html @@ -13,12 +13,12 @@
- - + Proportion of Net Worth Date: Sat, 1 Oct 2022 16:45:44 +0200 Subject: [PATCH 5/5] Update messages.es.xlf (#1305) * Update messages.es.xlf Co-authored-by: fdp10381 <63880387+fdp10381@users.noreply.github.com> --- apps/client/src/locales/messages.es.xlf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index 6a6d3c95f..3bf01e99a 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -2660,7 +2660,7 @@ Account Type - Account Type + Tipo de cuenta apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html 25 @@ -2668,7 +2668,7 @@ Excluded from Analysis - Excluded from Analysis + Excluido del análisis apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html 176