aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts')
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts23
1 files changed, 19 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
index c2a318285..abbfc63f8 100644
--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
@@ -1,8 +1,8 @@
1import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'
2import { AuthService, ConfirmService, Notifier, ScreenService } from '@app/core' 2import { AuthService, ConfirmService, Notifier, ScreenService, ServerService } from '@app/core'
3import { BlocklistService, VideoBlockComponent, VideoBlockService, VideoReportComponent } from '@app/shared/shared-moderation' 3import { BlocklistService, VideoBlockComponent, VideoBlockService, VideoReportComponent } from '@app/shared/shared-moderation'
4import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' 4import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
5import { VideoCaption } from '@shared/models' 5import { VideoCaption, VideoState } from '@shared/models'
6import { 6import {
7 Actor, 7 Actor,
8 DropdownAction, 8 DropdownAction,
@@ -29,6 +29,7 @@ export type VideoActionsDisplayType = {
29 liveInfo?: boolean 29 liveInfo?: boolean
30 removeFiles?: boolean 30 removeFiles?: boolean
31 transcoding?: boolean 31 transcoding?: boolean
32 editor?: boolean
32} 33}
33 34
34@Component({ 35@Component({
@@ -59,7 +60,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
59 mute: true, 60 mute: true,
60 liveInfo: false, 61 liveInfo: false,
61 removeFiles: false, 62 removeFiles: false,
62 transcoding: false 63 transcoding: false,
64 editor: true
63 } 65 }
64 @Input() placement = 'left' 66 @Input() placement = 'left'
65 67
@@ -89,7 +91,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
89 private videoBlocklistService: VideoBlockService, 91 private videoBlocklistService: VideoBlockService,
90 private screenService: ScreenService, 92 private screenService: ScreenService,
91 private videoService: VideoService, 93 private videoService: VideoService,
92 private redundancyService: RedundancyService 94 private redundancyService: RedundancyService,
95 private serverService: ServerService
93 ) { } 96 ) { }
94 97
95 get user () { 98 get user () {
@@ -149,6 +152,12 @@ export class VideoActionsDropdownComponent implements OnChanges {
149 return this.video.isUpdatableBy(this.user) 152 return this.video.isUpdatableBy(this.user)
150 } 153 }
151 154
155 isVideoEditable () {
156 return this.serverService.getHTMLConfig().videoEditor.enabled &&
157 this.video.state?.id === VideoState.PUBLISHED &&
158 this.video.isUpdatableBy(this.user)
159 }
160
152 isVideoRemovable () { 161 isVideoRemovable () {
153 return this.video.isRemovableBy(this.user) 162 return this.video.isRemovableBy(this.user)
154 } 163 }
@@ -330,6 +339,12 @@ export class VideoActionsDropdownComponent implements OnChanges {
330 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() 339 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable()
331 }, 340 },
332 { 341 {
342 label: $localize`Editor`,
343 linkBuilder: ({ video }) => [ '/video-editor/edit', video.uuid ],
344 iconName: 'film',
345 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.editor && this.isVideoEditable()
346 },
347 {
333 label: $localize`Block`, 348 label: $localize`Block`,
334 handler: () => this.showBlockModal(), 349 handler: () => this.showBlockModal(),
335 iconName: 'no', 350 iconName: 'no',