From bca6d58676b37c87d38f471c9b03d1964883abf4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Dec 2023 10:14:55 +0100 Subject: [PATCH] Automatically filter on local videos in admin We expect admins will mostly want to act on local videos --- client/src/app/+admin/admin.component.ts | 3 +++ .../shared/shared-main/misc/top-menu-dropdown.component.html | 1 + .../app/shared/shared-main/misc/top-menu-dropdown.component.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index c0d7db99e..71c2d94d1 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts @@ -57,6 +57,9 @@ export class AdminComponent implements OnInit { overviewItems.children.push({ label: $localize`Videos`, routerLink: '/admin/videos', + queryParams: { + search: 'isLocal:true' + }, iconName: 'videos' }) } diff --git a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html index 617d72efd..8d7864666 100644 --- a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html +++ b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html @@ -30,6 +30,7 @@ *ngIf="isDisplayed(menuChild)" ngbDropdownItem [ngClass]="{ icon: hasIcons }" routerLinkActive="active" ariaCurrentWhenActive="page" [routerLink]="menuChild.routerLink" #routerLink (click)="onActiveLinkScrollToTop(routerLink)" + [queryParams]="menuChild.queryParams" > diff --git a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts index a8cc9b593..19f1f7d41 100644 --- a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts +++ b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts @@ -15,6 +15,7 @@ export type TopMenuDropdownParam = { children?: { label: string routerLink: string + queryParams?: { [id: string]: string } iconName?: GlobalIconName isDisplayed?: () => boolean // Default: () => true