1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Fix choosing the licence in admin

This commit is contained in:
Chocobozzz 2025-07-17 11:12:08 +02:00
parent 8f4ba03550
commit 2790ec5aaa
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 7 additions and 4 deletions

View file

@ -414,7 +414,7 @@
<div class="form-group">
<label i18n for="defaultsPublishLicence">Default video licence</label>
<my-select-options inputId="defaultsPublishLicence" [items]="licenceOptions" formControlName="licence"></my-select-options>
<my-select-options inputId="defaultsPublishLicence" [items]="licenceOptions" formControlName="licence" clearable="true"></my-select-options>
<div *ngIf="formErrors.defaults.publish.licence" class="form-error" role="alert">{{ formErrors.defaults.publish.licence }}</div>
</div>

View file

@ -258,6 +258,7 @@ export class AdminConfigGeneralComponent implements OnInit, OnDestroy, CanCompon
this.privacyOptions = this.videoService.explainedPrivacyLabels(data.privacies).videoPrivacies
this.licenceOptions = data.licences
this.commentPoliciesOptions = data.commentPolicies
this.buildLandingPageOptions()
@ -592,7 +593,7 @@ export class AdminConfigGeneralComponent implements OnInit, OnDestroy, CanCompon
currentConfig: this.customConfig,
form: this.form,
formConfig: this.form.value,
success: $localize`Live configuration updated.`
success: $localize`General configuration updated.`
})
}
}

View file

@ -28,7 +28,9 @@ export class FormValidatorService {
if (field?.MESSAGES) validationMessages[name] = field.MESSAGES as { [name: string]: string }
const defaultValue = defaultValues[name] ?? ''
const defaultValue = defaultValues[name] !== undefined
? defaultValues[name]
: ''
if (field?.VALIDATORS) group[name] = [ defaultValue, field.VALIDATORS ]
else group[name] = [ defaultValue ]

View file

@ -140,7 +140,7 @@ export const customConfigUpdateValidator = [
body('defaults.publish.commentsPolicy').custom(isVideoCommentsPolicyValid),
body('defaults.publish.privacy').custom(isVideoPrivacyValid),
body('defaults.publish.licence').custom(isVideoLicenceValid),
body('defaults.publish.licence').optional().custom(isVideoLicenceValid),
body('defaults.p2p.webapp.enabled').isBoolean(),
body('defaults.p2p.embed.enabled').isBoolean(),
body('defaults.player.autoPlay').isBoolean(),