Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Merge branch 'dev' into feature/slim-sidebar

Michael Shamoona246b3b59830
diff --cc src-ui/src/app/components/app-frame/app-frame.component.html
index 2ff57ed37,8f94f80aa..7d003225d
--- a/src-ui/src/app/components/app-frame/app-frame.component.html
+++ b/src-ui/src/app/components/app-frame/app-frame.component.html
@@@ -204,10 -197,10 +204,10 @@@
</a>
</div>
</li>
- <li class="nav-item mt-2">
+ <li class="nav-item mt-2" [class.visually-hidden]="slimSidebarEnabled">
<div class="px-3 py-2 text-muted small d-flex align-items-center flex-wrap">
<div class="me-3">{{ versionString }}</div>
- <div *ngIf="appRemoteVersion" class="version-check">
+ <div *ngIf="!settingsService.updateCheckingIsSet || appRemoteVersion" class="version-check">
<ng-template #updateAvailablePopContent>
<span class="small">Paperless-ngx {{ appRemoteVersion.version }} <ng-container i18n>is available.</ng-container><br/><ng-container i18n>Click to view.</ng-container></span>
</ng-template>
diff --cc src-ui/src/app/components/manage/settings/settings.component.ts
index dcdb6bc64,0cf336a01..e033bdc6a
--- a/src-ui/src/app/components/manage/settings/settings.component.ts
+++ b/src-ui/src/app/components/manage/settings/settings.component.ts
@@@ -9,9 -16,18 +16,19 @@@ import
} from 'src/app/services/settings.service'
import { Toast, ToastService } from 'src/app/services/toast.service'
import { dirtyCheck, DirtyComponent } from '@ngneat/dirty-check-forms'
- import { Observable, Subscription, BehaviorSubject, first } from 'rxjs'
+ import {
+ Observable,
+ Subscription,
+ BehaviorSubject,
+ first,
+ tap,
+ takeUntil,
+ Subject,
+ } from 'rxjs'
import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings'
+ import { ActivatedRoute } from '@angular/router'
+ import { ViewportScroller } from '@angular/common'
+import { ForwardRefHandling } from '@angular/compiler'
@Component({
selector: 'app-settings',
@@@ -80,8 -91,25 +93,16 @@@ export class SettingsComponen
})
}
+ ngAfterViewInit(): void {
+ if (this.activatedRoute.snapshot.fragment) {
+ this.viewportScroller.scrollToAnchor(
+ this.activatedRoute.snapshot.fragment
+ )
+ }
+ }
+
- ngOnInit() {
- this.savedViewService.listAll().subscribe((r) => {
- this.savedViews = r.results
- this.initialize()
- })
- }
-
- initialize() {
- this.unsubscribeNotifier.next(true)
-
- let storeData = {
+ private getCurrentSettings() {
+ return {
bulkEditConfirmationDialogs: this.settings.get(
SETTINGS_KEYS.BULK_EDIT_CONFIRMATION_DIALOGS
),
@@@ -118,43 -145,42 +138,55 @@@
SETTINGS_KEYS.NOTIFICATIONS_CONSUMER_SUPPRESS_ON_DASHBOARD
),
commentsEnabled: this.settings.get(SETTINGS_KEYS.COMMENTS_ENABLED),
+ updateCheckingEnabled: this.settings.get(
+ SETTINGS_KEYS.UPDATE_CHECKING_ENABLED
+ ),
}
+ }
+
+ ngOnInit() {
+ this.savedViewService.listAll().subscribe((r) => {
+ this.savedViews = r.results
- let storeData = this.getCurrentSettings()
++ this.initialize()
++ })
++ }
+
- for (let view of this.savedViews) {
- storeData.savedViews[view.id.toString()] = {
- id: view.id,
- name: view.name,
- show_on_dashboard: view.show_on_dashboard,
- show_in_sidebar: view.show_in_sidebar,
- }
- this.savedViewGroup.addControl(
- view.id.toString(),
- new FormGroup({
- id: new FormControl(null),
- name: new FormControl(null),
- show_on_dashboard: new FormControl(null),
- show_in_sidebar: new FormControl(null),
- })
- )
++ initialize() {
++ this.unsubscribeNotifier.next(true)
++
++ let storeData = this.getCurrentSettings()
+
+ for (let view of this.savedViews) {
+ storeData.savedViews[view.id.toString()] = {
+ id: view.id,
+ name: view.name,
+ show_on_dashboard: view.show_on_dashboard,
+ show_in_sidebar: view.show_in_sidebar,
}
+ this.savedViewGroup.addControl(
+ view.id.toString(),
+ new FormGroup({
+ id: new FormControl(null),
+ name: new FormControl(null),
+ show_on_dashboard: new FormControl(null),
+ show_in_sidebar: new FormControl(null),
+ })
+ )
+ }
- this.store = new BehaviorSubject(storeData)
+ this.store = new BehaviorSubject(storeData)
- this.storeSub = this.store.asObservable().subscribe((state) => {
- this.settingsForm.patchValue(state, { emitEvent: false })
- })
+ this.storeSub = this.store.asObservable().subscribe((state) => {
+ this.settingsForm.patchValue(state, { emitEvent: false })
+ })
- // Initialize dirtyCheck
- this.isDirty$ = dirtyCheck(this.settingsForm, this.store.asObservable())
+ // Initialize dirtyCheck
+ this.isDirty$ = dirtyCheck(this.settingsForm, this.store.asObservable())
- // Record dirty in case we need to 'undo' appearance settings if not saved on close
- this.isDirty$.subscribe((dirty) => {
+ // Record dirty in case we need to 'undo' appearance settings if not saved on close
+ this.isDirty$
+ .pipe(takeUntil(this.unsubscribeNotifier))
+ .subscribe((dirty) => {
this.isDirty = dirty
})
diff --cc src-ui/src/app/data/paperless-uisettings.ts
index a5fdef51f,b32315e62..403d11f08
--- a/src-ui/src/app/data/paperless-uisettings.ts
+++ b/src-ui/src/app/data/paperless-uisettings.ts
@@@ -37,7 -37,9 +37,10 @@@ export const SETTINGS_KEYS =
NOTIFICATIONS_CONSUMER_SUPPRESS_ON_DASHBOARD:
'general-settings:notifications:consumer-suppress-on-dashboard',
COMMENTS_ENABLED: 'general-settings:comments-enabled',
+ SLIM_SIDEBAR: 'general-settings:slim-sidebar',
+ UPDATE_CHECKING_ENABLED: 'general-settings:update-checking:enabled',
+ UPDATE_CHECKING_BACKEND_SETTING:
+ 'general-settings:update-checking:backend-setting',
}
export const SETTINGS: PaperlessUiSetting[] = [