Feature: support sorting sidebar saved views (#4381)

This commit is contained in:
shamoon
2023-10-19 19:41:01 -07:00
committed by GitHub
parent 999ae678c2
commit 9880f9ebc7
18 changed files with 397 additions and 147 deletions

View File

@@ -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
})
}