mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-09 13:35:10 +00:00
Update some global components with loading signals
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
moveItemInArray,
|
||||
} from '@angular/cdk/drag-drop'
|
||||
import { NgClass } from '@angular/common'
|
||||
import { Component, HostListener, inject, OnInit } from '@angular/core'
|
||||
import { Component, HostListener, inject, OnInit, signal } from '@angular/core'
|
||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router'
|
||||
import {
|
||||
NgbCollapseModule,
|
||||
@@ -90,16 +90,48 @@ export class AppFrameComponent
|
||||
permissionsService = inject(PermissionsService)
|
||||
private djangoMessagesService = inject(DjangoMessagesService)
|
||||
|
||||
appRemoteVersion: AppRemoteVersion
|
||||
private appRemoteVersionSignal = signal<AppRemoteVersion>(null)
|
||||
|
||||
isMenuCollapsed: boolean = true
|
||||
private isMenuCollapsedSignal = signal(true)
|
||||
|
||||
slimSidebarAnimating: boolean = false
|
||||
private slimSidebarAnimatingSignal = signal(false)
|
||||
|
||||
public mobileSearchHidden: boolean = false
|
||||
private mobileSearchHiddenSignal = signal(false)
|
||||
|
||||
private lastScrollY: number = 0
|
||||
|
||||
get appRemoteVersion(): AppRemoteVersion {
|
||||
return this.appRemoteVersionSignal()
|
||||
}
|
||||
|
||||
set appRemoteVersion(value: AppRemoteVersion) {
|
||||
this.appRemoteVersionSignal.set(value)
|
||||
}
|
||||
|
||||
get isMenuCollapsed(): boolean {
|
||||
return this.isMenuCollapsedSignal()
|
||||
}
|
||||
|
||||
set isMenuCollapsed(value: boolean) {
|
||||
this.isMenuCollapsedSignal.set(value)
|
||||
}
|
||||
|
||||
get slimSidebarAnimating(): boolean {
|
||||
return this.slimSidebarAnimatingSignal()
|
||||
}
|
||||
|
||||
set slimSidebarAnimating(value: boolean) {
|
||||
this.slimSidebarAnimatingSignal.set(value)
|
||||
}
|
||||
|
||||
get mobileSearchHidden(): boolean {
|
||||
return this.mobileSearchHiddenSignal()
|
||||
}
|
||||
|
||||
set mobileSearchHidden(value: boolean) {
|
||||
this.mobileSearchHiddenSignal.set(value)
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
const permissionsService = this.permissionsService
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
ViewChild,
|
||||
ViewChildren,
|
||||
inject,
|
||||
signal,
|
||||
} from '@angular/core'
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
|
||||
import { Router } from '@angular/router'
|
||||
@@ -82,12 +83,36 @@ export class GlobalSearchComponent implements OnInit {
|
||||
private locationStrategy = inject(LocationStrategy)
|
||||
|
||||
public DataType = DataType
|
||||
public query: string
|
||||
private querySignal = signal<string>(null)
|
||||
public queryDebounce: Subject<string>
|
||||
public searchResults: GlobalSearchResult
|
||||
private searchResultsSignal = signal<GlobalSearchResult>(null)
|
||||
private currentItemIndex: number = -1
|
||||
private domIndex: number = -1
|
||||
public loading: boolean = false
|
||||
private loadingSignal = signal(false)
|
||||
|
||||
public get query(): string {
|
||||
return this.querySignal()
|
||||
}
|
||||
|
||||
public set query(value: string) {
|
||||
this.querySignal.set(value)
|
||||
}
|
||||
|
||||
public get searchResults(): GlobalSearchResult {
|
||||
return this.searchResultsSignal()
|
||||
}
|
||||
|
||||
public set searchResults(value: GlobalSearchResult) {
|
||||
this.searchResultsSignal.set(value)
|
||||
}
|
||||
|
||||
public get loading(): boolean {
|
||||
return this.loadingSignal()
|
||||
}
|
||||
|
||||
public set loading(value: boolean) {
|
||||
this.loadingSignal.set(value)
|
||||
}
|
||||
|
||||
@ViewChild('searchInput') searchInput: ElementRef
|
||||
@ViewChild('resultsDropdown') resultsDropdown: NgbDropdown
|
||||
|
||||
Reference in New Issue
Block a user