aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-19 14:23:00 +0100
committerChocobozzz <me@florianbigard.com>2022-01-19 14:31:05 +0100
commit419b520ca4434d17f3505013174e195c3a316716 (patch)
tree24dbf663c4e11e970cb780f96e6eb3efe023b222 /client/src/app/shared/shared-main
parent52435e467a0b30175a10af1dd3ae10d7d564d8ae (diff)
downloadPeerTube-419b520ca4434d17f3505013174e195c3a316716.tar.gz
PeerTube-419b520ca4434d17f3505013174e195c3a316716.tar.zst
PeerTube-419b520ca4434d17f3505013174e195c3a316716.zip
Add ability to cancel & delete video imports
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.html4
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.ts4
-rw-r--r--client/src/app/shared/shared-main/buttons/delete-button.component.ts4
-rw-r--r--client/src/app/shared/shared-main/video/video-import.service.ts10
4 files changed, 12 insertions, 10 deletions
diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html
index 65e06f7a4..11c8ffedd 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.html
+++ b/client/src/app/shared/shared-main/buttons/button.component.html
@@ -1,5 +1,5 @@
1<span class="action-button" [ngClass]="getClasses()" [ngbTooltip]="getTitle()" tabindex="0"> 1<span class="action-button" [ngClass]="getClasses()" [ngbTooltip]="title" tabindex="0">
2 <my-global-icon *ngIf="!loading" [iconName]="icon"></my-global-icon> 2 <my-global-icon *ngIf="icon && !loading" [iconName]="icon"></my-global-icon>
3 <my-small-loader [loading]="loading"></my-small-loader> 3 <my-small-loader [loading]="loading"></my-small-loader>
4 4
5 <span *ngIf="label" class="button-label">{{ label }}</span> 5 <span *ngIf="label" class="button-label">{{ label }}</span>
diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts
index ee74b3d12..b97012d9a 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/button.component.ts
@@ -16,10 +16,6 @@ export class ButtonComponent {
16 @Input() disabled = false 16 @Input() disabled = false
17 @Input() responsiveLabel = false 17 @Input() responsiveLabel = false
18 18
19 getTitle () {
20 return this.title || this.label
21 }
22
23 getClasses () { 19 getClasses () {
24 return { 20 return {
25 [this.className]: true, 21 [this.className]: true,
diff --git a/client/src/app/shared/shared-main/buttons/delete-button.component.ts b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
index c091f5309..90735852c 100644
--- a/client/src/app/shared/shared-main/buttons/delete-button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
@@ -20,10 +20,6 @@ export class DeleteButtonComponent implements OnInit {
20 // <my-delete-button label /> Use default label 20 // <my-delete-button label /> Use default label
21 if (this.label === '') { 21 if (this.label === '') {
22 this.label = $localize`Delete` 22 this.label = $localize`Delete`
23
24 if (!this.title) {
25 this.title = this.label
26 }
27 } 23 }
28 } 24 }
29} 25}
diff --git a/client/src/app/shared/shared-main/video/video-import.service.ts b/client/src/app/shared/shared-main/video/video-import.service.ts
index 99df78e3a..0a610ab1f 100644
--- a/client/src/app/shared/shared-main/video/video-import.service.ts
+++ b/client/src/app/shared/shared-main/video/video-import.service.ts
@@ -56,6 +56,16 @@ export class VideoImportService {
56 ) 56 )
57 } 57 }
58 58
59 deleteVideoImport (videoImport: VideoImport) {
60 return this.authHttp.delete(VideoImportService.BASE_VIDEO_IMPORT_URL + videoImport.id)
61 .pipe(catchError(err => this.restExtractor.handleError(err)))
62 }
63
64 cancelVideoImport (videoImport: VideoImport) {
65 return this.authHttp.post(VideoImportService.BASE_VIDEO_IMPORT_URL + videoImport.id + '/cancel', {})
66 .pipe(catchError(err => this.restExtractor.handleError(err)))
67 }
68
59 private buildImportVideoObject (video: VideoUpdate): VideoImportCreate { 69 private buildImportVideoObject (video: VideoUpdate): VideoImportCreate {
60 const language = video.language || null 70 const language = video.language || null
61 const licence = video.licence || null 71 const licence = video.licence || null