Browse Source

Clean up (#3018)

pull/3019/head
Thomas Kaul 11 months ago
committed by GitHub
parent
commit
e1371a8d2b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  2. 2
      apps/client/src/app/components/header/header.component.ts
  3. 4
      apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts
  4. 2
      apps/client/src/app/components/user-account-access/user-account-access.component.ts
  5. 6
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  6. 4
      apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
  7. 2
      apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts
  8. 2
      apps/client/src/app/pages/register/register-page.component.ts
  9. 2
      apps/client/src/app/services/settings-storage.service.ts
  10. 4
      apps/client/src/app/services/token-storage.service.ts
  11. 6
      libs/ui/src/lib/activities-filter/activities-filter.component.ts
  12. 2
      libs/ui/src/lib/activities-table/activities-table.component.ts
  13. 2
      libs/ui/src/lib/carousel/carousel-item.directive.ts
  14. 14
      libs/ui/src/lib/shared/abstract-mat-form-field.ts

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

@ -91,7 +91,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
private snackBar: MatSnackBar
) {}
public ngOnInit(): void {
public ngOnInit() {
const { benchmarks, currencies } = this.dataService.fetchInfo();
this.benchmarks = benchmarks;
@ -167,7 +167,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
});
}
public onClose(): void {
public onClose() {
this.dialogRef.close();
}

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

@ -217,7 +217,7 @@ export class HeaderComponent implements OnChanges {
this.signOut.next();
}
public openLoginDialog(): void {
public openLoginDialog() {
const dialogRef = this.dialog.open(LoginWithAccessTokenDialog, {
autoFocus: false,
data: {

4
apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts

@ -84,7 +84,7 @@ export class PositionDetailDialog implements OnDestroy, OnInit {
private userService: UserService
) {}
public ngOnInit(): void {
public ngOnInit() {
this.dataService
.fetchPositionDetail({
dataSource: this.data.dataSource,
@ -267,7 +267,7 @@ export class PositionDetailDialog implements OnDestroy, OnInit {
});
}
public onClose(): void {
public onClose() {
this.dialogRef.close();
}

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

@ -100,7 +100,7 @@ export class UserAccountAccessComponent implements OnDestroy, OnInit {
this.unsubscribeSubject.complete();
}
private openCreateAccessDialog(): void {
private openCreateAccessDialog() {
const dialogRef = this.dialog.open(CreateOrUpdateAccessDialog, {
data: {
access: {

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

@ -169,7 +169,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit {
isExcluded,
name,
platformId
}: AccountModel): void {
}: AccountModel) {
const dialogRef = this.dialog.open(CreateOrUpdateAccountDialog, {
data: {
account: {
@ -237,7 +237,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit {
});
}
private openCreateAccountDialog(): void {
private openCreateAccountDialog() {
const dialogRef = this.dialog.open(CreateOrUpdateAccountDialog, {
data: {
account: {
@ -279,7 +279,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit {
});
}
private openTransferBalanceDialog(): void {
private openTransferBalanceDialog() {
const dialogRef = this.dialog.open(TransferBalanceDialog, {
data: {
accounts: this.accounts

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

@ -274,7 +274,7 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
});
}
public openUpdateActivityDialog(activity: Activity): void {
public openUpdateActivityDialog(activity: Activity) {
const dialogRef = this.dialog.open(CreateOrUpdateActivityDialog, {
data: {
activity,
@ -311,7 +311,7 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
this.unsubscribeSubject.complete();
}
private openCreateActivityDialog(aActivity?: Activity): void {
private openCreateActivityDialog(aActivity?: Activity) {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))

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

@ -150,7 +150,7 @@ export class ImportActivitiesDialog implements OnDestroy {
}: {
files: FileList;
stepper: MatStepper;
}): void {
}) {
if (files.length === 0) {
return;
}

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

@ -79,7 +79,7 @@ export class RegisterPageComponent implements OnDestroy, OnInit {
accessToken: string,
authToken: string,
role: Role
): void {
) {
const dialogRef = this.dialog.open(ShowAccessTokenDialog, {
data: {
accessToken,

2
apps/client/src/app/services/settings-storage.service.ts

@ -18,7 +18,7 @@ export class SettingsStorageService {
window.localStorage.setItem(aKey, aValue);
}
public removeSetting(aKey: string): void {
public removeSetting(aKey: string) {
return window.localStorage.removeItem(aKey);
}
}

4
apps/client/src/app/services/token-storage.service.ts

@ -21,14 +21,14 @@ export class TokenStorageService {
);
}
public saveToken(token: string, staySignedIn = false): void {
public saveToken(token: string, staySignedIn = false) {
if (staySignedIn) {
window.localStorage.setItem(KEY_TOKEN, token);
}
window.sessionStorage.setItem(KEY_TOKEN, token);
}
public signOut(): void {
public signOut() {
const utmSource = window.localStorage.getItem('utm_source');
if (this.webAuthnService.isEnabled()) {

6
libs/ui/src/lib/activities-filter/activities-filter.component.ts

@ -72,7 +72,7 @@ export class ActivitiesFilterComponent implements OnChanges, OnDestroy {
}
}
public onAddFilter({ input, value }: MatChipInputEvent): void {
public onAddFilter({ input, value }: MatChipInputEvent) {
if (value?.trim()) {
this.updateFilters();
}
@ -85,7 +85,7 @@ export class ActivitiesFilterComponent implements OnChanges, OnDestroy {
this.searchControl.setValue(undefined);
}
public onRemoveFilter(aFilter: Filter): void {
public onRemoveFilter(aFilter: Filter) {
this.selectedFilters = this.selectedFilters.filter((filter) => {
return filter.id !== aFilter.id;
});
@ -93,7 +93,7 @@ export class ActivitiesFilterComponent implements OnChanges, OnDestroy {
this.updateFilters();
}
public onSelectFilter(event: MatAutocompleteSelectedEvent): void {
public onSelectFilter(event: MatAutocompleteSelectedEvent) {
this.selectedFilters.push(
this.allFilters.find((filter) => {
return filter.id === event.option.value;

2
libs/ui/src/lib/activities-table/activities-table.component.ts

@ -216,7 +216,7 @@ export class ActivitiesTableComponent
alert(aComment);
}
public onOpenPositionDialog({ dataSource, symbol }: UniqueAsset): void {
public onOpenPositionDialog({ dataSource, symbol }: UniqueAsset) {
this.router.navigate([], {
queryParams: { dataSource, symbol, positionDetailDialog: true }
});

2
libs/ui/src/lib/carousel/carousel-item.directive.ts

@ -10,7 +10,7 @@ export class CarouselItem implements FocusableOption {
public constructor(readonly element: ElementRef<HTMLElement>) {}
public focus(): void {
public focus() {
this.element.nativeElement.focus({ preventScroll: true });
}
}

14
libs/ui/src/lib/shared/abstract-mat-form-field.ts

@ -134,31 +134,31 @@ export abstract class AbstractMatFormField<T>
return this.focused || !this.empty;
}
public ngDoCheck(): void {
public ngDoCheck() {
if (this.ngControl) {
this.errorState = this.ngControl.invalid && this.ngControl.touched;
this.stateChanges.next();
}
}
public ngOnDestroy(): void {
public ngOnDestroy() {
this.stateChanges.complete();
this._focusMonitor.stopMonitoring(this._elementRef.nativeElement);
}
public registerOnChange(fn: (_: T) => void): void {
public registerOnChange(fn: (_: T) => void) {
this.onChange = fn;
}
public registerOnTouched(fn: () => void): void {
public registerOnTouched(fn: () => void) {
this.onTouched = fn;
}
public setDescribedByIds(ids: string[]): void {
public setDescribedByIds(ids: string[]) {
this.describedBy = ids.join(' ');
}
public writeValue(value: T): void {
public writeValue(value: T) {
this.value = value;
}
@ -173,7 +173,7 @@ export abstract class AbstractMatFormField<T>
this.stateChanges.next();
}
public onContainerClick(): void {
public onContainerClick() {
if (!this.focused) {
this.focus();
}

Loading…
Cancel
Save