Browse Source

Merge branch 'main' into feature/remove-activities-import-limit-for-premium-users

pull/1082/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
b31e2ba97e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 6
      apps/api/src/app/admin/admin.service.ts
  3. 10
      apps/api/src/app/user/user.service.ts
  4. 5
      apps/client/src/app/components/admin-users/admin-users.html
  5. 4
      apps/client/src/app/components/header/header.component.html
  6. 4
      apps/client/src/app/pages/account/account-page.html
  7. 9
      apps/client/src/app/pages/blog/2022/07/how-do-i-get-my-finances-in-order/how-do-i-get-my-finances-in-order-page.html
  8. 16
      apps/client/src/app/pages/resources/resources-page.html
  9. 1
      libs/common/src/lib/interfaces/admin-data.interface.ts
  10. 1
      libs/common/src/lib/interfaces/user.interface.ts

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Removed the alias from the user interface as a preparation to remove it from the `User` database schema
- Removed the activities import limit for users with a subscription
### Todo

6
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,

10
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<IUser> {
const access = await this.prismaService.access.findMany({
@ -63,7 +56,6 @@ export class UserService {
}
return {
alias,
id,
permissions,
subscription,

5
apps/client/src/app/components/admin-users/admin-users.html

@ -29,11 +29,10 @@
<td class="mat-cell px-1 py-2">
<div class="d-flex align-items-center">
<span class="d-none d-sm-inline-block"
>{{ userItem.alias || userItem.id }}</span
>{{ userItem.id }}</span
>
<span class="d-inline-block d-sm-none"
>{{ userItem.alias || (userItem.id | slice:0:5) +
'...' }}</span
>{{ (userItem.id | slice:0:5) + '...' }}</span
>
<gf-premium-indicator
*ngIf="userItem?.subscription?.type === 'Premium'"

4
apps/client/src/app/components/header/header.component.html

@ -124,13 +124,11 @@
: 'radio-button-on-outline'
"
></ion-icon>
<span *ngIf="user?.alias">{{ user.alias }}</span>
<span *ngIf="!user?.alias" i18n><span></span>Me</span>
<span i18n>Me</span>
</button>
<button
*ngFor="let accessItem of user?.access"
class="align-items-center d-flex"
disabled="false"
mat-menu-item
(click)="impersonateAccount(accessItem.id)"
>

4
apps/client/src/app/pages/account/account-page.html

@ -8,10 +8,6 @@
<div class="col">
<mat-card class="mb-3">
<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
*ngIf="hasPermissionToUpdateUserSettings && user?.subscription"
class="d-flex py-1"

9
apps/client/src/app/pages/blog/2022/07/how-do-i-get-my-finances-in-order/how-do-i-get-my-finances-in-order-page.html

@ -9,9 +9,9 @@
<section class="mb-4">
<p>
Before you can think of
<a [routerLink]="['/resources']">long-term investing</a>, you need
to have your finances in order. Take a look at Peter's journey to
see how you can achieve it, too.
<a [routerLink]="['/resources']">long-term investing</a>, you have
to get your finances in order. Take a look at Peter's journey to see
how you can achieve it, too.
</p>
<p>
Peter enjoys life, but sometimes he overspends a bit. He realizes it
@ -153,6 +153,9 @@
<li class="list-inline-item">
<span class="badge badge-light">Goal</span>
</li>
<li class="list-inline-item">
<span class="badge badge-light">Guide</span>
</li>
<li class="list-inline-item">
<span class="badge badge-light">Income</span>
</li>

16
apps/client/src/app/pages/resources/resources-page.html

@ -20,6 +20,22 @@
</div>
</div>
</div>
<div class="mb-4 media">
<div class="media-body">
<h3 class="h5 mt-0">How do I get my finances in order?</h3>
<div class="mb-1">
Before you can think of long-term investing, you have to get your
finances in order. Learn how you can reach your financial goals
easier and faster in this guide.
</div>
<div>
<a
[routerLink]="['/en', 'blog', '2022', '07', 'how-do-i-get-my-finances-in-order']"
>How do I get my finances in order? →</a
>
</div>
</div>
</div>
</div>
<h2 class="h4 mb-3">Market</h2>
<div class="mb-5">

1
libs/common/src/lib/interfaces/admin-data.interface.ts

@ -5,7 +5,6 @@ export interface AdminData {
userCount: number;
users: {
accountCount: number;
alias: string;
createdAt: Date;
engagement: number;
id: string;

1
libs/common/src/lib/interfaces/user.interface.ts

@ -8,7 +8,6 @@ export interface User {
id: string;
}[];
accounts: Account[];
alias?: string;
id: string;
permissions: string[];
settings: UserSettings;

Loading…
Cancel
Save