aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/+admin/users/user-edit/user-create.component.ts6
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts1
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-send.ts10
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss7
-rw-r--r--client/src/app/menu/menu.component.ts3
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts12
10 files changed, 37 insertions, 10 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts
index da333240c..c26ad1208 100644
--- a/client/src/app/+admin/users/user-edit/user-create.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-create.component.ts
@@ -1,5 +1,5 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { ConfigService } from '@app/+admin/config/shared/config.service' 3import { ConfigService } from '@app/+admin/config/shared/config.service'
4import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' 4import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
5import { 5import {
@@ -30,7 +30,6 @@ export class UserCreateComponent extends UserEdit implements OnInit {
30 protected configService: ConfigService, 30 protected configService: ConfigService,
31 protected screenService: ScreenService, 31 protected screenService: ScreenService,
32 protected auth: AuthService, 32 protected auth: AuthService,
33 private route: ActivatedRoute,
34 private router: Router, 33 private router: Router,
35 private notifier: Notifier, 34 private notifier: Notifier,
36 private userService: UserService 35 private userService: UserService
@@ -87,8 +86,7 @@ export class UserCreateComponent extends UserEdit implements OnInit {
87 } 86 }
88 87
89 isPasswordOptional () { 88 isPasswordOptional () {
90 const serverConfig = this.route.snapshot.data.serverConfig 89 return this.serverConfig.email.enabled
91 return serverConfig.email.enabled
92 } 90 }
93 91
94 getFormButtonTitle () { 92 getFormButtonTitle () {
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
index aebd53318..90a0e8f52 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
@@ -185,6 +185,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
185 this.serverService.getVideoPrivacies() 185 this.serverService.getVideoPrivacies()
186 .subscribe(privacies => { 186 .subscribe(privacies => {
187 this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies).videoPrivacies 187 this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies).videoPrivacies
188
188 if (this.schedulePublicationPossible) { 189 if (this.schedulePublicationPossible) {
189 this.videoPrivacies.push({ 190 this.videoPrivacies.push({
190 id: this.SPECIAL_SCHEDULED_PRIVACY, 191 id: this.SPECIAL_SCHEDULED_PRIVACY,
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
index 01c9fcb16..db25dc6be 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
@@ -62,7 +62,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
62 62
63 const video: LiveVideoCreate = { 63 const video: LiveVideoCreate = {
64 name, 64 name,
65 privacy: VideoPrivacy.PRIVATE, 65 privacy: this.highestPrivacy,
66 nsfw: this.serverConfig.instance.isNSFW, 66 nsfw: this.serverConfig.instance.isNSFW,
67 waitTranscoding: true, 67 waitTranscoding: true,
68 commentsEnabled: true, 68 commentsEnabled: true,
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
index 172dd5ba5..62aaeb019 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
@@ -79,7 +79,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af
79 this.isImportingVideo = true 79 this.isImportingVideo = true
80 80
81 const videoUpdate: VideoUpdate = { 81 const videoUpdate: VideoUpdate = {
82 privacy: VideoPrivacy.PRIVATE, 82 privacy: this.highestPrivacy,
83 waitTranscoding: false, 83 waitTranscoding: false,
84 commentsEnabled: true, 84 commentsEnabled: true,
85 downloadEnabled: true, 85 downloadEnabled: true,
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
index 2994d05fa..3243b4d38 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
@@ -66,7 +66,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV
66 this.isImportingVideo = true 66 this.isImportingVideo = true
67 67
68 const videoUpdate: VideoUpdate = { 68 const videoUpdate: VideoUpdate = {
69 privacy: VideoPrivacy.PRIVATE, 69 privacy: this.highestPrivacy,
70 waitTranscoding: false, 70 waitTranscoding: false,
71 commentsEnabled: true, 71 commentsEnabled: true,
72 downloadEnabled: true, 72 downloadEnabled: true,
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
index 0e7a26a47..ce8de049d 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
@@ -15,8 +15,8 @@ export abstract class VideoSend extends FormReactive implements OnInit {
15 videoPrivacies: VideoConstant<VideoPrivacy>[] = [] 15 videoPrivacies: VideoConstant<VideoPrivacy>[] = []
16 videoCaptions: VideoCaptionEdit[] = [] 16 videoCaptions: VideoCaptionEdit[] = []
17 17
18 firstStepPrivacyId = 0 18 firstStepPrivacyId: VideoPrivacy
19 firstStepChannelId = 0 19 firstStepChannelId: number
20 20
21 abstract firstStepDone: EventEmitter<string> 21 abstract firstStepDone: EventEmitter<string>
22 abstract firstStepError: EventEmitter<void> 22 abstract firstStepError: EventEmitter<void>
@@ -24,11 +24,15 @@ export abstract class VideoSend extends FormReactive implements OnInit {
24 protected loadingBar: LoadingBarService 24 protected loadingBar: LoadingBarService
25 protected notifier: Notifier 25 protected notifier: Notifier
26 protected authService: AuthService 26 protected authService: AuthService
27
27 protected serverService: ServerService 28 protected serverService: ServerService
28 protected videoService: VideoService 29 protected videoService: VideoService
29 protected videoCaptionService: VideoCaptionService 30 protected videoCaptionService: VideoCaptionService
31
30 protected serverConfig: HTMLServerConfig 32 protected serverConfig: HTMLServerConfig
31 33
34 protected highestPrivacy: VideoPrivacy
35
32 abstract canDeactivate (): CanComponentDeactivateResult 36 abstract canDeactivate (): CanComponentDeactivateResult
33 37
34 ngOnInit () { 38 ngOnInit () {
@@ -49,6 +53,8 @@ export abstract class VideoSend extends FormReactive implements OnInit {
49 53
50 this.videoPrivacies = videoPrivacies 54 this.videoPrivacies = videoPrivacies
51 this.firstStepPrivacyId = defaultPrivacyId 55 this.firstStepPrivacyId = defaultPrivacyId
56
57 this.highestPrivacy = this.videoService.getHighestAvailablePrivacy(privacies)
52 }) 58 })
53 } 59 }
54 60
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
index ec027f257..627de33c0 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
@@ -265,7 +265,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
265 downloadEnabled: true, 265 downloadEnabled: true,
266 channelId: this.firstStepChannelId, 266 channelId: this.firstStepChannelId,
267 nsfw: this.serverConfig.instance.isNSFW, 267 nsfw: this.serverConfig.instance.isNSFW,
268 privacy: VideoPrivacy.PRIVATE.toString(), 268 privacy: this.highestPrivacy.toString(),
269 filename: file.name, 269 filename: file.name,
270 previewfile: previewfile as any 270 previewfile: previewfile as any
271 } 271 }
diff --git a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss
index b42be318f..a6479c7ec 100644
--- a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss
@@ -25,6 +25,13 @@
25 } 25 }
26} 26}
27 27
28// Avoid higher z-index when overlay on touchscreens
29:host-context(.menu-open) {
30 .privacy-concerns {
31 z-index: z(overlay) - 1;
32 }
33}
34
28// Or if we are in the small view 35// Or if we are in the small view
29@media screen and (max-width: $small-view) { 36@media screen and (max-width: $small-view) {
30 .privacy-concerns { 37 .privacy-concerns {
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts
index be6e8af51..627a8712f 100644
--- a/client/src/app/menu/menu.component.ts
+++ b/client/src/app/menu/menu.component.ts
@@ -122,6 +122,9 @@ export class MenuComponent implements OnInit {
122 .subscribe(() => this.buildUserLanguages()) 122 .subscribe(() => this.buildUserLanguages())
123 }) 123 })
124 124
125 this.serverService.getConfig()
126 .subscribe(config => this.serverConfig = config)
127
125 this.modalService.openQuickSettingsSubject 128 this.modalService.openQuickSettingsSubject
126 .subscribe(() => this.openQuickSettings()) 129 .subscribe(() => this.openQuickSettings())
127 } 130 }
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index 1c1d06291..49d6fc1c7 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -404,6 +404,18 @@ export class VideoService implements VideosProvider {
404 } 404 }
405 } 405 }
406 406
407 getHighestAvailablePrivacy (serverPrivacies: VideoConstant<VideoPrivacy>[]) {
408 const order = [ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL, VideoPrivacy.UNLISTED, VideoPrivacy.PUBLIC ]
409
410 for (const privacy of order) {
411 if (serverPrivacies.find(p => p.id === privacy)) {
412 return privacy
413 }
414 }
415
416 throw new Error('No highest privacy available')
417 }
418
407 nsfwPolicyToParam (nsfwPolicy: NSFWPolicyType) { 419 nsfwPolicyToParam (nsfwPolicy: NSFWPolicyType) {
408 return nsfwPolicy === 'do_not_list' 420 return nsfwPolicy === 'do_not_list'
409 ? 'false' 421 ? 'false'