Browse Source

feat(client): rename dialog components

pull/5212/head
KenTandrian 2 days ago
parent
commit
de9041c533
  1. 13
      apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
  2. 6
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  3. 4
      apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts
  4. 16
      apps/client/src/app/components/admin-platform/admin-platform.component.ts
  5. 4
      apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts
  6. 6
      apps/client/src/app/components/admin-tag/admin-tag.component.ts
  7. 4
      apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts

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

@ -67,9 +67,9 @@ import { Subject } from 'rxjs';
import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators'; import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators';
import { AdminMarketDataService } from './admin-market-data.service'; import { AdminMarketDataService } from './admin-market-data.service';
import { GfAssetProfileDialog } from './asset-profile-dialog/asset-profile-dialog.component'; import { GfAssetProfileDialogComponent } from './asset-profile-dialog/asset-profile-dialog.component';
import { AssetProfileDialogParams } from './asset-profile-dialog/interfaces/interfaces'; import { AssetProfileDialogParams } from './asset-profile-dialog/interfaces/interfaces';
import { CreateAssetProfileDialog } from './create-asset-profile-dialog/create-asset-profile-dialog.component'; import { GfCreateAssetProfileDialogComponent } from './create-asset-profile-dialog/create-asset-profile-dialog.component';
import { CreateAssetProfileDialogParams } from './create-asset-profile-dialog/interfaces/interfaces'; import { CreateAssetProfileDialogParams } from './create-asset-profile-dialog/interfaces/interfaces';
@Component({ @Component({
@ -422,7 +422,7 @@ export class GfAdminMarketDataComponent
.subscribe((user) => { .subscribe((user) => {
this.user = user; this.user = user;
const dialogRef = this.dialog.open(GfAssetProfileDialog, { const dialogRef = this.dialog.open(GfAssetProfileDialogComponent, {
autoFocus: false, autoFocus: false,
data: { data: {
dataSource, dataSource,
@ -457,14 +457,17 @@ export class GfAdminMarketDataComponent
.subscribe((user) => { .subscribe((user) => {
this.user = user; this.user = user;
const dialogRef = this.dialog.open(CreateAssetProfileDialog, { const dialogRef = this.dialog.open(
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, } as CreateAssetProfileDialogParams,
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); }
);
dialogRef dialogRef
.afterClosed() .afterClosed()

6
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts

@ -116,7 +116,7 @@ import {
templateUrl: 'asset-profile-dialog.html', templateUrl: 'asset-profile-dialog.html',
styleUrls: ['./asset-profile-dialog.component.scss'] styleUrls: ['./asset-profile-dialog.component.scss']
}) })
export class GfAssetProfileDialog implements OnDestroy, OnInit { export class GfAssetProfileDialogComponent implements OnDestroy, OnInit {
private static readonly HISTORICAL_DATA_TEMPLATE = `date;marketPrice\n${format( private static readonly HISTORICAL_DATA_TEMPLATE = `date;marketPrice\n${format(
new Date(), new Date(),
DATE_FORMAT DATE_FORMAT
@ -220,7 +220,7 @@ export class GfAssetProfileDialog implements OnDestroy, OnInit {
private changeDetectorRef: ChangeDetectorRef, private changeDetectorRef: ChangeDetectorRef,
@Inject(MAT_DIALOG_DATA) public data: AssetProfileDialogParams, @Inject(MAT_DIALOG_DATA) public data: AssetProfileDialogParams,
private dataService: DataService, private dataService: DataService,
public dialogRef: MatDialogRef<GfAssetProfileDialog>, public dialogRef: MatDialogRef<GfAssetProfileDialogComponent>,
private formBuilder: FormBuilder, private formBuilder: FormBuilder,
private notificationService: NotificationService, private notificationService: NotificationService,
private snackBar: MatSnackBar, private snackBar: MatSnackBar,
@ -347,7 +347,7 @@ export class GfAssetProfileDialog implements OnDestroy, OnInit {
), ),
currency: this.assetProfile?.currency, currency: this.assetProfile?.currency,
historicalData: { historicalData: {
csvString: GfAssetProfileDialog.HISTORICAL_DATA_TEMPLATE csvString: GfAssetProfileDialogComponent.HISTORICAL_DATA_TEMPLATE
}, },
isActive: this.assetProfile?.isActive, isActive: this.assetProfile?.isActive,
name: this.assetProfile.name ?? this.assetProfile.symbol, name: this.assetProfile.name ?? this.assetProfile.symbol,

4
apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts

@ -51,7 +51,7 @@ import { CreateAssetProfileDialogMode } from './interfaces/interfaces';
styleUrls: ['./create-asset-profile-dialog.component.scss'], styleUrls: ['./create-asset-profile-dialog.component.scss'],
templateUrl: 'create-asset-profile-dialog.html' templateUrl: 'create-asset-profile-dialog.html'
}) })
export class CreateAssetProfileDialog implements OnInit, OnDestroy { export class GfCreateAssetProfileDialogComponent implements OnInit, OnDestroy {
public createAssetProfileForm: FormGroup; public createAssetProfileForm: FormGroup;
public mode: CreateAssetProfileDialogMode; public mode: CreateAssetProfileDialogMode;
@ -62,7 +62,7 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy {
public readonly adminService: AdminService, public readonly adminService: AdminService,
private readonly changeDetectorRef: ChangeDetectorRef, private readonly changeDetectorRef: ChangeDetectorRef,
private readonly dataService: DataService, private readonly dataService: DataService,
public readonly dialogRef: MatDialogRef<CreateAssetProfileDialog>, public readonly dialogRef: MatDialogRef<GfCreateAssetProfileDialogComponent>,
public readonly formBuilder: FormBuilder public readonly formBuilder: FormBuilder
) {} ) {}

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

@ -33,7 +33,7 @@ import { get } from 'lodash';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, takeUntil } from 'rxjs'; import { Subject, takeUntil } from 'rxjs';
import { CreateOrUpdatePlatformDialog } 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';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -153,7 +153,9 @@ export class GfAdminPlatformComponent implements OnInit, OnDestroy {
} }
private openCreatePlatformDialog() { private openCreatePlatformDialog() {
const dialogRef = this.dialog.open(CreateOrUpdatePlatformDialog, { const dialogRef = this.dialog.open(
GfCreateOrUpdatePlatformDialogComponent,
{
data: { data: {
platform: { platform: {
name: null, name: null,
@ -162,7 +164,8 @@ 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()
@ -189,7 +192,9 @@ export class GfAdminPlatformComponent implements OnInit, OnDestroy {
} }
private openUpdatePlatformDialog({ id, name, url }) { private openUpdatePlatformDialog({ id, name, url }) {
const dialogRef = this.dialog.open(CreateOrUpdatePlatformDialog, { const dialogRef = this.dialog.open(
GfCreateOrUpdatePlatformDialogComponent,
{
data: { data: {
platform: { platform: {
id, id,
@ -199,7 +204,8 @@ 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()

4
apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-platform-dialog.component.ts

@ -44,14 +44,14 @@ import { CreateOrUpdatePlatformDialogParams } from './interfaces/interfaces';
styleUrls: ['./create-or-update-platform-dialog.scss'], styleUrls: ['./create-or-update-platform-dialog.scss'],
templateUrl: 'create-or-update-platform-dialog.html' templateUrl: 'create-or-update-platform-dialog.html'
}) })
export class CreateOrUpdatePlatformDialog implements OnDestroy { export class GfCreateOrUpdatePlatformDialogComponent implements OnDestroy {
public platformForm: FormGroup; public platformForm: FormGroup;
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();
public constructor( public constructor(
@Inject(MAT_DIALOG_DATA) public data: CreateOrUpdatePlatformDialogParams, @Inject(MAT_DIALOG_DATA) public data: CreateOrUpdatePlatformDialogParams,
public dialogRef: MatDialogRef<CreateOrUpdatePlatformDialog>, public dialogRef: MatDialogRef<GfCreateOrUpdatePlatformDialogComponent>,
private formBuilder: FormBuilder private formBuilder: FormBuilder
) { ) {
this.platformForm = this.formBuilder.group({ this.platformForm = this.formBuilder.group({

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

@ -31,7 +31,7 @@ import { get } from 'lodash';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject, takeUntil } from 'rxjs'; import { Subject, takeUntil } from 'rxjs';
import { CreateOrUpdateTagDialog } 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';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -149,7 +149,7 @@ export class GfAdminTagComponent implements OnInit, OnDestroy {
} }
private openCreateTagDialog() { private openCreateTagDialog() {
const dialogRef = this.dialog.open(CreateOrUpdateTagDialog, { const dialogRef = this.dialog.open(GfCreateOrUpdateTagDialogComponent, {
data: { data: {
tag: { tag: {
name: null name: null
@ -184,7 +184,7 @@ export class GfAdminTagComponent implements OnInit, OnDestroy {
} }
private openUpdateTagDialog({ id, name }) { private openUpdateTagDialog({ id, name }) {
const dialogRef = this.dialog.open(CreateOrUpdateTagDialog, { const dialogRef = this.dialog.open(GfCreateOrUpdateTagDialogComponent, {
data: { data: {
tag: { tag: {
id, id,

4
apps/client/src/app/components/admin-tag/create-or-update-tag-dialog/create-or-update-tag-dialog.component.ts

@ -41,14 +41,14 @@ import { CreateOrUpdateTagDialogParams } from './interfaces/interfaces';
styleUrls: ['./create-or-update-tag-dialog.scss'], styleUrls: ['./create-or-update-tag-dialog.scss'],
templateUrl: 'create-or-update-tag-dialog.html' templateUrl: 'create-or-update-tag-dialog.html'
}) })
export class CreateOrUpdateTagDialog implements OnDestroy { export class GfCreateOrUpdateTagDialogComponent implements OnDestroy {
public tagForm: FormGroup; public tagForm: FormGroup;
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();
public constructor( public constructor(
@Inject(MAT_DIALOG_DATA) public data: CreateOrUpdateTagDialogParams, @Inject(MAT_DIALOG_DATA) public data: CreateOrUpdateTagDialogParams,
public dialogRef: MatDialogRef<CreateOrUpdateTagDialog>, public dialogRef: MatDialogRef<GfCreateOrUpdateTagDialogComponent>,
private formBuilder: FormBuilder private formBuilder: FormBuilder
) { ) {
this.tagForm = this.formBuilder.group({ this.tagForm = this.formBuilder.group({

Loading…
Cancel
Save