diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-12 09:10:07 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-10-12 09:10:07 +0200 |
commit | 8bd4a1edcccdbf3bc97d261e9acf20ccf5849487 (patch) | |
tree | de09006d851d780f64185bc37cb9392295b636ea /client/src/app | |
parent | 3d5d2deef5e8f26b009723db5addb0dcb90aa71d (diff) | |
download | PeerTube-8bd4a1edcccdbf3bc97d261e9acf20ccf5849487.tar.gz PeerTube-8bd4a1edcccdbf3bc97d261e9acf20ccf5849487.tar.zst PeerTube-8bd4a1edcccdbf3bc97d261e9acf20ccf5849487.zip |
Fix import link
Diffstat (limited to 'client/src/app')
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 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
2 | import { mergeMap } from 'rxjs' | ||
1 | import { Component, OnInit } from '@angular/core' | 3 | import { Component, OnInit } from '@angular/core' |
2 | import { AuthService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' | 4 | import { AuthService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' |
3 | import { DropdownAction, VideoChannelService, VideoChannelSyncService } from '@app/shared/shared-main' | 5 | import { DropdownAction, VideoChannelService, VideoChannelSyncService } from '@app/shared/shared-main' |
4 | import { HTMLServerConfig } from '@shared/models/server' | 6 | import { HTMLServerConfig } from '@shared/models/server' |
5 | import { VideoChannelSync, VideoChannelSyncState } from '@shared/models/videos' | 7 | import { VideoChannelSync, VideoChannelSyncState } from '@shared/models/videos' |
6 | import { SortMeta } from 'primeng/api' | ||
7 | import { mergeMap } from 'rxjs' | ||
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | templateUrl: './my-video-channel-syncs.component.html', | 10 | templateUrl: './my-video-channel-syncs.component.html', |
@@ -47,7 +47,8 @@ export class MyVideoChannelSyncsComponent extends RestTable implements OnInit { | |||
47 | [ | 47 | [ |
48 | { | 48 | { |
49 | label: $localize`List imports`, | 49 | label: $localize`List imports`, |
50 | linkBuilder: (videoChannelSync) => [ `/my-library/video-imports?search=videoChannelSyncId:${videoChannelSync.id}` ], | 50 | linkBuilder: () => [ '/my-library/video-imports' ], |
51 | queryParamsBuilder: sync => ({ search: `videoChannelSyncId:${sync.id}` }), | ||
51 | iconName: 'cloud-download' | 52 | iconName: 'cloud-download' |
52 | } | 53 | } |
53 | ], | 54 | ], |
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 @@ | |||
26 | 26 | ||
27 | <a | 27 | <a |
28 | *ngIf="action.linkBuilder && !action.isHeader" [ngClass]="{ 'with-icon': !!action.iconName }" | 28 | *ngIf="action.linkBuilder && !action.isHeader" [ngClass]="{ 'with-icon': !!action.iconName }" |
29 | class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [title]="action.title || ''" | 29 | class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [queryParams]="action.queryParamsBuilder(entry)" [title]="action.title || ''" |
30 | > | 30 | > |
31 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> | 31 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> |
32 | </a> | 32 | </a> |
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 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { Params } from '@angular/router' | ||
2 | import { GlobalIconName } from '@app/shared/shared-icons' | 3 | import { GlobalIconName } from '@app/shared/shared-icons' |
3 | 4 | ||
4 | export type DropdownAction<T> = { | 5 | export type DropdownAction<T> = { |
@@ -7,7 +8,10 @@ export type DropdownAction<T> = { | |||
7 | description?: string | 8 | description?: string |
8 | title?: string | 9 | title?: string |
9 | handler?: (a: T) => any | 10 | handler?: (a: T) => any |
11 | |||
10 | linkBuilder?: (a: T) => (string | number)[] | 12 | linkBuilder?: (a: T) => (string | number)[] |
13 | queryParamsBuilder?: (a: T) => Params | ||
14 | |||
11 | isDisplayed?: (a: T) => boolean | 15 | isDisplayed?: (a: T) => boolean |
12 | 16 | ||
13 | class?: string[] | 17 | class?: string[] |