Load saved views from app frame, not dashboard

This commit is contained in:
shamoon 2023-04-27 08:20:21 -07:00
parent d3e14818df
commit 757b61a010
2 changed files with 16 additions and 16 deletions

View File

@ -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 {

View File

@ -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() {