Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
refactor(frontend): use Angular inject() API instead of constructor parameter injection
johavendc6a273dae19
diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.tsindex be8f467b..49b1ba1f 100644--- a/frontend/src/app/app.component.ts+++ b/frontend/src/app/app.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject } from '@angular/core'+import { Component, inject } from '@angular/core'import { RouterOutlet } from '@angular/router'import { FaConfig } from '@fortawesome/angular-fontawesome'import { L10N_LOCALE, L10nLoader, L10nLocale } from 'angular-l10n'@@ -19,12 +19,13 @@ import { dJs } from './common/utils/time'template: '<router-outlet></router-outlet>'})export class AppComponent {- constructor(- @Inject(L10N_LOCALE) private locale: L10nLocale,- private l10nLoader: L10nLoader,- private bsLocaleService: BsLocaleService,- faConfig: FaConfig- ) {+ private locale = inject<L10nLocale>(L10N_LOCALE)+ private l10nLoader = inject(L10nLoader)+ private bsLocaleService = inject(BsLocaleService)++ constructor() {+ const faConfig = inject(FaConfig)+faConfig.fixedWidth = truesetTheme('bs5')defineLocale('fr', frLocale)diff --git a/frontend/src/app/applications/admin/admin.service.ts b/frontend/src/app/applications/admin/admin.service.tsindex d16d98fa..32e4f65d 100644--- a/frontend/src/app/applications/admin/admin.service.ts+++ b/frontend/src/app/applications/admin/admin.service.ts@@ -5,7 +5,7 @@*/import { HttpClient } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { Router } from '@angular/router'import {ADMIN_USERS_ROUTE,@@ -47,11 +47,9 @@ import { AdminUserModel } from './models/admin-user.model'providedIn: 'root'})export class AdminService {- constructor(- private readonly http: HttpClient,- private readonly router: Router,- private readonly authService: AuthService- ) {}+ private readonly http = inject(HttpClient)+ private readonly router = inject(Router)+ private readonly authService = inject(AuthService)listUsers(areGuests = false): Observable<AdminUserModel[]> {return this.httpdiff --git a/frontend/src/app/applications/admin/components/admin-groups.component.ts b/frontend/src/app/applications/admin/components/admin-groups.component.tsindex f6aa8ed5..1f58ce79 100644--- a/frontend/src/app/applications/admin/components/admin-groups.component.ts+++ b/frontend/src/app/applications/admin/components/admin-groups.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, ElementRef, Inject, ViewChild } from '@angular/core'+import { Component, ElementRef, ViewChild, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { ActivatedRoute, Data, Router, UrlSegment } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -31,7 +31,7 @@ import { USER_GROUP_ROLE } from '@sync-in-server/backend/src/applications/users/import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { ButtonCheckboxDirective } from 'ngx-bootstrap/buttons'import { BsDropdownDirective, BsDropdownMenuDirective, BsDropdownToggleDirective } from 'ngx-bootstrap/dropdown'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipDirective } from 'ngx-bootstrap/tooltip'import { filter, take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -78,6 +78,11 @@ import { AdminGroupEditUserDialogComponent } from './dialogs/admin-group-edit-ustemplateUrl: 'admin-groups.component.html'})export class AdminGroupsComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@ViewChild(VirtualScrollComponent) scrollView: {element: ElementRefviewPortItems: MemberModel[]@@ -155,13 +160,7 @@ export class AdminGroupsComponent {protected selected: MemberModel = nullprotected members: MemberModel[] = []- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly activatedRoute: ActivatedRoute,- private readonly layout: LayoutService,- private readonly adminService: AdminService- ) {+ constructor() {this.activatedRoute.data.subscribe((route: Data) => {this.personalGroupsView = route.type === GROUP_TYPE.PERSONALthis.setEnv(route.routes as UrlSegment[])diff --git a/frontend/src/app/applications/admin/components/admin-users.component.ts b/frontend/src/app/applications/admin/components/admin-users.component.tsindex 418c2c12..44610a6a 100644--- a/frontend/src/app/applications/admin/components/admin-users.component.ts+++ b/frontend/src/app/applications/admin/components/admin-users.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, ElementRef, Inject, ViewChild } from '@angular/core'+import { Component, ElementRef, ViewChild, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { ActivatedRoute, Data, Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -26,7 +26,7 @@ import { ContextMenuComponent, ContextMenuModule } from '@perfectmemory/ngx-contimport { USER_ROLE } from '@sync-in-server/backend/src/applications/users/constants/user'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { ButtonCheckboxDirective } from 'ngx-bootstrap/buttons'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipDirective } from 'ngx-bootstrap/tooltip'import { take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -68,6 +68,11 @@ import { AdminUserDialogComponent } from './dialogs/admin-user-dialog.component'templateUrl: 'admin-users.component.html'})export class AdminUsersComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@ViewChild(VirtualScrollComponent) scrollView: {element: ElementRefviewPortItems: AdminUserModel[]@@ -164,13 +169,7 @@ export class AdminUsersComponent {protected selected: AdminUserModel = nullprotected users: AdminUserModel[] = []- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly activatedRoute: ActivatedRoute,- private readonly layout: LayoutService,- private readonly adminService: AdminService- ) {+ constructor() {this.layout.setBreadcrumbIcon(ADMIN_ICON.USERS)this.activatedRoute.data.subscribe((route: Data) => {this.guestsView = route.type === USER_ROLE.GUESTdiff --git a/frontend/src/app/applications/admin/components/dialogs/admin-group-add-users-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-group-add-users-dialog.component.tsindex 065541f6..cbb01fdf 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-group-add-users-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-group-add-users-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faUserPlus } from '@fortawesome/free-solid-svg-icons'import { GROUP_TYPE } from '@sync-in-server/backend/src/applications/users/constants/group'@@ -25,6 +25,8 @@ import { AdminService } from '../../admin.service'templateUrl: 'admin-group-add-users-dialog.component.html'})export class AdminGroupAddUsersDialogComponent {+ protected readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@Input({ required: true }) parentGroup: GroupBrowseModel['parentGroup']@Input({ required: true }) currentMemberIds: number[] = []@Output() hasChanges = new EventEmitter<boolean>()@@ -32,11 +34,6 @@ export class AdminGroupAddUsersDialogComponent {protected submitted = falseprotected readonly icons = { faUserPlus }- constructor(- protected readonly layout: LayoutService,- private readonly adminService: AdminService- ) {}-searchMembers(query: string): Observable<MemberModel[]> {const search: SearchMembersDto = {search: query,diff --git a/frontend/src/app/applications/admin/components/dialogs/admin-group-delete-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-group-delete-dialog.component.tsindex 9b1b2934..c71335cb 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-group-delete-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-group-delete-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faMinus, faUserMinus } from '@fortawesome/free-solid-svg-icons'import { L10nTranslateDirective } from 'angular-l10n'@@ -22,17 +22,14 @@ import { AdminService } from '../../admin.service'templateUrl: 'admin-group-delete-dialog.component.html'})export class AdminGroupDeleteDialogComponent {+ private readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@Input({ required: true }) parentGroup: GroupBrowseModel['parentGroup']@Input({ required: true }) member: MemberModel@Output() wasDeleted = new EventEmitter<boolean>()protected submitted = falseprotected readonly icons = { GROUPS: USER_ICON.GROUPS, faMinus, faUserMinus }- constructor(- private readonly layout: LayoutService,- private readonly adminService: AdminService- ) {}-onSubmit() {this.submitted = trueconst notification = this.member.isUser ? 'Remove from group' : 'Delete group'diff --git a/frontend/src/app/applications/admin/components/dialogs/admin-group-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-group-dialog.component.tsindex 751b878b..aa16c8db 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-group-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-group-dialog.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faCog, faPen, faPlus, faShieldHalved } from '@fortawesome/free-solid-svg-icons'@@ -46,6 +46,9 @@ import { AdminPermissionsComponent } from '../utils/admin-permissions.component'templateUrl: 'admin-group-dialog.component.html'})export class AdminGroupDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@Input() group: AdminGroupModel = null@Input() parentGroup: Pick<AdminGroupModel, 'id' | 'name' | 'type'> = null@Output() groupChange = new EventEmitter<['add' | 'update', AdminGroupModel]>()@@ -66,12 +69,6 @@ export class AdminGroupDialogComponent implements OnInit {parent: FormControl<AdminGroupModel['parent']>}>- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly adminService: AdminService- ) {}-ngOnInit() {this.groupForm = new FormGroup({name: new FormControl<string>(this.group?.name || '', Validators.required),diff --git a/frontend/src/app/applications/admin/components/dialogs/admin-group-edit-user-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-group-edit-user-dialog.component.tsindex 6db4082d..0a80e804 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-group-edit-user-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-group-edit-user-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, Input, OnInit } from '@angular/core'+import { Component, Input, OnInit, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faKey, faUserPen } from '@fortawesome/free-solid-svg-icons'@@ -22,6 +22,8 @@ import { AdminGroupModel } from '../../models/admin-group.model'templateUrl: 'admin-group-edit-user-dialog.component.html'})export class AdminGroupEditUserDialogComponent implements OnInit {+ protected readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@Input({ required: true }) parentGroup: Pick<AdminGroupModel, 'id' | 'name' | 'type' | 'description'>@Input({ required: true }) user: MemberModelprotected submitted = false@@ -29,11 +31,6 @@ export class AdminGroupEditUserDialogComponent implements OnInit {protected readonly USER_GROUP_ROLE = USER_GROUP_ROLEprotected readonly icons = { faUserPen, faKey }- constructor(- protected readonly layout: LayoutService,- private readonly adminService: AdminService- ) {}-ngOnInit() {this.isManager = this.user.isGroupManager}diff --git a/frontend/src/app/applications/admin/components/dialogs/admin-guest-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-guest-dialog.component.tsindex e0828b65..2bb077d0 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-guest-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-guest-dialog.component.ts@@ -6,24 +6,22 @@import { TitleCasePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, Inject } from '@angular/core'+import { Component, inject } from '@angular/core'import { ReactiveFormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { USER_ROLE } from '@sync-in-server/backend/src/applications/users/constants/user'import type { SearchMembersDto } from '@sync-in-server/backend/src/applications/users/dto/search-members.dto'-import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'+import { L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { TabDirective, TabHeadingDirective, TabsetComponent } from 'ngx-bootstrap/tabs'import { Observable } from 'rxjs'import { InputPasswordComponent } from '../../../../common/components/input-password.component'import { PasswordStrengthBarComponent } from '../../../../common/components/password-strength-bar.component'import { AutofocusDirective } from '../../../../common/directives/auto-focus.directive'import { TimeDateFormatPipe } from '../../../../common/pipes/time-date-format.pipe'-import { LayoutService } from '../../../../layout/layout.service'import { UserGuestDialogComponent } from '../../../users/components/dialogs/user-guest-dialog.component'import { UserSearchComponent } from '../../../users/components/utils/user-search.component'import { GuestUserModel } from '../../../users/models/guest.model'import { MemberModel } from '../../../users/models/member.model'-import { UserService } from '../../../users/user.service'import { AdminService } from '../../admin.service'@Component({@@ -50,13 +48,9 @@ import { AdminService } from '../../admin.service'templateUrl: '../../../users/components/dialogs/user-guest-dialog.component.html'})export class AdminGuestDialogComponent extends UserGuestDialogComponent {- constructor(- @Inject(L10N_LOCALE) locale: L10nLocale,- layout: LayoutService,- userService: UserService,- private readonly adminService: AdminService- ) {- super(locale, layout, userService)+ private readonly adminService = inject(AdminService)+ constructor() {+ super()}override searchMembers(query: string): Observable<MemberModel[]> {diff --git a/frontend/src/app/applications/admin/components/dialogs/admin-impersonate-user-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-impersonate-user-dialog.component.tsindex 2f419e82..b886a03d 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-impersonate-user-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-impersonate-user-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, Inject, Input } from '@angular/core'+import { Component, Input, inject } from '@angular/core'import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faUserSecret } from '@fortawesome/free-solid-svg-icons'@@ -25,6 +25,9 @@ import { AdminUserModel } from '../../models/admin-user.model'templateUrl: 'admin-impersonate-user-dialog.component.html'})export class AdminImpersonateUserDialogComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@Input({ required: true }) user: AdminUserModelprotected submitted = falseprotected readonly icons = { faUserSecret }@@ -33,12 +36,6 @@ export class AdminImpersonateUserDialogComponent {password: FormControl<string>}>({ password: new FormControl('', Validators.required) })- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly adminService: AdminService- ) {}-onSubmit() {this.submitted = truethis.adminService.impersonateUser(this.user.id, { password: this.impersonateUserForm.value.password } satisfies UserPasswordDto).subscribe({diff --git a/frontend/src/app/applications/admin/components/dialogs/admin-user-delete-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-user-delete-dialog.component.tsindex 39a741b7..7b790480 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-user-delete-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-user-delete-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faUserMinus } from '@fortawesome/free-solid-svg-icons'@@ -23,6 +23,9 @@ import { AdminUserModel } from '../../models/admin-user.model'templateUrl: 'admin-user-delete-dialog.component.html'})export class AdminUserDeleteDialogComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@Input({ required: true }) user: AdminUserModel@Output() wasDeleted = new EventEmitter<boolean>()protected submitted = false@@ -32,12 +35,6 @@ export class AdminUserDeleteDialogComponent {deleteSpace: FormControl<boolean>}>({ adminPassword: new FormControl('', Validators.required), deleteSpace: new FormControl(false) })- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly layout: LayoutService,- private readonly adminService: AdminService- ) {}-onClose() {this.wasDeleted.emit(false)this.layout.closeDialog()diff --git a/frontend/src/app/applications/admin/components/dialogs/admin-user-dialog.component.ts b/frontend/src/app/applications/admin/components/dialogs/admin-user-dialog.component.tsindex 075e74b8..92adda5c 100644--- a/frontend/src/app/applications/admin/components/dialogs/admin-user-dialog.component.ts+++ b/frontend/src/app/applications/admin/components/dialogs/admin-user-dialog.component.ts@@ -6,7 +6,7 @@import { TitleCasePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faAddressCard, faShieldHalved, faSpinner, faUserPen, faUserPlus, faUsers } from '@fortawesome/free-solid-svg-icons'@@ -20,7 +20,7 @@ import {import type { CreateUserDto, UpdateUserDto } from '@sync-in-server/backend/src/applications/users/dto/create-or-update-user.dto'import type { SearchMembersDto } from '@sync-in-server/backend/src/applications/users/dto/search-members.dto'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TabDirective, TabHeadingDirective, TabsetComponent } from 'ngx-bootstrap/tabs'import { Observable } from 'rxjs'import { take } from 'rxjs/operators'@@ -66,6 +66,9 @@ import { AdminUserDeleteDialogComponent } from './admin-user-delete-dialog.compotemplateUrl: 'admin-user-dialog.component.html'})export class AdminUserDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly adminService = inject(AdminService)@Input() user: AdminUserModel = null@Output() userChange = new EventEmitter<['add' | 'update' | 'delete', AdminUserModel]>()protected submitted = false@@ -91,12 +94,6 @@ export class AdminUserDialogComponent implements OnInit {applications: FormControl<USER_PERMISSION[]>}>- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly adminService: AdminService- ) {}-ngOnInit() {this.userForm = new FormGroup({login: new FormControl<string>(this.user?.login || '', [Validators.required, Validators.pattern(USER_LOGIN_VALIDATION)]),diff --git a/frontend/src/app/applications/admin/components/utils/admin-permissions.component.ts b/frontend/src/app/applications/admin/components/utils/admin-permissions.component.tsindex 1c0f1585..cafe48df 100644--- a/frontend/src/app/applications/admin/components/utils/admin-permissions.component.ts+++ b/frontend/src/app/applications/admin/components/utils/admin-permissions.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, EventEmitter, Inject, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { USER_PERMISSION } from '@sync-in-server/backend/src/applications/users/constants/user'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { CapitalizePipe } from '../../../../common/pipes/capitalize.pipe'@@ -33,12 +33,11 @@ import { CapitalizePipe } from '../../../../common/pipes/capitalize.pipe'</div>`})export class AdminPermissionsComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)@Input() permissions: USER_PERMISSION[] = []@Output() permissionsChange = new EventEmitter<USER_PERMISSION[]>()protected readonly allApplications = Object.values(USER_PERMISSION)- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}-updatePermissions(app: USER_PERMISSION, event: any) {if (event.target.checked) {this.permissions.push(app)diff --git a/frontend/src/app/applications/comments/components/sidebar/comments-selection.component.ts b/frontend/src/app/applications/comments/components/sidebar/comments-selection.component.tsindex b8d0c530..7a5bb777 100644--- a/frontend/src/app/applications/comments/components/sidebar/comments-selection.component.ts+++ b/frontend/src/app/applications/comments/components/sidebar/comments-selection.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, computed, ElementRef, Inject, OnDestroy, Signal, ViewChild } from '@angular/core'+import { Component, computed, ElementRef, OnDestroy, Signal, ViewChild, inject } from '@angular/core'import { toObservable } from '@angular/core/rxjs-interop'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -39,18 +39,17 @@ import { CommentsService } from '../../services/comments.service'templateUrl: 'comments-selection.component.html'})export class CommentsSelectionComponent implements OnDestroy {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)+ private readonly commentsService = inject(CommentsService)@ViewChild('CommentCreate', { static: true }) commentInput: ElementRef<HTMLInputElement>private subscriptions: Subscription[] = []protected file: Signal<FileModel> = computed(() => (this.store.filesSelection().length ? this.store.filesSelection()[0] : null))protected comments: CommentModel[] = []protected readonly icons = { faEdit }- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly store: StoreService,- private readonly layout: LayoutService,- private readonly commentsService: CommentsService- ) {+ constructor() {this.subscriptions.push(toObservable(this.file).subscribe((file: FileModel) => this.loadComments(file)))}diff --git a/frontend/src/app/applications/comments/components/widgets/comments-recents-widget.component.ts b/frontend/src/app/applications/comments/components/widgets/comments-recents-widget.component.tsindex 516fb908..7decf466 100644--- a/frontend/src/app/applications/comments/components/widgets/comments-recents-widget.component.ts+++ b/frontend/src/app/applications/comments/components/widgets/comments-recents-widget.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, computed, Signal } from '@angular/core'+import { Component, computed, Signal, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faCommentDots } from '@fortawesome/free-regular-svg-icons'@@ -25,18 +25,17 @@ import { CommentsService } from '../../services/comments.service'templateUrl: './comments-recents-widget.component.html'})export class CommentsRecentsWidgetComponent {+ private readonly router = inject(Router)+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)+ private readonly commentsService = inject(CommentsService)private nbInitialComments = 10private nbComments = this.nbInitialCommentsprotected moreElements = falseprotected comments: Signal<CommentRecentModel[]> = computed(() => this.store.commentsRecents().slice(0, this.nbComments))protected readonly icons = { faCommentDots, faMagnifyingGlassPlus, faMagnifyingGlassMinus, faTrashAlt }- constructor(- private readonly router: Router,- private readonly layout: LayoutService,- private readonly store: StoreService,- private readonly commentsService: CommentsService- ) {+ constructor() {this.load()}diff --git a/frontend/src/app/applications/comments/services/comments.service.ts b/frontend/src/app/applications/comments/services/comments.service.tsindex c43ef2ce..109ad72b 100644--- a/frontend/src/app/applications/comments/services/comments.service.ts+++ b/frontend/src/app/applications/comments/services/comments.service.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { API_COMMENTS_FROM_SPACE, API_COMMENTS_RECENTS } from '@sync-in-server/backend/src/applications/comments/constants/routes'import type { CreateOrUpdateCommentDto, DeleteCommentDto } from '@sync-in-server/backend/src/applications/comments/dto/comment.dto'import type { CommentRecent } from '@sync-in-server/backend/src/applications/comments/interfaces/comment-recent.interface'@@ -21,11 +21,9 @@ import { CommentModel } from '../models/comment.model'providedIn: 'root'})export class CommentsService {- constructor(- private readonly store: StoreService,- private readonly layout: LayoutService,- private readonly http: HttpClient- ) {}+ private readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)+ private readonly http = inject(HttpClient)getComments(file: FileModel): Observable<CommentModel[]> {return this.http.get<Comment[]>(`${API_COMMENTS_FROM_SPACE}/${file.path}`).pipe(map((cs) => cs.map((c) => new CommentModel(c))))diff --git a/frontend/src/app/applications/files/components/dialogs/files-compression-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-compression-dialog.component.tsindex ca261bd2..02ac8c25 100644--- a/frontend/src/app/applications/files/components/dialogs/files-compression-dialog.component.ts+++ b/frontend/src/app/applications/files/components/dialogs/files-compression-dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, EventEmitter, HostListener, Inject, Input, OnInit, Output } from '@angular/core'+import { ChangeDetectionStrategy, Component, EventEmitter, HostListener, Input, OnInit, Output, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faFileArchive } from '@fortawesome/free-solid-svg-icons'@@ -22,6 +22,9 @@ import { FilesService } from '../../services/files.service'changeDetection: ChangeDetectionStrategy.OnPush})export class FilesCompressionDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly filesService = inject(FilesService)@Input() archiveProps: CompressFileDto = { name: '', files: [], compressInDirectory: true, extension: tarExtension }@Output() submitEvent = new EventEmitter()public disableInDirCompression = false@@ -29,12 +32,6 @@ export class FilesCompressionDialogComponent implements OnInit {protected readonly icons = { faFileArchive }protected submitted = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly filesService: FilesService- ) {}-ngOnInit() {if (this.disableInDirCompression) {this.archiveProps.compressInDirectory = falsediff --git a/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.tsindex 2b300723..df44422b 100644--- a/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.ts+++ b/frontend/src/app/applications/files/components/dialogs/files-new-dialog.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, ElementRef, EventEmitter, HostListener, Inject, Input, OnInit, Output, ViewChild } from '@angular/core'+import { Component, ElementRef, EventEmitter, HostListener, Input, OnInit, Output, ViewChild, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faCaretDown, faFileAlt, faFolderClosed, faGlobe } from '@fortawesome/free-solid-svg-icons'@@ -25,6 +25,9 @@ import { FilesService } from '../../services/files.service'imports: [FaIconComponent, L10nTranslateDirective, BsDropdownModule, FormsModule, L10nTranslatePipe, AutofocusDirective, KeyValuePipe]})export class FilesNewDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected layout = inject(LayoutService)+ private filesService = inject(FilesService)@Input() files: FileModel[]@Input() inputType: 'file' | 'directory' | 'download'@Output() refreshFiles = new EventEmitter()@@ -38,12 +41,6 @@ export class FilesNewDialogComponent implements OnInit {protected submitted = falseprotected error: string- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected layout: LayoutService,- private filesService: FilesService- ) {}-ngOnInit() {if (this.inputType === 'download') {this.fileProp.title = 'Download from URL'diff --git a/frontend/src/app/applications/files/components/dialogs/files-trash-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-trash-dialog.component.tsindex 477a4d62..02330dc5 100644--- a/frontend/src/app/applications/files/components/dialogs/files-trash-dialog.component.ts+++ b/frontend/src/app/applications/files/components/dialogs/files-trash-dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, EventEmitter, HostListener, Inject, Input, Output } from '@angular/core'+import { ChangeDetectionStrategy, Component, EventEmitter, HostListener, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faSpinner, faTrashCan } from '@fortawesome/free-solid-svg-icons'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'@@ -18,17 +18,14 @@ import { FileModel } from '../../models/file.model'changeDetection: ChangeDetectionStrategy.OnPush})export class FilesTrashDialogComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected layout = inject(LayoutService)@Input() files: FileModel[] = []@Input() permanently = false@Output() removeFiles = new EventEmitter<void>()protected readonly icons = { faTrashCan, faSpinner }protected submitted = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected layout: LayoutService- ) {}-@HostListener('document:keyup.enter')onEnter() {this.onSubmit()diff --git a/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.tsindex cf2ff09d..9e098ef7 100644--- a/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.ts+++ b/frontend/src/app/applications/files/components/dialogs/files-trash-empty-dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, HostListener, Input } from '@angular/core'+import { Component, HostListener, Input, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faSpinner, faTrashCan } from '@fortawesome/free-solid-svg-icons'import { L10nTranslateDirective } from 'angular-l10n'@@ -18,15 +18,12 @@ import { FilesService } from '../../services/files.service'templateUrl: 'files-trash-empty-dialog.component.html'})export class FilesTrashEmptyDialogComponent {+ protected layout = inject(LayoutService)+ private filesService = inject(FilesService)@Input() files: FileModel[] = []protected readonly icons = { faTrashCan, faSpinner }protected submitted = false- constructor(- protected layout: LayoutService,- private filesService: FilesService- ) {}-@HostListener('document:keyup.enter')onEnter() {this.onSubmit()diff --git a/frontend/src/app/applications/files/components/dialogs/files-tree-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-tree-dialog.component.tsindex 0b4cf3f3..1e465544 100755--- a/frontend/src/app/applications/files/components/dialogs/files-tree-dialog.component.ts+++ b/frontend/src/app/applications/files/components/dialogs/files-tree-dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, EventEmitter, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faFile, faFolderClosed } from '@fortawesome/free-regular-svg-icons'import { FileTree } from '@sync-in-server/backend/src/applications/files/interfaces/file-tree.interface'@@ -29,6 +29,7 @@ export interface FileTreeEvent {templateUrl: 'files-tree-dialog.component.html'})export class FilesTreeDialogComponent {+ protected readonly layout = inject(LayoutService)@Input() currentRoots: SpaceRootProps[] = []@Output() submitEvent = new EventEmitter<FileTreeEvent>()@Input() allowSpaces = false@@ -39,8 +40,6 @@ export class FilesTreeDialogComponent {protected errorSelection = nullprotected selection: FileTree = null- constructor(protected readonly layout: LayoutService) {}-onSelect(file: FileTree) {if (file) {if (this.mustHaveShareOutsidePermission) {diff --git a/frontend/src/app/applications/files/components/dialogs/files-viewer-dialog.component.ts b/frontend/src/app/applications/files/components/dialogs/files-viewer-dialog.component.tsindex f3b44b51..cf9e530f 100644--- a/frontend/src/app/applications/files/components/dialogs/files-viewer-dialog.component.ts+++ b/frontend/src/app/applications/files/components/dialogs/files-viewer-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpErrorResponse } from '@angular/common/http'-import { Component, Input, OnDestroy, OnInit } from '@angular/core'+import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'import { Subscription } from 'rxjs'import { LayoutService } from '../../../../layout/layout.service'import { FileModel } from '../../models/file.model'@@ -21,6 +21,8 @@ import { FilesViewerTextComponent } from '../viewers/files-viewer-text.componenttemplateUrl: 'files-viewer-dialog.component.html'})export class FilesViewerDialogComponent implements OnInit, OnDestroy {+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)@Input() currentFile: FileModel@Input() mode: 'view' | 'edit' = 'view'private subscription: Subscription = null@@ -29,11 +31,6 @@ export class FilesViewerDialogComponent implements OnInit, OnDestroy {protected canAccess = falseprotected currentHeight: number- constructor(- private readonly http: HttpClient,- private readonly layout: LayoutService- ) {}-ngOnInit() {this.subscription = this.layout.resizeEvent.subscribe(() => this.onResize())this.http.head(this.currentFile.dataUrl).subscribe({diff --git a/frontend/src/app/applications/files/components/sidebar/files-clipboard.component.ts b/frontend/src/app/applications/files/components/sidebar/files-clipboard.component.tsindex 68fa373d..696c34b7 100644--- a/frontend/src/app/applications/files/components/sidebar/files-clipboard.component.ts+++ b/frontend/src/app/applications/files/components/sidebar/files-clipboard.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, Inject, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faArrowsAlt, faClone, faDownload, faQuestion, faTimes, faTrashCan } from '@fortawesome/free-solid-svg-icons'@@ -13,7 +13,7 @@ import { tarExtension } from '@sync-in-server/backend/src/applications/files/conimport { FILE_OPERATION } from '@sync-in-server/backend/src/applications/files/constants/operations'import type { CompressFileDto } from '@sync-in-server/backend/src/applications/files/dto/file-operations.dto'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipModule } from 'ngx-bootstrap/tooltip'import { Subscription } from 'rxjs'import { take } from 'rxjs/operators'@@ -31,6 +31,10 @@ import { FilesCompressionDialogComponent } from '../dialogs/files-compression-ditemplateUrl: 'files-clipboard.component.html'})export class FilesClipboardComponent implements OnDestroy {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)+ private readonly filesService = inject(FilesService)private subscriptions: Subscription[] = []protected readonly icons = { faTrashCan, faTimes, faDownload, faArrowsAlt, faClone, faQuestion }protected readonly originalOrderKeyValue = originalOrderKeyValue@@ -43,12 +47,7 @@ export class FilesClipboardComponent implements OnDestroy {protected selectedAction: 'copyPaste' | 'cutPaste' | 'download' | 'compress' = this.filesService.clipboardActionprotected files: FileModel[] = []- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly layout: LayoutService,- private readonly store: StoreService,- private readonly filesService: FilesService- ) {+ constructor() {this.subscriptions.push(this.store.filesClipboard.subscribe((files: FileModel[]) => (this.files = files)))}diff --git a/frontend/src/app/applications/files/components/sidebar/files-selection.component.ts b/frontend/src/app/applications/files/components/sidebar/files-selection.component.tsindex dd8aea9b..397d9375 100755--- a/frontend/src/app/applications/files/components/sidebar/files-selection.component.ts+++ b/frontend/src/app/applications/files/components/sidebar/files-selection.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, computed, Inject, input, InputSignal, Signal } from '@angular/core'+import { ChangeDetectionStrategy, Component, computed, input, InputSignal, Signal, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faArrowsAlt, faClipboardCheck } from '@fortawesome/free-solid-svg-icons'@@ -40,6 +40,10 @@ import { FilesViewerMediaComponent } from '../viewers/files-viewer-media.componestyles: ['.card {width: 100%; background: transparent; border: none}']})export class FilesSelectionComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly layout = inject(LayoutService)+ private readonly filesService = inject(FilesService)files: InputSignal<FileModel[]> = input.required<FileModel[]>()protected multiple: Signal<boolean> = computed(() => this.files().length > 1)protected resizeOffset: Signal<number> = computed(() => (this.multiple() ? 120 : 80))@@ -53,13 +57,6 @@ export class FilesSelectionComponent {faArrowsAlt}- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly layout: LayoutService,- private readonly filesService: FilesService- ) {}-goToShare(share: { type: number; name: string }) {this.layout.toggleRSideBar(false)this.routerdiff --git a/frontend/src/app/applications/files/components/sidebar/files-tasks.component.ts b/frontend/src/app/applications/files/components/sidebar/files-tasks.component.tsindex e8ef5fc3..1a698d61 100644--- a/frontend/src/app/applications/files/components/sidebar/files-tasks.component.ts+++ b/frontend/src/app/applications/files/components/sidebar/files-tasks.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { IconDefinition } from '@fortawesome/fontawesome-svg-core'@@ -40,6 +40,11 @@ import { FilesService } from '../../services/files.service'templateUrl: 'files-tasks.component.html'})export class FilesTasksComponent implements OnDestroy {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly store = inject(StoreService)+ private readonly filesService = inject(FilesService)+ private readonly filesTasksService = inject(FilesTasksService)protected readonly icons = { faTrashAlt, faFlag, faClock, faFile, faFolderClosed }protected readonly iconsStatus: IconDefinition[] = [faSpinner, faCheck, faExclamation]protected readonly iconsOperation = {@@ -57,13 +62,7 @@ export class FilesTasksComponent implements OnDestroy {protected tasks: FileTask[] = []private subscriptions: Subscription[] = []- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly store: StoreService,- private readonly filesService: FilesService,- private readonly filesTasksService: FilesTasksService- ) {+ constructor() {this.subscriptions.push(this.store.filesActiveTasks.subscribe((tasks: FileTask[]) => this.updateTasks(tasks, true)))this.subscriptions.push(this.store.filesEndedTasks.subscribe((tasks: FileTask[]) => this.updateTasks(tasks, false)))}diff --git a/frontend/src/app/applications/files/components/sidebar/files-tree.component.ts b/frontend/src/app/applications/files/components/sidebar/files-tree.component.tsindex d4b3ec50..fdde68ea 100644--- a/frontend/src/app/applications/files/components/sidebar/files-tree.component.ts+++ b/frontend/src/app/applications/files/components/sidebar/files-tree.component.ts@@ -5,7 +5,7 @@*/import { IActionMapping, ITreeOptions, TREE_ACTIONS, TreeModel, TreeModule, TreeNode } from '@ali-hm/angular-tree-component'-import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'+import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild, inject } from '@angular/core'import { toObservable } from '@angular/core/rxjs-interop'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -32,6 +32,11 @@ import { FilesService } from '../../services/files.service'templateUrl: 'files-tree.component.html'})export class FilesTreeComponent implements OnInit, OnDestroy {+ private readonly layout = inject(LayoutService)+ private readonly router = inject(Router)+ private readonly user = inject(UserService)+ private readonly filesService = inject(FilesService)+ protected readonly store = inject(StoreService)@ViewChild('tree', { static: true }) tree: any@Output() selected = new EventEmitter()@Input() showFiles = false@@ -80,13 +85,7 @@ export class FilesTreeComponent implements OnInit, OnDestroy {private preventDblClick = falseprivate preventTimer: any- constructor(- private readonly layout: LayoutService,- private readonly router: Router,- private readonly user: UserService,- private readonly filesService: FilesService,- protected readonly store: StoreService- ) {+ constructor() {if (this.enableCopyMove) {this.subscriptions.push(toObservable(this.store.filesSelection).subscribe(() => this.checkAllowed(this.selection)))}diff --git a/frontend/src/app/applications/files/components/utils/file-permissions.component.ts b/frontend/src/app/applications/files/components/utils/file-permissions.component.tsindex 7715ff3b..c994d7df 100644--- a/frontend/src/app/applications/files/components/utils/file-permissions.component.ts+++ b/frontend/src/app/applications/files/components/utils/file-permissions.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, Inject, Input, OnChanges } from '@angular/core'+import { Component, Input, OnChanges, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { AvailableBSPositions } from 'ngx-bootstrap/positioning'@@ -32,14 +32,13 @@ import { SPACES_PERMISSIONS_TEXT } from '../../../spaces/spaces.constants'`})export class FilePermissionsComponent implements OnChanges {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)@Input({ required: true }) permissions: Partial<typeof SPACES_PERMISSIONS_TEXT> = {}@Input() tooltipPlacement: AvailableBSPositions = 'top'@Input() replaceEmptyPermissions = falseprotected hasPermissions = falseprotected readonly originalOrderKeyValue = originalOrderKeyValue- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}-ngOnChanges() {this.hasPermissions = !!Object.keys(this.permissions).length}diff --git a/frontend/src/app/applications/files/components/viewers/files-viewer-document.component.ts b/frontend/src/app/applications/files/components/viewers/files-viewer-document.component.tsindex 90550e13..4c2d9c33 100644--- a/frontend/src/app/applications/files/components/viewers/files-viewer-document.component.ts+++ b/frontend/src/app/applications/files/components/viewers/files-viewer-document.component.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpParams } from '@angular/common/http'-import { Component, Input, OnInit } from '@angular/core'+import { Component, Input, OnInit, inject } from '@angular/core'import { API_FILES_ONLY_OFFICE_SETTINGS } from '@sync-in-server/backend/src/applications/files/constants/routes'import { OnlyOfficeReqConfig } from '@sync-in-server/backend/src/applications/files/interfaces/only-office-config.interface'import { LayoutService } from '../../../../layout/layout.service'@@ -29,17 +29,14 @@ import { OnlyOfficeComponent } from '../utils/only-office.component'`})export class FilesViewerDocumentComponent implements OnInit {+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)@Input() file: FileModel@Input() currentHeight: number@Input() mode: 'view' | 'edit'protected docId: stringprotected documentConfig: OnlyOfficeReqConfig = null- constructor(- private readonly http: HttpClient,- private readonly layout: LayoutService- ) {}-ngOnInit() {this.docId = `viewer-doc-${this.file.id}`this.httpdiff --git a/frontend/src/app/applications/files/components/viewers/files-viewer-html.component.ts b/frontend/src/app/applications/files/components/viewers/files-viewer-html.component.tsindex a975e2ee..50cf937c 100755--- a/frontend/src/app/applications/files/components/viewers/files-viewer-html.component.ts+++ b/frontend/src/app/applications/files/components/viewers/files-viewer-html.component.ts@@ -5,7 +5,7 @@*/import { HttpClient } from '@angular/common/http'-import { Component, Input, OnInit } from '@angular/core'+import { Component, Input, OnInit, inject } from '@angular/core'import { DomSanitizer } from '@angular/platform-browser'import { LayoutService } from '../../../../layout/layout.service'@@ -16,16 +16,13 @@ import { LayoutService } from '../../../../layout/layout.service'}`})export class FilesViewerHtmlComponent implements OnInit {+ private readonly http = inject(HttpClient)+ private readonly sanitizer = inject(DomSanitizer)+ private readonly layout = inject(LayoutService)@Input() currentHeight: number@Input() fileUrl: stringprotected content: any = null- constructor(- private readonly http: HttpClient,- private readonly sanitizer: DomSanitizer,- private readonly layout: LayoutService- ) {}-ngOnInit() {this.http.get(this.fileUrl, { responseType: 'text' }).subscribe({next: (data: string) => (this.content = this.sanitizer.bypassSecurityTrustResourceUrl(`data:text/html,${data}`)),diff --git a/frontend/src/app/applications/files/components/viewers/files-viewer-pdf.component.ts b/frontend/src/app/applications/files/components/viewers/files-viewer-pdf.component.tsindex 222f189e..96d3f94c 100644--- a/frontend/src/app/applications/files/components/viewers/files-viewer-pdf.component.ts+++ b/frontend/src/app/applications/files/components/viewers/files-viewer-pdf.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'+import { ChangeDetectionStrategy, Component, Input, OnInit, inject } from '@angular/core'import { DomSanitizer } from '@angular/platform-browser'import { assetsUrl } from '../../files.constants'@@ -14,13 +14,12 @@ import { assetsUrl } from '../../files.constants'template: ` <iframe [src]="url" class="app-viewer-iframe" [style.height.px]="currentHeight"></iframe> `})export class FilesViewerPdfComponent implements OnInit {+ private readonly sanitizer = inject(DomSanitizer)@Input() fileUrl: string@Input() currentHeight: numberprotected url: anyprivate readonly pdfjsUrl = `${assetsUrl}/pdfjs/web/viewer.html?file=`- constructor(private readonly sanitizer: DomSanitizer) {}-ngOnInit() {this.url = this.sanitizer.bypassSecurityTrustResourceUrl(`${this.pdfjsUrl}${encodeURIComponent(this.fileUrl)}`)}diff --git a/frontend/src/app/applications/files/components/viewers/files-viewer-text.component.ts b/frontend/src/app/applications/files/components/viewers/files-viewer-text.component.tsindex 1f43174f..b3271854 100644--- a/frontend/src/app/applications/files/components/viewers/files-viewer-text.component.ts+++ b/frontend/src/app/applications/files/components/viewers/files-viewer-text.component.ts@@ -5,7 +5,7 @@*/import { HttpClient } from '@angular/common/http'-import { AfterViewInit, Component, Input, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'+import { AfterViewInit, Component, Input, OnInit, ViewChild, ViewEncapsulation, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { CodeMirrorComponent } from '../../../../common/components/code-mirror.component'import { themeDark } from '../../../../layout/layout.interfaces'@@ -30,6 +30,8 @@ import { FileModel } from '../../models/file.model'</div>`})export class FilesViewerTextComponent implements OnInit, AfterViewInit {+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)@ViewChild('CodeMirror', { static: true }) ref: any@Input() currentHeight: number@Input() file: FileModel@@ -45,11 +47,6 @@ export class FilesViewerTextComponent implements OnInit, AfterViewInit {private readonly modeUrl = `${assetsUrl}/codemirror/mode/%N/%N.js`private mode: string = null- constructor(- private readonly http: HttpClient,- private readonly layout: LayoutService- ) {}-ngOnInit() {this.ref.codeMirror.modeURL = this.modeUrlconst detectedMode = this.ref.codeMirror.findModeByFileName(this.file.name)diff --git a/frontend/src/app/applications/files/components/widgets/files-recents-widget.component.ts b/frontend/src/app/applications/files/components/widgets/files-recents-widget.component.tsindex f43d3020..efdb3c54 100644--- a/frontend/src/app/applications/files/components/widgets/files-recents-widget.component.ts+++ b/frontend/src/app/applications/files/components/widgets/files-recents-widget.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, computed, Signal } from '@angular/core'+import { Component, computed, Signal, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faFileLines } from '@fortawesome/free-regular-svg-icons'@@ -22,17 +22,16 @@ import { FilesService } from '../../services/files.service'templateUrl: './files-recents-widget.component.html'})export class FilesRecentsWidgetComponent {+ private readonly router = inject(Router)+ private readonly store = inject(StoreService)+ private readonly filesService = inject(FilesService)private nbInitialFiles = 10private nbFiles = this.nbInitialFilesprotected moreElements = falseprotected files: Signal<FileRecentModel[]> = computed(() => this.store.filesRecents().slice(0, this.nbFiles))protected readonly icons = { faFileLines, faMagnifyingGlassPlus, faMagnifyingGlassMinus, faTrashAlt }- constructor(- private readonly router: Router,- private readonly store: StoreService,- private readonly filesService: FilesService- ) {+ constructor() {this.load()}diff --git a/frontend/src/app/applications/files/services/files-tasks.service.ts b/frontend/src/app/applications/files/services/files-tasks.service.tsindex e6def8e3..55759186 100644--- a/frontend/src/app/applications/files/services/files-tasks.service.ts+++ b/frontend/src/app/applications/files/services/files-tasks.service.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpErrorResponse } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { FILE_OPERATION } from '@sync-in-server/backend/src/applications/files/constants/operations'import { API_FILES_TASKS } from '@sync-in-server/backend/src/applications/files/constants/routes'import { FileTask, FileTaskStatus } from '@sync-in-server/backend/src/applications/files/models/file-task'@@ -22,6 +22,9 @@ import { FileEvent } from '../interfaces/file-event.interface'@Injectable({ providedIn: 'root' })export class FilesTasksService {+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)private readonly onDone = {[FILE_OPERATION.DELETE]: { title: 'Deletion', fileEvent: { delete: true } as Partial<FileEvent> },[FILE_OPERATION.MOVE]: { title: 'Move', fileEvent: { delete: true, reloadFocusOnDst: true } as Partial<FileEvent> },@@ -34,11 +37,7 @@ export class FilesTasksService {private watcher: Subscription = nullprivate watch = timer(1000, 1000).pipe(tap(() => this.doWatch()))- constructor(- private readonly http: HttpClient,- private readonly layout: LayoutService,- private readonly store: StoreService- ) {+ constructor() {this.loadAll()}diff --git a/frontend/src/app/applications/files/services/files-upload.service.ts b/frontend/src/app/applications/files/services/files-upload.service.tsindex a9b9efec..b1cf93ee 100644--- a/frontend/src/app/applications/files/services/files-upload.service.ts+++ b/frontend/src/app/applications/files/services/files-upload.service.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpEventType, HttpUploadProgressEvent } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { API_FILES_OPERATION_UPLOAD } from '@sync-in-server/backend/src/applications/files/constants/routes'import { FileTask, FileTaskStatus } from '@sync-in-server/backend/src/applications/files/models/file-task'import { lastValueFrom, Observable } from 'rxjs'@@ -17,14 +17,11 @@ import { FilesService } from './files.service'@Injectable({ providedIn: 'root' })export class FilesUploadService {+ private readonly http = inject(HttpClient)+ private readonly filesService = inject(FilesService)+ private readonly filesTasksService = inject(FilesTasksService)public supportUploadDirectory = supportUploadDirectory()- constructor(- private readonly http: HttpClient,- private readonly filesService: FilesService,- private readonly filesTasksService: FilesTasksService- ) {}-async addFiles(files: FileUpload[]) {const apiRoute = `${API_FILES_OPERATION_UPLOAD}/${this.filesService.currentRoute}`const taskReqs: [FileTask, Observable<any>][] = []diff --git a/frontend/src/app/applications/files/services/files.service.ts b/frontend/src/app/applications/files/services/files.service.tsindex a41af615..f054ff98 100644--- a/frontend/src/app/applications/files/services/files.service.ts+++ b/frontend/src/app/applications/files/services/files.service.ts@@ -6,7 +6,7 @@import type { TreeNode } from '@ali-hm/angular-tree-component'import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { DomSanitizer } from '@angular/platform-browser'import { FILE_OPERATION } from '@sync-in-server/backend/src/applications/files/constants/operations'import {@@ -43,6 +43,11 @@ import { FilesTasksService } from './files-tasks.service'@Injectable({ providedIn: 'root' })export class FilesService {+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)+ private readonly sanitizer = inject(DomSanitizer)+ private readonly filesTasksService = inject(FilesTasksService)// Tree sectionpublic treeNodeSelected: TreeNode = nullpublic treeCopyMoveOn = new Subject<void>()@@ -51,14 +56,6 @@ export class FilesService {// Filespublic currentRoute: string- constructor(- private readonly http: HttpClient,- private readonly layout: LayoutService,- private readonly store: StoreService,- private readonly sanitizer: DomSanitizer,- private readonly filesTasksService: FilesTasksService- ) {}-getTreeNode(nodePath: string, showFiles = false): Promise<FileTree[]> {return firstValueFrom(this.http.get<FileTree[]>(`${API_SPACES_TREE}/${nodePath}`, { params: showFiles ? new HttpParams().set('showFiles', showFiles) : null })diff --git a/frontend/src/app/applications/links/components/dialogs/link-dialog.component.ts b/frontend/src/app/applications/links/components/dialogs/link-dialog.component.tsindex 15e1052d..3acc1152 100644--- a/frontend/src/app/applications/links/components/dialogs/link-dialog.component.ts+++ b/frontend/src/app/applications/links/components/dialogs/link-dialog.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faClipboard, faClipboardCheck, faEye, faEyeSlash, faLock, faLockOpen } from '@fortawesome/free-solid-svg-icons'@@ -60,6 +60,12 @@ import { LinksService } from '../../services/links.service'templateUrl: 'link-dialog.component.html'})export class LinkDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)+ private readonly sharesService = inject(SharesService)+ private readonly linksService = inject(LinksService)+ private readonly spacesService = inject(SpacesService)// from links component or children dialog component@Input() share: ShareLinkModel | (Partial<ShareModel> & { link: LinkGuest })@Input() parentSpaceId: number = null@@ -99,14 +105,7 @@ export class LinkDialogComponent implements OnInit {isActive: FormControl<boolean>}>- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- public readonly layout: LayoutService,- private readonly userService: UserService,- private readonly sharesService: SharesService,- private readonly linksService: LinksService,- private readonly spacesService: SpacesService- ) {+ constructor() {// set picker expiration to current date + 1 daythis.minDate.setDate(this.minDate.getDate() + 1)}diff --git a/frontend/src/app/applications/links/components/links.component.ts b/frontend/src/app/applications/links/components/links.component.tsindex 54514a85..1d64e4c1 100644--- a/frontend/src/app/applications/links/components/links.component.ts+++ b/frontend/src/app/applications/links/components/links.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core'+import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'import { ActivatedRoute } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -25,7 +25,7 @@ import {} from '@fortawesome/free-solid-svg-icons'import { ContextMenuComponent, ContextMenuModule } from '@perfectmemory/ngx-contextmenu'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipModule } from 'ngx-bootstrap/tooltip'import { take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -66,6 +66,12 @@ import { LinkDialogComponent } from './dialogs/link-dialog.component'templateUrl: 'links.component.html'})export class LinksComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly store = inject(StoreService)+ protected readonly layout = inject(LayoutService)+ private readonly linksService = inject(LinksService)+ private readonly sharesService = inject(SharesService)@ViewChild(VirtualScrollComponent) scrollView: {element: ElementRefviewPortItems: ShareLinkModel[]@@ -152,14 +158,7 @@ export class LinksComponent implements OnInit {protected sortTable = new SortTable(this.constructor.name, this.sortSettings)protected btnSortFields = { name: 'Name', link: 'Link', accessed: 'Accessed' }- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly activatedRoute: ActivatedRoute,- private readonly store: StoreService,- protected readonly layout: LayoutService,- private readonly linksService: LinksService,- private readonly sharesService: SharesService- ) {+ constructor() {this.loadShareLinks()this.activatedRoute.queryParams.subscribe((params) => (this.focusOnSelect = params.select))this.layout.setBreadcrumbIcon(this.icons.faLink)@@ -255,6 +254,6 @@ export class LinksComponent implements OnInit {goTo(share?: ShareLinkModel) {share = share || this.selected- this.sharesService.goTo(share)+ this.sharesService.goTo(share).catch(console.error)}}diff --git a/frontend/src/app/applications/links/components/public/public-link-auth.component.ts b/frontend/src/app/applications/links/components/public/public-link-auth.component.tsindex c39890e9..224aeb54 100644--- a/frontend/src/app/applications/links/components/public/public-link-auth.component.ts+++ b/frontend/src/app/applications/links/components/public/public-link-auth.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject } from '@angular/core'+import { Component, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { ActivatedRoute, Params, RouterLink } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -19,17 +19,16 @@ import { LinksService } from '../../services/links.service'templateUrl: 'public-link-auth.component.html'})export class PublicLinkAuthComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly linksService = inject(LinksService)protected readonly logoUrl = logoUrlprotected readonly linkProtected = linkProtectedprotected readonly icons = { faKey, faSignInAlt }private uuid: stringprotected password = ''- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly activatedRoute: ActivatedRoute,- private readonly linksService: LinksService- ) {+ constructor() {this.activatedRoute.params.subscribe((p: Params) => (this.uuid = p.uuid))}diff --git a/frontend/src/app/applications/links/components/public/public-link-error.component.ts b/frontend/src/app/applications/links/components/public/public-link-error.component.tsindex fdaef828..5e7be332 100644--- a/frontend/src/app/applications/links/components/public/public-link-error.component.ts+++ b/frontend/src/app/applications/links/components/public/public-link-error.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component } from '@angular/core'+import { Component, inject } from '@angular/core'import { ActivatedRoute, Params, RouterLink } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'@@ -18,11 +18,12 @@ import { LINK_ERROR_TRANSLATION } from '../../links.constants'templateUrl: 'public-link-error.component.html'})export class PublicLinkErrorComponent {+ private readonly activatedRoute = inject(ActivatedRoute)protected readonly logoUrl = logoUrlprotected readonly icons = { faExclamationCircle }protected error: string- constructor(private readonly activatedRoute: ActivatedRoute) {+ constructor() {this.activatedRoute.params.subscribe((params: Params) => (this.error = LINK_ERROR_TRANSLATION[params.error]))}}diff --git a/frontend/src/app/applications/links/components/public/public-link.component.ts b/frontend/src/app/applications/links/components/public/public-link.component.tsindex 74ff64b2..e64485a9 100644--- a/frontend/src/app/applications/links/components/public/public-link.component.ts+++ b/frontend/src/app/applications/links/components/public/public-link.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject } from '@angular/core'+import { Component, inject } from '@angular/core'import { ActivatedRoute, Data, Params, RouterLink } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { SpaceLink } from '@sync-in-server/backend/src/applications/links/interfaces/link-space.interface'@@ -19,17 +19,16 @@ import { LinksService } from '../../services/links.service'templateUrl: 'public-link.component.html'})export class PublicLinkComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly linksService = inject(LinksService)protected readonly icons = { SPACES: SPACES_ICON.SPACES }protected readonly logoUrl = logoUrlprivate linkUUID: stringprotected mimeUrl: string = nullprotected link: SpaceLink- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly activatedRoute: ActivatedRoute,- private readonly linksService: LinksService- ) {+ constructor() {this.activatedRoute.params.subscribe((params: Params) => (this.linkUUID = params.uuid))this.activatedRoute.data.subscribe((data: Data) => this.setLink(data.link))}diff --git a/frontend/src/app/applications/links/components/sidebar/link-selection.component.ts b/frontend/src/app/applications/links/components/sidebar/link-selection.component.tsindex b9e87d68..fecd3357 100644--- a/frontend/src/app/applications/links/components/sidebar/link-selection.component.ts+++ b/frontend/src/app/applications/links/components/sidebar/link-selection.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, Inject, input, InputSignal } from '@angular/core'+import { ChangeDetectionStrategy, Component, input, InputSignal, inject } from '@angular/core'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { AutoResizeDirective } from '../../../../common/directives/auto-resize.directive'import { TimeDateFormatPipe } from '../../../../common/pipes/time-date-format.pipe'@@ -21,11 +21,10 @@ import { ShareLinkModel } from '../../models/share-link.model'styles: ['.card {width: 100%; background: transparent; border: none}']})export class LinkSelectionComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)link: InputSignal<ShareLinkModel> = input.required<ShareLinkModel>()protected readonly cardImageSize = defaultCardImageSizeprotected readonly resizeOffset = defaultResizeOffsetprotected accessHover = falseprotected lastAccessHover = false-- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}}diff --git a/frontend/src/app/applications/links/services/links.service.ts b/frontend/src/app/applications/links/services/links.service.tsindex 5849fcd6..eff0dee1 100644--- a/frontend/src/app/applications/links/services/links.service.ts+++ b/frontend/src/app/applications/links/services/links.service.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpErrorResponse } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { Router } from '@angular/router'import { LINK_ERROR, LINK_TYPE } from '@sync-in-server/backend/src/applications/links/constants/links'import {@@ -26,7 +26,7 @@ import { SPACE_OPERATION, SPACE_ROLE } from '@sync-in-server/backend/src/applicaimport { MEMBER_TYPE } from '@sync-in-server/backend/src/applications/users/constants/member'import type { UserPasswordDto } from '@sync-in-server/backend/src/applications/users/dto/user-password.dto'import type { LoginResponseDto } from '@sync-in-server/backend/src/authentication/dto/login-response.dto'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { ClipboardService } from 'ngx-clipboard'import { catchError, map, Observable, of } from 'rxjs'import { take } from 'rxjs/operators'@@ -45,13 +45,11 @@ import { ShareLinkModel } from '../models/share-link.model'providedIn: 'root'})export class LinksService {- constructor(- private readonly router: Router,- private readonly http: HttpClient,- private readonly layout: LayoutService,- private readonly authService: AuthService,- private readonly clipboard: ClipboardService- ) {}+ private readonly router = inject(Router)+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)+ private readonly authService = inject(AuthService)+ private readonly clipboard = inject(ClipboardService)shareLinksList(): Observable<ShareLinkModel[]> {return this.http.get<ShareLinkModel[]>(API_SHARES_LINKS_LIST).pipe(map((sls: Partial<ShareLinkModel>[]) => sls.map((s) => new ShareLinkModel(s))))diff --git a/frontend/src/app/applications/notifications/components/sidebar/notifications.component.ts b/frontend/src/app/applications/notifications/components/sidebar/notifications.component.tsindex 65b82626..907a1d10 100644--- a/frontend/src/app/applications/notifications/components/sidebar/notifications.component.ts+++ b/frontend/src/app/applications/notifications/components/sidebar/notifications.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { AfterViewInit, Component, effect, ElementRef, QueryList, ViewChildren } from '@angular/core'+import { AfterViewInit, Component, effect, ElementRef, QueryList, ViewChildren, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faCheck, faCircleInfo, faMagnifyingGlass, faTimes, faTrashAlt } from '@fortawesome/free-solid-svg-icons'@@ -26,16 +26,15 @@ import { NotificationsService } from '../../notifications.service'templateUrl: 'notifications.component.html'})export class NotificationsComponent implements AfterViewInit {+ private readonly router = inject(Router)+ protected readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)+ private readonly notificationsService = inject(NotificationsService)@ViewChildren('notificationsHtml') notificationsHtml!: QueryList<ElementRef>private observer!: IntersectionObserverprotected readonly icons = { faCheck, faTimes, faMagnifyingGlass, faTrashAlt, faCircleInfo }- constructor(- private readonly router: Router,- protected readonly store: StoreService,- private readonly layout: LayoutService,- private readonly notificationsService: NotificationsService- ) {+ constructor() {// Re-observe the elements if notifications array has changeseffect(() => {this.store.unreadNotifications()diff --git a/frontend/src/app/applications/notifications/notifications.service.ts b/frontend/src/app/applications/notifications/notifications.service.tsindex d33524f5..1e49654f 100644--- a/frontend/src/app/applications/notifications/notifications.service.ts+++ b/frontend/src/app/applications/notifications/notifications.service.ts@@ -5,7 +5,7 @@*/import { HttpClient } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { API_NOTIFICATIONS, NOTIFICATIONS_ROUTE } from '@sync-in-server/backend/src/applications/notifications/constants/routes'import type { NotificationFromUser } from '@sync-in-server/backend/src/applications/notifications/interfaces/notification-properties.interface'import { ActiveToast } from 'ngx-toastr'@@ -20,11 +20,9 @@ import { NotificationModel } from './models/notification.model'providedIn: 'root'})export class NotificationsService {- constructor(- private readonly http: HttpClient,- private readonly store: StoreService,- private readonly layout: LayoutService- ) {}+ private readonly http = inject(HttpClient)+ private readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)getNotifications(unread: boolean = false): Observable<NotificationModel[]> {return this.httpdiff --git a/frontend/src/app/applications/recents/components/recents.component.ts b/frontend/src/app/applications/recents/components/recents.component.tsindex 71462209..3ec699b1 100644--- a/frontend/src/app/applications/recents/components/recents.component.ts+++ b/frontend/src/app/applications/recents/components/recents.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component } from '@angular/core'+import { Component, inject } from '@angular/core'import { AutoResizeDirective } from '../../../common/directives/auto-resize.directive'import { LayoutService } from '../../../layout/layout.service'import { CommentsRecentsWidgetComponent } from '../../comments/components/widgets/comments-recents-widget.component'@@ -17,7 +17,9 @@ import { RECENTS_ICON, RECENTS_PATH, RECENTS_TITLE } from '../recents.constants'templateUrl: './recents.component.html'})export class RecentsComponent {- constructor(private readonly layout: LayoutService) {+ private readonly layout = inject(LayoutService)++ constructor() {this.layout.setBreadcrumbIcon(RECENTS_ICON)this.layout.setBreadcrumbNav({ url: `/${RECENTS_PATH.BASE}/${RECENTS_TITLE}`, translating: true, sameLink: true })}diff --git a/frontend/src/app/applications/recents/components/widgets/recents-apps-widget.component.ts b/frontend/src/app/applications/recents/components/widgets/recents-apps-widget.component.tsindex df9127ce..1203a0fd 100644--- a/frontend/src/app/applications/recents/components/widgets/recents-apps-widget.component.ts+++ b/frontend/src/app/applications/recents/components/widgets/recents-apps-widget.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component } from '@angular/core'+import { Component, inject } from '@angular/core'import { RouterLink } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { USER_PERMISSION } from '@sync-in-server/backend/src/applications/users/constants/user'@@ -18,10 +18,9 @@ import { UserService } from '../../../users/user.service'templateUrl: './recents-apps-widget.component.html'})export class RecentsAppsWidgetComponent {+ protected readonly userService = inject(UserService)protected readonly USER_PERMISSION = USER_PERMISSIONprotected readonly SPACES_ICON = SPACES_ICONprotected readonly SPACES_PATH = SPACES_PATHprotected readonly SPACES_TITLE = SPACES_TITLE-- constructor(protected readonly userService: UserService) {}}diff --git a/frontend/src/app/applications/search/components/search.component.ts b/frontend/src/app/applications/search/components/search.component.tsindex 3ad2fc2a..72128901 100644--- a/frontend/src/app/applications/search/components/search.component.ts+++ b/frontend/src/app/applications/search/components/search.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, computed, Inject, Signal, ViewChild } from '@angular/core'+import { Component, computed, Signal, ViewChild, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -42,6 +42,12 @@ import { SEARCH_ICON, SEARCH_PATH } from '../search.constants'templateUrl: './search.component.html'})export class SearchComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly layout = inject(LayoutService)+ protected readonly store = inject(StoreService)+ private readonly filesService = inject(FilesService)+@ViewChild(FilterComponent, { static: true }) inputFilter: FilterComponentprotected readonly icons = { SEARCH_ICON, faSpinner, faTrashCan, faTimes, faFont }protected minCharsToSearch = minCharsToSearch@@ -50,13 +56,7 @@ export class SearchComponent {protected selectedId: number = nullpublic searchContent: Signal<string> = computed(() => this.store.currentSearch().content)- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly layout: LayoutService,- protected readonly store: StoreService,- private readonly filesService: FilesService- ) {+ constructor() {this.layout.setBreadcrumbIcon(SEARCH_ICON)this.layout.setBreadcrumbNav({ url: `/${SEARCH_PATH.BASE}`, translating: false, sameLink: true })}diff --git a/frontend/src/app/applications/shares/components/dialogs/share-dialog.component.ts b/frontend/src/app/applications/shares/components/dialogs/share-dialog.component.tsindex d378bcbe..fab6c042 100644--- a/frontend/src/app/applications/shares/components/dialogs/share-dialog.component.ts+++ b/frontend/src/app/applications/shares/components/dialogs/share-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormsModule, ReactiveFormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faCog, faPlus, faSpinner, faUsers, faUserShield } from '@fortawesome/free-solid-svg-icons'@@ -14,7 +14,7 @@ import { LINK_TYPE } from '@sync-in-server/backend/src/applications/links/constaimport { SPACE_ALIAS, SPACE_OPERATION } from '@sync-in-server/backend/src/applications/spaces/constants/spaces'import type { SearchMembersDto } from '@sync-in-server/backend/src/applications/users/dto/search-members.dto'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TabsModule } from 'ngx-bootstrap/tabs'import { Observable } from 'rxjs'import { take } from 'rxjs/operators'@@ -56,6 +56,12 @@ import { ShareRepositoryComponent } from '../utils/share-repository.component'templateUrl: 'share-dialog.component.html'})export class ShareDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)+ private readonly sharesService = inject(SharesService)+ private readonly linksService = inject(LinksService)+ private readonly spacesService = inject(SpacesService)@Input() share: ShareModel@Input() file: FileSpace & Pick<FileModel, 'root'>@Input() parentShareId: number = null@@ -81,15 +87,6 @@ export class ShareDialogComponent implements OnInit {protected loading = falseprotected submitted = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly userService: UserService,- private readonly sharesService: SharesService,- private readonly linksService: LinksService,- private readonly spacesService: SpacesService- ) {}-ngOnInit() {if (!this.share) {// new sharediff --git a/frontend/src/app/applications/shares/components/dialogs/shared-children-dialog.component.ts b/frontend/src/app/applications/shares/components/dialogs/shared-children-dialog.component.tsindex 0aa41c8d..ce58bff5 100644--- a/frontend/src/app/applications/shares/components/dialogs/shared-children-dialog.component.ts+++ b/frontend/src/app/applications/shares/components/dialogs/shared-children-dialog.component.ts@@ -6,11 +6,11 @@import { NgTemplateOutlet } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import type { ShareChild } from '@sync-in-server/backend/src/applications/shares/models/share-child.model'import { L10nTranslateDirective } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { Observable } from 'rxjs'import { take } from 'rxjs/operators'import { AutoResizeDirective } from '../../../../common/directives/auto-resize.directive'@@ -35,6 +35,10 @@ import { ShareDialogComponent } from './share-dialog.component'styleUrls: ['shared-children-dialog.component.scss']})export class SharedChildrenDialogComponent implements OnInit {+ protected readonly layout = inject(LayoutService)+ private readonly sharesService = inject(SharesService)+ private readonly linksService = inject(LinksService)+ private readonly spacesService = inject(SpacesService)@Input() fromAdmin = false@Input() share: ShareFileModel@Input() space: SpaceModel@@ -45,13 +49,6 @@ export class SharedChildrenDialogComponent implements OnInit {protected childShares: ShareChildModel[]protected selected: ShareChildModel- constructor(- protected readonly layout: LayoutService,- private readonly sharesService: SharesService,- private readonly linksService: LinksService,- private readonly spacesService: SpacesService- ) {}-ngOnInit() {this.loadChildShares()}diff --git a/frontend/src/app/applications/shares/components/shared.component.ts b/frontend/src/app/applications/shares/components/shared.component.tsindex 506f96d3..f698d23c 100644--- a/frontend/src/app/applications/shares/components/shared.component.ts+++ b/frontend/src/app/applications/shares/components/shared.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core'+import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core'import { ActivatedRoute } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -26,7 +26,7 @@ import { ContextMenuComponent, ContextMenuModule } from '@perfectmemory/ngx-contimport type { ShareFile } from '@sync-in-server/backend/src/applications/shares/interfaces/share-file.interface'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { BsDropdownModule } from 'ngx-bootstrap/dropdown'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipModule } from 'ngx-bootstrap/tooltip'import { take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -77,6 +77,8 @@ export class SharedComponent implements OnInit {@ViewChild(NavigationViewComponent, { static: true }) btnNavigationView: NavigationViewComponent@ViewChild('MainContextMenu', { static: true }) mainContextMenu: ContextMenuComponent<any>@ViewChild('TargetContextMenu', { static: true }) targetContextMenu: ContextMenuComponent<any>+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)protected readonly icons = {SHARED: SPACES_ICON.SHARED_WITH_OTHERS,faArrowRotateRight,@@ -95,7 +97,6 @@ export class SharedComponent implements OnInit {protected readonly TAB_MENU = TAB_MENUprotected loading = falseprotected galleryMode: ViewMode- private focusOnSelect: stringprotected shares: ShareFileModel[] = []protected selected: ShareFileModel = null// Sort@@ -133,21 +134,19 @@ export class SharedComponent implements OnInit {sortable: true}}+ protected btnSortFields = { name: 'Name', created: 'Created' }+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly store = inject(StoreService)+ private readonly sharesService = inject(SharesService)+ private focusOnSelect: stringprivate readonly sortSettings: SortSettings = {default: [{ prop: 'name', type: 'string' }],name: [{ prop: 'name', type: 'string' }],created: [{ prop: 'createdAt', type: 'date' }]}protected sortTable = new SortTable(this.constructor.name, this.sortSettings)- protected btnSortFields = { name: 'Name', created: 'Created' }- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly activatedRoute: ActivatedRoute,- private readonly store: StoreService,- private readonly sharesService: SharesService- ) {+ constructor() {this.loadShares()this.activatedRoute.queryParams.subscribe((params) => (this.focusOnSelect = params.select))this.layout.setBreadcrumbIcon(this.icons.SHARED)@@ -263,14 +262,6 @@ export class SharedComponent implements OnInit {this.layout.openContextMenu(ev, this.targetContextMenu)}- private focusOn(select: string) {- const s = this.shares.find((share) => share.name === select)- if (s) {- setTimeout(() => this.scrollView.scrollInto(s), 100)- this.onSelect(s)- }- }-goTo(share?: ShareFileModel) {share = share || this.selectedthis.sharesService.goTo(share).catch((e: Error) => console.error(e))@@ -279,4 +270,12 @@ export class SharedComponent implements OnInit {goToComments(share: ShareFileModel) {this.sharesService.goTo(share).then(() => this.layout.showRSideBarTab(TAB_MENU.COMMENTS, true))}++ private focusOn(select: string) {+ const s = this.shares.find((share) => share.name === select)+ if (s) {+ setTimeout(() => this.scrollView.scrollInto(s), 100)+ this.onSelect(s)+ }+ }}diff --git a/frontend/src/app/applications/shares/components/sidebar/share-selection.component.ts b/frontend/src/app/applications/shares/components/sidebar/share-selection.component.tsindex 8537890c..06763f7a 100755--- a/frontend/src/app/applications/shares/components/sidebar/share-selection.component.ts+++ b/frontend/src/app/applications/shares/components/sidebar/share-selection.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, Inject, input, InputSignal } from '@angular/core'+import { ChangeDetectionStrategy, Component, input, InputSignal, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { AutoResizeDirective } from '../../../../common/directives/auto-resize.directive'@@ -35,17 +35,14 @@ import { ShareRepositoryComponent } from '../utils/share-repository.component'styles: ['.card {width: 100%; background: transparent; border: none}']})export class ShareSelectionComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly layout = inject(LayoutService)+ private readonly sharesService = inject(SharesService)share: InputSignal<ShareFileModel> = input.required<ShareFileModel>()protected readonly iconShared = SPACES_ICON.SHARED_WITH_OTHERSprotected readonly cardImageSize = defaultCardImageSizeprotected readonly resizeOffset = defaultResizeOffset- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly layout: LayoutService,- private readonly sharesService: SharesService- ) {}-childShareDialog(share: ShareFileModel) {if (!share.counts.shares) returnthis.layout.openDialog(SharedChildrenDialogComponent, null, { initialState: { share: share } as SharedChildrenDialogComponent })diff --git a/frontend/src/app/applications/shares/components/utils/share-file-name.component.ts b/frontend/src/app/applications/shares/components/utils/share-file-name.component.tsindex 816f1d78..82aac552 100644--- a/frontend/src/app/applications/shares/components/utils/share-file-name.component.ts+++ b/frontend/src/app/applications/shares/components/utils/share-file-name.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject, Input, OnChanges, OnInit } from '@angular/core'+import { Component, Input, OnChanges, OnInit, inject } from '@angular/core'import { L10N_LOCALE, L10nLocale } from 'angular-l10n'import { pathSlice } from '../../../../common/utils/functions'import { ShareLinkModel } from '../../../links/models/share-link.model'@@ -23,11 +23,10 @@ import { ShareModel } from '../../models/share.model'</div>`})export class ShareFileNameComponent implements OnInit, OnChanges {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)@Input({ required: true }) share: ShareModel | ShareLinkModelprotected fileName: string- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}-ngOnInit() {this.setFilePath()}diff --git a/frontend/src/app/applications/shares/components/utils/share-repository.component.ts b/frontend/src/app/applications/shares/components/utils/share-repository.component.tsindex 93b49cc7..d168c3a7 100644--- a/frontend/src/app/applications/shares/components/utils/share-repository.component.ts+++ b/frontend/src/app/applications/shares/components/utils/share-repository.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject, Input, OnChanges, OnInit } from '@angular/core'+import { Component, Input, OnChanges, OnInit, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { IconDefinition } from '@fortawesome/fontawesome-svg-core'import { faQuestion } from '@fortawesome/free-solid-svg-icons'@@ -52,6 +52,8 @@ interface ShareRepository {`})export class ShareRepositoryComponent implements OnInit, OnChanges {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly layout = inject(LayoutService)@Input({ required: true }) share: Partial<ShareModel> | ShareFileModel | ShareLinkModel@Input() galleryMode: ViewMode@Input() showIcon = true@@ -64,11 +66,6 @@ export class ShareRepositoryComponent implements OnInit, OnChanges {translate: false}- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly layout: LayoutService- ) {}-ngOnInit() {this.setRepository()}diff --git a/frontend/src/app/applications/shares/services/shares.service.ts b/frontend/src/app/applications/shares/services/shares.service.tsindex 6e21bba2..2998baf2 100644--- a/frontend/src/app/applications/shares/services/shares.service.ts+++ b/frontend/src/app/applications/shares/services/shares.service.ts@@ -5,7 +5,7 @@*/import { HttpClient } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { Router } from '@angular/router'import type { FileSpace } from '@sync-in-server/backend/src/applications/files/interfaces/file-space.interface'import { API_SHARES_LIST, SHARES_ROUTE } from '@sync-in-server/backend/src/applications/shares/constants/routes'@@ -25,10 +25,8 @@ import { getFilePath } from '../shares.functions'@Injectable({ providedIn: 'root' })export class SharesService {- constructor(- private readonly http: HttpClient,- private readonly router: Router- ) {}+ private readonly http = inject(HttpClient)+ private readonly router = inject(Router)getShare(shareId: number): Observable<ShareModel> {return this.http.get<ShareProps>(`${SHARES_ROUTE.BASE}/${shareId}`).pipe(map((s: ShareProps) => new ShareModel(s)))diff --git a/frontend/src/app/applications/spaces/components/dialogs/space-anchor-file-dialog.component.ts b/frontend/src/app/applications/spaces/components/dialogs/space-anchor-file-dialog.component.tsindex 6260183f..26110761 100644--- a/frontend/src/app/applications/spaces/components/dialogs/space-anchor-file-dialog.component.ts+++ b/frontend/src/app/applications/spaces/components/dialogs/space-anchor-file-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faAnchor, faPlus, faSpinner } from '@fortawesome/free-solid-svg-icons'import { SPACE_OPERATION } from '@sync-in-server/backend/src/applications/spaces/constants/spaces'@@ -30,6 +30,10 @@ import { SpaceManageRootsComponent } from '../utils/space-manage-roots.componenttemplateUrl: 'space-anchor-file-dialog.component.html'})export class SpaceAnchorFileDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)+ private spacesService = inject(SpacesService)@Input({ required: true }) files: FileModel[]public addAnchoredFiles = new EventEmitter<{ space: SpaceModel; fileNames: string[] }>()protected readonly icons = { faAnchor, faPlus, faSpinner, SPACES: SPACES_ICON.SPACES }@@ -41,13 +45,6 @@ export class SpaceAnchorFileDialogComponent implements OnInit {protected submitted = falseprotected loading = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly userService: UserService,- private spacesService: SpacesService- ) {}-ngOnInit() {for (const f of this.files) {this.space.roots.push({diff --git a/frontend/src/app/applications/spaces/components/dialogs/space-dialog.component.ts b/frontend/src/app/applications/spaces/components/dialogs/space-dialog.component.tsindex 7d8f1a47..01ef3408 100644--- a/frontend/src/app/applications/spaces/components/dialogs/space-dialog.component.ts+++ b/frontend/src/app/applications/spaces/components/dialogs/space-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faAnchor, faCog, faPen, faPlus, faSpinner, faUsers, faUserShield } from '@fortawesome/free-solid-svg-icons'@@ -15,7 +15,7 @@ import { SpaceProps } from '@sync-in-server/backend/src/applications/spaces/modeimport type { SpaceRootProps } from '@sync-in-server/backend/src/applications/spaces/models/space-root-props.model'import type { SearchMembersDto } from '@sync-in-server/backend/src/applications/users/dto/search-members.dto'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TabsModule } from 'ngx-bootstrap/tabs'import { Observable, Subject } from 'rxjs'import { take } from 'rxjs/operators'@@ -59,6 +59,11 @@ import { ExternalFilePathEvent, SpaceRootPathDialogComponent } from './space-rootemplateUrl: 'space-dialog.component.html'})export class SpaceDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)+ private readonly spacesService = inject(SpacesService)+ private readonly linksService = inject(LinksService)@Input({ required: true }) space: SpaceModel = new SpaceModel({id: 0,name: '',@@ -90,14 +95,6 @@ export class SpaceDialogComponent implements OnInit {protected loading = falseprotected submitted = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly userService: UserService,- private readonly spacesService: SpacesService,- private readonly linksService: LinksService- ) {}-ngOnInit() {if (!this.space.id) {this.space.managers.unshift(ownerToMember(this.user, SPACE_ROLE.IS_MANAGER))diff --git a/frontend/src/app/applications/spaces/components/dialogs/space-root-path-dialog.component.ts b/frontend/src/app/applications/spaces/components/dialogs/space-root-path-dialog.component.tsindex 8e8d518d..4312c094 100644--- a/frontend/src/app/applications/spaces/components/dialogs/space-root-path-dialog.component.ts+++ b/frontend/src/app/applications/spaces/components/dialogs/space-root-path-dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, EventEmitter, HostListener, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, HostListener, Input, OnInit, Output, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faFolderClosed } from '@fortawesome/free-solid-svg-icons'@@ -25,6 +25,9 @@ export interface ExternalFilePathEvent {templateUrl: 'space-root-path-dialog.component.html'})export class SpaceRootPathDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly spacesService = inject(SpacesService)@Input() currentRoots: SpaceRootModel[] = []@Output() submitEvent = new EventEmitter<ExternalFilePathEvent>()@Input() withRootName = true@@ -37,12 +40,6 @@ export class SpaceRootPathDialogComponent implements OnInit {protected rootPathIsValid = falseprotected rootIsValid = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly spacesService: SpacesService- ) {}-ngOnInit() {if (!this.withRootName) {this.rootNameIsValid = truediff --git a/frontend/src/app/applications/spaces/components/dialogs/space-user-anchors-dialog.component.ts b/frontend/src/app/applications/spaces/components/dialogs/space-user-anchors-dialog.component.tsindex b876ecd4..22a6cee4 100644--- a/frontend/src/app/applications/spaces/components/dialogs/space-user-anchors-dialog.component.ts+++ b/frontend/src/app/applications/spaces/components/dialogs/space-user-anchors-dialog.component.ts@@ -5,12 +5,12 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, Input, OnInit } from '@angular/core'+import { Component, Input, OnInit, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faAnchor, faPlus, faSpinner } from '@fortawesome/free-solid-svg-icons'import type { SpaceRootProps } from '@sync-in-server/backend/src/applications/spaces/models/space-root-props.model'import { L10nTranslateDirective } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { Subject } from 'rxjs'import { take } from 'rxjs/operators'import { LayoutService } from '../../../../layout/layout.service'@@ -28,6 +28,8 @@ import { ExternalFilePathEvent } from './space-root-path-dialog.component'templateUrl: 'space-user-anchors-dialog.component.html'})export class SpaceUserAnchorsDialogComponent implements OnInit {+ protected readonly layout = inject(LayoutService)+ private readonly spacesService = inject(SpacesService)@Input({ required: true }) space: SpaceModel@Input({ required: true }) user: UserTypeprotected addRootFileEvent = new Subject<FileTreeEvent | ExternalFilePathEvent>()@@ -36,11 +38,6 @@ export class SpaceUserAnchorsDialogComponent implements OnInit {protected submitted = falseprotected loading = false- constructor(- protected readonly layout: LayoutService,- private readonly spacesService: SpacesService- ) {}-ngOnInit() {if (this.space?.roots.length) {// re-added afterdiff --git a/frontend/src/app/applications/spaces/components/sidebar/space-selection.component.ts b/frontend/src/app/applications/spaces/components/sidebar/space-selection.component.tsindex 9c263885..2568ee1d 100755--- a/frontend/src/app/applications/spaces/components/sidebar/space-selection.component.ts+++ b/frontend/src/app/applications/spaces/components/sidebar/space-selection.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, Inject, input, InputSignal } from '@angular/core'+import { ChangeDetectionStrategy, Component, input, InputSignal, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { SPACE_ROLE } from '@sync-in-server/backend/src/applications/spaces/constants/spaces'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective } from 'angular-l10n'@@ -37,18 +37,15 @@ import { SpaceUserAnchorsDialogComponent } from '../dialogs/space-user-anchors-dstyles: ['.card {width: 100%; background: transparent; border: none}']})export class SpaceSelectionComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly userService = inject(UserService)+ private readonly layout = inject(LayoutService)space: InputSignal<SpaceModel> = input.required<SpaceModel>()protected readonly SPACE_ROLE = SPACE_ROLEprotected readonly icons = { SPACES: SPACES_ICON.SPACES, ANCHORED: SPACES_ICON.ANCHORED, SHARED: SPACES_ICON.SHARED_WITH_OTHERS }protected readonly cardImageSize = defaultCardImageSizeprotected resizeOffset = defaultResizeOffset- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly userService: UserService,- private readonly layout: LayoutService- ) {}-openSpaceRootsDialog() {this.layout.openDialog(SpaceUserAnchorsDialogComponent, 'md', {initialState: {diff --git a/frontend/src/app/applications/spaces/components/sidebar/trash-selection.component.ts b/frontend/src/app/applications/spaces/components/sidebar/trash-selection.component.tsindex 3d9effe6..b9324271 100755--- a/frontend/src/app/applications/spaces/components/sidebar/trash-selection.component.ts+++ b/frontend/src/app/applications/spaces/components/sidebar/trash-selection.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, Inject, input, InputSignal } from '@angular/core'+import { ChangeDetectionStrategy, Component, input, InputSignal, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { AutoResizeDirective } from '../../../../common/directives/auto-resize.directive'@@ -21,10 +21,9 @@ import { SPACES_ICON } from '../../spaces.constants'styles: ['.card {width: 100%; background: transparent; border: none}']})export class TrashSelectionComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)trash: InputSignal<TrashModel> = input.required<TrashModel>()protected readonly iconTrash = SPACES_ICON.TRASHprotected readonly cardImageSize = defaultCardImageSizeprotected readonly resizeOffset = defaultResizeOffset-- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}}diff --git a/frontend/src/app/applications/spaces/components/spaces-browser.component.ts b/frontend/src/app/applications/spaces/components/spaces-browser.component.tsindex 6e932d9c..22278108 100644--- a/frontend/src/app/applications/spaces/components/spaces-browser.component.ts+++ b/frontend/src/app/applications/spaces/components/spaces-browser.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe, NgTemplateOutlet } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { AfterViewInit, Component, ElementRef, HostListener, Inject, NgZone, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core'+import { AfterViewInit, Component, ElementRef, HostListener, NgZone, OnDestroy, OnInit, Renderer2, ViewChild, inject } from '@angular/core'import { ActivatedRoute, Data, Router, UrlSegment } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -46,7 +46,7 @@ import { SPACE_OPERATION, SPACE_REPOSITORY } from '@sync-in-server/backend/src/aimport type { SpaceFiles } from '@sync-in-server/backend/src/applications/spaces/interfaces/space-files.interface'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { BsDropdownModule } from 'ngx-bootstrap/dropdown'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipModule } from 'ngx-bootstrap/tooltip'import { Subscription } from 'rxjs'import { take } from 'rxjs/operators'@@ -109,6 +109,16 @@ import { SpaceAnchorFileDialogComponent } from './dialogs/space-anchor-file-dialtemplateUrl: 'spaces-browser.component.html'})export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroy {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly zone = inject(NgZone)+ private readonly renderer = inject(Renderer2)+ protected readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)+ private readonly spacesBrowser = inject(SpacesBrowserService)+ private readonly filesService = inject(FilesService)+ private readonly filesUpload = inject(FilesUploadService)@ViewChild(VirtualScrollComponent) scrollView: { element: ElementRef; viewPortItems: FileModel[]; scrollInto: (arg: FileModel | number) => void }@ViewChild(FilterComponent, { static: true }) inputFilter: FilterComponent@ViewChild(NavigationViewComponent, { static: true }) btnNavigationView: any@@ -255,19 +265,6 @@ export class SpacesBrowserComponent implements OnInit, AfterViewInit, OnDestroyprotected selection: FileModel[] = []protected stats = { dirs: 0, files: 0, size: 0, elements: 0 }- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly activatedRoute: ActivatedRoute,- private readonly zone: NgZone,- private readonly renderer: Renderer2,- protected readonly layout: LayoutService,- private readonly store: StoreService,- private readonly spacesBrowser: SpacesBrowserService,- private readonly filesService: FilesService,- private readonly filesUpload: FilesUploadService- ) {}-ngOnInit() {this.galleryMode = this.btnNavigationView.currentView()this.supportUploadFolder = this.filesUpload.supportUploadDirectorydiff --git a/frontend/src/app/applications/spaces/components/spaces-nav.component.ts b/frontend/src/app/applications/spaces/components/spaces-nav.component.tsindex 824e0af0..ecfd99bf 100644--- a/frontend/src/app/applications/spaces/components/spaces-nav.component.ts+++ b/frontend/src/app/applications/spaces/components/spaces-nav.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { RouterOutlet } from '@angular/router'import { faCommentDots } from '@fortawesome/free-regular-svg-icons'import { faClipboardList, faFolderTree, faInfo } from '@fortawesome/free-solid-svg-icons'@@ -24,6 +24,8 @@ import { FileModel } from '../../files/models/file.model'template: ` <router-outlet></router-outlet> `})export class SpacesNavComponent implements OnDestroy {+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)private tabs: TabMenu[] = [{ label: TAB_MENU.SELECTION, components: [SelectionComponent], loadComponent: false, icon: faInfo, title: 'Informations', active: false },{ label: TAB_MENU.TREE, components: [FilesTreeComponent], loadComponent: true, icon: faFolderTree, title: null, active: false },@@ -40,10 +42,7 @@ export class SpacesNavComponent implements OnDestroy {}]- constructor(- private readonly layout: LayoutService,- private readonly store: StoreService- ) {+ constructor() {this.layout.setTabsRSideBar(TAB_GROUP.FILES, this.tabs)}diff --git a/frontend/src/app/applications/spaces/components/spaces.component.ts b/frontend/src/app/applications/spaces/components/spaces.component.tsindex 60ee0a06..0b598db8 100644--- a/frontend/src/app/applications/spaces/components/spaces.component.ts+++ b/frontend/src/app/applications/spaces/components/spaces.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core'+import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'import { ActivatedRoute, Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -25,7 +25,7 @@ import { SPACE_OPERATION, SPACE_ROLE } from '@sync-in-server/backend/src/applicaimport { USER_PERMISSION } from '@sync-in-server/backend/src/applications/users/constants/user'import { Member } from '@sync-in-server/backend/src/applications/users/interfaces/member.interface'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipModule } from 'ngx-bootstrap/tooltip'import { take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -69,6 +69,13 @@ import { SpaceUserAnchorsDialogComponent } from './dialogs/space-user-anchors-ditemplateUrl: 'spaces.component.html'})export class SpacesComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly router = inject(Router)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly spacesService = inject(SpacesService)+ private readonly store = inject(StoreService)+ private readonly userService = inject(UserService)@ViewChild(VirtualScrollComponent) scrollView: { element: ElementRef; viewPortItems: SpaceModel[]; scrollInto: (arg: SpaceModel | number) => void }@ViewChild(FilterComponent, { static: true }) inputFilter: FilterComponent@ViewChild(NavigationViewComponent, { static: true }) btnNavigationView: NavigationViewComponent@@ -153,15 +160,7 @@ export class SpacesComponent implements OnInit {protected canEditSpace = falseprotected canManageRoots = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly router: Router,- private readonly activatedRoute: ActivatedRoute,- private readonly spacesService: SpacesService,- private readonly store: StoreService,- private readonly userService: UserService- ) {+ constructor() {this.loadSpaces()this.canCreateSpace = this.userService.userHavePermission(USER_PERMISSION.SPACES_ADMIN)this.layout.setBreadcrumbIcon(SPACES_ICON.SPACES)diff --git a/frontend/src/app/applications/spaces/components/trash.component.ts b/frontend/src/app/applications/spaces/components/trash.component.tsindex 73917203..2ecda082 100644--- a/frontend/src/app/applications/spaces/components/trash.component.ts+++ b/frontend/src/app/applications/spaces/components/trash.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core'+import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faArrowDown, faArrowRotateRight, faArrowUp, faCircleInfo } from '@fortawesome/free-solid-svg-icons'@@ -44,6 +44,11 @@ import { SPACES_ICON, SPACES_PATH, SPACES_TITLE } from '../spaces.constants'templateUrl: 'trash.component.html'})export class TrashComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ private readonly router = inject(Router)+ private readonly store = inject(StoreService)+ private readonly spacesService = inject(SpacesService)@ViewChild(VirtualScrollComponent) scrollView: { element: ElementRef; viewPortItems: TrashModel[]; scrollInto: (arg: TrashModel | number) => void }@ViewChild(FilterComponent, { static: true }) inputFilter: FilterComponent@ViewChild(NavigationViewComponent, { static: true }) btnNavigationView: NavigationViewComponent@@ -96,13 +101,7 @@ export class TrashComponent implements OnInit {protected sortTable = new SortTable(this.constructor.name, this.sortSettings)protected btnSortFields = { name: 'Name', nb: 'Elements', mtime: 'Modified' }- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- private readonly router: Router,- private readonly store: StoreService,- private readonly spacesService: SpacesService- ) {+ constructor() {this.loadTrashBins()this.layout.setBreadcrumbIcon(SPACES_ICON.TRASH)this.layout.setBreadcrumbNav({ url: `/${SPACES_PATH.TRASH}/${SPACES_TITLE.TRASH}`, translating: true, sameLink: true })diff --git a/frontend/src/app/applications/spaces/components/utils/space-manage-roots.component.ts b/frontend/src/app/applications/spaces/components/utils/space-manage-roots.component.tsindex e5541396..f954497b 100644--- a/frontend/src/app/applications/spaces/components/utils/space-manage-roots.component.ts+++ b/frontend/src/app/applications/spaces/components/utils/space-manage-roots.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, ElementRef, Inject, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'+import { Component, ElementRef, Input, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faPen, faTimes } from '@fortawesome/free-solid-svg-icons'@@ -44,6 +44,7 @@ import { ExternalFilePathEvent } from '../dialogs/space-root-path-dialog.componetemplateUrl: 'space-manage-roots.component.html'})export class SpaceManageRootsComponent implements OnInit, OnDestroy {+ protected locale = inject<L10nLocale>(L10N_LOCALE)@ViewChild('InputRename') inputRename: ElementRef@Input({ required: true }) space: Partial<SpaceModel>@Input({ required: true }) user: UserType@@ -54,8 +55,6 @@ export class SpaceManageRootsComponent implements OnInit, OnDestroy {protected readonly SPACES_PERMISSIONS_TEXT = SPACES_PERMISSIONS_TEXTprotected readonly originalOrderKeyValue = originalOrderKeyValue- constructor(@Inject(L10N_LOCALE) protected locale: L10nLocale) {}-ngOnInit() {if (this.addRootFile) {this.subscription = this.addRootFile.subscribe((file: FileTreeEvent | ExternalFilePathEvent) => this.addRoot(file))diff --git a/frontend/src/app/applications/spaces/services/spaces-browser.service.ts b/frontend/src/app/applications/spaces/services/spaces-browser.service.tsindex 8e2968ec..4fd97894 100644--- a/frontend/src/app/applications/spaces/services/spaces-browser.service.ts+++ b/frontend/src/app/applications/spaces/services/spaces-browser.service.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpErrorResponse } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { UrlSegment } from '@angular/router'import { IconDefinition } from '@fortawesome/fontawesome-svg-core'import { API_SPACES_BROWSE } from '@sync-in-server/backend/src/applications/spaces/constants/routes'@@ -20,6 +20,8 @@ import { SPACES_ICON, SPACES_PATH, SPACES_TITLE } from '../spaces.constants'@Injectable({ providedIn: 'root' })export class SpacesBrowserService {+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)private browseApi: stringprivate breadCrumbUrl: stringprivate breadCrumbIcon: IconDefinition@@ -28,11 +30,6 @@ export class SpacesBrowserService {private inRootSpace = falsepublic inPersonalSpace = false- constructor(- private readonly http: HttpClient,- private readonly layout: LayoutService- ) {}-setEnvironment(repository: SPACE_REPOSITORY, routes: UrlSegment[]) {this.breadCrumbFilesRepo = SPACES_PATH.FILES === repositorythis.inPersonalSpace = routes.length && routes[0].path === SPACES_PATH.PERSONALdiff --git a/frontend/src/app/applications/spaces/services/spaces.service.ts b/frontend/src/app/applications/spaces/services/spaces.service.tsindex 7cd8970c..59289d5e 100644--- a/frontend/src/app/applications/spaces/services/spaces.service.ts+++ b/frontend/src/app/applications/spaces/services/spaces.service.ts@@ -5,7 +5,7 @@*/import { HttpClient } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import type { CreateOrUpdateShareDto } from '@sync-in-server/backend/src/applications/shares/dto/create-or-update-share.dto'import type { ShareProps } from '@sync-in-server/backend/src/applications/shares/interfaces/share-props.interface'import type { ShareChild } from '@sync-in-server/backend/src/applications/shares/models/share-child.model'@@ -29,8 +29,7 @@ import { SpaceModel, SpaceRootModel } from '../models/space.model'@Injectable({ providedIn: 'root' })export class SpacesService {- constructor(private readonly http: HttpClient) {}-+ private readonly http = inject(HttpClient)listSpaces(): Observable<SpaceModel[]> {return this.http.get<SpaceProps[]>(API_SPACES_LIST).pipe(map((sps: SpaceProps[]) => sps.map((s: SpaceProps) => new SpaceModel(s))))}diff --git a/frontend/src/app/applications/sync/components/dialogs/sync-client-delete.dialog.component.ts b/frontend/src/app/applications/sync/components/dialogs/sync-client-delete.dialog.component.tsindex 98adb3cd..9645e625 100755--- a/frontend/src/app/applications/sync/components/dialogs/sync-client-delete.dialog.component.ts+++ b/frontend/src/app/applications/sync/components/dialogs/sync-client-delete.dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/import { HttpErrorResponse } from '@angular/common/http'-import { ChangeDetectionStrategy, Component, EventEmitter, HostListener, Input, Output } from '@angular/core'+import { ChangeDetectionStrategy, Component, EventEmitter, HostListener, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faSpinner, faTrashCan } from '@fortawesome/free-solid-svg-icons'import { L10nTranslateDirective } from 'angular-l10n'@@ -19,16 +19,13 @@ import { SyncService } from '../../services/sync.service'templateUrl: './sync-client-delete.dialog.component.html'})export class SyncClientDeleteDialogComponent {+ protected readonly layout = inject(LayoutService)+ private readonly syncService = inject(SyncService)@Input() client: SyncClientModel@Output() wasDeleted = new EventEmitter()protected readonly icons = { faSpinner, faTrashCan }protected submitted = false- constructor(- protected readonly layout: LayoutService,- private readonly syncService: SyncService- ) {}-@HostListener('document:keyup.enter')onEnter() {this.onSubmit()diff --git a/frontend/src/app/applications/sync/components/dialogs/sync-path-report.dialog.component.ts b/frontend/src/app/applications/sync/components/dialogs/sync-path-report.dialog.component.tsindex d2f20f14..92da716b 100644--- a/frontend/src/app/applications/sync/components/dialogs/sync-path-report.dialog.component.ts+++ b/frontend/src/app/applications/sync/components/dialogs/sync-path-report.dialog.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, Inject, Input, OnDestroy, OnInit, signal, ViewChild, WritableSignal } from '@angular/core'+import { Component, Input, OnDestroy, OnInit, signal, ViewChild, WritableSignal, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faArrowDown, faArrowUp, faFilter, faFlask, faMapMarkerAlt, faRotate, faSpinner, faStop } from '@fortawesome/free-solid-svg-icons'@@ -55,6 +55,11 @@ import { SYNC_ICON } from '../../sync.constants'templateUrl: 'sync-path-report.dialog.component.html'})export class SyncPathReportDialogComponent implements OnInit, OnDestroy {+ locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly layout = inject(LayoutService)+ private readonly electron = inject(Electron)+ private readonly store = inject(StoreService)+ private readonly syncService = inject(SyncService)@ViewChild(AutoResizeDirective, { static: true }) autoResizeDirective: AutoResizeDirective@ViewChild(FilterComponent, { static: true }) inputFilter: FilterComponent@Input() syncPath: SyncPathModel@@ -107,14 +112,6 @@ export class SyncPathReportDialogComponent implements OnInit, OnDestroy {protected transfers: WritableSignal<SyncTransferModel[]> = signal([])private subscriptions: Subscription[] = []- constructor(- @Inject(L10N_LOCALE) public locale: L10nLocale,- private readonly layout: LayoutService,- private readonly electron: Electron,- private readonly store: StoreService,- private readonly syncService: SyncService- ) {}-ngOnInit() {this.electron.ipcRenderer.on(EVENT.SYNC.REPORT_TRANSFER, (_ev, tr: SyncTransfer) => this.addTransfer(tr))this.subscriptions.push(this.store.clientSyncIsReporting.subscribe((state: boolean) => this.manageState(state)))diff --git a/frontend/src/app/applications/sync/components/dialogs/sync-path-settings.dialog.component.ts b/frontend/src/app/applications/sync/components/dialogs/sync-path-settings.dialog.component.tsindex e1f97c2f..dea1be06 100755--- a/frontend/src/app/applications/sync/components/dialogs/sync-path-settings.dialog.component.ts+++ b/frontend/src/app/applications/sync/components/dialogs/sync-path-settings.dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faRotate, faTimes } from '@fortawesome/free-solid-svg-icons'@@ -25,6 +25,10 @@ import { SyncPathSettingsComponent } from '../shared/sync-path-settings.componentemplateUrl: 'sync-path-settings.dialog.component.html'})export class SyncPathSettingsDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ protected readonly store = inject(StoreService)+ private readonly syncService = inject(SyncService)@Input({ required: true }) syncPathSelected: SyncPathModel@Input() syncClientSelected: SyncClientModel // not needed from client, only for web@Output() mustRefresh = new EventEmitter<void>()@@ -44,13 +48,6 @@ export class SyncPathSettingsDialogComponent implements OnInit {protected readonly icons = { faTimes, faRotate }protected confirmDeletion = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- protected readonly store: StoreService,- private readonly syncService: SyncService- ) {}-ngOnInit() {this.syncPath = new SyncPathModel(JSON.parse(JSON.stringify(this.syncPathSelected)))}diff --git a/frontend/src/app/applications/sync/components/dialogs/sync-transfers-delete.dialog.component.ts b/frontend/src/app/applications/sync/components/dialogs/sync-transfers-delete.dialog.component.tsindex c3ec1319..8fbe684b 100644--- a/frontend/src/app/applications/sync/components/dialogs/sync-transfers-delete.dialog.component.ts+++ b/frontend/src/app/applications/sync/components/dialogs/sync-transfers-delete.dialog.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, EventEmitter, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faTrashCan } from '@fortawesome/free-solid-svg-icons'import { L10nTranslateDirective } from 'angular-l10n'@@ -18,15 +18,12 @@ import { SyncService } from '../../services/sync.service'templateUrl: './sync-transfers-delete.dialog.component.html'})export class SyncTransfersDeleteDialogComponent {+ protected readonly layout = inject(LayoutService)+ private readonly syncService = inject(SyncService)@Input() syncPath: SyncPathModel = null@Output() wasDeleted = new EventEmitter<void>()protected readonly icons = { faTrashCan }- constructor(- protected readonly layout: LayoutService,- private readonly syncService: SyncService- ) {}-doClear() {this.syncService.deleteTransfers(this.syncPath?.id).then(() => {this.wasDeleted.emit()diff --git a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.ts b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.tsindex 3b026ad1..14582b08 100755--- a/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.ts+++ b/frontend/src/app/applications/sync/components/shared/sync-path-settings.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject, Input } from '@angular/core'+import { Component, Input, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -35,6 +35,7 @@ import { SyncPathDirectionIconComponent } from '../utils/sync-path-direction-icotemplateUrl: './sync-path-settings.component.html'})export class SyncPathSettingsComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)@Input() syncPath: SyncPathModel@Input() direction = 'center'@Input() showPaths = false@@ -56,6 +57,4 @@ export class SyncPathSettingsComponent {protected readonly SYNC_PATH_MODE = SYNC_PATH_MODEprotected readonly SYNC_PATH_DIFF_MODE = SYNC_PATH_DIFF_MODEprotected readonly SYNC_PATH_SCHEDULER_UNIT = SYNC_PATH_SCHEDULER_UNIT-- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}}diff --git a/frontend/src/app/applications/sync/components/sync-clients.component.ts b/frontend/src/app/applications/sync/components/sync-clients.component.tsindex 45857ed0..6632152b 100644--- a/frontend/src/app/applications/sync/components/sync-clients.component.ts+++ b/frontend/src/app/applications/sync/components/sync-clients.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, Inject } from '@angular/core'+import { Component, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -23,7 +23,7 @@ import {faTrashCan} from '@fortawesome/free-solid-svg-icons'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipDirective } from 'ngx-bootstrap/tooltip'import { take } from 'rxjs/operators'import { AutoResizeDirective } from '../../../common/directives/auto-resize.directive'@@ -46,6 +46,10 @@ import { SyncPathSettingsDialogComponent } from './dialogs/sync-path-settings.distyleUrl: './sync-clients.component.scss'})export class SyncClientsComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly layout = inject(LayoutService)+ private readonly syncService = inject(SyncService)protected readonly icons = {faArrowRotateRight,faTrashCan,@@ -68,12 +72,7 @@ export class SyncClientsComponent {protected selectedPath: SyncPathModelprotected clients: SyncClientModel[] = []- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly layout: LayoutService,- private readonly syncService: SyncService- ) {+ constructor() {this.layout.setBreadcrumbIcon(USER_ICON.CLIENTS)this.layout.setBreadcrumbNav({url: `/${USER_PATH.BASE}/${USER_PATH.CLIENTS}/${USER_TITLE.CLIENTS}`,diff --git a/frontend/src/app/applications/sync/components/sync-paths.component.ts b/frontend/src/app/applications/sync/components/sync-paths.component.tsindex 2524c86c..b9b58ae6 100644--- a/frontend/src/app/applications/sync/components/sync-paths.component.ts+++ b/frontend/src/app/applications/sync/components/sync-paths.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, effect, Inject, OnDestroy, OnInit, ViewChild } from '@angular/core'+import { Component, effect, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -74,6 +74,11 @@ import { SyncPathSchedulerComponent } from './utils/sync-path-scheduler.componentemplateUrl: 'sync-paths.component.html'})export class SyncPathsComponent implements OnInit, OnDestroy {+ locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ protected readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)+ private readonly syncService = inject(SyncService)@ViewChild(AutoResizeDirective, { static: true }) autoResize: AutoResizeDirective@ViewChild(FilterComponent, { static: true }) inputFilter: FilterComponent@ViewChild('SyncPathContextMenu', { static: true }) syncPathContextMenu: ContextMenuComponent<any>@@ -180,13 +185,7 @@ export class SyncPathsComponent implements OnInit, OnDestroy {private focusOnPathId: number = nullprivate focusOnPathSettings = false- constructor(- @Inject(L10N_LOCALE) public locale: L10nLocale,- private readonly router: Router,- protected readonly store: StoreService,- private readonly layout: LayoutService,- private readonly syncService: SyncService- ) {+ constructor() {this.layout.setBreadcrumbIcon(SYNC_ICON.SYNC)this.layout.setBreadcrumbNav({url: `/${SYNC_PATH.BASE}/${SYNC_PATH.PATHS}/${SYNC_TITLE.SYNCS}`,diff --git a/frontend/src/app/applications/sync/components/sync-transfers.component.ts b/frontend/src/app/applications/sync/components/sync-transfers.component.tsindex 8044f3ca..5c181863 100644--- a/frontend/src/app/applications/sync/components/sync-transfers.component.ts+++ b/frontend/src/app/applications/sync/components/sync-transfers.component.ts@@ -4,13 +4,13 @@* See the LICENSE file for licensing details*/import { KeyValuePipe } from '@angular/common'-import { Component, effect, ElementRef, Inject, ViewChild } from '@angular/core'+import { Component, effect, ElementRef, ViewChild, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faArrowDown, faArrowUp, faRedo, faTrashCan } from '@fortawesome/free-solid-svg-icons'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipDirective } from 'ngx-bootstrap/tooltip'import { take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -42,6 +42,11 @@ import { SyncTransfersDeleteDialogComponent } from './dialogs/sync-transfers-deltemplateUrl: 'sync-transfers.component.html'})export class SyncTransfersComponent {+ locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly store = inject(StoreService)+ private readonly router = inject(Router)+ private readonly layout = inject(LayoutService)+ private readonly syncService = inject(SyncService)@ViewChild(VirtualScrollComponent) scrollView: {element: ElementRefviewPortItems: SyncTransferModel[]@@ -101,13 +106,7 @@ export class SyncTransfersComponent {private search: string = nullprivate query: string = null- constructor(- @Inject(L10N_LOCALE) public locale: L10nLocale,- protected readonly store: StoreService,- private readonly router: Router,- private readonly layout: LayoutService,- private readonly syncService: SyncService- ) {+ constructor() {this.layout.setBreadcrumbIcon(SYNC_ICON.TRANSFERS)this.layout.setBreadcrumbNav({url: `/${SYNC_PATH.BASE}/${SYNC_PATH.TRANSFERS}/${SYNC_TITLE.TRANSFERS}`,diff --git a/frontend/src/app/applications/sync/components/utils/sync-path-scheduler.component.ts b/frontend/src/app/applications/sync/components/utils/sync-path-scheduler.component.tsindex bd335d92..9a7799cb 100644--- a/frontend/src/app/applications/sync/components/utils/sync-path-scheduler.component.ts+++ b/frontend/src/app/applications/sync/components/utils/sync-path-scheduler.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Input } from '@angular/core'+import { Component, Input, inject } from '@angular/core'import { SYNC_PATH_SCHEDULER_UNIT } from '@sync-in-server/backend/src/applications/sync/constants/sync'import { L10nTranslateDirective } from 'angular-l10n'import { StoreService } from '../../../../store/store.service'@@ -34,9 +34,8 @@ import { SyncPathModel } from '../../models/sync-path.model'</span>`})export class SyncPathSchedulerComponent {+ protected readonly store = inject(StoreService)@Input({ required: true }) s: SyncPathModelprotected readonly SYNC_PATH_SCHEDULER_UNIT = SYNC_PATH_SCHEDULER_UNITprotected readonly CLIENT_SCHEDULER_STATE = CLIENT_SCHEDULER_STATE-- constructor(protected readonly store: StoreService) {}}diff --git a/frontend/src/app/applications/sync/components/wizard/sync-wizard-client.component.ts b/frontend/src/app/applications/sync/components/wizard/sync-wizard-client.component.tsindex 6363b77f..b856b897 100644--- a/frontend/src/app/applications/sync/components/wizard/sync-wizard-client.component.ts+++ b/frontend/src/app/applications/sync/components/wizard/sync-wizard-client.component.ts@@ -3,7 +3,7 @@* This file is part of Sync-in | The open source file sync and share solution* See the LICENSE file for licensing details*/-import { Component, Renderer2 } from '@angular/core'+import { Component, Renderer2, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faArrowCircleRight, faTimesCircle } from '@fortawesome/free-solid-svg-icons'@@ -23,17 +23,16 @@ import { SYNC_ICON, SYNC_PATH, SYNC_TITLE } from '../../sync.constants'templateUrl: 'sync-wizard-client.component.html'})export class SyncWizardClientComponent {+ private readonly router = inject(Router)+ private readonly renderer = inject(Renderer2)+ private readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)+ protected readonly syncService = inject(SyncService)protected readonly icons = { faTimesCircle, faArrowCircleRight }public pathIsValid = falsepublic infoMsg: string = null- constructor(- private readonly router: Router,- private readonly renderer: Renderer2,- private readonly store: StoreService,- private readonly layout: LayoutService,- protected readonly syncService: SyncService- ) {+ constructor() {this.layout.setBreadcrumbIcon(SYNC_ICON.WIZARD)this.layout.setBreadcrumbNav({url: `/${SYNC_PATH.BASE}/${SYNC_PATH.WIZARD}/${SYNC_PATH.WIZARD_CLIENT}/${SYNC_TITLE.WIZARD_CLIENT}`,diff --git a/frontend/src/app/applications/sync/components/wizard/sync-wizard-server.component.ts b/frontend/src/app/applications/sync/components/wizard/sync-wizard-server.component.tsindex 12a832c3..af1a0723 100644--- a/frontend/src/app/applications/sync/components/wizard/sync-wizard-server.component.ts+++ b/frontend/src/app/applications/sync/components/wizard/sync-wizard-server.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, Inject, signal, ViewChild, WritableSignal } from '@angular/core'+import { Component, signal, ViewChild, WritableSignal, inject } from '@angular/core'import { FormsModule, ReactiveFormsModule } from '@angular/forms'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -30,6 +30,13 @@ import { isSynchronizable } from '../../sync.utils'templateUrl: 'sync-wizard-server.component.html'})export class SyncWizardServerComponent {+ locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly store = inject(StoreService)+ private readonly userService = inject(UserService)+ private readonly filesService = inject(FilesService)+ private readonly syncService = inject(SyncService)+ private readonly layout = inject(LayoutService)@ViewChild(AutoResizeDirective, { static: true }) autoResize: AutoResizeDirectiveprotected readonly icons = { faArrowCircleLeft, faArrowCircleRight, faFolderPlus }private readonly rootPaths: SyncWizardPath[] = [@@ -75,15 +82,7 @@ export class SyncWizardServerComponent {protected currentShowedPath: stringprotected canCreateDir = false- constructor(- @Inject(L10N_LOCALE) public locale: L10nLocale,- private readonly router: Router,- private readonly store: StoreService,- private readonly userService: UserService,- private readonly filesService: FilesService,- private readonly syncService: SyncService,- private readonly layout: LayoutService- ) {+ constructor() {if (this.syncService.wizard.remotePath) {this.browse(this.syncService.wizard.remotePath.path.split('/').slice(0, -1).join('/'), this.syncService.wizard.remotePath.name).catch((e: Error) => {diff --git a/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.ts b/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.tsindex c4c68be4..7d73b22b 100644--- a/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.ts+++ b/frontend/src/app/applications/sync/components/wizard/sync-wizard-settings.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component } from '@angular/core'+import { Component, inject } from '@angular/core'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { SYNC_PATH_CONFLICT_MODE, SYNC_PATH_MODE } from '@sync-in-server/backend/src/applications/sync/constants/sync'@@ -23,6 +23,9 @@ import { SyncPathDirectionIconComponent } from '../utils/sync-path-direction-icotemplateUrl: './sync-wizard-settings.component.html'})export class SyncWizardSettingsComponent {+ private readonly router = inject(Router)+ private readonly layout = inject(LayoutService)+ protected readonly syncService = inject(SyncService)protected readonly SYNC_PATH_CONFLICT_MODE = SYNC_PATH_CONFLICT_MODEprotected readonly SYNC_PATH_MODE = SYNC_PATH_MODEprotected readonly icons = { CLIENT: SYNC_ICON.CLIENT, SERVER: SYNC_ICON.SERVER }@@ -30,11 +33,7 @@ export class SyncWizardSettingsComponent {protected syncPath: SyncPathModelprotected error: string = null- constructor(- private readonly router: Router,- private readonly layout: LayoutService,- protected readonly syncService: SyncService- ) {+ constructor() {this.syncPath = new SyncPathModel({settings: {name: this.syncService.wizard.localPath.name,diff --git a/frontend/src/app/applications/sync/services/sync.service.ts b/frontend/src/app/applications/sync/services/sync.service.tsindex 1df7c559..7dd660a6 100644--- a/frontend/src/app/applications/sync/services/sync.service.ts+++ b/frontend/src/app/applications/sync/services/sync.service.ts@@ -5,7 +5,7 @@*/import { HttpClient } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { Router } from '@angular/router'import { API_SYNC_CLIENTS, SYNC_ROUTE } from '@sync-in-server/backend/src/applications/sync/constants/routes'import {@@ -36,6 +36,11 @@ import { getServerPath } from '../sync.utils'providedIn: 'root'})export class SyncService {+ private readonly router = inject(Router)+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)+ private readonly electron = inject(Electron)// wizardpublic wizard: {localPath: {@@ -55,13 +60,7 @@ export class SyncService {}}- constructor(- private readonly router: Router,- private readonly http: HttpClient,- private readonly layout: LayoutService,- private readonly store: StoreService,- private readonly electron: Electron- ) {+ constructor() {this.resetWizard()}diff --git a/frontend/src/app/applications/users/components/dialogs/user-group-add-users-dialog.component.ts b/frontend/src/app/applications/users/components/dialogs/user-group-add-users-dialog.component.tsindex 8f77323f..fbd5fc48 100644--- a/frontend/src/app/applications/users/components/dialogs/user-group-add-users-dialog.component.ts+++ b/frontend/src/app/applications/users/components/dialogs/user-group-add-users-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faUserPlus } from '@fortawesome/free-solid-svg-icons'import { GROUP_TYPE } from '@sync-in-server/backend/src/applications/users/constants/group'@@ -25,6 +25,8 @@ import { UserSearchComponent } from '../utils/user-search.component'templateUrl: 'user-group-add-users-dialog.component.html'})export class UserGroupAddUsersDialogComponent {+ protected readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@Input({ required: true }) parentGroup: GroupBrowseModel['parentGroup']@Input({ required: true }) currentMemberIds: number[] = []@Output() hasChanges = new EventEmitter<boolean>()@@ -32,11 +34,6 @@ export class UserGroupAddUsersDialogComponent {protected submitted = falseprotected readonly icons = { faUserPlus }- constructor(- protected readonly layout: LayoutService,- private readonly userService: UserService- ) {}-searchMembers(query: string): Observable<MemberModel[]> {const search: SearchMembersDto = {search: query,diff --git a/frontend/src/app/applications/users/components/dialogs/user-group-delete-dialog.component.ts b/frontend/src/app/applications/users/components/dialogs/user-group-delete-dialog.component.tsindex 640c6c4f..d607ac5a 100644--- a/frontend/src/app/applications/users/components/dialogs/user-group-delete-dialog.component.ts+++ b/frontend/src/app/applications/users/components/dialogs/user-group-delete-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faMinus, faUserMinus } from '@fortawesome/free-solid-svg-icons'import { L10nTranslateDirective } from 'angular-l10n'@@ -22,17 +22,14 @@ import { UserService } from '../../user.service'templateUrl: 'user-group-delete-dialog.component.html'})export class UserGroupDeleteDialogComponent {+ private readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@Input({ required: true }) parentGroup: GroupBrowseModel['parentGroup']@Input({ required: true }) member: MemberModel@Output() wasDeleted = new EventEmitter<boolean>()protected submitted = falseprotected readonly icons = { GROUPS: USER_ICON.GROUPS, faMinus, faUserMinus }- constructor(- private readonly layout: LayoutService,- private readonly userService: UserService- ) {}-onSubmit() {this.submitted = trueconst notification = this.member.isUser ? 'Remove from group' : 'Delete group'diff --git a/frontend/src/app/applications/users/components/dialogs/user-group-dialog.component.ts b/frontend/src/app/applications/users/components/dialogs/user-group-dialog.component.tsindex 60e69b29..6edc716a 100644--- a/frontend/src/app/applications/users/components/dialogs/user-group-dialog.component.ts+++ b/frontend/src/app/applications/users/components/dialogs/user-group-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormsModule, ReactiveFormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faCog, faPen, faSpinner, faUsers } from '@fortawesome/free-solid-svg-icons'@@ -25,6 +25,8 @@ import { UserService } from '../../user.service'templateUrl: 'user-group-dialog.component.html'})export class UserGroupDialogComponent implements OnInit {+ protected readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@Input() originalGroup: MemberModel@Output() groupChange = new EventEmitter<['add' | 'update', MemberModel]>()protected group: MemberModel@@ -35,11 +37,6 @@ export class UserGroupDialogComponent implements OnInit {protected submitted = falseprotected loading = false- constructor(- protected readonly layout: LayoutService,- private readonly userService: UserService- ) {}-ngOnInit() {if (!this.originalGroup?.id) {this.group = new MemberModel({diff --git a/frontend/src/app/applications/users/components/dialogs/user-guest-dialog.component.ts b/frontend/src/app/applications/users/components/dialogs/user-guest-dialog.component.tsindex 12d66a23..abff79bc 100644--- a/frontend/src/app/applications/users/components/dialogs/user-guest-dialog.component.ts+++ b/frontend/src/app/applications/users/components/dialogs/user-guest-dialog.component.ts@@ -6,7 +6,7 @@import { TitleCasePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faAddressCard, faPen, faPlus, faShieldHalved, faSpinner, faUsers, faUsersGear } from '@fortawesome/free-solid-svg-icons'@@ -52,6 +52,9 @@ import { UserSearchComponent } from '../utils/user-search.component'templateUrl: 'user-guest-dialog.component.html'})export class UserGuestDialogComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ protected readonly layout = inject(LayoutService)+ protected readonly userService = inject(UserService)@Input() guest: GuestUserModel = null@Output() guestChange = new EventEmitter<['add' | 'update' | 'delete', GuestUserModel]>()protected readonly user: UserType = this.userService.user@@ -77,12 +80,6 @@ export class UserGuestDialogComponent implements OnInit {managers: FormControl<MemberModel[]>}>- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- protected readonly layout: LayoutService,- protected readonly userService: UserService- ) {}-ngOnInit() {this.guestForm = new FormGroup({login: new FormControl<string>(this.guest?.login || '', [Validators.required, Validators.pattern(USER_LOGIN_VALIDATION)]),diff --git a/frontend/src/app/applications/users/components/dialogs/user-personal-group-edit-user-dialog.component.ts b/frontend/src/app/applications/users/components/dialogs/user-personal-group-edit-user-dialog.component.tsindex e84e7ca2..25be937d 100644--- a/frontend/src/app/applications/users/components/dialogs/user-personal-group-edit-user-dialog.component.ts+++ b/frontend/src/app/applications/users/components/dialogs/user-personal-group-edit-user-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, Input, OnInit } from '@angular/core'+import { Component, Input, OnInit, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faKey, faUserPen } from '@fortawesome/free-solid-svg-icons'@@ -22,6 +22,8 @@ import { UserService } from '../../user.service'templateUrl: 'user-personal-group-edit-user-dialog.component.html'})export class UserPersonalGroupEditUserDialogComponent implements OnInit {+ protected readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@Input({ required: true }) parentGroup: GroupBrowseModel['parentGroup']@Input({ required: true }) user: MemberModelprotected submitted = false@@ -29,11 +31,6 @@ export class UserPersonalGroupEditUserDialogComponent implements OnInit {protected readonly USER_GROUP_ROLE = USER_GROUP_ROLEprotected readonly icons = { faUserPen, faKey }- constructor(- protected readonly layout: LayoutService,- private readonly userService: UserService- ) {}-ngOnInit() {this.isManager = this.user.isGroupManager}diff --git a/frontend/src/app/applications/users/components/dialogs/user-personal-group-leave-dialog.component.ts b/frontend/src/app/applications/users/components/dialogs/user-personal-group-leave-dialog.component.tsindex a2edd96b..6e09a9b8 100644--- a/frontend/src/app/applications/users/components/dialogs/user-personal-group-leave-dialog.component.ts+++ b/frontend/src/app/applications/users/components/dialogs/user-personal-group-leave-dialog.component.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Component, EventEmitter, Input, Output } from '@angular/core'+import { Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faRightFromBracket } from '@fortawesome/free-solid-svg-icons'import { L10nTranslateDirective } from 'angular-l10n'@@ -21,16 +21,13 @@ import { UserService } from '../../user.service'templateUrl: 'user-personal-group-leave-dialog.component.html'})export class UserPersonalGroupLeaveDialogComponent {+ private readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@Input({ required: true }) member: MemberModel@Output() wasLeft = new EventEmitter<boolean>()protected submitted = falseprotected readonly icons = { GROUPS: USER_ICON.GROUPS, faRightFromBracket }- constructor(- private readonly layout: LayoutService,- private readonly userService: UserService- ) {}-onClose() {this.wasLeft.emit(false)this.layout.closeDialog()diff --git a/frontend/src/app/applications/users/components/sidebar/user-onlines.component.ts b/frontend/src/app/applications/users/components/sidebar/user-onlines.component.tsindex 49b8f9ce..a6111a9f 100644--- a/frontend/src/app/applications/users/components/sidebar/user-onlines.component.ts+++ b/frontend/src/app/applications/users/components/sidebar/user-onlines.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, computed, Signal } from '@angular/core'+import { Component, computed, Signal, inject } from '@angular/core'import { USER_ONLINE_STATUS, USER_ONLINE_STATUS_LIST } from '@sync-in-server/backend/src/applications/users/constants/user'import { L10nTranslateDirective } from 'angular-l10n'import { AutoResizeDirective } from '../../../../common/directives/auto-resize.directive'@@ -17,10 +17,9 @@ import { UserOnlineModel } from '../../models/user-online.model'templateUrl: 'user-onlines.component.html'})export class UserOnlinesComponent {+ private readonly store = inject(StoreService)protected readonly allOnlineStatus = USER_ONLINE_STATUS_LISTpublic onlineUsers: Signal<UserOnlineModel[]> = computed(() =>this.store.onlineUsers().filter((u) => u.onlineStatus !== USER_ONLINE_STATUS.OFFLINE))-- constructor(private readonly store: StoreService) {}}diff --git a/frontend/src/app/applications/users/components/sidebar/user-profile.component.ts b/frontend/src/app/applications/users/components/sidebar/user-profile.component.tsindex 26a171fb..146bf78a 100644--- a/frontend/src/app/applications/users/components/sidebar/user-profile.component.ts+++ b/frontend/src/app/applications/users/components/sidebar/user-profile.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { RouterLink } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -26,6 +26,10 @@ import { UserService } from '../../user.service'imports: [FormsModule, RouterLink, CapitalizePipe, FaIconComponent, L10nTranslateDirective]})export class UserProfileComponent implements OnDestroy {+ private readonly layout = inject(LayoutService)+ private readonly authService = inject(AuthService)+ private readonly userService = inject(UserService)+ protected readonly store = inject(StoreService)protected readonly USER_PATH = USER_PATHprotected readonly allOnlineStatus = USER_ONLINE_STATUS_LISTprotected readonly icons = { faUserAlt, faCircleHalfStroke, faCog, faPowerOff, faUserSecret }@@ -33,12 +37,7 @@ export class UserProfileComponent implements OnDestroy {protected userAvatar: string = nullprivate subscriptions: Subscription[] = []- constructor(- private readonly layout: LayoutService,- private readonly authService: AuthService,- private readonly userService: UserService,- protected readonly store: StoreService- ) {+ constructor() {this.subscriptions.push(this.store.user.subscribe((user: UserType) => (this.user = user)))this.subscriptions.push(this.store.userAvatarUrl.subscribe((avatarUrl: string) => (this.userAvatar = avatarUrl)))}diff --git a/frontend/src/app/applications/users/components/user-account.component.ts b/frontend/src/app/applications/users/components/user-account.component.tsindex 1dc762f7..b5091d98 100644--- a/frontend/src/app/applications/users/components/user-account.component.ts+++ b/frontend/src/app/applications/users/components/user-account.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, Inject, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faCopy, faKey } from '@fortawesome/free-solid-svg-icons'@@ -50,6 +50,11 @@ import { UserService } from '../user.service'templateUrl: 'user-account.component.html'})export class UserAccountComponent implements OnDestroy {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)+ private readonly clipBoardService = inject(ClipboardService)private subscriptions: Subscription[] = []protected readonly allNotifications = Object.values(USER_NOTIFICATION_TEXT)protected readonly allOnlineStatus = USER_ONLINE_STATUS_LIST@@ -63,13 +68,7 @@ export class UserAccountComponent implements OnDestroy {protected oldPassword: stringprotected newPassword: string- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly store: StoreService,- private readonly layout: LayoutService,- private readonly userService: UserService,- private readonly clipBoardService: ClipboardService- ) {+ constructor() {this.subscriptions.push(this.store.user.subscribe((user: UserType) => (this.user = user)))this.subscriptions.push(this.store.userAvatarUrl.subscribe((avatarUrl) => (this.userAvatar = avatarUrl)))this.layout.setBreadcrumbIcon(USER_ICON.ACCOUNT)diff --git a/frontend/src/app/applications/users/components/user-applications.component.ts b/frontend/src/app/applications/users/components/user-applications.component.tsindex dc1f2cc7..cd852e7b 100644--- a/frontend/src/app/applications/users/components/user-applications.component.ts+++ b/frontend/src/app/applications/users/components/user-applications.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component } from '@angular/core'+import { Component, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faApple, faLinux, faWindows } from '@fortawesome/free-brands-svg-icons'import { faDownload, faTerminal } from '@fortawesome/free-solid-svg-icons'@@ -24,15 +24,14 @@ import { UserService } from '../user.service'templateUrl: './user-applications.component.html'})export class UserApplicationsComponent {+ protected readonly store = inject(StoreService)+ private readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)protected readonly icons = { faWindows, faApple, faLinux, faDownload, faTerminal }protected readonly APP_STORE_OS = APP_STORE_PLATFORMprotected readonly APP_STORE_PLATFORM_LIST = Object.values(APP_STORE_PLATFORM)- constructor(- protected readonly store: StoreService,- private readonly layout: LayoutService,- private readonly userService: UserService- ) {+ constructor() {this.userService.checkAppStoreAvailability()this.layout.setBreadcrumbIcon(USER_ICON.APPS)this.layout.setBreadcrumbNav({diff --git a/frontend/src/app/applications/users/components/user-groups.component.ts b/frontend/src/app/applications/users/components/user-groups.component.tsindex c7dc39e4..464d4a72 100644--- a/frontend/src/app/applications/users/components/user-groups.component.ts+++ b/frontend/src/app/applications/users/components/user-groups.component.ts@@ -6,7 +6,7 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, ElementRef, Inject, ViewChild } from '@angular/core'+import { Component, ElementRef, ViewChild, inject } from '@angular/core'import { ActivatedRoute, Data, Router, UrlSegment } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import {@@ -27,7 +27,7 @@ import { GROUP_TYPE } from '@sync-in-server/backend/src/applications/users/constimport { USER_GROUP_ROLE, USER_PERMISSION } from '@sync-in-server/backend/src/applications/users/constants/user'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { BsDropdownDirective, BsDropdownMenuDirective, BsDropdownToggleDirective } from 'ngx-bootstrap/dropdown'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipDirective } from 'ngx-bootstrap/tooltip'import { filter, take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -70,6 +70,11 @@ import { UserPersonalGroupLeaveDialogComponent } from './dialogs/user-personal-gtemplateUrl: 'user-groups.component.html'})export class UserGroupsComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly router = inject(Router)+ private readonly activatedRoute = inject(ActivatedRoute)+ private readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@ViewChild(VirtualScrollComponent) scrollView: {element: ElementRefviewPortItems: MemberModel[]@@ -179,13 +184,7 @@ export class UserGroupsComponent {protected selected: MemberModel = nullprotected members: MemberModel[] = []- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly router: Router,- private readonly activatedRoute: ActivatedRoute,- private readonly layout: LayoutService,- private readonly userService: UserService- ) {+ constructor() {this.activatedRoute.data.subscribe((route: Data) => this.setEnv(route.routes as UrlSegment[]))this.activatedRoute.queryParams.subscribe((params) => (this.focusOnSelect = params.select))this.layout.setBreadcrumbIcon(USER_ICON.GROUPS)diff --git a/frontend/src/app/applications/users/components/user-guests.component.ts b/frontend/src/app/applications/users/components/user-guests.component.tsindex f03cc5b6..c7a11fef 100644--- a/frontend/src/app/applications/users/components/user-guests.component.ts+++ b/frontend/src/app/applications/users/components/user-guests.component.ts@@ -6,13 +6,13 @@import { KeyValuePipe } from '@angular/common'import { HttpErrorResponse } from '@angular/common/http'-import { Component, ElementRef, Inject, ViewChild } from '@angular/core'+import { Component, ElementRef, ViewChild, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faArrowDown, faArrowRotateRight, faArrowUp, faKey, faPen, faPlus, faRotate } from '@fortawesome/free-solid-svg-icons'import { ContextMenuComponent, ContextMenuModule } from '@perfectmemory/ngx-contextmenu'import { USER_PERMISSION } from '@sync-in-server/backend/src/applications/users/constants/user'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { TooltipDirective } from 'ngx-bootstrap/tooltip'import { take } from 'rxjs/operators'import { FilterComponent } from '../../../common/components/filter.component'@@ -47,6 +47,9 @@ import { UserAvatarComponent } from './utils/user-avatar.component'templateUrl: 'user-guests.component.html'})export class UserGuestsComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@ViewChild(VirtualScrollComponent) scrollView: {element: ElementRefviewPortItems: GuestUserModel[]@@ -126,11 +129,7 @@ export class UserGuestsComponent {protected selected: GuestUserModel = nullprotected guests: GuestUserModel[] = []- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly layout: LayoutService,- private readonly userService: UserService- ) {+ constructor() {this.loadGuests()this.layout.setBreadcrumbIcon(USER_ICON.GUESTS)this.layout.setBreadcrumbNav({diff --git a/frontend/src/app/applications/users/components/utils/user-avatar.component.ts b/frontend/src/app/applications/users/components/utils/user-avatar.component.tsindex 20ce01b8..bd51a37f 100644--- a/frontend/src/app/applications/users/components/utils/user-avatar.component.ts+++ b/frontend/src/app/applications/users/components/utils/user-avatar.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, Inject, Input, OnInit } from '@angular/core'+import { ChangeDetectionStrategy, Component, Input, OnInit, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faLightbulb, faUsers, faUserShield } from '@fortawesome/free-solid-svg-icons'import { L10N_LOCALE, L10nLocale, L10nTranslatePipe } from 'angular-l10n'@@ -72,6 +72,7 @@ import { MemberModel } from '../../models/member.model'`})export class UserAvatarComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)@Input() user: OwnerType | MemberModel | any@Input() isMember = false@Input() unknownUserAsInfo = false@@ -82,8 +83,6 @@ export class UserAvatarComponent implements OnInit {@Input() container: string = nullprotected readonly icons = { faUsers, faUserShield, faLightbulb }- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}-ngOnInit(): void {if (this.height < 28) {this.fontSize = 13diff --git a/frontend/src/app/applications/users/components/utils/user-search.component.ts b/frontend/src/app/applications/users/components/utils/user-search.component.tsindex 4980032d..1fda7083 100644--- a/frontend/src/app/applications/users/components/utils/user-search.component.ts+++ b/frontend/src/app/applications/users/components/utils/user-search.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { Component, ElementRef, EventEmitter, Inject, Input, NgZone, OnInit, Output, ViewChild } from '@angular/core'+import { Component, ElementRef, EventEmitter, Input, NgZone, OnInit, Output, ViewChild, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faPen, faTimes } from '@fortawesome/free-solid-svg-icons'@@ -42,6 +42,8 @@ import { USER_ICON } from '../../user.constants'templateUrl: 'users-search.component.html'})export class UserSearchComponent implements OnInit {+ protected locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly ngZone = inject(NgZone)@ViewChild('InputTypeHead') inputTypeHead: ElementRef@Input() members: MemberModel[] = []@Output() membersChange = new EventEmitter<MemberModel[]>()@@ -65,11 +67,6 @@ export class UserSearchComponent implements OnInit {mergeMap((search: any) => this.searchFunction(search || '').pipe(tap((results: MemberModel[]) => (this.lastResults = results)))))- constructor(- @Inject(L10N_LOCALE) protected locale: L10nLocale,- private readonly ngZone: NgZone- ) {}-ngOnInit() {this.setDefaultPlaceHolder()}diff --git a/frontend/src/app/applications/users/user.service.ts b/frontend/src/app/applications/users/user.service.tsindex c643e615..6af503cb 100644--- a/frontend/src/app/applications/users/user.service.ts+++ b/frontend/src/app/applications/users/user.service.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpErrorResponse } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { NOTIFICATIONS_WS } from '@sync-in-server/backend/src/applications/notifications/constants/websocket'import { SPACE_OPERATION } from '@sync-in-server/backend/src/applications/spaces/constants/spaces'import { SYNC_ROUTE } from '@sync-in-server/backend/src/applications/sync/constants/routes'@@ -56,13 +56,13 @@ import { myAvatarUrl } from './user.functions'@Injectable({ providedIn: 'root' })export class UserService {- constructor(- private readonly http: HttpClient,- private readonly layout: LayoutService,- private readonly store: StoreService,- private readonly webSocket: Socket,- private readonly notifications: NotificationsService- ) {+ private readonly http = inject(HttpClient)+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)+ private readonly webSocket = inject(Socket)+ private readonly notifications = inject(NotificationsService)++ constructor() {this.webSocket.fromEvent('connect').subscribe(() => this.notifications.checkUnreadNotifications())this.webSocket.fromEvent('disconnect').subscribe(() => this.store.onlineUsers.set([]))this.webSocket.fromEvent(NOTIFICATIONS_WS.EVENTS.NOTIFICATION).subscribe(() => this.notifications.checkUnreadNotifications(true))diff --git a/frontend/src/app/auth/auth.component.ts b/frontend/src/app/auth/auth.component.tsindex 08047b5e..7022d154 100644--- a/frontend/src/app/auth/auth.component.ts+++ b/frontend/src/app/auth/auth.component.ts@@ -5,7 +5,7 @@*/import { NgOptimizedImage } from '@angular/common'-import { Component, Inject } from '@angular/core'+import { Component, inject } from '@angular/core'import { FormGroup, ReactiveFormsModule, UntypedFormBuilder, Validators } from '@angular/forms'import { Router } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -23,18 +23,19 @@ import { AuthService } from './auth.service'imports: [AutofocusDirective, ReactiveFormsModule, FaIconComponent, L10nTranslateDirective, L10nTranslatePipe, NgOptimizedImage]})export class AuthComponent {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly fb = inject(UntypedFormBuilder)+ private readonly router = inject(Router)+ private readonly auth = inject(AuthService)protected readonly icons = { faLock, faUserAlt }protected logoUrl = logoDarkUrlprotected loginForm: FormGroupprotected hasError: any = nullprotected submitted = false- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly fb: UntypedFormBuilder,- private readonly router: Router,- private readonly auth: AuthService- ) {+ constructor() {+ const fb = this.fb+this.loginForm = fb.group({username: this.fb.control('', [Validators.required]),password: this.fb.control('', [Validators.required])diff --git a/frontend/src/app/auth/auth.interceptor.ts b/frontend/src/app/auth/auth.interceptor.tsindex 660e604a..f2364e5b 100644--- a/frontend/src/app/auth/auth.interceptor.ts+++ b/frontend/src/app/auth/auth.interceptor.ts@@ -5,7 +5,7 @@*/import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'-import { Injectable, Injector } from '@angular/core'+import { Injectable, Injector, inject } from '@angular/core'import { API_AUTH_LOGIN, API_AUTH_LOGOUT, API_AUTH_REFRESH } from '@sync-in-server/backend/src/authentication/constants/routes'import { BehaviorSubject, concatMap, delay, Observable, of, retryWhen, throwError } from 'rxjs'import { catchError, filter, finalize, switchMap, take } from 'rxjs/operators'@@ -16,16 +16,13 @@ import { AuthService } from './auth.service'providedIn: 'root'})export class AuthInterceptor implements HttpInterceptor {- private auth: AuthService | null+ private readonly injector = inject(Injector)+ private auth: AuthService | null = nullprivate isRefreshingToken = falseprivate waitForRefreshToken: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false)private retryCount = 3private retryWaitMilliSeconds = 2000- constructor(private readonly injector: Injector) {- this.auth = null- }-intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {const encodedUrl = hasReservedUrlChars(request.url)if (encodedUrl) {diff --git a/frontend/src/app/auth/auth.service.ts b/frontend/src/app/auth/auth.service.tsindex 36030a26..41e12f19 100644--- a/frontend/src/app/auth/auth.service.ts+++ b/frontend/src/app/auth/auth.service.ts@@ -5,7 +5,7 @@*/import { HttpClient, HttpErrorResponse, HttpRequest } from '@angular/common/http'-import { Injectable } from '@angular/core'+import { Injectable, inject } from '@angular/core'import { Router } from '@angular/router'import { CLIENT_TOKEN_EXPIRED_ERROR } from '@sync-in-server/backend/src/applications/sync/constants/auth'import { API_SYNC_AUTH_COOKIE } from '@sync-in-server/backend/src/applications/sync/constants/routes'@@ -32,19 +32,16 @@ import { AUTH_PATHS } from './auth.constants'providedIn: 'root'})export class AuthService {+ private readonly http = inject(HttpClient)+ private readonly router = inject(Router)+ private readonly store = inject(StoreService)+ private readonly userService = inject(UserService)+ private readonly layout = inject(LayoutService)+ private readonly electron = inject(Electron)private _refreshExpiration = parseInt(localStorage.getItem('refresh_expiration') || '0', 10) || 0private _accessExpiration = parseInt(localStorage.getItem('access_expiration') || '0', 10) || 0public returnUrl: string- constructor(- private readonly http: HttpClient,- private readonly router: Router,- private readonly store: StoreService,- private readonly userService: UserService,- private readonly layout: LayoutService,- private readonly electron: Electron- ) {}-get refreshExpiration(): number {return this._refreshExpiration}diff --git a/frontend/src/app/common/components/code-mirror.component.ts b/frontend/src/app/common/components/code-mirror.component.tsindex bb52f042..26be7d51 100755--- a/frontend/src/app/common/components/code-mirror.component.ts+++ b/frontend/src/app/common/components/code-mirror.component.ts@@ -12,6 +12,7 @@ import {ElementRef,EventEmitter,forwardRef,+ inject,Input,KeyValueDiffer,KeyValueDiffers,@@ -61,21 +62,20 @@ export class CodeMirrorComponent implements AfterViewInit, OnDestroy, ControlVal@Output() cursorActivity = new EventEmitter<Editor>()/* called when the editor is focused or loses focus */@Output() focusChange = new EventEmitter<boolean>()- /* called when the editor is scrolled */// eslint-disable-next-line @angular-eslint/no-output-native@Output() scroll = new EventEmitter<ScrollInfo>()@ViewChild('ref', { static: true }) ref: ElementRef+ /* called when the editor is scrolled */value = ''disabled = falseisFocused = falsetextArea: EditorFromTextAreacodeMirror: any+ private _differs = inject(KeyValueDiffers)+ private readonly _ngZone = inject(NgZone)private _differ: KeyValueDiffer<string, any>- constructor(- private _differs: KeyValueDiffers,- private readonly _ngZone: NgZone- ) {+ constructor() {this.codeMirror = CodeMirror ? CodeMirror : import('codemirror')}diff --git a/frontend/src/app/common/components/filter.component.ts b/frontend/src/app/common/components/filter.component.tsindex b42e0146..9096c172 100644--- a/frontend/src/app/common/components/filter.component.ts+++ b/frontend/src/app/common/components/filter.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, ElementRef, HostListener, Inject, OnDestroy, signal, ViewChild } from '@angular/core'+import { Component, ElementRef, HostListener, OnDestroy, signal, ViewChild, inject } from '@angular/core'import { FormBuilder, FormControl, ReactiveFormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faTimes } from '@fortawesome/free-solid-svg-icons'@@ -35,16 +35,15 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'`})export class FilterComponent implements OnDestroy {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)+ private readonly fb = inject(FormBuilder)@ViewChild('iFilter', { static: true }) iFilter: ElementRefpublic search = signal('')protected readonly searchControl: FormControlprotected readonly faTimes = faTimesprivate readonly subscription: Subscription- constructor(- @Inject(L10N_LOCALE) protected readonly locale: L10nLocale,- private readonly fb: FormBuilder- ) {+ constructor() {this.searchControl = this.fb.control('')this.subscription = this.searchControl.valueChanges.pipe(debounceTime(300), distinctUntilChanged()).subscribe((value) => this.onType(value))}diff --git a/frontend/src/app/common/components/input-password.component.ts b/frontend/src/app/common/components/input-password.component.tsindex c5829942..99fbdd2e 100644--- a/frontend/src/app/common/components/input-password.component.ts+++ b/frontend/src/app/common/components/input-password.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, ElementRef, EventEmitter, Inject, Input, OnInit, Output, ViewChild } from '@angular/core'+import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild, inject } from '@angular/core'import { FormsModule, ReactiveFormsModule } from '@angular/forms'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faDice, faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons'@@ -46,6 +46,7 @@ import { genPassword, togglePasswordType } from '../utils/functions'</div> `})export class InputPasswordComponent implements OnInit {+ protected readonly locale = inject<L10nLocale>(L10N_LOCALE)@ViewChild('Password', { static: true }) passwordElement: ElementRef@Input() password: string@Output() passwordChange = new EventEmitter<string>()@@ -59,8 +60,6 @@ export class InputPasswordComponent implements OnInit {protected readonly toggleVisiblePassword = togglePasswordTypeprotected readonly icons = { faEye, faEyeSlash, faDice }- constructor(@Inject(L10N_LOCALE) protected readonly locale: L10nLocale) {}-ngOnInit() {if (this.focus) {setTimeout(() => {diff --git a/frontend/src/app/common/components/navigation-view/navigation-view.component.ts b/frontend/src/app/common/components/navigation-view/navigation-view.component.tsindex 1caa027a..42da7daa 100644--- a/frontend/src/app/common/components/navigation-view/navigation-view.component.ts+++ b/frontend/src/app/common/components/navigation-view/navigation-view.component.ts@@ -5,7 +5,7 @@*/import { KeyValuePipe } from '@angular/common'-import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'+import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { IconDefinition } from '@fortawesome/fontawesome-svg-core'import { faArrowDown, faArrowUp, faCog, faTh, faThLarge, faThList } from '@fortawesome/free-solid-svg-icons'@@ -33,6 +33,7 @@ export interface ViewMode {changeDetection: ChangeDetectionStrategy.OnPush})export class NavigationViewComponent {+ private readonly layout = inject(LayoutService)@Input() sortParams: { column: string; asc: boolean }@Input() sortFields: Record<string, string>@Output() switchView = new EventEmitter<ViewMode>()@@ -48,7 +49,7 @@ export class NavigationViewComponent {thXxl: { enabled: true, text: 'XXL', icon: faThLarge, dimensions: 232, image: 192, imageRes: 1024, faSize: 80, textSize: 13, margins: 18 }}- constructor(private readonly layout: LayoutService) {+ constructor() {this.viewsMode.tl.text = this.layout.translateString(this.viewsMode.tl.text)}diff --git a/frontend/src/app/common/components/select/select.component.ts b/frontend/src/app/common/components/select/select.component.tsindex 598908b9..5326ccf0 100644--- a/frontend/src/app/common/components/select/select.component.ts+++ b/frontend/src/app/common/components/select/select.component.ts@@ -5,7 +5,7 @@*/import { NgTemplateOutlet } from '@angular/common'-import { Component, ElementRef, EventEmitter, forwardRef, Input, OnDestroy, OnInit, Output, TemplateRef } from '@angular/core'+import { Component, ElementRef, EventEmitter, forwardRef, Input, OnDestroy, OnInit, Output, TemplateRef, inject } from '@angular/core'import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'import { DomSanitizer, SafeHtml } from '@angular/platform-browser'import { FaIconComponent } from '@fortawesome/angular-fontawesome'@@ -31,6 +31,8 @@ import { SelectItem } from './select.model']})export class SelectComponent implements OnInit, OnDestroy, ControlValueAccessor {+ private readonly sanitizer = inject(DomSanitizer)+ public element: ElementRef = inject(ElementRef)@Input({ required: true }) searchFunction: (search: string) => any@Input() customTemplateOptions: TemplateRef<any>@Input() customTemplateSelect: TemplateRef<any>@@ -53,18 +55,13 @@ export class SelectComponent implements OnInit, OnDestroy, ControlValueAccessorpublic options: SelectItem[] = []public itemObjects: SelectItem[] = []public activeOption: SelectItem- public element: ElementRefpublic inputMode = falsepublic inputValue = ''protected onChange: any = Function.prototypeprotected onTouched: any = Function.prototypeprivate behavior: GenericBehavior- public constructor(- element: ElementRef,- private readonly sanitizer: DomSanitizer- ) {- this.element = element+ public constructor() {this.clickedOutside = this.clickedOutside.bind(this)}diff --git a/frontend/src/app/common/components/storage-quota.component.ts b/frontend/src/app/common/components/storage-quota.component.tsindex 45b684cc..376b9410 100644--- a/frontend/src/app/common/components/storage-quota.component.ts+++ b/frontend/src/app/common/components/storage-quota.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core'+import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'import { FormsModule } from '@angular/forms'import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'import { TooltipModule } from 'ngx-bootstrap/tooltip'@@ -33,6 +33,7 @@ import { quotaRegexp } from '../utils/regexp'</div>`})export class StorageQuotaComponent implements OnInit {+ protected locale = inject<L10nLocale>(L10N_LOCALE)@Input() quota: number@Output() quotaChange = new EventEmitter<number>()@Input() maxWidthPercent = 75@@ -40,8 +41,6 @@ export class StorageQuotaComponent implements OnInit {protected quotaText: stringprotected invalid = false- constructor(@Inject(L10N_LOCALE) protected locale: L10nLocale) {}-ngOnInit() {if (this.fullWidth) {this.maxWidthPercent = 100diff --git a/frontend/src/app/common/components/virtual-scroll.component.ts b/frontend/src/app/common/components/virtual-scroll.component.tsindex 0d4050a6..c19479c0 100644--- a/frontend/src/app/common/components/virtual-scroll.component.ts+++ b/frontend/src/app/common/components/virtual-scroll.component.ts@@ -9,6 +9,7 @@ import {Component,ElementRef,EventEmitter,+ inject,Input,NgZone,OnChanges,@@ -58,7 +59,6 @@ import { LayoutService } from '../../layout/layout.service']})export class VirtualScrollComponent<T> implements OnInit, OnChanges, OnDestroy {- protected viewPortItems: T[] = []@ViewChild('content', { read: ElementRef, static: true }) contentElementRef: ElementRef@ViewChild('shim', { read: ElementRef, static: true }) shimElementRef: ElementRef@Output() isScrollBottom = new EventEmitter<boolean>()@@ -70,6 +70,11 @@ export class VirtualScrollComponent<T> implements OnInit, OnChanges, OnDestroy {@Input() childHeight = 35@Input() childWidth: number@Input() bufferAmount = 0+ protected viewPortItems: T[] = []+ private readonly element = inject(ElementRef)+ private readonly renderer = inject(Renderer2)+ private readonly ngZone = inject(NgZone)+ private readonly layout = inject(LayoutService)private subscriptions: Subscription[] = []private scrollbarWidth = 0private _scrollChat = new Subject<void>()@@ -90,13 +95,6 @@ export class VirtualScrollComponent<T> implements OnInit, OnChanges, OnDestroy {switchMap((state) => of(state).pipe(repeat({ count: 30, delay: 10 }))))- constructor(- private readonly element: ElementRef,- private readonly renderer: Renderer2,- private readonly ngZone: NgZone,- private readonly layout: LayoutService- ) {}-ngOnInit() {this.resizeOffsetHeight(true)this.addParentEventHandlers()diff --git a/frontend/src/app/common/directives/auto-focus.directive.ts b/frontend/src/app/common/directives/auto-focus.directive.tsindex b04ab5d3..3b08d315 100644--- a/frontend/src/app/common/directives/auto-focus.directive.ts+++ b/frontend/src/app/common/directives/auto-focus.directive.ts@@ -4,15 +4,15 @@* See the LICENSE file for licensing details*/-import { Directive, ElementRef, Input, OnInit } from '@angular/core'+import { Directive, ElementRef, Input, OnInit, inject } from '@angular/core'@Directive({ selector: '[appAutofocus]' })export class AutofocusDirective implements OnInit {+ private readonly elementRef = inject(ElementRef)+@Input() autoFocus = true@Input() autoSelect = true- constructor(private readonly elementRef: ElementRef) {}-ngOnInit() {setTimeout(() => {if (this.autoFocus) {diff --git a/frontend/src/app/common/directives/auto-resize.directive.ts b/frontend/src/app/common/directives/auto-resize.directive.tsindex c5f82405..6c46d1b0 100644--- a/frontend/src/app/common/directives/auto-resize.directive.ts+++ b/frontend/src/app/common/directives/auto-resize.directive.ts@@ -4,25 +4,24 @@* See the LICENSE file for licensing details*/-import { AfterViewInit, Directive, ElementRef, Input, OnDestroy, Renderer2 } from '@angular/core'+import { AfterViewInit, Directive, ElementRef, Input, OnDestroy, Renderer2, inject } from '@angular/core'import { skip, Subscription } from 'rxjs'import { defaultResizeOffset } from '../../layout/layout.constants'import { LayoutService } from '../../layout/layout.service'@Directive({ selector: '[appAutoResize]' })export class AutoResizeDirective implements AfterViewInit, OnDestroy {+ private readonly elementRef = inject(ElementRef)+ private readonly renderer = inject(Renderer2)+ private readonly layout = inject(LayoutService)@Input() overFlowX = 'hidden'@Input() resizeOffset: number = defaultResizeOffset@Input() useMaxHeight = trueprivate readonly resizeSubscription: Subscription- constructor(- private readonly elementRef: ElementRef,- private readonly renderer: Renderer2,- private readonly layout: LayoutService- ) {- this.renderer.setStyle(elementRef.nativeElement, 'overflow-y', 'auto')- this.renderer.setStyle(elementRef.nativeElement, 'scrollbar-width', 'thin')+ constructor() {+ this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-y', 'auto')+ this.renderer.setStyle(this.elementRef.nativeElement, 'scrollbar-width', 'thin')this.resizeSubscription = this.layout.resizeEvent.pipe(skip(1)).subscribe(() => this.onResize())}diff --git a/frontend/src/app/common/directives/input-edit.directive.ts b/frontend/src/app/common/directives/input-edit.directive.tsindex 25a01785..1c8d088a 100644--- a/frontend/src/app/common/directives/input-edit.directive.ts+++ b/frontend/src/app/common/directives/input-edit.directive.ts@@ -4,12 +4,14 @@* See the LICENSE file for licensing details*/-import { Directive, ElementRef, EventEmitter, HostListener, Input, OnInit, Output, Renderer2 } from '@angular/core'+import { Directive, ElementRef, EventEmitter, HostListener, Input, OnInit, Output, Renderer2, inject } from '@angular/core'@Directive({selector: '[appInputEdit]'})export class InputEditDirective implements OnInit {+ private readonly elementRef = inject(ElementRef)+ private readonly renderer = inject(Renderer2)@Input() inputObject: { isRenamed: boolean } & any@Input() inputField = 'name'@Input() fullWidth = false@@ -22,11 +24,6 @@ export class InputEditDirective implements OnInit {private dangerColor = '#dd4b39'private primaryColor = '#3c8dbc'- constructor(- private readonly elementRef: ElementRef,- private readonly renderer: Renderer2- ) {}-ngOnInit() {this.initStyles()this.renamingInProgress.emit(true)diff --git a/frontend/src/app/common/directives/upload-files.directive.ts b/frontend/src/app/common/directives/upload-files.directive.tsindex 8e35bcb8..401ee71f 100644--- a/frontend/src/app/common/directives/upload-files.directive.ts+++ b/frontend/src/app/common/directives/upload-files.directive.ts@@ -4,20 +4,17 @@* See the LICENSE file for licensing details*/-import { Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, Renderer2 } from '@angular/core'+import { Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, Renderer2, inject } from '@angular/core'@Directive({ selector: '[appUploadFiles]' })export class UploadFilesDirective implements OnInit, OnDestroy {+ private elementRef = inject(ElementRef)+ private readonly renderer = inject(Renderer2)@Input() options: { isMultiple?: boolean; isDirectory?: boolean }@Output() uploadFiles = new EventEmitter<{ files: File[]; isDirectory: boolean }>()private eventElement: () => void | undefinedprivate eventInput: () => void | undefined- constructor(- private elementRef: ElementRef,- private readonly renderer: Renderer2- ) {}-ngOnInit() {const input = document.createElement('input')this.renderer.setAttribute(input, 'type', 'file')diff --git a/frontend/src/app/common/pipes/join-counts.pipe.ts b/frontend/src/app/common/pipes/join-counts.pipe.tsindex e4b604fc..faea4c8f 100644--- a/frontend/src/app/common/pipes/join-counts.pipe.ts+++ b/frontend/src/app/common/pipes/join-counts.pipe.ts@@ -4,13 +4,12 @@* See the LICENSE file for licensing details*/-import { Pipe, PipeTransform } from '@angular/core'+import { Pipe, PipeTransform, inject } from '@angular/core'import { L10nTranslationService } from 'angular-l10n'@Pipe({ name: 'joinCounts' })export class JoinCountsPipe implements PipeTransform {- constructor(private readonly translate: L10nTranslationService) {}-+ private readonly translate = inject(L10nTranslationService)transform(input: Record<string, number>, ignoreKeys: string[] = []): string {let output = ''if (!input) return outputdiff --git a/frontend/src/app/common/pipes/join.pipe.ts b/frontend/src/app/common/pipes/join.pipe.tsindex acbe957f..004acbaa 100644--- a/frontend/src/app/common/pipes/join.pipe.ts+++ b/frontend/src/app/common/pipes/join.pipe.ts@@ -4,14 +4,13 @@* See the LICENSE file for licensing details*/-import { Pipe, PipeTransform } from '@angular/core'+import { Pipe, PipeTransform, inject } from '@angular/core'import { L10nTranslationService } from 'angular-l10n'import { CapitalizePipe } from './capitalize.pipe'@Pipe({ name: 'join' })export class JoinPipe implements PipeTransform {- constructor(private readonly translate: L10nTranslationService) {}-+ private readonly translate = inject(L10nTranslationService)transform(input: string[], translate = false, field: string = null, separator = ', '): string {if (!input.length) return ''const arr = (field ? input.map((item: any) => item[field]) : input.concat()).sort()diff --git a/frontend/src/app/common/pipes/linkify.pipe.ts b/frontend/src/app/common/pipes/linkify.pipe.tsindex b4b0b0f6..028a8c39 100644--- a/frontend/src/app/common/pipes/linkify.pipe.ts+++ b/frontend/src/app/common/pipes/linkify.pipe.ts@@ -4,12 +4,12 @@* See the LICENSE file for licensing details*/-import { Pipe, PipeTransform, SecurityContext } from '@angular/core'+import { inject, Pipe, PipeTransform, SecurityContext } from '@angular/core'import { DomSanitizer } from '@angular/platform-browser'@Pipe({ name: 'linkify' })export class LinkifyPipe implements PipeTransform {- constructor(private readonly sanitizer: DomSanitizer) {}+ private readonly sanitizer = inject(DomSanitizer)transform(value: any): any {return this.sanitizer.sanitize(SecurityContext.HTML, this.stylize(value))diff --git a/frontend/src/app/common/pipes/time-ago.pipe.ts b/frontend/src/app/common/pipes/time-ago.pipe.tsindex e56a14bb..45464340 100644--- a/frontend/src/app/common/pipes/time-ago.pipe.ts+++ b/frontend/src/app/common/pipes/time-ago.pipe.ts@@ -4,14 +4,15 @@* See the LICENSE file for licensing details*/-import { ChangeDetectorRef, NgZone, OnDestroy, Pipe, PipeTransform } from '@angular/core'+import { ChangeDetectorRef, NgZone, OnDestroy, Pipe, PipeTransform, inject } from '@angular/core'import { Dayjs } from 'dayjs'import { dJs } from '../utils/time'@Pipe({ name: 'amTimeAgo', pure: false })export class TimeAgoPipe implements PipeTransform, OnDestroy {+ private readonly cdRef = inject(ChangeDetectorRef)+ private ngZone = inject(NgZone)private currentTimer: number | null-private lastTime: numberprivate lastValue: anyprivate lastOmitSuffix: boolean@@ -19,11 +20,6 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy {private lastText: stringprivate formatFn: (d: Dayjs) => string- constructor(- private readonly cdRef: ChangeDetectorRef,- private ngZone: NgZone- ) {}-format(d: Dayjs) {return d.from(dJs(), this.lastOmitSuffix)}diff --git a/frontend/src/app/electron/electron.service.ts b/frontend/src/app/electron/electron.service.tsindex bb02a85a..8d5e235f 100644--- a/frontend/src/app/electron/electron.service.ts+++ b/frontend/src/app/electron/electron.service.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { effect, Injectable, NgZone } from '@angular/core'+import { effect, Injectable, NgZone, inject } from '@angular/core'import { toObservable } from '@angular/core/rxjs-interop'import { FileTask } from '@sync-in-server/backend/src/applications/files/models/file-task'import type { SyncClientAuthDto } from '@sync-in-server/backend/src/applications/sync/dtos/sync-client-auth.dto'@@ -29,14 +29,13 @@ declare global {providedIn: 'root'})export class Electron {+ private readonly ngZone = inject(NgZone)+ private readonly store = inject(StoreService)public readonly enabled = checkIfElectronApp()public readonly ipcRenderer = this.enabled ? window.ipcRenderer : nullprivate syncTasksCount: Record<number, number> = {}- constructor(- private readonly ngZone: NgZone,- private readonly store: StoreService- ) {+ constructor() {this.store.isElectronApp.set(this.enabled)if (this.enabled) {effect(() => {diff --git a/frontend/src/app/layout/breadcrumb/breadcrumb.component.ts b/frontend/src/app/layout/breadcrumb/breadcrumb.component.tsindex 17838dd7..0ceb6abc 100644--- a/frontend/src/app/layout/breadcrumb/breadcrumb.component.ts+++ b/frontend/src/app/layout/breadcrumb/breadcrumb.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { Component, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { RouterLink, RouterLinkActive } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { IconDefinition } from '@fortawesome/fontawesome-svg-core'@@ -19,12 +19,13 @@ import { BreadCrumbUrl } from './breadcrumb.interfaces'imports: [RouterLink, RouterLinkActive, FaIconComponent]})export class BreadcrumbComponent implements OnDestroy {+ private readonly layout = inject(LayoutService)protected readonly icons = { faChevronRight }protected breadcrumbIcon: IconDefinition = faHomeprotected levels: { link: string[] | string; title: string }[] = []private subscriptions: Subscription[] = []- constructor(private readonly layout: LayoutService) {+ constructor() {this.subscriptions.push(this.layout.breadcrumbNav.subscribe((url) => this.updateNav(url)))this.subscriptions.push(this.layout.breadcrumbIcon.subscribe((icon) => (this.breadcrumbIcon = icon)))}diff --git a/frontend/src/app/layout/layout.component.ts b/frontend/src/app/layout/layout.component.tsindex 8479e22d..158715f8 100644--- a/frontend/src/app/layout/layout.component.ts+++ b/frontend/src/app/layout/layout.component.ts@@ -4,8 +4,7 @@* See the LICENSE file for licensing details*/-import { DOCUMENT } from '@angular/common'-import { Component, HostListener, Inject, OnDestroy, Renderer2 } from '@angular/core'+import { Component, HostListener, OnDestroy, Renderer2, DOCUMENT, inject } from '@angular/core'import { RouterOutlet } from '@angular/router'import { Subscription } from 'rxjs'import { themeLight } from './layout.interfaces'@@ -20,6 +19,9 @@ import { SideBarRightComponent } from './sidebar/sidebar.right.component'imports: [RouterOutlet, NavBarComponent, SideBarLeftComponent, SideBarRightComponent]})export class LayoutComponent implements OnDestroy {+ private readonly document = inject<Document>(DOCUMENT)+ private readonly layout = inject(LayoutService)+ private readonly renderer = inject(Renderer2)protected themeMode = themeLightprivate rightSideBarClass = 'control-sidebar-open'private leftSideBarCollapsedClass = 'sidebar-collapse'@@ -27,11 +29,7 @@ export class LayoutComponent implements OnDestroy {private isSmallerThanMediumScreen = falseprivate subscriptions: Subscription[] = []- constructor(- @Inject(DOCUMENT) private readonly document: Document,- private readonly layout: LayoutService,- private readonly renderer: Renderer2- ) {+ constructor() {this.subscriptions.push(this.layout.switchTheme.subscribe((theme: string) => this.setTheme(theme)))this.subscriptions.push(this.layout.toggleRightSideBar.subscribe((status: boolean) => this.toggleRightSideBar(status)))this.subscriptions.push(this.layout.toggleLeftSideBar.subscribe((status) => this.toggleLeftSideBar(status)))diff --git a/frontend/src/app/layout/layout.service.ts b/frontend/src/app/layout/layout.service.tsindex 65ad368d..c9f5020d 100644--- a/frontend/src/app/layout/layout.service.ts+++ b/frontend/src/app/layout/layout.service.ts@@ -5,14 +5,14 @@*/import { HttpErrorResponse } from '@angular/common/http'-import { Injectable, NgZone } from '@angular/core'+import { Injectable, NgZone, inject } from '@angular/core'import { Title } from '@angular/platform-browser'import { IconDefinition } from '@fortawesome/fontawesome-svg-core'import { ContextMenuComponent, ContextMenuService } from '@perfectmemory/ngx-contextmenu'import { getBrowserLanguage, L10nTranslationService } from 'angular-l10n'import { BsLocaleService } from 'ngx-bootstrap/datepicker'import { BsModalService } from 'ngx-bootstrap/modal'-import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'+import { BsModalRef } from 'ngx-bootstrap/modal'import { ActiveToast, ToastrService } from 'ngx-toastr'import { BehaviorSubject, fromEvent, mergeWith, Observable, Subject } from 'rxjs'import { map } from 'rxjs/operators'@@ -30,6 +30,14 @@ declare const window: any@Injectable({ providedIn: 'root' })export class LayoutService {+ private readonly title = inject(Title)+ private readonly ngZone = inject(NgZone)+ private readonly translation = inject(L10nTranslationService)+ private readonly bsLocale = inject(BsLocaleService)+ private readonly bsModal = inject(BsModalService)+ private readonly toastr = inject(ToastrService)+ private readonly contextMenu = inject<ContextMenuService<any>>(ContextMenuService)+ private readonly electron = inject(Electron)public currentRightSideBarTab: string | null = null// Resize eventpublic resizeEvent = new BehaviorSubject<void | null>(null)@@ -69,16 +77,7 @@ export class LayoutService {private modalIDS: (number | string)[] = []private readonly dialogConfig = { animated: true, keyboard: true, backdrop: true, ignoreBackdropClick: true }- constructor(- private readonly title: Title,- private readonly ngZone: NgZone,- private readonly translation: L10nTranslationService,- private readonly bsLocale: BsLocaleService,- private readonly bsModal: BsModalService,- private readonly toastr: ToastrService,- private readonly contextMenu: ContextMenuService<any>,- private readonly electron: Electron- ) {+ constructor() {this.title.setTitle(APP_NAME)this.preferTheme.subscribe((theme) => this.setTheme(theme))}diff --git a/frontend/src/app/layout/navbar/navbar.component.ts b/frontend/src/app/layout/navbar/navbar.component.tsindex 8d88b7dd..bf205131 100644--- a/frontend/src/app/layout/navbar/navbar.component.ts+++ b/frontend/src/app/layout/navbar/navbar.component.ts@@ -5,7 +5,7 @@*/import { Location } from '@angular/common'-import { Component, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faAngleLeft, faAngleRight } from '@fortawesome/free-solid-svg-icons'import { USER_ONLINE_STATUS_LIST } from '@sync-in-server/backend/src/applications/users/constants/user'@@ -22,17 +22,16 @@ import { LayoutService } from '../layout.service'imports: [BreadcrumbComponent, FaIconComponent]})export class NavBarComponent implements OnDestroy {+ private readonly location = inject(Location)+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)private subscriptions: Subscription[] = []protected readonly allOnlineStatus = USER_ONLINE_STATUS_LISTprotected readonly icons = { faAngleLeft, faAngleRight }protected user: UserTypeprotected userAvatar: string = null- constructor(- private readonly location: Location,- private readonly layout: LayoutService,- private readonly store: StoreService- ) {+ constructor() {this.subscriptions.push(this.store.user.subscribe((user: UserType) => (this.user = user)))this.subscriptions.push(this.store.userAvatarUrl.subscribe((avatarUrl) => (this.userAvatar = avatarUrl)))}diff --git a/frontend/src/app/layout/sidebar/components/selection.component.ts b/frontend/src/app/layout/sidebar/components/selection.component.tsindex 5a208b88..481b0a42 100644--- a/frontend/src/app/layout/sidebar/components/selection.component.ts+++ b/frontend/src/app/layout/sidebar/components/selection.component.ts@@ -4,7 +4,7 @@* See the LICENSE file for licensing details*/-import { ChangeDetectionStrategy, Component, computed, Signal } from '@angular/core'+import { ChangeDetectionStrategy, Component, computed, Signal, inject } from '@angular/core'import { FilesSelectionComponent } from '../../../applications/files/components/sidebar/files-selection.component'import { LinkSelectionComponent } from '../../../applications/links/components/sidebar/link-selection.component'import { ShareSelectionComponent } from '../../../applications/shares/components/sidebar/share-selection.component'@@ -20,11 +20,10 @@ import { StoreService } from '../../../store/store.service'templateUrl: 'selection.component.html'})export class SelectionComponent {+ protected readonly store = inject(StoreService)protected SPACES_PATH = SPACES_PATHprotected selectionType: Signal<(typeof SPACES_PATH)[keyof typeof SPACES_PATH]> = computed(() => this.setRepository(this.store.repository()))- constructor(protected readonly store: StoreService) {}-private setRepository(repository: string) {if ([SPACES_PATH.SPACES, SPACES_PATH.SHARED, SPACES_PATH.LINKS, SPACES_PATH.TRASHES].indexOf(repository) > -1) {return repositorydiff --git a/frontend/src/app/layout/sidebar/components/windows.component.ts b/frontend/src/app/layout/sidebar/components/windows.component.tsindex 695f182e..862f0d2e 100755--- a/frontend/src/app/layout/sidebar/components/windows.component.ts+++ b/frontend/src/app/layout/sidebar/components/windows.component.ts@@ -5,7 +5,7 @@*/import { NgOptimizedImage } from '@angular/common'-import { Component, OnDestroy } from '@angular/core'+import { Component, OnDestroy, inject } from '@angular/core'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faTimes, faXmark } from '@fortawesome/free-solid-svg-icons'import { L10nTranslateDirective } from 'angular-l10n'@@ -20,11 +20,12 @@ import { LayoutService } from '../../layout.service'templateUrl: 'windows.component.html'})export class WindowsComponent implements OnDestroy {+ private readonly layout = inject(LayoutService)protected readonly icons = { faXmark, faTimes }protected windows: AppWindow[] = []private readonly subscription: Subscription = null- constructor(private readonly layout: LayoutService) {+ constructor() {this.subscription = this.layout.minimizedWindows.subscribe((windows: AppWindow[]) => this.setWindows(windows))}diff --git a/frontend/src/app/layout/sidebar/sidebar.left.component.ts b/frontend/src/app/layout/sidebar/sidebar.left.component.tsindex 99ae3037..5b25616f 100644--- a/frontend/src/app/layout/sidebar/sidebar.left.component.ts+++ b/frontend/src/app/layout/sidebar/sidebar.left.component.ts@@ -5,7 +5,7 @@*/import { AsyncPipe, Location, NgComponentOutlet, NgTemplateOutlet } from '@angular/common'-import { Component, ElementRef, OnDestroy, Renderer2, ViewChild } from '@angular/core'+import { Component, ElementRef, OnDestroy, Renderer2, ViewChild, inject } from '@angular/core'import { ResolveEnd, Router, RouterLink } from '@angular/router'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faAngleLeft, faAngleRight, faUserSecret } from '@fortawesome/free-solid-svg-icons'@@ -33,6 +33,13 @@ import { LayoutService } from '../layout.service'imports: [RouterLink, FaIconComponent, AutoResizeDirective, L10nTranslateDirective, NgComponentOutlet, AsyncPipe, NgTemplateOutlet]})export class SideBarLeftComponent implements OnDestroy {+ protected readonly store = inject(StoreService)+ private readonly router = inject(Router)+ private readonly renderer = inject(Renderer2)+ private readonly location = inject(Location)+ private readonly authService = inject(AuthService)+ private readonly layout = inject(LayoutService)+ private readonly userService = inject(UserService)@ViewChild('sidebar', { static: true }) sidebar: ElementRefprivate subscriptions: Subscription[] = []private menuAppsHovered = false@@ -49,15 +56,7 @@ export class SideBarLeftComponent implements OnDestroy {protected currentMenu: AppMenuprotected appsMenu: AppMenu = APP_MENU- constructor(- protected readonly store: StoreService,- private readonly router: Router,- private readonly renderer: Renderer2,- private readonly location: Location,- private readonly authService: AuthService,- private readonly layout: LayoutService,- private readonly userService: UserService- ) {+ constructor() {this.appName = APP_NAMEthis.appVersion = APP_VERSIONthis.appsMenu.submenus = [SPACES_MENU, SEARCH_MENU, SYNC_MENU, USER_MENU, ADMIN_MENU]diff --git a/frontend/src/app/layout/sidebar/sidebar.right.component.ts b/frontend/src/app/layout/sidebar/sidebar.right.component.tsindex 3df79127..afe52673 100644--- a/frontend/src/app/layout/sidebar/sidebar.right.component.ts+++ b/frontend/src/app/layout/sidebar/sidebar.right.component.ts@@ -5,7 +5,7 @@*/import { AsyncPipe, NgComponentOutlet } from '@angular/common'-import { Component, computed, OnDestroy } from '@angular/core'+import { Component, computed, OnDestroy, inject } from '@angular/core'import { toObservable } from '@angular/core/rxjs-interop'import { FaIconComponent } from '@fortawesome/angular-fontawesome'import { faBell, faFlag, faUser, faWindowRestore } from '@fortawesome/free-regular-svg-icons'@@ -30,6 +30,8 @@ import { WindowsComponent } from './components/windows.component'templateUrl: 'sidebar.right.component.html'})export class SideBarRightComponent implements OnDestroy {+ private readonly layout = inject(LayoutService)+ private readonly store = inject(StoreService)protected visible = falseprotected showComponents = falseprotected tabs: TabMenu[] = []@@ -92,10 +94,7 @@ export class SideBarRightComponent implements OnDestroy {}]- constructor(- private readonly layout: LayoutService,- private readonly store: StoreService- ) {+ constructor() {this.tabs = [...this.firstsTabs, ...this.lastsTabs]this.subscriptions.push(this.layout.rightSideBarIsOpen.subscribe((state: boolean) => this.setVisible(state)))this.subscriptions.push(this.layout.rightSideBarSetTabs.subscribe((menuTabs: { name: TAB_GROUP; tabs: TabMenu[] }) => this.setTabs(menuTabs)))