From 1009b462e9745b6061226ede047829d833994f03 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 19 Mar 2023 12:03:47 +0100 Subject: [PATCH] Feature/add subscription expiration dates to the admin control panel (#1796) * Add expiration date * Update changelog --- CHANGELOG.md | 6 ++++++ .../app/components/admin-users/admin-users.component.ts | 7 ++++++- .../client/src/app/components/admin-users/admin-users.html | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4162b3d07..c54218f15 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 the subscription expiration date to the users table of the admin control panel + ## 1.246.0 - 2023-03-18 ### Added diff --git a/apps/client/src/app/components/admin-users/admin-users.component.ts b/apps/client/src/app/components/admin-users/admin-users.component.ts index 0e76a8733..bae725e53 100644 --- a/apps/client/src/app/components/admin-users/admin-users.component.ts +++ b/apps/client/src/app/components/admin-users/admin-users.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; -import { getEmojiFlag } from '@ghostfolio/common/helper'; +import { getDateFormatString, getEmojiFlag } from '@ghostfolio/common/helper'; import { AdminData, InfoItem, User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { @@ -18,6 +18,7 @@ import { takeUntil } from 'rxjs/operators'; templateUrl: './admin-users.html' }) export class AdminUsersComponent implements OnDestroy, OnInit { + public defaultDateFormat: string; public getEmojiFlag = getEmojiFlag; public hasPermissionForSubscription: boolean; public info: InfoItem; @@ -43,6 +44,10 @@ export class AdminUsersComponent implements OnDestroy, OnInit { .subscribe((state) => { if (state?.user) { this.user = state.user; + + this.defaultDateFormat = getDateFormatString( + this.user.settings.locale + ); } }); } diff --git a/apps/client/src/app/components/admin-users/admin-users.html b/apps/client/src/app/components/admin-users/admin-users.html index 15127802e..ad1fe26f5 100644 --- a/apps/client/src/app/components/admin-users/admin-users.html +++ b/apps/client/src/app/components/admin-users/admin-users.html @@ -53,6 +53,7 @@ *ngIf="userItem?.subscription?.type === 'Premium'" class="ml-1" [enableLink]="false" + [title]="userItem.subscription.expiresAt | date: defaultDateFormat" >