Feature/remove alias from user interface (#1083)
* Remove alias from user interface * Update changelog
This commit is contained in:
parent
e9dbd4a55d
commit
95bcc3f32d
@ -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/),
|
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).
|
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
|
## 1.169.0 - 14.07.2022
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service';
|
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service';
|
||||||
import { ConfigurationService } from '@ghostfolio/api/services/configuration.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 { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
|
||||||
import { MarketDataService } from '@ghostfolio/api/services/market-data.service';
|
import { MarketDataService } from '@ghostfolio/api/services/market-data.service';
|
||||||
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
|
||||||
@ -24,7 +23,6 @@ export class AdminService {
|
|||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private readonly configurationService: ConfigurationService,
|
private readonly configurationService: ConfigurationService,
|
||||||
private readonly dataGatheringService: DataGatheringService,
|
|
||||||
private readonly exchangeRateDataService: ExchangeRateDataService,
|
private readonly exchangeRateDataService: ExchangeRateDataService,
|
||||||
private readonly marketDataService: MarketDataService,
|
private readonly marketDataService: MarketDataService,
|
||||||
private readonly prismaService: PrismaService,
|
private readonly prismaService: PrismaService,
|
||||||
@ -174,7 +172,6 @@ export class AdminService {
|
|||||||
_count: {
|
_count: {
|
||||||
select: { Account: true, Order: true }
|
select: { Account: true, Order: true }
|
||||||
},
|
},
|
||||||
alias: true,
|
|
||||||
Analytics: {
|
Analytics: {
|
||||||
select: {
|
select: {
|
||||||
activityCount: true,
|
activityCount: true,
|
||||||
@ -194,7 +191,7 @@ export class AdminService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return usersWithAnalytics.map(
|
return usersWithAnalytics.map(
|
||||||
({ _count, alias, Analytics, createdAt, id, Subscription }) => {
|
({ _count, Analytics, createdAt, id, Subscription }) => {
|
||||||
const daysSinceRegistration =
|
const daysSinceRegistration =
|
||||||
differenceInDays(new Date(), createdAt) + 1;
|
differenceInDays(new Date(), createdAt) + 1;
|
||||||
const engagement = Analytics.activityCount / daysSinceRegistration;
|
const engagement = Analytics.activityCount / daysSinceRegistration;
|
||||||
@ -206,7 +203,6 @@ export class AdminService {
|
|||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
alias,
|
|
||||||
createdAt,
|
createdAt,
|
||||||
engagement,
|
engagement,
|
||||||
id,
|
id,
|
||||||
|
@ -36,14 +36,7 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async getUser(
|
public async getUser(
|
||||||
{
|
{ Account, id, permissions, Settings, subscription }: UserWithSettings,
|
||||||
Account,
|
|
||||||
alias,
|
|
||||||
id,
|
|
||||||
permissions,
|
|
||||||
Settings,
|
|
||||||
subscription
|
|
||||||
}: UserWithSettings,
|
|
||||||
aLocale = locale
|
aLocale = locale
|
||||||
): Promise<IUser> {
|
): Promise<IUser> {
|
||||||
const access = await this.prismaService.access.findMany({
|
const access = await this.prismaService.access.findMany({
|
||||||
@ -63,7 +56,6 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
alias,
|
|
||||||
id,
|
id,
|
||||||
permissions,
|
permissions,
|
||||||
subscription,
|
subscription,
|
||||||
|
@ -29,11 +29,10 @@
|
|||||||
<td class="mat-cell px-1 py-2">
|
<td class="mat-cell px-1 py-2">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<span class="d-none d-sm-inline-block"
|
<span class="d-none d-sm-inline-block"
|
||||||
>{{ userItem.alias || userItem.id }}</span
|
>{{ userItem.id }}</span
|
||||||
>
|
>
|
||||||
<span class="d-inline-block d-sm-none"
|
<span class="d-inline-block d-sm-none"
|
||||||
>{{ userItem.alias || (userItem.id | slice:0:5) +
|
>{{ (userItem.id | slice:0:5) + '...' }}</span
|
||||||
'...' }}</span
|
|
||||||
>
|
>
|
||||||
<gf-premium-indicator
|
<gf-premium-indicator
|
||||||
*ngIf="userItem?.subscription?.type === 'Premium'"
|
*ngIf="userItem?.subscription?.type === 'Premium'"
|
||||||
|
@ -124,13 +124,11 @@
|
|||||||
: 'radio-button-on-outline'
|
: 'radio-button-on-outline'
|
||||||
"
|
"
|
||||||
></ion-icon>
|
></ion-icon>
|
||||||
<span *ngIf="user?.alias">{{ user.alias }}</span>
|
<span i18n>Me</span>
|
||||||
<span *ngIf="!user?.alias" i18n><span></span>Me</span>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngFor="let accessItem of user?.access"
|
*ngFor="let accessItem of user?.access"
|
||||||
class="align-items-center d-flex"
|
class="align-items-center d-flex"
|
||||||
disabled="false"
|
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
(click)="impersonateAccount(accessItem.id)"
|
(click)="impersonateAccount(accessItem.id)"
|
||||||
>
|
>
|
||||||
|
@ -8,10 +8,6 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<mat-card class="mb-3">
|
<mat-card class="mb-3">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div *ngIf="user.alias" class="d-flex py-1">
|
|
||||||
<div class="pr-1 w-50" i18n>Alias</div>
|
|
||||||
<div class="pl-1 w-50">{{ user.alias }}</div>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
*ngIf="hasPermissionToUpdateUserSettings && user?.subscription"
|
*ngIf="hasPermissionToUpdateUserSettings && user?.subscription"
|
||||||
class="d-flex py-1"
|
class="d-flex py-1"
|
||||||
|
@ -5,7 +5,6 @@ export interface AdminData {
|
|||||||
userCount: number;
|
userCount: number;
|
||||||
users: {
|
users: {
|
||||||
accountCount: number;
|
accountCount: number;
|
||||||
alias: string;
|
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
engagement: number;
|
engagement: number;
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -8,7 +8,6 @@ export interface User {
|
|||||||
id: string;
|
id: string;
|
||||||
}[];
|
}[];
|
||||||
accounts: Account[];
|
accounts: Account[];
|
||||||
alias?: string;
|
|
||||||
id: string;
|
id: string;
|
||||||
permissions: string[];
|
permissions: string[];
|
||||||
settings: UserSettings;
|
settings: UserSettings;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user