aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-library/my-ownership
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-10 09:31:33 +0200
committerChocobozzz <me@florianbigard.com>2021-05-10 09:38:11 +0200
commitdc2b2938c293bae271a27a6c823f66496998b4d3 (patch)
tree5952837923f46f31684dfee68688091eb112938d /client/src/app/+my-library/my-ownership
parente024fd6a7494b37251da1d59470324305cdb4129 (diff)
downloadPeerTube-dc2b2938c293bae271a27a6c823f66496998b4d3.tar.gz
PeerTube-dc2b2938c293bae271a27a6c823f66496998b4d3.tar.zst
PeerTube-dc2b2938c293bae271a27a6c823f66496998b4d3.zip
Sort channels by -updatedAt
Diffstat (limited to 'client/src/app/+my-library/my-ownership')
-rw-r--r--client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html9
-rw-r--r--client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts16
2 files changed, 9 insertions, 16 deletions
diff --git a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html
index 088765b20..d0393a2a4 100644
--- a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html
+++ b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html
@@ -8,13 +8,8 @@
8 <div class="modal-body" [formGroup]="form"> 8 <div class="modal-body" [formGroup]="form">
9 <div class="form-group"> 9 <div class="form-group">
10 <label i18n for="channel">Select a channel to receive the video</label> 10 <label i18n for="channel">Select a channel to receive the video</label>
11 <div class="peertube-select-container"> 11 <my-select-channel labelForId="channel" formControlName="channel" [items]="videoChannels"></my-select-channel>
12 <select formControlName="channel" id="channel" class="form-control"> 12
13 <option i18n value="undefined" disabled>Channel that will receive the video</option>
14 <option *ngFor="let channel of videoChannels" [value]="channel.id">{{ channel.displayName }}
15 </option>
16 </select>
17 </div>
18 <div *ngIf="formErrors.channel" class="form-error">{{ formErrors.channel }}</div> 13 <div *ngIf="formErrors.channel" class="form-error">{{ formErrors.channel }}</div>
19 </div> 14 </div>
20 </div> 15 </div>
diff --git a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts
index 0e2395754..7889d0985 100644
--- a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts
+++ b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts
@@ -1,11 +1,12 @@
1import { switchMap } from 'rxjs/operators' 1import { SelectChannelItem } from 'src/types/select-options-item.model'
2import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { listUserChannels } from '@app/helpers'
4import { OWNERSHIP_CHANGE_CHANNEL_VALIDATOR } from '@app/shared/form-validators/video-ownership-change-validators' 5import { OWNERSHIP_CHANGE_CHANNEL_VALIDATOR } from '@app/shared/form-validators/video-ownership-change-validators'
5import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 6import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
6import { VideoChannelService, VideoOwnershipService } from '@app/shared/shared-main' 7import { VideoOwnershipService } from '@app/shared/shared-main'
7import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 8import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
8import { VideoChangeOwnership, VideoChannel } from '@shared/models' 9import { VideoChangeOwnership } from '@shared/models'
9 10
10@Component({ 11@Component({
11 selector: 'my-accept-ownership', 12 selector: 'my-accept-ownership',
@@ -18,8 +19,7 @@ export class MyAcceptOwnershipComponent extends FormReactive implements OnInit {
18 @ViewChild('modal', { static: true }) modal: ElementRef 19 @ViewChild('modal', { static: true }) modal: ElementRef
19 20
20 videoChangeOwnership: VideoChangeOwnership | undefined = undefined 21 videoChangeOwnership: VideoChangeOwnership | undefined = undefined
21 22 videoChannels: SelectChannelItem[]
22 videoChannels: VideoChannel[]
23 23
24 error: string = null 24 error: string = null
25 25
@@ -28,7 +28,6 @@ export class MyAcceptOwnershipComponent extends FormReactive implements OnInit {
28 private videoOwnershipService: VideoOwnershipService, 28 private videoOwnershipService: VideoOwnershipService,
29 private notifier: Notifier, 29 private notifier: Notifier,
30 private authService: AuthService, 30 private authService: AuthService,
31 private videoChannelService: VideoChannelService,
32 private modalService: NgbModal 31 private modalService: NgbModal
33 ) { 32 ) {
34 super() 33 super()
@@ -37,9 +36,8 @@ export class MyAcceptOwnershipComponent extends FormReactive implements OnInit {
37 ngOnInit () { 36 ngOnInit () {
38 this.videoChannels = [] 37 this.videoChannels = []
39 38
40 this.authService.userInformationLoaded 39 listUserChannels(this.authService)
41 .pipe(switchMap(() => this.videoChannelService.listAccountVideoChannels(this.authService.getUser().account))) 40 .subscribe(channels => this.videoChannels = channels)
42 .subscribe(videoChannels => this.videoChannels = videoChannels.data)
43 41
44 this.buildForm({ 42 this.buildForm({
45 channel: OWNERSHIP_CHANGE_CHANNEL_VALIDATOR 43 channel: OWNERSHIP_CHANGE_CHANNEL_VALIDATOR