aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-12 14:37:27 +0200
committerChocobozzz <me@florianbigard.com>2022-10-12 14:37:27 +0200
commitd50e8d1aee3d563796ec1e184e094cdc937d0d77 (patch)
tree923da502db96d8adf2d5551f40e1b480fba34c28 /client/src/app/shared
parent02cb75c7e864fddb8c17a689e9d79012af3e0339 (diff)
downloadPeerTube-d50e8d1aee3d563796ec1e184e094cdc937d0d77.tar.gz
PeerTube-d50e8d1aee3d563796ec1e184e094cdc937d0d77.tar.zst
PeerTube-d50e8d1aee3d563796ec1e184e094cdc937d0d77.zip
Fix action dropdown with query params
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-main/buttons/action-dropdown.component.html2
-rw-r--r--client/src/app/shared/shared-main/buttons/action-dropdown.component.ts6
2 files changed, 7 insertions, 1 deletions
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 cdcfb9a48..474baafd7 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)" [queryParams]="action.queryParamsBuilder(entry)" [title]="action.title || ''" 29 class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [queryParams]="getQueryParams(action, 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 ad55677d8..e6164fced 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
@@ -48,6 +48,12 @@ export class ActionDropdownComponent<T> {
48 return [ this.actions as DropdownAction<T>[] ] 48 return [ this.actions as DropdownAction<T>[] ]
49 } 49 }
50 50
51 getQueryParams (action: DropdownAction<T>, entry: T) {
52 if (action.queryParamsBuilder) return action.queryParamsBuilder(entry)
53
54 return {}
55 }
56
51 areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, entry: T): boolean { 57 areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, entry: T): boolean {
52 return actions.some(a => { 58 return actions.some(a => {
53 if (Array.isArray(a)) return this.areActionsDisplayed(a, entry) 59 if (Array.isArray(a)) return this.areActionsDisplayed(a, entry)