Chorehancement: update to Angular v22, 'zoneless' / 'reactive' (#13114)

This commit is contained in:
shamoon
2026-07-10 00:42:16 -07:00
committed by GitHub
parent f244442c65
commit 106b41a15c
213 changed files with 5363 additions and 5842 deletions
@@ -5,7 +5,7 @@ import {
DragDropModule,
moveItemInArray,
} from '@angular/cdk/drag-drop'
import { Component, inject } from '@angular/core'
import { Component, inject, signal } from '@angular/core'
import { RouterModule } from '@angular/router'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { TourNgBootstrap, TourService } from 'ngx-ui-tour-ng-bootstrap'
@@ -47,12 +47,12 @@ export class DashboardComponent extends ComponentWithPermissions {
private tourService = inject(TourService)
private toastService = inject(ToastService)
public dashboardViews: SavedView[] = []
readonly dashboardViews = signal<SavedView[]>([])
constructor() {
super()
this.savedViewService.listAll().subscribe(() => {
this.dashboardViews = this.savedViewService.dashboardViews
this.dashboardViews.set(this.savedViewService.dashboardViews)
})
}
@@ -73,22 +73,20 @@ export class DashboardComponent extends ComponentWithPermissions {
}
onDragStart(event: CdkDragStart) {
this.settingsService.globalDropzoneEnabled = false
this.settingsService.globalDropzoneEnabled.set(false)
}
onDragEnd(event: CdkDragEnd) {
this.settingsService.globalDropzoneEnabled = true
this.settingsService.globalDropzoneEnabled.set(true)
}
onDrop(event: CdkDragDrop<SavedView[]>) {
moveItemInArray(
this.dashboardViews,
event.previousIndex,
event.currentIndex
)
const dashboardViews = [...this.dashboardViews()]
moveItemInArray(dashboardViews, event.previousIndex, event.currentIndex)
this.dashboardViews.set(dashboardViews)
this.settingsService
.updateDashboardViewsSort(this.dashboardViews)
.updateDashboardViewsSort(this.dashboardViews())
.subscribe({
next: () => {
this.toastService.showInfo($localize`Dashboard updated`)