mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-22 00:52:42 -05:00
Feature: support sorting sidebar saved views (#4381)
This commit is contained in:
@@ -29,22 +29,7 @@ export class DashboardComponent extends ComponentWithPermissions {
|
||||
super()
|
||||
|
||||
this.savedViewService.listAll().subscribe(() => {
|
||||
const sorted: number[] = this.settingsService.get(
|
||||
SETTINGS_KEYS.DASHBOARD_VIEWS_SORT_ORDER
|
||||
)
|
||||
this.dashboardViews =
|
||||
sorted?.length > 0
|
||||
? sorted
|
||||
.map((id) =>
|
||||
this.savedViewService.dashboardViews.find((v) => v.id === id)
|
||||
)
|
||||
.concat(
|
||||
this.savedViewService.dashboardViews.filter(
|
||||
(v) => !sorted.includes(v.id)
|
||||
)
|
||||
)
|
||||
.filter((v) => v)
|
||||
: [...this.savedViewService.dashboardViews]
|
||||
this.dashboardViews = this.savedViewService.dashboardViews
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user