mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Fix choosing the licence in admin
This commit is contained in:
parent
8f4ba03550
commit
2790ec5aaa
4 changed files with 7 additions and 4 deletions
|
@ -414,7 +414,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label i18n for="defaultsPublishLicence">Default video licence</label>
|
<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 *ngIf="formErrors.defaults.publish.licence" class="form-error" role="alert">{{ formErrors.defaults.publish.licence }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -258,6 +258,7 @@ export class AdminConfigGeneralComponent implements OnInit, OnDestroy, CanCompon
|
||||||
|
|
||||||
this.privacyOptions = this.videoService.explainedPrivacyLabels(data.privacies).videoPrivacies
|
this.privacyOptions = this.videoService.explainedPrivacyLabels(data.privacies).videoPrivacies
|
||||||
this.licenceOptions = data.licences
|
this.licenceOptions = data.licences
|
||||||
|
|
||||||
this.commentPoliciesOptions = data.commentPolicies
|
this.commentPoliciesOptions = data.commentPolicies
|
||||||
|
|
||||||
this.buildLandingPageOptions()
|
this.buildLandingPageOptions()
|
||||||
|
@ -592,7 +593,7 @@ export class AdminConfigGeneralComponent implements OnInit, OnDestroy, CanCompon
|
||||||
currentConfig: this.customConfig,
|
currentConfig: this.customConfig,
|
||||||
form: this.form,
|
form: this.form,
|
||||||
formConfig: this.form.value,
|
formConfig: this.form.value,
|
||||||
success: $localize`Live configuration updated.`
|
success: $localize`General configuration updated.`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,9 @@ export class FormValidatorService {
|
||||||
|
|
||||||
if (field?.MESSAGES) validationMessages[name] = field.MESSAGES as { [name: string]: string }
|
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 ]
|
if (field?.VALIDATORS) group[name] = [ defaultValue, field.VALIDATORS ]
|
||||||
else group[name] = [ defaultValue ]
|
else group[name] = [ defaultValue ]
|
||||||
|
|
|
@ -140,7 +140,7 @@ export const customConfigUpdateValidator = [
|
||||||
|
|
||||||
body('defaults.publish.commentsPolicy').custom(isVideoCommentsPolicyValid),
|
body('defaults.publish.commentsPolicy').custom(isVideoCommentsPolicyValid),
|
||||||
body('defaults.publish.privacy').custom(isVideoPrivacyValid),
|
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.webapp.enabled').isBoolean(),
|
||||||
body('defaults.p2p.embed.enabled').isBoolean(),
|
body('defaults.p2p.embed.enabled').isBoolean(),
|
||||||
body('defaults.player.autoPlay').isBoolean(),
|
body('defaults.player.autoPlay').isBoolean(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue