Browse Source

Task/improve typings of dialogs (#5846)

* Improve typings
pull/5834/head^2
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
ecc35c9ffa
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      apps/client/src/app/app.component.ts
  2. 17
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
  3. 28
      apps/client/src/app/components/admin-platform/admin-platform.component.ts
  4. 14
      apps/client/src/app/components/admin-tag/admin-tag.component.ts
  5. 2
      apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/interfaces/interfaces.ts
  6. 7
      apps/client/src/app/components/admin-users/admin-users.component.ts
  7. 6
      apps/client/src/app/components/header/header.component.ts
  8. 10
      apps/client/src/app/components/home-watchlist/home-watchlist.component.ts
  9. 5
      apps/client/src/app/components/login-with-access-token-dialog/interfaces/interfaces.ts
  10. 4
      apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts
  11. 7
      apps/client/src/app/components/rule/rule.component.ts
  12. 15
      apps/client/src/app/components/user-account-access/user-account-access.component.ts
  13. 25
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  14. 2
      apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts
  15. 31
      apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
  16. 1
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts
  17. 2
      apps/client/src/app/pages/portfolio/activities/import-activities-dialog/interfaces/interfaces.ts
  18. 7
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
  19. 10
      apps/client/src/app/pages/register/register-page.component.ts
  20. 10
      apps/client/src/app/services/user/user.service.ts
  21. 7
      libs/ui/src/lib/benchmark/benchmark.component.ts
  22. 10
      libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts

7
apps/client/src/app/app.component.ts

@ -276,7 +276,10 @@ export class AppComponent implements OnDestroy, OnInit {
.subscribe((user) => { .subscribe((user) => {
this.user = user; this.user = user;
const dialogRef = this.dialog.open(GfHoldingDetailDialogComponent, { const dialogRef = this.dialog.open<
GfHoldingDetailDialogComponent,
HoldingDetailDialogParams
>(GfHoldingDetailDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
dataSource, dataSource,
@ -302,7 +305,7 @@ export class AppComponent implements OnDestroy, OnInit {
hasPermission(this.user?.permissions, permissions.updateOrder) && hasPermission(this.user?.permissions, permissions.updateOrder) &&
!this.user?.settings?.isRestrictedView, !this.user?.settings?.isRestrictedView,
locale: this.user?.settings?.locale locale: this.user?.settings?.locale
} as HoldingDetailDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });

17
apps/client/src/app/components/admin-market-data/admin-market-data.component.ts

@ -430,7 +430,10 @@ export class GfAdminMarketDataComponent
.subscribe((user) => { .subscribe((user) => {
this.user = user; this.user = user;
const dialogRef = this.dialog.open(GfAssetProfileDialogComponent, { const dialogRef = this.dialog.open<
GfAssetProfileDialogComponent,
AssetProfileDialogParams
>(GfAssetProfileDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
dataSource, dataSource,
@ -438,7 +441,7 @@ export class GfAdminMarketDataComponent
colorScheme: this.user?.settings.colorScheme, colorScheme: this.user?.settings.colorScheme,
deviceType: this.deviceType, deviceType: this.deviceType,
locale: this.user?.settings?.locale locale: this.user?.settings?.locale
} as AssetProfileDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });
@ -465,17 +468,17 @@ export class GfAdminMarketDataComponent
.subscribe((user) => { .subscribe((user) => {
this.user = user; this.user = user;
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfCreateAssetProfileDialogComponent, GfCreateAssetProfileDialogComponent,
{ CreateAssetProfileDialogParams
>(GfCreateAssetProfileDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
deviceType: this.deviceType, deviceType: this.deviceType,
locale: this.user?.settings?.locale locale: this.user?.settings?.locale
} as CreateAssetProfileDialogParams, },
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()

28
apps/client/src/app/components/admin-platform/admin-platform.component.ts

@ -34,6 +34,7 @@ import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, takeUntil } from 'rxjs'; import { Subject, takeUntil } from 'rxjs';
import { GfCreateOrUpdatePlatformDialogComponent } from './create-or-update-platform-dialog/create-or-update-platform-dialog.component'; import { GfCreateOrUpdatePlatformDialogComponent } from './create-or-update-platform-dialog/create-or-update-platform-dialog.component';
import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-dialog/interfaces/interfaces';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -153,19 +154,20 @@ export class GfAdminPlatformComponent implements OnInit, OnDestroy {
} }
private openCreatePlatformDialog() { private openCreatePlatformDialog() {
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfCreateOrUpdatePlatformDialogComponent, GfCreateOrUpdatePlatformDialogComponent,
{ CreateOrUpdatePlatformDialogParams
>(GfCreateOrUpdatePlatformDialogComponent, {
data: { data: {
platform: { platform: {
id: null,
name: null, name: null,
url: null url: null
} }
}, },
height: this.deviceType === 'mobile' ? '98vh' : undefined, height: this.deviceType === 'mobile' ? '98vh' : undefined,
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()
@ -191,10 +193,19 @@ export class GfAdminPlatformComponent implements OnInit, OnDestroy {
}); });
} }
private openUpdatePlatformDialog({ id, name, url }) { private openUpdatePlatformDialog({
const dialogRef = this.dialog.open( id,
name,
url
}: {
id: string;
name: string;
url: string;
}) {
const dialogRef = this.dialog.open<
GfCreateOrUpdatePlatformDialogComponent, GfCreateOrUpdatePlatformDialogComponent,
{ CreateOrUpdatePlatformDialogParams
>(GfCreateOrUpdatePlatformDialogComponent, {
data: { data: {
platform: { platform: {
id, id,
@ -204,8 +215,7 @@ export class GfAdminPlatformComponent implements OnInit, OnDestroy {
}, },
height: this.deviceType === 'mobile' ? '98vh' : undefined, height: this.deviceType === 'mobile' ? '98vh' : undefined,
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()

14
apps/client/src/app/components/admin-tag/admin-tag.component.ts

@ -32,6 +32,7 @@ import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, takeUntil } from 'rxjs'; import { Subject, takeUntil } from 'rxjs';
import { GfCreateOrUpdateTagDialogComponent } from './create-or-update-tag-dialog/create-or-update-tag-dialog.component'; import { GfCreateOrUpdateTagDialogComponent } from './create-or-update-tag-dialog/create-or-update-tag-dialog.component';
import { CreateOrUpdateTagDialogParams } from './create-or-update-tag-dialog/interfaces/interfaces';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -149,9 +150,13 @@ export class GfAdminTagComponent implements OnInit, OnDestroy {
} }
private openCreateTagDialog() { private openCreateTagDialog() {
const dialogRef = this.dialog.open(GfCreateOrUpdateTagDialogComponent, { const dialogRef = this.dialog.open<
GfCreateOrUpdateTagDialogComponent,
CreateOrUpdateTagDialogParams
>(GfCreateOrUpdateTagDialogComponent, {
data: { data: {
tag: { tag: {
id: null,
name: null name: null
} }
}, },
@ -183,8 +188,11 @@ export class GfAdminTagComponent implements OnInit, OnDestroy {
}); });
} }
private openUpdateTagDialog({ id, name }) { private openUpdateTagDialog({ id, name }: { id: string; name: string }) {
const dialogRef = this.dialog.open(GfCreateOrUpdateTagDialogComponent, { const dialogRef = this.dialog.open<
GfCreateOrUpdateTagDialogComponent,
CreateOrUpdateTagDialogParams
>(GfCreateOrUpdateTagDialogComponent, {
data: { data: {
tag: { tag: {
id, id,

2
apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/interfaces/interfaces.ts

@ -1,5 +1,5 @@
import { Tag } from '@prisma/client'; import { Tag } from '@prisma/client';
export interface CreateOrUpdateTagDialogParams { export interface CreateOrUpdateTagDialogParams {
tag: Tag; tag: Pick<Tag, 'id' | 'name'>;
} }

7
apps/client/src/app/components/admin-users/admin-users.component.ts

@ -288,14 +288,17 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit {
return; return;
} }
const dialogRef = this.dialog.open(GfUserDetailDialogComponent, { const dialogRef = this.dialog.open<
GfUserDetailDialogComponent,
UserDetailDialogParams
>(GfUserDetailDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
userData, userData,
deviceType: this.deviceType, deviceType: this.deviceType,
hasPermissionForSubscription: this.hasPermissionForSubscription, hasPermissionForSubscription: this.hasPermissionForSubscription,
locale: this.user?.settings?.locale locale: this.user?.settings?.locale
} as UserDetailDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : '60vh', height: this.deviceType === 'mobile' ? '98vh' : '60vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });

6
apps/client/src/app/components/header/header.component.ts

@ -1,4 +1,5 @@
import { UpdateUserSettingDto } from '@ghostfolio/api/app/user/update-user-setting.dto'; import { UpdateUserSettingDto } from '@ghostfolio/api/app/user/update-user-setting.dto';
import { LoginWithAccessTokenDialogParams } from '@ghostfolio/client/components/login-with-access-token-dialog/interfaces/interfaces';
import { GfLoginWithAccessTokenDialogComponent } from '@ghostfolio/client/components/login-with-access-token-dialog/login-with-access-token-dialog.component'; import { GfLoginWithAccessTokenDialogComponent } from '@ghostfolio/client/components/login-with-access-token-dialog/login-with-access-token-dialog.component';
import { LayoutService } from '@ghostfolio/client/core/layout.service'; import { LayoutService } from '@ghostfolio/client/core/layout.service';
import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service';
@ -271,7 +272,10 @@ export class GfHeaderComponent implements OnChanges {
} }
public openLoginDialog() { public openLoginDialog() {
const dialogRef = this.dialog.open(GfLoginWithAccessTokenDialogComponent, { const dialogRef = this.dialog.open<
GfLoginWithAccessTokenDialogComponent,
LoginWithAccessTokenDialogParams
>(GfLoginWithAccessTokenDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
accessToken: '', accessToken: '',

10
apps/client/src/app/components/home-watchlist/home-watchlist.component.ts

@ -149,17 +149,17 @@ export class GfHomeWatchlistComponent implements OnDestroy, OnInit {
.subscribe((user) => { .subscribe((user) => {
this.user = user; this.user = user;
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfCreateWatchlistItemDialogComponent, GfCreateWatchlistItemDialogComponent,
{ CreateWatchlistItemDialogParams
>(GfCreateWatchlistItemDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
deviceType: this.deviceType, deviceType: this.deviceType,
locale: this.user?.settings?.locale locale: this.user?.settings?.locale
} as CreateWatchlistItemDialogParams, },
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()

5
apps/client/src/app/components/login-with-access-token-dialog/interfaces/interfaces.ts

@ -0,0 +1,5 @@
export interface LoginWithAccessTokenDialogParams {
accessToken: string;
hasPermissionToUseSocialLogin: boolean;
title: string;
}

4
apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts

@ -26,6 +26,8 @@ import { IonIcon } from '@ionic/angular/standalone';
import { addIcons } from 'ionicons'; import { addIcons } from 'ionicons';
import { eyeOffOutline, eyeOutline } from 'ionicons/icons'; import { eyeOffOutline, eyeOutline } from 'ionicons/icons';
import { LoginWithAccessTokenDialogParams } from './interfaces/interfaces';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ imports: [
@ -51,7 +53,7 @@ export class GfLoginWithAccessTokenDialogComponent {
public isAccessTokenHidden = true; public isAccessTokenHidden = true;
public constructor( public constructor(
@Inject(MAT_DIALOG_DATA) public data: any, @Inject(MAT_DIALOG_DATA) public data: LoginWithAccessTokenDialogParams,
public dialogRef: MatDialogRef<GfLoginWithAccessTokenDialogComponent>, public dialogRef: MatDialogRef<GfLoginWithAccessTokenDialogComponent>,
private internetIdentityService: InternetIdentityService, private internetIdentityService: InternetIdentityService,
private router: Router, private router: Router,

7
apps/client/src/app/components/rule/rule.component.ts

@ -79,13 +79,16 @@ export class GfRuleComponent implements OnInit {
} }
public onCustomizeRule(rule: PortfolioReportRule) { public onCustomizeRule(rule: PortfolioReportRule) {
const dialogRef = this.dialog.open(GfRuleSettingsDialogComponent, { const dialogRef = this.dialog.open<
GfRuleSettingsDialogComponent,
RuleSettingsDialogParams
>(GfRuleSettingsDialogComponent, {
data: { data: {
rule, rule,
categoryName: this.categoryName, categoryName: this.categoryName,
locale: this.locale, locale: this.locale,
settings: this.settings settings: this.settings
} as RuleSettingsDialogParams, },
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });

15
apps/client/src/app/components/user-account-access/user-account-access.component.ts

@ -31,6 +31,7 @@ import { EMPTY, Subject } from 'rxjs';
import { catchError, takeUntil } from 'rxjs/operators'; import { catchError, takeUntil } from 'rxjs/operators';
import { GfCreateOrUpdateAccessDialogComponent } from './create-or-update-access-dialog/create-or-update-access-dialog.component'; import { GfCreateOrUpdateAccessDialogComponent } from './create-or-update-access-dialog/create-or-update-access-dialog.component';
import { CreateOrUpdateAccessDialogParams } from './create-or-update-access-dialog/interfaces/interfaces';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -187,10 +188,15 @@ export class GfUserAccountAccessComponent implements OnDestroy, OnInit {
} }
private openCreateAccessDialog() { private openCreateAccessDialog() {
const dialogRef = this.dialog.open(GfCreateOrUpdateAccessDialogComponent, { const dialogRef = this.dialog.open<
GfCreateOrUpdateAccessDialogComponent,
CreateOrUpdateAccessDialogParams
>(GfCreateOrUpdateAccessDialogComponent, {
data: { data: {
access: { access: {
alias: '', alias: '',
grantee: null,
id: null,
permissions: ['READ_RESTRICTED'], permissions: ['READ_RESTRICTED'],
type: 'PRIVATE' type: 'PRIVATE'
} }
@ -219,12 +225,15 @@ export class GfUserAccountAccessComponent implements OnDestroy, OnInit {
return; return;
} }
const dialogRef = this.dialog.open(GfCreateOrUpdateAccessDialogComponent, { const dialogRef = this.dialog.open<
GfCreateOrUpdateAccessDialogComponent,
CreateOrUpdateAccessDialogParams
>(GfCreateOrUpdateAccessDialogComponent, {
data: { data: {
access: { access: {
alias: access.alias, alias: access.alias,
id: access.id,
grantee: access.grantee === 'Public' ? null : access.grantee, grantee: access.grantee === 'Public' ? null : access.grantee,
id: access.id,
permissions: access.permissions, permissions: access.permissions,
type: access.type type: access.type
} }

25
apps/client/src/app/pages/accounts/accounts-page.component.ts

@ -23,6 +23,8 @@ import { EMPTY, Subject, Subscription } from 'rxjs';
import { catchError, takeUntil } from 'rxjs/operators'; import { catchError, takeUntil } from 'rxjs/operators';
import { GfCreateOrUpdateAccountDialogComponent } from './create-or-update-account-dialog/create-or-update-account-dialog.component'; import { GfCreateOrUpdateAccountDialogComponent } from './create-or-update-account-dialog/create-or-update-account-dialog.component';
import { CreateOrUpdateAccountDialogParams } from './create-or-update-account-dialog/interfaces/interfaces';
import { TransferBalanceDialogParams } from './transfer-balance/interfaces/interfaces';
import { GfTransferBalanceDialogComponent } from './transfer-balance/transfer-balance-dialog.component'; import { GfTransferBalanceDialogComponent } from './transfer-balance/transfer-balance-dialog.component';
@Component({ @Component({
@ -179,7 +181,10 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit {
name, name,
platformId platformId
}: AccountModel) { }: AccountModel) {
const dialogRef = this.dialog.open(GfCreateOrUpdateAccountDialogComponent, { const dialogRef = this.dialog.open<
GfCreateOrUpdateAccountDialogComponent,
CreateOrUpdateAccountDialogParams
>(GfCreateOrUpdateAccountDialogComponent, {
data: { data: {
account: { account: {
balance, balance,
@ -227,7 +232,10 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit {
} }
private openAccountDetailDialog(aAccountId: string) { private openAccountDetailDialog(aAccountId: string) {
const dialogRef = this.dialog.open(GfAccountDetailDialogComponent, { const dialogRef = this.dialog.open<
GfAccountDetailDialogComponent,
AccountDetailDialogParams
>(GfAccountDetailDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
accountId: aAccountId, accountId: aAccountId,
@ -237,7 +245,7 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit {
!this.hasImpersonationId && !this.hasImpersonationId &&
hasPermission(this.user?.permissions, permissions.createOrder) && hasPermission(this.user?.permissions, permissions.createOrder) &&
!this.user?.settings?.isRestrictedView !this.user?.settings?.isRestrictedView
} as AccountDetailDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });
@ -253,12 +261,16 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit {
} }
private openCreateAccountDialog() { private openCreateAccountDialog() {
const dialogRef = this.dialog.open(GfCreateOrUpdateAccountDialogComponent, { const dialogRef = this.dialog.open<
GfCreateOrUpdateAccountDialogComponent,
CreateOrUpdateAccountDialogParams
>(GfCreateOrUpdateAccountDialogComponent, {
data: { data: {
account: { account: {
balance: 0, balance: 0,
comment: null, comment: null,
currency: this.user?.settings?.baseCurrency, currency: this.user?.settings?.baseCurrency,
id: null,
isExcluded: false, isExcluded: false,
name: null, name: null,
platformId: null platformId: null
@ -295,7 +307,10 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit {
} }
private openTransferBalanceDialog() { private openTransferBalanceDialog() {
const dialogRef = this.dialog.open(GfTransferBalanceDialogComponent, { const dialogRef = this.dialog.open<
GfTransferBalanceDialogComponent,
TransferBalanceDialogParams
>(GfTransferBalanceDialogComponent, {
data: { data: {
accounts: this.accounts accounts: this.accounts
}, },

2
apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts

@ -1,5 +1,5 @@
import { Account } from '@prisma/client'; import { Account } from '@prisma/client';
export interface CreateOrUpdateAccountDialogParams { export interface CreateOrUpdateAccountDialogParams {
account: Account; account: Omit<Account, 'createdAt' | 'updatedAt' | 'userId'>;
} }

31
apps/client/src/app/pages/portfolio/activities/activities-page.component.ts

@ -28,6 +28,7 @@ import { Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { GfCreateOrUpdateActivityDialogComponent } from './create-or-update-activity-dialog/create-or-update-activity-dialog.component'; import { GfCreateOrUpdateActivityDialogComponent } from './create-or-update-activity-dialog/create-or-update-activity-dialog.component';
import { CreateOrUpdateActivityDialogParams } from './create-or-update-activity-dialog/interfaces/interfaces';
import { GfImportActivitiesDialogComponent } from './import-activities-dialog/import-activities-dialog.component'; import { GfImportActivitiesDialogComponent } from './import-activities-dialog/import-activities-dialog.component';
import { ImportActivitiesDialogParams } from './import-activities-dialog/interfaces/interfaces'; import { ImportActivitiesDialogParams } from './import-activities-dialog/interfaces/interfaces';
@ -245,11 +246,14 @@ export class GfActivitiesPageComponent implements OnDestroy, OnInit {
} }
public onImport() { public onImport() {
const dialogRef = this.dialog.open(GfImportActivitiesDialogComponent, { const dialogRef = this.dialog.open<
GfImportActivitiesDialogComponent,
ImportActivitiesDialogParams
>(GfImportActivitiesDialogComponent, {
data: { data: {
deviceType: this.deviceType, deviceType: this.deviceType,
user: this.user user: this.user
} as ImportActivitiesDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : undefined, height: this.deviceType === 'mobile' ? '98vh' : undefined,
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });
@ -268,12 +272,15 @@ export class GfActivitiesPageComponent implements OnDestroy, OnInit {
} }
public onImportDividends() { public onImportDividends() {
const dialogRef = this.dialog.open(GfImportActivitiesDialogComponent, { const dialogRef = this.dialog.open<
GfImportActivitiesDialogComponent,
ImportActivitiesDialogParams
>(GfImportActivitiesDialogComponent, {
data: { data: {
activityTypes: ['DIVIDEND'], activityTypes: ['DIVIDEND'],
deviceType: this.deviceType, deviceType: this.deviceType,
user: this.user user: this.user
} as ImportActivitiesDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : undefined, height: this.deviceType === 'mobile' ? '98vh' : undefined,
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });
@ -306,9 +313,10 @@ export class GfActivitiesPageComponent implements OnDestroy, OnInit {
} }
public openUpdateActivityDialog(aActivity: Activity) { public openUpdateActivityDialog(aActivity: Activity) {
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfCreateOrUpdateActivityDialogComponent, GfCreateOrUpdateActivityDialogComponent,
{ CreateOrUpdateActivityDialogParams
>(GfCreateOrUpdateActivityDialogComponent, {
data: { data: {
activity: aActivity, activity: aActivity,
accounts: this.user?.accounts, accounts: this.user?.accounts,
@ -316,8 +324,7 @@ export class GfActivitiesPageComponent implements OnDestroy, OnInit {
}, },
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()
@ -350,9 +357,10 @@ export class GfActivitiesPageComponent implements OnDestroy, OnInit {
.subscribe((user) => { .subscribe((user) => {
this.updateUser(user); this.updateUser(user);
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfCreateOrUpdateActivityDialogComponent, GfCreateOrUpdateActivityDialogComponent,
{ CreateOrUpdateActivityDialogParams
>(GfCreateOrUpdateActivityDialogComponent, {
data: { data: {
accounts: this.user?.accounts, accounts: this.user?.accounts,
activity: { activity: {
@ -368,8 +376,7 @@ export class GfActivitiesPageComponent implements OnDestroy, OnInit {
}, },
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()

1
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts

@ -4,7 +4,6 @@ import { User } from '@ghostfolio/common/interfaces';
import { Account } from '@prisma/client'; import { Account } from '@prisma/client';
export interface CreateOrUpdateActivityDialogParams { export interface CreateOrUpdateActivityDialogParams {
accountId: string;
accounts: Account[]; accounts: Account[];
activity: Activity; activity: Activity;
user: User; user: User;

2
apps/client/src/app/pages/portfolio/activities/import-activities-dialog/interfaces/interfaces.ts

@ -3,7 +3,7 @@ import { User } from '@ghostfolio/common/interfaces';
import { Type } from '@prisma/client'; import { Type } from '@prisma/client';
export interface ImportActivitiesDialogParams { export interface ImportActivitiesDialogParams {
activityTypes: Type[]; activityTypes?: Type[];
deviceType: string; deviceType: string;
user: User; user: User;
} }

7
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -558,7 +558,10 @@ export class GfAllocationsPageComponent implements OnDestroy, OnInit {
} }
private openAccountDetailDialog(aAccountId: string) { private openAccountDetailDialog(aAccountId: string) {
const dialogRef = this.dialog.open(GfAccountDetailDialogComponent, { const dialogRef = this.dialog.open<
GfAccountDetailDialogComponent,
AccountDetailDialogParams
>(GfAccountDetailDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
accountId: aAccountId, accountId: aAccountId,
@ -568,7 +571,7 @@ export class GfAllocationsPageComponent implements OnDestroy, OnInit {
!this.hasImpersonationId && !this.hasImpersonationId &&
hasPermission(this.user?.permissions, permissions.createOrder) && hasPermission(this.user?.permissions, permissions.createOrder) &&
!this.user?.settings?.isRestrictedView !this.user?.settings?.isRestrictedView
} as AccountDetailDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });

10
apps/client/src/app/pages/register/register-page.component.ts

@ -84,18 +84,18 @@ export class GfRegisterPageComponent implements OnDestroy, OnInit {
} }
public openShowAccessTokenDialog() { public openShowAccessTokenDialog() {
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfUserAccountRegistrationDialogComponent, GfUserAccountRegistrationDialogComponent,
{ UserAccountRegistrationDialogParams
>(GfUserAccountRegistrationDialogComponent, {
data: { data: {
deviceType: this.deviceType, deviceType: this.deviceType,
needsToAcceptTermsOfService: this.hasPermissionForSubscription needsToAcceptTermsOfService: this.hasPermissionForSubscription
} as UserAccountRegistrationDialogParams, },
disableClose: true, disableClose: true,
height: this.deviceType === 'mobile' ? '98vh' : undefined, height: this.deviceType === 'mobile' ? '98vh' : undefined,
width: this.deviceType === 'mobile' ? '100vw' : '30rem' width: this.deviceType === 'mobile' ? '100vw' : '30rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()

10
apps/client/src/app/services/user/user.service.ts

@ -116,18 +116,18 @@ export class UserService extends ObservableStore<UserStoreState> {
permissions.enableSubscriptionInterstitial permissions.enableSubscriptionInterstitial
) )
) { ) {
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfSubscriptionInterstitialDialogComponent, GfSubscriptionInterstitialDialogComponent,
{ SubscriptionInterstitialDialogParams
>(GfSubscriptionInterstitialDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
user user
} as SubscriptionInterstitialDialogParams, },
disableClose: true, disableClose: true,
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()

7
libs/ui/src/lib/benchmark/benchmark.component.ts

@ -155,14 +155,17 @@ export class GfBenchmarkComponent implements OnChanges, OnDestroy {
dataSource, dataSource,
symbol symbol
}: AssetProfileIdentifier) { }: AssetProfileIdentifier) {
const dialogRef = this.dialog.open(GfBenchmarkDetailDialogComponent, { const dialogRef = this.dialog.open<
GfBenchmarkDetailDialogComponent,
BenchmarkDetailDialogParams
>(GfBenchmarkDetailDialogComponent, {
data: { data: {
dataSource, dataSource,
symbol, symbol,
colorScheme: this.user?.settings?.colorScheme, colorScheme: this.user?.settings?.colorScheme,
deviceType: this.deviceType, deviceType: this.deviceType,
locale: this.locale locale: this.locale
} as BenchmarkDetailDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : undefined, height: this.deviceType === 'mobile' ? '98vh' : undefined,
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });

10
libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts

@ -199,9 +199,10 @@ export class GfHistoricalMarketDataEditorComponent
}) { }) {
const marketPrice = this.marketDataByMonth[yearMonth]?.[day]?.marketPrice; const marketPrice = this.marketDataByMonth[yearMonth]?.[day]?.marketPrice;
const dialogRef = this.dialog.open( const dialogRef = this.dialog.open<
GfHistoricalMarketDataEditorDialogComponent, GfHistoricalMarketDataEditorDialogComponent,
{ HistoricalMarketDataEditorDialogParams
>(GfHistoricalMarketDataEditorDialogComponent, {
data: { data: {
marketPrice, marketPrice,
currency: this.currency, currency: this.currency,
@ -209,11 +210,10 @@ export class GfHistoricalMarketDataEditorComponent
dateString: `${yearMonth}-${day}`, dateString: `${yearMonth}-${day}`,
symbol: this.symbol, symbol: this.symbol,
user: this.user user: this.user
} as HistoricalMarketDataEditorDialogParams, },
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
} });
);
dialogRef dialogRef
.afterClosed() .afterClosed()

Loading…
Cancel
Save