diff --git a/CHANGELOG.md b/CHANGELOG.md index ebbcc8d3..c9157a15 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 the date range component to the holdings tab +### Changed + +- Extended the statistics section on the about page (users in Slack community) + ### Fixed - Fixed the creation of historical data in the admin control panel (upsert instead of update) diff --git a/apps/api/src/app/info/info.service.ts b/apps/api/src/app/info/info.service.ts index 073a3dbd..2d2ca915 100644 --- a/apps/api/src/app/info/info.service.ts +++ b/apps/api/src/app/info/info.service.ts @@ -7,6 +7,7 @@ import { PrismaService } from '@ghostfolio/api/services/prisma.service'; import { PropertyService } from '@ghostfolio/api/services/property/property.service'; import { PROPERTY_IS_READ_ONLY_MODE, + PROPERTY_SLACK_COMMUNITY_USERS, PROPERTY_STRIPE_CONFIG, PROPERTY_SYSTEM_MESSAGE } from '@ghostfolio/common/config'; @@ -187,6 +188,12 @@ export class InfoService { }); } + private async countSlackCommunityUsers() { + return (await this.propertyService.getByKey( + PROPERTY_SLACK_COMMUNITY_USERS + )) as string; + } + private getDemoAuthToken() { return this.jwtService.sign({ id: InfoService.DEMO_USER_ID @@ -218,19 +225,19 @@ export class InfoService { } catch {} const activeUsers1d = await this.countActiveUsers(1); - const activeUsers7d = await this.countActiveUsers(7); const activeUsers30d = await this.countActiveUsers(30); const newUsers30d = await this.countNewUsers(30); const gitHubContributors = await this.countGitHubContributors(); const gitHubStargazers = await this.countGitHubStargazers(); + const slackCommunityUsers = await this.countSlackCommunityUsers(); statistics = { activeUsers1d, - activeUsers7d, activeUsers30d, gitHubContributors, gitHubStargazers, - newUsers30d + newUsers30d, + slackCommunityUsers }; await this.redisCacheService.set( diff --git a/apps/client/src/app/pages/about/about-page.html b/apps/client/src/app/pages/about/about-page.html index 25d6c2fe..e68ec6f9 100644 --- a/apps/client/src/app/pages/about/about-page.html +++ b/apps/client/src/app/pages/about/about-page.html @@ -35,8 +35,8 @@ new feature, please join the Ghostfolio Slack channelSlack community, tweet to
-

- {{ statistics?.activeUsers1d || '-' }} -

+

{{ statistics?.activeUsers1d || '-' }}

Active Users (Last 24 hours)
-

- {{ statistics?.activeUsers7d ?? '-' }} -

-
- Active Users (Last 7 days) -
-
-
-

- {{ statistics?.activeUsers30d ?? '-' }} -

-
- Active Users (Last 30 days) -
-
-
-

- {{ statistics?.newUsers30d ?? '-' }} -

+

{{ statistics?.newUsers30d ?? '-' }}

New Users (Last 30 days)
-

- {{ statistics?.gitHubContributors ?? '-' }} -

+

{{ statistics?.activeUsers30d ?? '-' }}

+
+ Active Users (Last 30 days) +
+
+
+

{{ statistics?.slackCommunityUsers ?? '-' }}

+
Users in Slack community
+
+
+

{{ statistics?.gitHubContributors ?? '-' }}

Contributors on GitHub
-

- {{ statistics?.gitHubStargazers ?? '-' }} -

+

{{ statistics?.gitHubStargazers ?? '-' }}

Stars on GitHub
diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index ef57ca9d..6e19ef1f 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -45,6 +45,7 @@ export const PROPERTY_CURRENCIES = 'CURRENCIES'; export const PROPERTY_IS_READ_ONLY_MODE = 'IS_READ_ONLY_MODE'; export const PROPERTY_LAST_DATA_GATHERING = 'LAST_DATA_GATHERING'; export const PROPERTY_LOCKED_DATA_GATHERING = 'LOCKED_DATA_GATHERING'; +export const PROPERTY_SLACK_COMMUNITY_USERS = 'SLACK_COMMUNITY_USERS'; export const PROPERTY_STRIPE_CONFIG = 'STRIPE_CONFIG'; export const PROPERTY_SYSTEM_MESSAGE = 'SYSTEM_MESSAGE'; diff --git a/libs/common/src/lib/interfaces/statistics.interface.ts b/libs/common/src/lib/interfaces/statistics.interface.ts index 98f1753b..ba3f0a1d 100644 --- a/libs/common/src/lib/interfaces/statistics.interface.ts +++ b/libs/common/src/lib/interfaces/statistics.interface.ts @@ -1,8 +1,8 @@ export interface Statistics { activeUsers1d: number; - activeUsers7d: number; activeUsers30d: number; gitHubContributors: number; gitHubStargazers: number; newUsers30d: number; + slackCommunityUsers: string; }