From 6913f69134947432a192890b2de7c2d48094e85c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 Feb 2019 14:33:47 +0100 Subject: Move original publication date in advanced settings --- client/src/app/shared/video/video-edit.model.ts | 2 +- .../+video-edit/shared/video-edit.component.html | 92 +++++++++++----------- .../+video-edit/shared/video-edit.component.ts | 2 +- .../migrations/0340-add-originally-published-at.ts | 16 ++-- 4 files changed, 55 insertions(+), 57 deletions(-) diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts index c5d5bb406..1f633d427 100644 --- a/client/src/app/shared/video/video-edit.model.ts +++ b/client/src/app/shared/video/video-edit.model.ts @@ -57,7 +57,7 @@ export class VideoEdit implements VideoUpdate { this.previewUrl = video.previewUrl this.scheduleUpdate = video.scheduledUpdate - this.originallyPublishedAt = new Date(video.originallyPublishedAt) + this.originallyPublishedAt = video.originallyPublishedAt ? new Date(video.originallyPublishedAt) : null } } 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 2fb540170..1be1084ad 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,20 +114,6 @@ -
- - - - - -
- {{ formErrors.originallyPublishedAt }} -
-
- -
-
- -
+
+
+
+ +
-
- -
+
+ +
-
- - - -
- {{ formErrors.support }} +
+ + + +
+ {{ formErrors.support }} +
- +
+
+ + + + + +
+ {{ formErrors.originallyPublishedAt }} +
+
+ + - + +
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 836452948..c7ebcec25 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 @@ -26,7 +26,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { @Input() videoPrivacies: VideoConstant[] = [] @Input() userVideoChannels: { id: number, label: string, support: string }[] = [] @Input() schedulePublicationPossible = true - @Input() videoCaptions: VideoCaptionEdit[] = [] + @Input() videoCaptions: (VideoCaptionEdit & { captionPath?: string })[] = [] @Input() waitTranscodingEnabled = true @ViewChild('videoCaptionAddModal') videoCaptionAddModal: VideoCaptionAddModalComponent diff --git a/server/initializers/migrations/0340-add-originally-published-at.ts b/server/initializers/migrations/0340-add-originally-published-at.ts index ab8d66854..fe4f4a5f9 100644 --- a/server/initializers/migrations/0340-add-originally-published-at.ts +++ b/server/initializers/migrations/0340-add-originally-published-at.ts @@ -6,19 +6,13 @@ async function up (utils: { sequelize: Sequelize.Sequelize }): Promise { - { - const data = { - type: Sequelize.DATE, - allowNull: true, - defaultValue: Sequelize.NOW - } - await utils.queryInterface.addColumn('video', 'originallyPublishedAt', data) + const data = { + type: Sequelize.DATE, + allowNull: true, + defaultValue: null } + await utils.queryInterface.addColumn('video', 'originallyPublishedAt', data) - { - const query = 'UPDATE video SET "originallyPublishedAt" = video."publishedAt"' - await utils.sequelize.query(query) - } } function down (options) { -- cgit v1.2.3