Skip to content

Commit 66109d2

Browse files
committed
feat: add tracks, dump dependencies, cs fixes
1 parent bf6e2dc commit 66109d2

File tree

110 files changed

+239
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+239
-205
lines changed

src/app/about/about.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {BytesPipe} from 'ngx-pipes';
1111
import {map, switchMap} from 'rxjs/operators';
1212
import showdown from 'showdown';
1313

14+
import * as versionJson from '../../version.json';
15+
1416
function replaceAll(str: string, find: string, replace: string): string {
1517
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace);
1618
}
@@ -84,7 +86,7 @@ Take part in [the translation of the site](https://github.com/autowp/autowp-fron
8486
templateUrl: './about.component.html',
8587
})
8688
export class AboutComponent implements OnInit {
87-
protected readonly version = require('../../version.json');
89+
protected readonly version = versionJson;
8890

8991
protected readonly html$ = this.statGrpc
9092
.getAboutData(new Empty())

src/app/account/account.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {AuthService} from '@services/auth.service';
55
import {MessageService} from '@services/message';
66
import {PageEnvService} from '@services/page-env.service';
77
import {PictureService} from '@services/picture';
8-
import {Observable, combineLatest, of} from 'rxjs';
8+
import {combineLatest, Observable, of} from 'rxjs';
99
import {map, shareReplay, switchMap} from 'rxjs/operators';
1010

1111
import {ToastsService} from '../toasts/toasts.service';

src/app/account/accounts/accounts.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Component, OnInit} from '@angular/core';
22
import {APIService} from '@services/api.service';
33
import {PageEnvService} from '@services/page-env.service';
4-
import {BehaviorSubject, EMPTY, Observable, combineLatest} from 'rxjs';
4+
import {BehaviorSubject, combineLatest, EMPTY, Observable} from 'rxjs';
55
import {catchError, map} from 'rxjs/operators';
66

77
import {ToastsService} from '../../toasts/toasts.service';

src/app/account/contacts/contacts.component.ts

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {LanguageService} from '@services/language';
77
import {PageEnvService} from '@services/page-env.service';
88
import {KeycloakService} from 'keycloak-angular';
99
import {BehaviorSubject, EMPTY, Observable} from 'rxjs';
10-
import {catchError, map, switchMap} from 'rxjs/operators';
10+
import {catchError, map, switchMap} from 'rxjs/operators';
1111

1212
import {ToastsService} from '../../toasts/toasts.service';
1313

@@ -18,27 +18,25 @@ import {ToastsService} from '../../toasts/toasts.service';
1818
export class AccountContactsComponent implements OnInit {
1919
private readonly reload$ = new BehaviorSubject<void>(void 0);
2020

21-
protected readonly items$: Observable<Contact[]> = this.auth
22-
.getUser$()
23-
.pipe(
24-
map((user) => {
25-
if (!user) {
26-
this.keycloak.login({
27-
locale: this.languageService.language,
28-
redirectUri: window.location.href,
29-
});
30-
return EMPTY;
31-
}
32-
return user;
33-
}),
34-
switchMap(() => this.reload$),
35-
switchMap(() => this.contactsService.getContacts$()),
36-
catchError((error) => {
37-
this.toastService.handleError(error);
21+
protected readonly items$: Observable<Contact[]> = this.auth.getUser$().pipe(
22+
map((user) => {
23+
if (!user) {
24+
this.keycloak.login({
25+
locale: this.languageService.language,
26+
redirectUri: window.location.href,
27+
});
3828
return EMPTY;
39-
}),
40-
map(response => response.items || [])
41-
);
29+
}
30+
return user;
31+
}),
32+
switchMap(() => this.reload$),
33+
switchMap(() => this.contactsService.getContacts$()),
34+
catchError((error: unknown) => {
35+
this.toastService.handleError(error);
36+
return EMPTY;
37+
}),
38+
map((response) => response.items || []),
39+
);
4240

4341
constructor(
4442
private readonly contactsService: ContactsService,
@@ -48,8 +46,7 @@ export class AccountContactsComponent implements OnInit {
4846
private readonly contacts: ContactsClient,
4947
private readonly languageService: LanguageService,
5048
private readonly keycloak: KeycloakService,
51-
) {
52-
}
49+
) {}
5350

5451
ngOnInit(): void {
5552
setTimeout(() => this.pageEnv.set({pageId: 198}), 0);

src/app/account/inbox-pictures/inbox-pictures.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {ActivatedRoute} from '@angular/router';
33
import {AuthService} from '@services/auth.service';
44
import {PageEnvService} from '@services/page-env.service';
55
import {PictureService} from '@services/picture';
6-
import {EMPTY, combineLatest} from 'rxjs';
6+
import {combineLatest, EMPTY} from 'rxjs';
77
import {catchError, debounceTime, distinctUntilChanged, map, switchMap} from 'rxjs/operators';
88

99
import {ToastsService} from '../../toasts/toasts.service';

src/app/account/profile/profile.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {PageEnvService} from '@services/page-env.service';
1010
import {TimezoneService} from '@services/timezone';
1111
import {InvalidParams} from '@utils/invalid-params.pipe';
1212
import {KeycloakService} from 'keycloak-angular';
13-
import {EMPTY, Subscription, of} from 'rxjs';
13+
import {EMPTY, of, Subscription} from 'rxjs';
1414
import {catchError, switchMap, tap} from 'rxjs/operators';
1515

1616
import {ToastsService} from '../../toasts/toasts.service';
@@ -102,7 +102,9 @@ export class AccountProfileComponent implements OnInit, OnDestroy {
102102
});
103103
}
104104
ngOnDestroy(): void {
105-
this.sub && this.sub.unsubscribe();
105+
if (this.sub) {
106+
this.sub.unsubscribe();
107+
}
106108
}
107109

