Skip to content

Commit ed399e0

Browse files
committed
refactor: standalone modules
1 parent 5faa77f commit ed399e0

File tree

308 files changed

+1597
-2062
lines changed

Some content is hidden

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

308 files changed

+1597
-2062
lines changed

src/app/about/about-routing.module.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
import {NgModule} from '@angular/core';
2-
import {RouterModule, Routes} from '@angular/router';
1+
import {Routes} from '@angular/router';
32

43
import {AboutComponent} from './about.component';
54

6-
const routes: Routes = [{component: AboutComponent, path: '', pathMatch: 'full', title: $localize`About us`}];
7-
8-
@NgModule({
9-
exports: [RouterModule],
10-
imports: [RouterModule.forChild(routes)],
11-
})
12-
export class AboutRoutingModule {}
5+
export const routes: Routes = [{component: AboutComponent, path: '', pathMatch: 'full', title: $localize`About us`}];

src/app/about/about.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {DecimalPipe} from '@angular/common';
1+
import {AsyncPipe, DecimalPipe} from '@angular/common';
22
import {Component, inject, OnInit} from '@angular/core';
3-
import {Router} from '@angular/router';
3+
import {Router, RouterLink} from '@angular/router';
44
import {APIUser} from '@grpc/spec.pb';
55
import {StatisticsClient} from '@grpc/spec.pbsc';
66
import {Empty} from '@ngx-grpc/well-known-types';
@@ -81,8 +81,10 @@ You can support our project by [finances](/donate) or [moral](/feedback).
8181
Take part in [the translation of the site](https://github.com/autowp/autowp-frontend/tree/master/src/locale) into other languages.`;
8282

8383
@Component({
84+
imports: [RouterLink, AsyncPipe],
8485
providers: [BytesPipe],
8586
selector: 'app-about',
87+
standalone: true,
8688
templateUrl: './about.component.html',
8789
})
8890
export class AboutComponent implements OnInit {

src/app/about/about.module.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/app/account/access/access.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import {Component, inject, OnInit} from '@angular/core';
2+
import {RouterLink} from '@angular/router';
23
import {environment} from '@environment/environment';
34
import {PageEnvService} from '@services/page-env.service';
45

56
@Component({
7+
imports: [RouterLink],
68
selector: 'app-account-access',
9+
standalone: true,
710
templateUrl: './access.component.html',
811
})
912
export class AccountAccessComponent implements OnInit {

src/app/account/account-routing.module.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {NgModule} from '@angular/core';
2-
import {RouterModule, Routes} from '@angular/router';
1+
import {Routes} from '@angular/router';
32

43
import {authGuard} from '../auth.guard';
54
import {AccountAccessComponent} from './access/access.component';
@@ -14,7 +13,7 @@ import {AccountMessagesComponent} from './messages/messages.component';
1413
import {AccountProfileComponent} from './profile/profile.component';
1514
import {AccountSpecsConflictsComponent} from './specs-conflicts/specs-conflicts.component';
1615

17-
const routes: Routes = [
16+
export const routes: Routes = [
1817
{
1918
children: [
2019
{
@@ -83,9 +82,3 @@ const routes: Routes = [
8382
},
8483
{path: '', pathMatch: 'full', redirectTo: 'profile'},
8584
];
86-
87-
@NgModule({
88-
exports: [RouterModule],
89-
imports: [RouterModule.forChild(routes)],
90-
})
91-
export class AccountRoutingModule {}

src/app/account/account.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import {AsyncPipe} from '@angular/common';
12
import {Component, inject} from '@angular/core';
3+
import {RouterLink, RouterOutlet} from '@angular/router';
24
import {ForumsClient} from '@grpc/spec.pbsc';
35
import {Empty} from '@ngx-grpc/well-known-types';
46
import {AuthService} from '@services/auth.service';
@@ -22,7 +24,9 @@ interface SidebarItem {
2224
}
2325

2426
@Component({
27+
imports: [RouterLink, RouterOutlet, AsyncPipe],
2528
selector: 'app-account',
29+
standalone: true,
2630
templateUrl: './account.component.html',
2731
})
2832
export class AccountComponent {

src/app/account/account.module.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
import {AsyncPipe} from '@angular/common';
12
import {Component, inject, OnInit} from '@angular/core';
23
import {APIService} from '@services/api.service';
34
import {PageEnvService} from '@services/page-env.service';
5+
import {MarkdownComponent} from '@utils/markdown/markdown.component';
46
import {BehaviorSubject, combineLatest, EMPTY, Observable} from 'rxjs';
57
import {catchError, map} from 'rxjs/operators';
68

79
import {ToastsService} from '../../toasts/toasts.service';
810
import {APIAccount, APIAccountItemsGetResponse} from '../account.service';
911

1012
@Component({
13+
imports: [MarkdownComponent, AsyncPipe],
1114
selector: 'app-account-accounts',
15+
standalone: true,
1216
templateUrl: './accounts.component.html',
1317
})
1418
export class AccountAccountsComponent implements OnInit {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1+
import {AsyncPipe, DatePipe} from '@angular/common';
12
import {Component, inject, OnInit} from '@angular/core';
3+
import {RouterLink} from '@angular/router';
24
import {Contact, DeleteContactRequest} from '@grpc/spec.pb';
35
import {ContactsClient} from '@grpc/spec.pbsc';
6+
import {NgbTooltip} from '@ng-bootstrap/ng-bootstrap';
47
import {AuthService} from '@services/auth.service';
58
import {ContactsService} from '@services/contacts';
69
import {LanguageService} from '@services/language';
710
import {PageEnvService} from '@services/page-env.service';
11+
import {TimeAgoPipe} from '@utils/time-ago.pipe';
812
import {KeycloakService} from 'keycloak-angular';
913
import {BehaviorSubject, EMPTY, Observable} from 'rxjs';
1014
import {catchError, map, switchMap} from 'rxjs/operators';
1115

1216
import {ToastsService} from '../../toasts/toasts.service';
17+
import {UserComponent} from '../../user/user/user.component';
1318

1419
@Component({
20+
imports: [RouterLink, UserComponent, NgbTooltip, AsyncPipe, DatePipe, TimeAgoPipe],
1521
selector: 'app-account-contacts',
22+
standalone: true,
1623
templateUrl: './contacts.component.html',
1724
})
1825
export class AccountContactsComponent implements OnInit {

src/app/account/delete/delete.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Component, inject, OnInit} from '@angular/core';
2+
import {FormsModule} from '@angular/forms';
23
import {Router} from '@angular/router';
34
import {APIDeleteUserRequest} from '@grpc/spec.pb';
45
import {UsersClient} from '@grpc/spec.pbsc';
@@ -11,9 +12,13 @@ import {switchMap} from 'rxjs/operators';
1112

1213
import {extractFieldViolations, fieldViolations2InvalidParams} from '../../grpc';
1314
import {ToastsService} from '../../toasts/toasts.service';
15+
import {InvalidParamsPipe} from '../../utils/invalid-params.pipe';
16+
import {MarkdownComponent} from '../../utils/markdown/markdown.component';
1417

1518
@Component({
19+
imports: [MarkdownComponent, FormsModule, InvalidParamsPipe],
1620
selector: 'app-account-delete',
21+
standalone: true,
1722
templateUrl: './delete.component.html',
1823
})
1924
export class AccountDeleteComponent implements OnInit {

src/app/account/delete/deleted/deleted.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import {Component, inject, OnInit} from '@angular/core';
22
import {PageEnvService} from '@services/page-env.service';
33

4+
import {MarkdownComponent} from '../../../utils/markdown/markdown.component';
5+
46
@Component({
7+
imports: [MarkdownComponent],
58
selector: 'app-account-delete-deleted',
9+
standalone: true,
610
templateUrl: './deleted.component.html',
711
})
812
export class AccountDeletedComponent implements OnInit {

src/app/account/email/email.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {AsyncPipe} from '@angular/common';
12
import {Component, inject, OnInit} from '@angular/core';
23
import {environment} from '@environment/environment';
34
import {APIMeRequest, UserFields} from '@grpc/spec.pb';
@@ -9,7 +10,9 @@ import {catchError, map} from 'rxjs/operators';
910
import {ToastsService} from '../../toasts/toasts.service';
1011

1112
@Component({
13+
imports: [AsyncPipe],
1214
selector: 'app-account-email',
15+
standalone: true,
1316
templateUrl: './email.component.html',
1417
})
1518
export class AccountEmailComponent implements OnInit {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {AsyncPipe} from '@angular/common';
12
import {Component, inject, OnInit} from '@angular/core';
23
import {ActivatedRoute} from '@angular/router';
34
import {AuthService} from '@services/auth.service';
@@ -6,10 +7,14 @@ import {PictureService} from '@services/picture';
67
import {combineLatest, EMPTY} from 'rxjs';
78
import {catchError, debounceTime, distinctUntilChanged, map, switchMap} from 'rxjs/operators';
89

10+
import {PaginatorComponent} from '../../paginator/paginator/paginator.component';
11+
import {ThumbnailComponent} from '../../thumbnail/thumbnail/thumbnail.component';
912
import {ToastsService} from '../../toasts/toasts.service';
1013

1114
@Component({
15+
imports: [ThumbnailComponent, PaginatorComponent, AsyncPipe],
1216
selector: 'app-account-inbox-pictures',
17+
standalone: true,
1318
templateUrl: './inbox-pictures.component.html',
1419
})
1520
export class AccountInboxPicturesComponent implements OnInit {

src/app/account/messages/messages.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import {AsyncPipe} from '@angular/common';
12
import {Component, inject} from '@angular/core';
2-
import {ActivatedRoute} from '@angular/router';
3+
import {ActivatedRoute, RouterLink} from '@angular/router';
34
import {APIMessage, APIUser, MessagingGetMessagesRequest, Pages} from '@grpc/spec.pb';
45
import {MessagingClient} from '@grpc/spec.pbsc';
56
import {MessageService} from '@services/message';
@@ -9,10 +10,16 @@ import {BehaviorSubject, EMPTY, Observable, of} from 'rxjs';
910
import {catchError, debounceTime, distinctUntilChanged, map, switchMap, tap} from 'rxjs/operators';
1011

1112
import {MessageDialogService} from '../../message-dialog/message-dialog.service';
13+
import {PaginatorComponent} from '../../paginator/paginator/paginator.component';
1214
import {ToastsService} from '../../toasts/toasts.service';
15+
import {UserComponent} from '../../user/user/user.component';
16+
import {PastTimeIndicatorComponent} from '../../utils/past-time-indicator/past-time-indicator.component';
17+
import {UserTextComponent} from '../../utils/user-text/user-text.component';
1318

1419
@Component({
20+
imports: [UserComponent, RouterLink, UserTextComponent, PastTimeIndicatorComponent, PaginatorComponent, AsyncPipe],
1521
selector: 'app-account-messages',
22+
standalone: true,
1623
templateUrl: './messages.component.html',
1724
})
1825
export class AccountMessagesComponent {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import {AsyncPipe} from '@angular/common';
12
import {HttpErrorResponse} from '@angular/common/http';
23
import {Component, ElementRef, inject, OnDestroy, OnInit, ViewChild} from '@angular/core';
4+
import {FormsModule} from '@angular/forms';
35
import {environment} from '@environment/environment';
46
import {APIImage, APIMeRequest, APIUser, UserFields} from '@grpc/spec.pb';
57
import {UsersClient} from '@grpc/spec.pbsc';
@@ -14,9 +16,13 @@ import {EMPTY, of, Subscription} from 'rxjs';
1416
import {catchError, switchMap, tap} from 'rxjs/operators';
1517

1618
import {ToastsService} from '../../toasts/toasts.service';
19+
import {InvalidParamsPipe} from '../../utils/invalid-params.pipe';
20+
import {MarkdownComponent} from '../../utils/markdown/markdown.component';
1721

1822
@Component({
23+
imports: [MarkdownComponent, FormsModule, AsyncPipe, InvalidParamsPipe],
1924
selector: 'app-account-profile',
25+
standalone: true,
2026
templateUrl: './profile.component.html',
2127
})
2228
export class AccountProfileComponent implements OnInit, OnDestroy {

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import {AsyncPipe} from '@angular/common';
12
import {Component, inject, OnInit} from '@angular/core';
2-
import {ActivatedRoute} from '@angular/router';
3+
import {ActivatedRoute, RouterLink} from '@angular/router';
34
import {
45
APIItem,
56
APIUser,
@@ -21,6 +22,8 @@ import {combineLatest, Observable, of} from 'rxjs';
2122
import {debounceTime, distinctUntilChanged, map, shareReplay, switchMap} from 'rxjs/operators';
2223

2324
import {APIAttrsService} from '../../api/attrs/attrs.service';
25+
import {PaginatorComponent} from '../../paginator/paginator/paginator.component';
26+
import {UserComponent} from '../../user/user/user.component';
2427

2528
interface APIAttrConflictValueInList {
2629
user$: Observable<APIUser | null>;
@@ -51,7 +54,9 @@ function mapFilter(filter: null | string): AttrConflictsRequest.Filter {
5154
}
5255

5356
@Component({
57+
imports: [RouterLink, UserComponent, PaginatorComponent, AsyncPipe],
5458
selector: 'app-account-specs-conflicts',
59+
standalone: true,
5560
templateUrl: './specs-conflicts.component.html',
5661
})
5762
export class AccountSpecsConflictsComponent implements OnInit {

src/app/api/attrs/attrs.module.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/app/api/comments/comments.module.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/app/api/perspective/perspective.module.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)