Browse Source
Feature/Clean up unused OnInit implementations (#3961)
* Clean up unused OnInit implementations
pull/3962/head
Wasif Mujahid
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with
17 additions and
57 deletions
-
apps/client/src/app/components/access-table/access-table.component.ts
-
apps/client/src/app/components/accounts-table/accounts-table.component.ts
-
apps/client/src/app/components/admin-market-data-detail/admin-market-data-detail.component.ts
-
apps/client/src/app/components/dialog-footer/dialog-footer.component.ts
-
apps/client/src/app/components/dialog-header/dialog-header.component.ts
-
apps/client/src/app/components/fear-and-greed-index/fear-and-greed-index.component.ts
-
apps/client/src/app/components/login-with-access-token-dialog/login-with-access-token-dialog.component.ts
-
apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
-
apps/client/src/app/components/toggle/toggle.component.ts
-
apps/client/src/app/components/user-account-membership/user-account-membership.component.ts
-
apps/client/src/app/components/world-map-chart/world-map-chart.component.ts
-
apps/client/src/app/pages/faq/self-hosting/self-hosting-page.component.ts
-
apps/client/src/app/pages/i18n/i18n-page.component.ts
-
apps/client/src/app/pages/markets/markets-page.component.ts
-
apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.component.ts
|
|
@ -10,7 +10,6 @@ import { |
|
|
|
EventEmitter, |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnInit, |
|
|
|
Output |
|
|
|
} from '@angular/core'; |
|
|
|
import { MatTableDataSource } from '@angular/material/table'; |
|
|
@ -21,7 +20,7 @@ import { MatTableDataSource } from '@angular/material/table'; |
|
|
|
templateUrl: './access-table.component.html', |
|
|
|
styleUrls: ['./access-table.component.scss'] |
|
|
|
}) |
|
|
|
export class AccessTableComponent implements OnChanges, OnInit { |
|
|
|
export class AccessTableComponent implements OnChanges { |
|
|
|
@Input() accesses: Access[]; |
|
|
|
@Input() showActions: boolean; |
|
|
|
@Input() user: User; |
|
|
@ -37,8 +36,6 @@ export class AccessTableComponent implements OnChanges, OnInit { |
|
|
|
private notificationService: NotificationService |
|
|
|
) {} |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
this.displayedColumns = ['alias', 'grantee', 'type', 'details']; |
|
|
|
|
|
|
|
|
|
@ -9,7 +9,6 @@ import { |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnDestroy, |
|
|
|
OnInit, |
|
|
|
Output, |
|
|
|
ViewChild |
|
|
|
} from '@angular/core'; |
|
|
@ -26,7 +25,7 @@ import { Subject, Subscription } from 'rxjs'; |
|
|
|
templateUrl: './accounts-table.component.html', |
|
|
|
styleUrls: ['./accounts-table.component.scss'] |
|
|
|
}) |
|
|
|
export class AccountsTableComponent implements OnChanges, OnDestroy, OnInit { |
|
|
|
export class AccountsTableComponent implements OnChanges, OnDestroy { |
|
|
|
@Input() accounts: AccountModel[]; |
|
|
|
@Input() baseCurrency: string; |
|
|
|
@Input() deviceType: string; |
|
|
@ -61,8 +60,6 @@ export class AccountsTableComponent implements OnChanges, OnDestroy, OnInit { |
|
|
|
private router: Router |
|
|
|
) {} |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
this.displayedColumns = ['status', 'account', 'platform']; |
|
|
|
|
|
|
|
|
|
@ -12,7 +12,6 @@ import { |
|
|
|
EventEmitter, |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnInit, |
|
|
|
Output |
|
|
|
} from '@angular/core'; |
|
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
@ -42,7 +41,7 @@ import { MarketDataDetailDialog } from './market-data-detail-dialog/market-data- |
|
|
|
styleUrls: ['./admin-market-data-detail.component.scss'], |
|
|
|
templateUrl: './admin-market-data-detail.component.html' |
|
|
|
}) |
|
|
|
export class AdminMarketDataDetailComponent implements OnChanges, OnInit { |
|
|
|
export class AdminMarketDataDetailComponent implements OnChanges { |
|
|
|
@Input() currency: string; |
|
|
|
@Input() dataSource: DataSource; |
|
|
|
@Input() dateOfFirstActivity: string; |
|
|
@ -81,8 +80,6 @@ export class AdminMarketDataDetailComponent implements OnChanges, OnInit { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
this.defaultDateFormat = getDateFormatString(this.locale); |
|
|
|
|
|
|
|
|
|
@ -3,7 +3,6 @@ import { |
|
|
|
Component, |
|
|
|
EventEmitter, |
|
|
|
Input, |
|
|
|
OnInit, |
|
|
|
Output |
|
|
|
} from '@angular/core'; |
|
|
|
|
|
|
@ -14,13 +13,11 @@ import { |
|
|
|
templateUrl: './dialog-footer.component.html', |
|
|
|
styleUrls: ['./dialog-footer.component.scss'] |
|
|
|
}) |
|
|
|
export class DialogFooterComponent implements OnInit { |
|
|
|
export class DialogFooterComponent { |
|
|
|
@Input() deviceType: string; |
|
|
|
|
|
|
|
@Output() closeButtonClicked = new EventEmitter<void>(); |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public onClickCloseButton() { |
|
|
|
this.closeButtonClicked.emit(); |
|
|
|
} |
|
|
|
|
|
@ -3,7 +3,6 @@ import { |
|
|
|
Component, |
|
|
|
EventEmitter, |
|
|
|
Input, |
|
|
|
OnInit, |
|
|
|
Output |
|
|
|
} from '@angular/core'; |
|
|
|
|
|
|
@ -14,15 +13,13 @@ import { |
|
|
|
templateUrl: './dialog-header.component.html', |
|
|
|
styleUrls: ['./dialog-header.component.scss'] |
|
|
|
}) |
|
|
|
export class DialogHeaderComponent implements OnInit { |
|
|
|
export class DialogHeaderComponent { |
|
|
|
@Input() deviceType: string; |
|
|
|
@Input() position: 'center' | 'left' = 'left'; |
|
|
|
@Input() title: string; |
|
|
|
|
|
|
|
@Output() closeButtonClicked = new EventEmitter<void>(); |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public onClickCloseButton() { |
|
|
|
this.closeButtonClicked.emit(); |
|
|
|
} |
|
|
|
|
|
@ -5,8 +5,7 @@ import { |
|
|
|
ChangeDetectionStrategy, |
|
|
|
Component, |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnInit |
|
|
|
OnChanges |
|
|
|
} from '@angular/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
@ -15,14 +14,12 @@ import { |
|
|
|
templateUrl: './fear-and-greed-index.component.html', |
|
|
|
styleUrls: ['./fear-and-greed-index.component.scss'] |
|
|
|
}) |
|
|
|
export class FearAndGreedIndexComponent implements OnChanges, OnInit { |
|
|
|
export class FearAndGreedIndexComponent implements OnChanges { |
|
|
|
@Input() fearAndGreedIndex: number; |
|
|
|
|
|
|
|
public fearAndGreedIndexEmoji: string; |
|
|
|
public fearAndGreedIndexText: string; |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
const { emoji, key } = resolveFearAndGreedIndex(this.fearAndGreedIndex); |
|
|
|
|
|
|
|
|
|
@ -28,8 +28,6 @@ export class LoginWithAccessTokenDialog { |
|
|
|
private tokenStorageService: TokenStorageService |
|
|
|
) {} |
|
|
|
|
|
|
|
ngOnInit() {} |
|
|
|
|
|
|
|
public onChangeStaySignedIn(aValue: MatCheckboxChange) { |
|
|
|
this.settingsStorageService.setSetting( |
|
|
|
KEY_STAY_SIGNED_IN, |
|
|
|
|
|
@ -8,7 +8,6 @@ import { |
|
|
|
EventEmitter, |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnInit, |
|
|
|
Output |
|
|
|
} from '@angular/core'; |
|
|
|
import { formatDistanceToNow } from 'date-fns'; |
|
|
@ -19,7 +18,7 @@ import { formatDistanceToNow } from 'date-fns'; |
|
|
|
templateUrl: './portfolio-summary.component.html', |
|
|
|
styleUrls: ['./portfolio-summary.component.scss'] |
|
|
|
}) |
|
|
|
export class PortfolioSummaryComponent implements OnChanges, OnInit { |
|
|
|
export class PortfolioSummaryComponent implements OnChanges { |
|
|
|
@Input() baseCurrency: string; |
|
|
|
@Input() hasPermissionToUpdateUserSettings: boolean; |
|
|
|
@Input() isLoading: boolean; |
|
|
@ -35,8 +34,6 @@ export class PortfolioSummaryComponent implements OnChanges, OnInit { |
|
|
|
); |
|
|
|
public timeInMarket: string; |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
if (this.summary) { |
|
|
|
if (this.summary.firstOrderDate) { |
|
|
|
|
|
@ -6,7 +6,6 @@ import { |
|
|
|
EventEmitter, |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnInit, |
|
|
|
Output |
|
|
|
} from '@angular/core'; |
|
|
|
import { FormControl } from '@angular/forms'; |
|
|
@ -17,7 +16,7 @@ import { FormControl } from '@angular/forms'; |
|
|
|
templateUrl: './toggle.component.html', |
|
|
|
styleUrls: ['./toggle.component.scss'] |
|
|
|
}) |
|
|
|
export class ToggleComponent implements OnChanges, OnInit { |
|
|
|
export class ToggleComponent implements OnChanges { |
|
|
|
public static DEFAULT_DATE_RANGE_OPTIONS: ToggleOption[] = [ |
|
|
|
{ label: $localize`Today`, value: '1d' }, |
|
|
|
{ label: $localize`YTD`, value: 'ytd' }, |
|
|
@ -34,8 +33,6 @@ export class ToggleComponent implements OnChanges, OnInit { |
|
|
|
|
|
|
|
public optionFormControl = new FormControl<string>(undefined); |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
this.optionFormControl.setValue(this.defaultValue); |
|
|
|
} |
|
|
|
|
|
@ -9,8 +9,7 @@ import { |
|
|
|
ChangeDetectionStrategy, |
|
|
|
ChangeDetectorRef, |
|
|
|
Component, |
|
|
|
OnDestroy, |
|
|
|
OnInit |
|
|
|
OnDestroy |
|
|
|
} from '@angular/core'; |
|
|
|
import { |
|
|
|
MatSnackBar, |
|
|
@ -27,7 +26,7 @@ import { catchError, switchMap, takeUntil } from 'rxjs/operators'; |
|
|
|
styleUrls: ['./user-account-membership.scss'], |
|
|
|
templateUrl: './user-account-membership.html' |
|
|
|
}) |
|
|
|
export class UserAccountMembershipComponent implements OnDestroy, OnInit { |
|
|
|
export class UserAccountMembershipComponent implements OnDestroy { |
|
|
|
public baseCurrency: string; |
|
|
|
public coupon: number; |
|
|
|
public couponId: string; |
|
|
@ -88,8 +87,6 @@ export class UserAccountMembershipComponent implements OnDestroy, OnInit { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public onCheckout() { |
|
|
|
this.dataService |
|
|
|
.createCheckoutSession({ couponId: this.couponId, priceId: this.priceId }) |
|
|
|
|
|
@ -6,8 +6,7 @@ import { |
|
|
|
Component, |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnDestroy, |
|
|
|
OnInit |
|
|
|
OnDestroy |
|
|
|
} from '@angular/core'; |
|
|
|
import svgMap from 'svgmap'; |
|
|
|
|
|
|
@ -17,7 +16,7 @@ import svgMap from 'svgmap'; |
|
|
|
templateUrl: './world-map-chart.component.html', |
|
|
|
styleUrls: ['./world-map-chart.component.scss'] |
|
|
|
}) |
|
|
|
export class WorldMapChartComponent implements OnChanges, OnDestroy, OnInit { |
|
|
|
export class WorldMapChartComponent implements OnChanges, OnDestroy { |
|
|
|
@Input() countries: { [code: string]: { name?: string; value: number } }; |
|
|
|
@Input() format: string; |
|
|
|
@Input() isInPercent = false; |
|
|
@ -28,8 +27,6 @@ export class WorldMapChartComponent implements OnChanges, OnDestroy, OnInit { |
|
|
|
|
|
|
|
public constructor(private changeDetectorRef: ChangeDetectorRef) {} |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
// Create a copy before manipulating countries object
|
|
|
|
this.countries = structuredClone(this.countries); |
|
|
|
|
|
@ -10,8 +10,6 @@ import { Subject } from 'rxjs'; |
|
|
|
export class SelfHostingPageComponent implements OnDestroy { |
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
this.unsubscribeSubject.next(); |
|
|
|
this.unsubscribeSubject.complete(); |
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { Subject } from 'rxjs'; |
|
|
|
|
|
|
|
@Component({ |
|
|
@ -8,11 +8,9 @@ import { Subject } from 'rxjs'; |
|
|
|
styleUrls: ['./i18n-page.scss'], |
|
|
|
templateUrl: './i18n-page.html' |
|
|
|
}) |
|
|
|
export class GfI18nPageComponent implements OnInit { |
|
|
|
export class GfI18nPageComponent { |
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
this.unsubscribeSubject.next(); |
|
|
|
this.unsubscribeSubject.complete(); |
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
|
import { Component, OnDestroy } from '@angular/core'; |
|
|
|
import { Subject } from 'rxjs'; |
|
|
|
|
|
|
|
@Component({ |
|
|
@ -7,11 +7,9 @@ import { Subject } from 'rxjs'; |
|
|
|
styleUrls: ['./markets-page.scss'], |
|
|
|
templateUrl: './markets-page.html' |
|
|
|
}) |
|
|
|
export class MarketsPageComponent implements OnDestroy, OnInit { |
|
|
|
export class MarketsPageComponent implements OnDestroy { |
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
this.unsubscribeSubject.next(); |
|
|
|
this.unsubscribeSubject.complete(); |
|
|
|
|
|
@ -12,8 +12,6 @@ export class ShowAccessTokenDialog { |
|
|
|
|
|
|
|
public constructor(@Inject(MAT_DIALOG_DATA) public data: any) {} |
|
|
|
|
|
|
|
ngOnInit() {} |
|
|
|
|
|
|
|
public enableAgreeButton() { |
|
|
|
this.isAgreeButtonDisabled = false; |
|
|
|
} |
|
|
|