108110
private showSavedMessage() {

src/app/account/specs-conflicts/specs-conflicts.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {AuthService} from '@services/auth.service';
55
import {PageEnvService} from '@services/page-env.service';
66
import {UserService} from '@services/user';
77
import {getUnitAbbrTranslation} from '@utils/translations';
8-
import {Observable, combineLatest} from 'rxjs';
8+
import {combineLatest, Observable} from 'rxjs';
99
import {debounceTime, distinctUntilChanged, map, switchMap} from 'rxjs/operators';
1010

1111
import {APIAttrConflict, APIAttrConflictValue, APIAttrsService} from '../../api/attrs/attrs.service';

src/app/api/attrs/attrs.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {Injectable} from '@angular/core';
22
import {
33
AttrAttribute,
44
AttrAttributeID,
5-
AttrAttributeType,
65
AttrAttributesRequest,
6+
AttrAttributeType,
77
AttrListOptionsRequest,
88
AttrListOptionsResponse,
99
AttrZone,

src/app/api/picture-moder-vote-template/picture-moder-vote-template.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {DeleteModerVoteTemplateRequest, ModerVoteTemplate} from '@grpc/spec.pb';
33
import {PicturesClient} from '@grpc/spec.pbsc';
44
import {Empty} from '@ngx-grpc/well-known-types';
55
import {AuthService} from '@services/auth.service';
6-
import {BehaviorSubject, Observable, combineLatest} from 'rxjs';
6+
import {BehaviorSubject, combineLatest, Observable} from 'rxjs';
77
import {map, shareReplay, switchMap, tap} from 'rxjs/operators';
88

99
export interface APIPictureModerVoteTemplatePostData {

src/app/cars/attrs-change-log/attrs-change-log.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import {APIItem} from '@services/item';
99
import {PageEnvService} from '@services/page-env.service';
1010
import {UserService} from '@services/user';
1111
import {getAttrsTranslation, getUnitAbbrTranslation} from '@utils/translations';
12-
import {EMPTY, Observable, Subscription, combineLatest, of} from 'rxjs';
12+
import {combineLatest, EMPTY, Observable, of, Subscription} from 'rxjs';
1313
import {catchError, debounceTime, distinctUntilChanged, map, shareReplay, switchMap} from 'rxjs/operators';
1414

15-
import {APIAttrAttributeValue, APIAttrUnit, APIAttrsService} from '../../api/attrs/attrs.service';
15+
import {APIAttrAttributeValue, APIAttrsService, APIAttrUnit} from '../../api/attrs/attrs.service';
1616
import {ToastsService} from '../../toasts/toasts.service';
1717

1818
@Component({
@@ -158,7 +158,9 @@ export class CarsAttrsChangeLogComponent implements OnInit, OnDestroy {
158158
}
159159

160160
ngOnDestroy(): void {
161-
this.querySub && this.querySub.unsubscribe();
161+
if (this.querySub) {
162+
this.querySub.unsubscribe();
163+
}
162164
}
163165

164166
protected getAttrsTranslation(id: string): string {

0 commit comments

Comments
 (0)