]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add warning and update privacy on share playlist (#4469)
authorNataly Rocha <nata_r10@hotmail.com>
Fri, 22 Oct 2021 13:11:45 +0000 (08:11 -0500)
committerGitHub <noreply@github.com>
Fri, 22 Oct 2021 13:11:45 +0000 (15:11 +0200)
* add warning and update privacy on share

* update playlist display name on toast

* change privacy update to link

* remove conditional

* Improve share private warning styling

Co-authored-by: Chocobozzz <me@florianbigard.com>
client/src/app/shared/shared-share-modal/video-share.component.html
client/src/app/shared/shared-share-modal/video-share.component.scss
client/src/app/shared/shared-share-modal/video-share.component.ts

index bcb1db4c431cde1d403295c0c23d3e85b4179b5c..059699d3b85dc990544ca7a1a1bc3ef6335cdbef 100644 (file)
     <div class="playlist" *ngIf="playlist">
       <div class="title-page title-page-single" i18n *ngIf="video">Share the playlist</div>
 
+
+      <div *ngIf="isPrivatePlaylist()" class="alert-private alert alert-warning">
+        <div i18n>This playlist is private so you won't be able to share it with external users</div>
+
+        <a i18n class="peertube-button-link orange-button" [routerLink]="[ '/my-library/video-playlists/update', playlist.uuid ]" target="_blank" rel="noopener noreferrer">
+          Update playlist privacy
+        </a>
+      </div>
+
       <div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activePlaylistId">
 
         <ng-container ngbNavItem="url">
     <div class="video" *ngIf="video">
       <div class="title-page title-page-single" *ngIf="playlist" i18n>Share the video</div>
 
+      <div *ngIf="isPrivateVideo()" class="alert-private alert alert-warning">
+        <div i18n>This video is private so you won't be able to share it with external users</div>
+
+        <a i18n class="peertube-button-link orange-button" [routerLink]="[ '/videos/', 'update', video.shortUUID ]" target="_blank" rel="noopener noreferrer">
+          Update video privacy
+        </a>
+      </div>
+
       <div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activeVideoId">
 
         <ng-container ngbNavItem="url">
index 98aab8fe8ca095ec16f570893b07582b256aaff3..ac3b841da3eb1b623717ef30535739e40690c7ed 100644 (file)
@@ -81,3 +81,9 @@ my-input-toggle-hidden {
     }
   }
 }
+
+.alert-private {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
index 70890e551fa40d6475b7aae9fdcb0fc2c9b93ddb..e6e4bd147eec1acd15ac4520a95542341ee3aec2 100644 (file)
@@ -3,7 +3,7 @@ import { VideoDetails } from '@app/shared/shared-main'
 import { VideoPlaylist } from '@app/shared/shared-video-playlist'
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils'
-import { VideoCaption } from '@shared/models'
+import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
 import { buildVideoOrPlaylistEmbed } from '../../../assets/player/utils'
 
 type Customizations = {
@@ -126,6 +126,14 @@ export class VideoShareComponent {
     return this.video.isLocal
   }
 
+  isPrivateVideo () {
+    return this.video.privacy.id === VideoPrivacy.PRIVATE
+  }
+
+  isPrivatePlaylist () {
+    return this.playlist.privacy.id === VideoPlaylistPrivacy.PRIVATE
+  }
+
   private getPlaylistOptions (baseUrl?: string) {
     return {
       baseUrl,