From 1e74f19a2179df7fc2e0da73163ef2c3118cbecb Mon Sep 17 00:00:00 2001 From: clementbrizard Date: Sat, 12 Jan 2019 13:45:23 +0000 Subject: Enable video upload and edit --- .../forms/form-validators/video-validators.service.ts | 6 ++++++ client/src/app/shared/video-import/video-import.service.ts | 4 +++- client/src/app/shared/video/video.service.ts | 4 +++- .../videos/+video-edit/shared/video-edit.component.html | 14 ++++++++++++++ .../app/videos/+video-edit/shared/video-edit.component.ts | 4 +++- server/controllers/api/videos/index.ts | 8 +++++++- server/helpers/custom-validators/videos.ts | 7 ++++++- server/middlewares/validators/videos/videos.ts | 5 +++++ 8 files changed, 47 insertions(+), 5 deletions(-) diff --git a/client/src/app/shared/forms/form-validators/video-validators.service.ts b/client/src/app/shared/forms/form-validators/video-validators.service.ts index 81ed0666f..e3f7a0969 100644 --- a/client/src/app/shared/forms/form-validators/video-validators.service.ts +++ b/client/src/app/shared/forms/form-validators/video-validators.service.ts @@ -16,6 +16,7 @@ export class VideoValidatorsService { readonly VIDEO_TAGS: BuildFormValidator readonly VIDEO_SUPPORT: BuildFormValidator readonly VIDEO_SCHEDULE_PUBLICATION_AT: BuildFormValidator + readonly VIDEO_ORIGINALLY_PUBLISHED_AT: BuildFormValidator constructor (private i18n: I18n) { @@ -92,5 +93,10 @@ export class VideoValidatorsService { 'required': this.i18n('A date is required to schedule video update.') } } + + this.VIDEO_ORIGINALLY_PUBLISHED_AT = { + VALIDATORS: [ ], + MESSAGES: {} + } } } diff --git a/client/src/app/shared/video-import/video-import.service.ts b/client/src/app/shared/video-import/video-import.service.ts index 7ae66ddfc..11a7694c8 100644 --- a/client/src/app/shared/video-import/video-import.service.ts +++ b/client/src/app/shared/video-import/video-import.service.ts @@ -67,6 +67,7 @@ export class VideoImportService { const description = video.description || null const support = video.support || null const scheduleUpdate = video.scheduleUpdate || null + const originallyPublishedAt = video.originallyPublishedAt || null return { name: video.name, @@ -83,7 +84,8 @@ export class VideoImportService { commentsEnabled: video.commentsEnabled, thumbnailfile: video.thumbnailfile, previewfile: video.previewfile, - scheduleUpdate + scheduleUpdate, + originallyPublishedAt } } diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index 55844f988..5d258891f 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts @@ -81,6 +81,7 @@ export class VideoService implements VideosProvider { const description = video.description || null const support = video.support || null const scheduleUpdate = video.scheduleUpdate || null + const originallyPublishedAt = video.originallyPublishedAt || null const body: VideoUpdate = { name: video.name, @@ -97,7 +98,8 @@ export class VideoService implements VideosProvider { commentsEnabled: video.commentsEnabled, thumbnailfile: video.thumbnailfile, previewfile: video.previewfile, - scheduleUpdate + scheduleUpdate, + originallyPublishedAt } const data = objectToFormData(body) diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html index bd52d686a..23a71a068 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html @@ -114,6 +114,20 @@ +
+ + + + + +
+ {{ formErrors.originallyPublishedAt }} +
+
+