Skip to content

Commit 103f81a

Browse files
committed
feat: add tracks, dump dependencies
1 parent 37b4ffc commit 103f81a

File tree

84 files changed

+3666
-3229
lines changed

Some content is hidden

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

84 files changed

+3666
-3229
lines changed

package-lock.json

Lines changed: 3508 additions & 3071 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular-devkit/architect": "^0.1800.6",
14+
"@angular-devkit/architect": "^0.1802.2",
1515
"@angular-devkit/build-angular": "^18.0.6",
1616
"@angular/animations": "^18.0.5",
1717
"@angular/cdk": "^18",
@@ -71,12 +71,12 @@
7171
"@types/node": "^20.4.5",
7272
"@types/showdown": "^2.0.6",
7373
"@types/sprintf-js": "^1.1.4",
74-
"@typescript-eslint/eslint-plugin": "^7",
75-
"@typescript-eslint/parser": "^7",
74+
"@typescript-eslint/eslint-plugin": "^7 || ^8",
75+
"@typescript-eslint/parser": "^7 || ^8",
7676
"eslint": "^8.45.0 || ^9",
7777
"eslint-config-prettier": "^9.0.0",
7878
"eslint-plugin-json": "^4",
79-
"eslint-plugin-perfectionist": "^2.2.0",
79+
"eslint-plugin-perfectionist": "^2.2.0 || ^3",
8080
"eslint-plugin-prettier": "^5.0.1",
8181
"eslint-plugin-rxjs": "^5.0.2",
8282
"eslint-plugin-rxjs-angular": "^2.0.0",

src/app/account/accounts/accounts.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1 i18n>My accounts</h1>
44
@if (accounts$ | async; as accounts) {
55
@if (accounts.length > 0 && !disconnectFailed) {
66
<div class="card card-body mb-4">
7-
@for (account of accounts; track account) {
7+
@for (account of accounts; track account.id) {
88
<div>
99
<p>
1010
@if (account.can_remove) {

src/app/account/contacts/contacts.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h1 i18n>Contacts</h1>
33
</div>
44
<div class="row">
5-
@for (contact of items; track contact) {
5+
@for (contact of items$ | async; track contact.contactUserId) {
66
<div class="col-md-6 mb-2">
77
<div class="d-flex justify-content-start">
88
<div class="align-self-start me-3">

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

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,44 @@
1-
import {Component} from '@angular/core';
1+
import {Component, OnInit} from '@angular/core';
22
import {Contact, DeleteContactRequest} from '@grpc/spec.pb';
33
import {ContactsClient} from '@grpc/spec.pbsc';
44
import {AuthService} from '@services/auth.service';
55
import {ContactsService} from '@services/contacts';
66
import {LanguageService} from '@services/language';
77
import {PageEnvService} from '@services/page-env.service';
88
import {KeycloakService} from 'keycloak-angular';
9-
import {EMPTY} from 'rxjs';
10-
import {map, switchMap} from 'rxjs/operators';
9+
import {BehaviorSubject, EMPTY, Observable} from 'rxjs';
10+
import {catchError, map, switchMap} from 'rxjs/operators';
1111

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

1414
@Component({
1515
selector: 'app-account-contacts',
1616
templateUrl: './contacts.component.html',
1717
})
18-
export class AccountContactsComponent {
19-
protected items: Contact[] = [];
18+
export class AccountContactsComponent implements OnInit {
19+
private readonly reload$ = new BehaviorSubject<void>(void 0);
20+
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);
38+
return EMPTY;
39+
}),
40+
map(response => response.items || [])
41+
);
2042

2143
constructor(
2244
private readonly contactsService: ContactsService,
@@ -27,41 +49,17 @@ export class AccountContactsComponent {
2749
private readonly languageService: LanguageService,
2850
private readonly keycloak: KeycloakService,
2951
) {
30-
setTimeout(() => this.pageEnv.set({pageId: 198}), 0);
52+
}
3153

32-
this.auth
33-
.getUser$()
34-
.pipe(
35-
map((user) => {
36-
if (!user) {
37-
this.keycloak.login({
38-
locale: this.languageService.language,
39-
redirectUri: window.location.href,
40-
});
41-
return EMPTY;
42-
}
43-
return user;
44-
}),
45-
switchMap(() => this.contactsService.getContacts$()),
46-
)
47-
.subscribe({
48-
error: (response: unknown) => this.toastService.handleError(response),
49-
next: (response) => {
50-
this.items = response.items ? response.items : [];
51-
},
52-
});
54+
ngOnInit(): void {
55+
setTimeout(() => this.pageEnv.set({pageId: 198}), 0);
5356
}
5457

5558
protected deleteContact(id: string) {
5659
this.contacts.deleteContact(new DeleteContactRequest({userId: id})).subscribe({
5760
error: (response: unknown) => this.toastService.handleError(response),
5861
next: () => {
59-
for (let i = 0; i < this.items.length; i++) {
60-
if (this.items[i].contactUserId === id) {
61-
this.items.splice(i, 1);
62-
break;
63-
}
64-
}
62+
this.reload$.next(void 0);
6563
},
6664
});
6765
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ <h1 i18n>Unmoderated</h1>
33
</div>
44
@if (data$ | async; as data) {
55
<div class="row">
6-
@for (picture of data.pictures; track picture) {
6+
@for (picture of data.pictures; track picture.id) {
77
<div class="col-12 cols-sm-6 col-md-6 col-lg-4">
88
<app-thumbnail [picture]="picture" [route]="['/picture', picture.identity]"></app-thumbnail>
99
</div>

src/app/account/messages/messages.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1>{{ pageName }}</h1>
1818
}
1919

2020
<div class="comments">
21-
@for (message of data.items; track message) {
21+
@for (message of data.items; track message.message.id) {
2222
<div class="message">
2323
@if (message.message.authorId !== '0') {
2424
@if (message.author$ | async; as author) {

src/app/account/profile/profile.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h2 i18n>Other</h2>
5252
[class.is-invalid]="settingsInvalidParams.language"
5353
[(ngModel)]="settings.language"
5454
>
55-
@for (language of languages; track language) {
55+
@for (language of languages; track language.value) {
5656
<option [value]="language.value">{{ language.name }}</option>
5757
}
5858
</select>

src/app/app.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@
144144
</li>
145145
<li class="nav-item" ngbDropdown placement="bottom-right">
146146
<button href="#" class="nav-link" ngbDropdownToggle>
147-
@for (lang of languages; track lang) {
147+
@for (lang of languages; track lang.code) {
148148
@if (lang.code === language) {
149149
<i [ngClass]="lang.flag" aria-hidden="true"></i>
150150
}
151151
}
152152
</button>
153153
<div ngbDropdownMenu>
154-
@for (lang of languages; track lang) {
154+
@for (lang of languages; track lang.code) {
155155
<a
156156
class="dropdown-item"
157157
[href]="'//' + lang.hostname + urlPath"
@@ -245,7 +245,7 @@
245245
</div>
246246
</div>
247247
<p class="language-picker">
248-
@for (lang of languages; track lang) {
248+
@for (lang of languages; track lang.code) {
249249
@if (lang.code !== language) {
250250
<a [href]="'//' + lang.hostname + urlPath">
251251
<i [ngClass]="lang.flag" aria-hidden="true"></i>

src/app/articles/list/list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 i18n>Articles</h1>
1313
@if (articles$ | async; as response) {
1414
<div class="card card-body">
1515
<ul class="article-list">
16-
@for (article of response.articles; track article) {
16+
@for (article of response.articles; track article.id) {
1717
<li>
1818
@if (article.previewUrl) {
1919
<a [routerLink]="article.routerLink">

0 commit comments

Comments
 (0)