mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-12 17:47:08 +01:00
Feature: support sorting sidebar saved views (#4381)
This commit is contained in:
parent
999ae678c2
commit
9880f9ebc7
18 changed files with 397 additions and 147 deletions
|
|
@ -24,7 +24,6 @@ import {
|
|||
} from '../data/paperless-uisettings'
|
||||
import { PaperlessUser } from '../data/paperless-user'
|
||||
import { PermissionsService } from './permissions.service'
|
||||
import { SavedViewService } from './rest/saved-view.service'
|
||||
import { ToastService } from './toast.service'
|
||||
import { PaperlessSavedView } from '../data/paperless-saved-view'
|
||||
|
||||
|
|
@ -55,8 +54,11 @@ export class SettingsService {
|
|||
return this._renderer
|
||||
}
|
||||
|
||||
public dashboardIsEmpty: boolean = false
|
||||
|
||||
public globalDropzoneEnabled: boolean = true
|
||||
public globalDropzoneActive: boolean = false
|
||||
public organizingSidebarSavedViews: boolean = false
|
||||
|
||||
constructor(
|
||||
rendererFactory: RendererFactory2,
|
||||
|
|
@ -66,7 +68,6 @@ export class SettingsService {
|
|||
@Inject(LOCALE_ID) private localeId: string,
|
||||
protected http: HttpClient,
|
||||
private toastService: ToastService,
|
||||
private savedViewService: SavedViewService,
|
||||
private permissionsService: PermissionsService
|
||||
) {
|
||||
this._renderer = rendererFactory.createRenderer(null, null)
|
||||
|
|
@ -515,11 +516,7 @@ export class SettingsService {
|
|||
}
|
||||
|
||||
offerTour(): boolean {
|
||||
return (
|
||||
!this.savedViewService.loading &&
|
||||
this.savedViewService.dashboardViews.length == 0 &&
|
||||
!this.get(SETTINGS_KEYS.TOUR_COMPLETE)
|
||||
)
|
||||
return this.dashboardIsEmpty && !this.get(SETTINGS_KEYS.TOUR_COMPLETE)
|
||||
}
|
||||
|
||||
completeTour() {
|
||||
|
|
@ -544,4 +541,11 @@ export class SettingsService {
|
|||
])
|
||||
return this.storeSettings()
|
||||
}
|
||||
|
||||
updateSidebarViewsSort(sidebarViews: PaperlessSavedView[]): Observable<any> {
|
||||
this.set(SETTINGS_KEYS.SIDEBAR_VIEWS_SORT_ORDER, [
|
||||
...new Set(sidebarViews.map((v) => v.id)),
|
||||
])
|
||||
return this.storeSettings()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue