mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-21 04:52:40 +00:00
Chorehancement: update to Angular v22, 'zoneless' / 'reactive' (#13114)
This commit is contained in:
1 parent
f244442c65
commit
106b41a15c
213 files changed
+5363
-5842
No files matched your search
+3
-3
@@ -1,17 +1,17 @@
|
||||
@if (loading) {
|
||||
@if (loading()) {
|
||||
<div class="d-flex">
|
||||
<output class="spinner-border spinner-border-sm fw-normal" role="status"></output>
|
||||
</div>
|
||||
} @else {
|
||||
<ul class="list-group">
|
||||
@if (entries.length === 0) {
|
||||
@if (entries().length === 0) {
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-center">
|
||||
<span class="fst-italic" i18n>No entries found.</span>
|
||||
</div>
|
||||
</li>
|
||||
} @else {
|
||||
@for (entry of entries; track entry.id) {
|
||||
@for (entry of entries(); track entry.id) {
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<ng-template #timestamp>
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
import { AsyncPipe, KeyValuePipe, TitleCasePipe } from '@angular/common'
|
||||
import { Component, Input, OnInit, inject } from '@angular/core'
|
||||
import { Component, Input, OnInit, inject, signal } from '@angular/core'
|
||||
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
|
||||
import { Observable, first, map, of, shareReplay } from 'rxjs'
|
||||
@@ -44,8 +44,8 @@ export class DocumentHistoryComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
public loading: boolean = true
|
||||
public entries: AuditLogEntry[] = []
|
||||
readonly loading = signal(true)
|
||||
readonly entries = signal<AuditLogEntry[]>([])
|
||||
|
||||
private readonly prettyNameCache = new Map<string, Observable<string>>()
|
||||
|
||||
@@ -55,10 +55,10 @@ export class DocumentHistoryComponent implements OnInit {
|
||||
|
||||
private loadHistory(): void {
|
||||
if (this._documentId) {
|
||||
this.loading = true
|
||||
this.loading.set(true)
|
||||
this.documentService.getHistory(this._documentId).subscribe((entries) => {
|
||||
this.entries = entries
|
||||
this.loading = false
|
||||
this.entries.set(entries)
|
||||
this.loading.set(false)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user