From 95bcc3f32d65547858d0a21ab2bd35335610106c Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 17 Jul 2022 11:05:23 +0200 Subject: [PATCH] Feature/remove alias from user interface (#1083) * Remove alias from user interface * Update changelog --- CHANGELOG.md | 6 ++++++ apps/api/src/app/admin/admin.service.ts | 6 +----- apps/api/src/app/user/user.service.ts | 10 +--------- .../src/app/components/admin-users/admin-users.html | 5 ++--- .../src/app/components/header/header.component.html | 4 +--- apps/client/src/app/pages/account/account-page.html | 4 ---- libs/common/src/lib/interfaces/admin-data.interface.ts | 1 - libs/common/src/lib/interfaces/user.interface.ts | 1 - 8 files changed, 11 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b147fac8a..5e613f3b6 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 + +### Changed + +- Removed the alias from the user interface as a preparation to remove it from the `User` database schema + ## 1.169.0 - 14.07.2022 ### Added diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 5e240a473..2d4edc993 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -1,6 +1,5 @@ import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; -import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; import { MarketDataService } from '@ghostfolio/api/services/market-data.service'; import { PrismaService } from '@ghostfolio/api/services/prisma.service'; @@ -24,7 +23,6 @@ export class AdminService { public constructor( private readonly configurationService: ConfigurationService, - private readonly dataGatheringService: DataGatheringService, private readonly exchangeRateDataService: ExchangeRateDataService, private readonly marketDataService: MarketDataService, private readonly prismaService: PrismaService, @@ -174,7 +172,6 @@ export class AdminService { _count: { select: { Account: true, Order: true } }, - alias: true, Analytics: { select: { activityCount: true, @@ -194,7 +191,7 @@ export class AdminService { }); return usersWithAnalytics.map( - ({ _count, alias, Analytics, createdAt, id, Subscription }) => { + ({ _count, Analytics, createdAt, id, Subscription }) => { const daysSinceRegistration = differenceInDays(new Date(), createdAt) + 1; const engagement = Analytics.activityCount / daysSinceRegistration; @@ -206,7 +203,6 @@ export class AdminService { : undefined; return { - alias, createdAt, engagement, id, diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index 32716b454..213351ede 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -36,14 +36,7 @@ export class UserService { } public async getUser( - { - Account, - alias, - id, - permissions, - Settings, - subscription - }: UserWithSettings, + { Account, id, permissions, Settings, subscription }: UserWithSettings, aLocale = locale ): Promise { const access = await this.prismaService.access.findMany({ @@ -63,7 +56,6 @@ export class UserService { } return { - alias, id, permissions, subscription, 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 39f778b2b..8eef62832 100644 --- a/apps/client/src/app/components/admin-users/admin-users.html +++ b/apps/client/src/app/components/admin-users/admin-users.html @@ -29,11 +29,10 @@
{{ userItem.alias || userItem.id }}{{ userItem.id }} {{ userItem.alias || (userItem.id | slice:0:5) + - '...' }}{{ (userItem.id | slice:0:5) + '...' }} - {{ user.alias }} - Me + Me