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 61d0459e3c
commit f9bf35147c
18 changed files with 397 additions and 147 deletions

View File

@@ -1,19 +1,3 @@
.col-sidebar .row {
top: 3.5rem;
}
:host ::ng-deep {
.cdk-drag-placeholder {
opacity: .5;
}
/* Animate items as they're being sorted. */
.cdk-drop-list-dragging .cdk-drag {
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}
/* Animate an item that has been dropped. */
.cdk-drag-animating {
transition: transform 300ms cubic-bezier(0, 0, 0.2, 1);
}
}

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

View File

@@ -17,7 +17,7 @@
<div class="d-flex justify-content-between align-items-center my-2">
<div class="progress flex-grow-1">
<div *ngFor="let filetype of statistics?.document_file_type_counts; let i = index; let last = last"
class="progress-bar bg-primary text-primary-contrast"
class="progress-bar bg-primary"
role="progressbar"
[ngbPopover]="getFileTypeName(filetype)"
i18n-ngbPopover

View File

@@ -1,4 +1,4 @@
<ngb-alert class="pe-3" type="primary" [dismissible]="true" (closed)="dismiss.emit(true)">
<ngb-alert class="pe-3 text-primary-contrast" type="primary" [dismissible]="true" (closed)="dismiss.emit(true)">
<h4 class="alert-heading"><ng-container i18n>Paperless-ngx is running!</ng-container> 🎉</h4>
<p i18n>You're ready to start uploading documents! Explore the various features of this web app on your own, or start a quick tour using the button below.</p>
<p i18n>More detail on how to use and configure Paperless-ngx is always available in the <a href="https://docs.paperless-ngx.com" target="_blank">documentation</a>.</p>