Browse Source

Refactoring

pull/2870/head
Thomas Kaul 2 years ago
parent
commit
8477ca3315
  1. 8
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html
  2. 2
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts
  3. 4
      apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts
  4. 3
      libs/common/src/lib/interfaces/access.interface.ts
  5. 1
      libs/common/src/lib/types/access-type.type.ts
  6. 2
      libs/common/src/lib/types/index.ts
  7. 2
      libs/ui/src/lib/value/value.component.html

8
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html

@ -1,14 +1,12 @@
<div class="container p-0">
<div class="no-gutters row">
<div
class="status-container text-muted text-right"
(click)="errors?.length > 0 && onShowErrors()"
>
<div class="status-container text-muted text-right">
@if (errors?.length > 0 && !isLoading) {
<ion-icon
i18n-title
name="time-outline"
title="Oops! Our data provider partner is experiencing the hiccups."
title="Oops! A data provider is experiencing the hiccups."
(click)="onShowErrors()"
/>
}
</div>

2
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts

@ -70,7 +70,7 @@ export class PortfolioPerformanceComponent implements OnChanges, OnInit {
}
).start();
} else {
this.value.nativeElement.innerHTML = '***';
this.value.nativeElement.innerHTML = '*****';
}
}
}

4
apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts

@ -42,11 +42,11 @@ export class CreateOrUpdateAccessDialog implements OnDestroy {
userId: [this.data.access.grantee, Validators.required]
});
this.accessForm.get('type').valueChanges.subscribe((value) => {
this.accessForm.get('type').valueChanges.subscribe((accessType) => {
const permissionsControl = this.accessForm.get('permissions');
const userIdControl = this.accessForm.get('userId');
if (value === 'PRIVATE') {
if (accessType === 'PRIVATE') {
permissionsControl.setValidators(Validators.required);
userIdControl.setValidators(Validators.required);
} else {

3
libs/common/src/lib/interfaces/access.interface.ts

@ -1,3 +1,4 @@
import { AccessType } from '@ghostfolio/common/types';
import { AccessPermission } from '@prisma/client';
export interface Access {
@ -5,5 +6,5 @@ export interface Access {
grantee?: string;
id: string;
permissions: AccessPermission[];
type: 'PRIVATE' | 'PUBLIC';
type: AccessType;
}

1
libs/common/src/lib/types/access-type.type.ts

@ -0,0 +1 @@
export type AccessType = 'PRIVATE' | 'PUBLIC';

2
libs/common/src/lib/types/index.ts

@ -1,3 +1,4 @@
import type { AccessType } from './access-type.type';
import type { AccessWithGranteeUser } from './access-with-grantee-user.type';
import type { AccountWithPlatform } from './account-with-platform.type';
import type { AccountWithValue } from './account-with-value.type';
@ -18,6 +19,7 @@ import type { UserWithSettings } from './user-with-settings.type';
import type { ViewMode } from './view-mode.type';
export type {
AccessType,
AccessWithGranteeUser,
AccountWithPlatform,
AccountWithValue,

2
libs/ui/src/lib/value/value.component.html

@ -32,7 +32,7 @@
}"
>
<ng-container *ngIf="value === null">
<span class="text-monospace text-muted">***</span>
<span class="text-monospace text-muted">*****</span>
</ng-container>
<ng-container *ngIf="value !== null">
{{ formattedValue }}

Loading…
Cancel
Save