From 8bd4a1edcccdbf3bc97d261e9acf20ccf5849487 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Oct 2022 09:10:07 +0200 Subject: Fix import link --- .../my-video-channel-syncs/my-video-channel-syncs.component.ts | 7 ++++--- .../app/shared/shared-main/buttons/action-dropdown.component.html | 2 +- .../app/shared/shared-main/buttons/action-dropdown.component.ts | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts index 5d5cc6dea..d18e78201 100644 --- a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts +++ b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts @@ -1,10 +1,10 @@ +import { SortMeta } from 'primeng/api' +import { mergeMap } from 'rxjs' import { Component, OnInit } from '@angular/core' import { AuthService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' import { DropdownAction, VideoChannelService, VideoChannelSyncService } from '@app/shared/shared-main' import { HTMLServerConfig } from '@shared/models/server' import { VideoChannelSync, VideoChannelSyncState } from '@shared/models/videos' -import { SortMeta } from 'primeng/api' -import { mergeMap } from 'rxjs' @Component({ templateUrl: './my-video-channel-syncs.component.html', @@ -47,7 +47,8 @@ export class MyVideoChannelSyncsComponent extends RestTable implements OnInit { [ { label: $localize`List imports`, - linkBuilder: (videoChannelSync) => [ `/my-library/video-imports?search=videoChannelSyncId:${videoChannelSync.id}` ], + linkBuilder: () => [ '/my-library/video-imports' ], + queryParamsBuilder: sync => ({ search: `videoChannelSyncId:${sync.id}` }), iconName: 'cloud-download' } ], diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html index 37cf63fcd..cdcfb9a48 100644 --- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html @@ -26,7 +26,7 @@ diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts index 749773f8a..ad55677d8 100644 --- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts @@ -1,4 +1,5 @@ import { Component, Input } from '@angular/core' +import { Params } from '@angular/router' import { GlobalIconName } from '@app/shared/shared-icons' export type DropdownAction = { @@ -7,7 +8,10 @@ export type DropdownAction = { description?: string title?: string handler?: (a: T) => any + linkBuilder?: (a: T) => (string | number)[] + queryParamsBuilder?: (a: T) => Params + isDisplayed?: (a: T) => boolean class?: string[] -- cgit v1.2.3