From 757b61a0101da1eaf22b9aec3fdbf9513c1218f9 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:20:21 -0700 Subject: [PATCH] Load saved views from app frame, not dashboard --- .../components/app-frame/app-frame.component.ts | 17 ++++++++++++++++- .../components/dashboard/dashboard.component.ts | 15 --------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src-ui/src/app/components/app-frame/app-frame.component.ts b/src-ui/src/app/components/app-frame/app-frame.component.ts index 7167bce44..24b7e8f23 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.ts +++ b/src-ui/src/app/components/app-frame/app-frame.component.ts @@ -27,6 +27,11 @@ import { ComponentCanDeactivate } from 'src/app/guards/dirty-doc.guard' import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings' import { ToastService } from 'src/app/services/toast.service' import { ComponentWithPermissions } from '../with-permissions/with-permissions.component' +import { + PermissionAction, + PermissionsService, + PermissionType, +} from 'src/app/services/permissions.service' @Component({ selector: 'app-app-frame', @@ -47,9 +52,19 @@ export class AppFrameComponent private list: DocumentListViewService, public settingsService: SettingsService, public tasksService: TasksService, - private readonly toastService: ToastService + private readonly toastService: ToastService, + private permissionsService: PermissionsService ) { super() + + if ( + permissionsService.currentUserCan( + PermissionAction.View, + PermissionType.SavedView + ) + ) { + savedViewService.initialize() + } } ngOnInit(): void { diff --git a/src-ui/src/app/components/dashboard/dashboard.component.ts b/src-ui/src/app/components/dashboard/dashboard.component.ts index 271e2cf14..de3c5c969 100644 --- a/src-ui/src/app/components/dashboard/dashboard.component.ts +++ b/src-ui/src/app/components/dashboard/dashboard.component.ts @@ -1,9 +1,4 @@ import { Component } from '@angular/core' -import { - PermissionAction, - PermissionsService, - PermissionType, -} from 'src/app/services/permissions.service' import { SavedViewService } from 'src/app/services/rest/saved-view.service' import { SettingsService } from 'src/app/services/settings.service' import { ComponentWithPermissions } from '../with-permissions/with-permissions.component' @@ -16,19 +11,9 @@ import { ComponentWithPermissions } from '../with-permissions/with-permissions.c export class DashboardComponent extends ComponentWithPermissions { constructor( public settingsService: SettingsService, - private permissionsService: PermissionsService, public savedViewService: SavedViewService ) { super() - - if ( - permissionsService.currentUserCan( - PermissionAction.View, - PermissionType.SavedView - ) - ) { - savedViewService.initialize() - } } get subtitle() {