]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/video-list/video-user-subscriptions.component.ts
More robust tests
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / video-list / video-user-subscriptions.component.ts
index 6d19707df7baa36e3cefffa29be15e0003ebd6f8..6aabb93a58c482a6e4afd86740d6c77cd5d95f14 100644 (file)
@@ -1,13 +1,13 @@
 
 import { switchMap } from 'rxjs/operators'
-import { Component, OnDestroy, OnInit } from '@angular/core'
+import { Component, ComponentFactoryResolver, OnDestroy, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
 import { AuthService, LocalStorageService, Notifier, ScopedTokensService, ScreenService, ServerService, UserService } from '@app/core'
 import { HooksService } from '@app/core/plugins/hooks.service'
 import { immutableAssign } from '@app/helpers'
 import { VideoService } from '@app/shared/shared-main'
 import { UserSubscriptionService } from '@app/shared/shared-user-subscription'
-import { AbstractVideoList, OwnerDisplayType } from '@app/shared/shared-video-miniature'
+import { AbstractVideoList } from '@app/shared/shared-video-miniature'
 import { FeedFormat, VideoSortField } from '@shared/models'
 import { environment } from '../../../environments/environment'
 import { copyToClipboard } from '../../../root-helpers/utils'
@@ -20,7 +20,6 @@ import { copyToClipboard } from '../../../root-helpers/utils'
 export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy {
   titlePage: string
   sort = '-publishedAt' as VideoSortField
-  ownerDisplayType: OwnerDisplayType = 'auto'
   groupByDate = true
 
   constructor (
@@ -33,6 +32,7 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
     protected screenService: ScreenService,
     protected storageService: LocalStorageService,
     private userSubscription: UserSubscriptionService,
+    protected cfr: ComponentFactoryResolver,
     private hooks: HooksService,
     private videoService: VideoService,
     private scopedTokensService: ScopedTokensService
@@ -60,22 +60,24 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
         tokens => {
           const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken)
           feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url
+
+          this.actions.unshift({
+            label: $localize`Copy feed URL`,
+            iconName: 'syndication',
+            justIcon: true,
+            href: feedUrl,
+            click: e => {
+              e.preventDefault()
+              copyToClipboard(feedUrl)
+              this.activateCopiedMessage()
+            }
+          })
         },
 
         err => {
           this.notifier.error(err.message)
         }
       )
-
-    this.actions.unshift({
-      label: $localize`Feed`,
-      iconName: 'syndication',
-      justIcon: true,
-      click: () => {
-        copyToClipboard(feedUrl)
-        this.activateCopiedMessage()
-      }
-    })
   }
 
   ngOnDestroy () {
@@ -100,7 +102,8 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
   }
 
   generateSyndicationList () {
-    // not implemented yet
+    /* method disabled: the view provides its own */
+    throw new Error('Method not implemented.')
   }
 
   activateCopiedMessage () {