From 04d292c3342266b951475f8ecb3d9797d29b40fd Mon Sep 17 00:00:00 2001 From: rmmayo Date: Tue, 28 May 2024 17:04:51 +0000 Subject: [PATCH] #2490 - configure video page - WIP --- dashboard-prime/package.json | 1 + .../common-components/stores/UseAppConfig.js | 7 + .../common-components/video/VideoPlayer.vue | 151 +++-- .../src/components/video/VideoConfigPage.vue | 586 +++++++++++++++++- .../src/components/video/VideoFileInput.vue | 110 ++++ .../src/components/video/VideoService.js | 34 + dashboard-prime/src/main.js | 1 + 7 files changed, 811 insertions(+), 79 deletions(-) create mode 100644 dashboard-prime/src/components/video/VideoFileInput.vue create mode 100644 dashboard-prime/src/components/video/VideoService.js diff --git a/dashboard-prime/package.json b/dashboard-prime/package.json index 6329a1d434..616a0912fd 100644 --- a/dashboard-prime/package.json +++ b/dashboard-prime/package.json @@ -42,6 +42,7 @@ "tinycolor2": "1.6.0", "tui-editor-plugin-font-size": "1.0.4", "vee-validate": "4.12.8", + "video.js": "8.12.0", "vis-network": "9.1.9", "vue": "3.4.27", "vue-router": "4.3.2", diff --git a/dashboard-prime/src/common-components/stores/UseAppConfig.js b/dashboard-prime/src/common-components/stores/UseAppConfig.js index 7fd7c31dc5..09036affa3 100644 --- a/dashboard-prime/src/common-components/stores/UseAppConfig.js +++ b/dashboard-prime/src/common-components/stores/UseAppConfig.js @@ -113,7 +113,11 @@ export const useAppConfig = defineStore('dashboardAppConfig', () => { const approvalConfUserTagLabel = computed(() => config.value.approvalConfUserTagLabel) const projectMetricsTagCharts = computed(() => config.value.projectMetricsTagCharts) const maxDailyUserEvents = computed(() => config.value.maxDailyUserEvents) + const allowedVideoUploadMimeTypes = computed(() => config.value.allowedVideoUploadMimeTypes) + const videoUploadWarningMessage = computed(() => config.value.videoUploadWarningMessage) + const maxVideoCaptionsLength = computed(() => config.value.maxVideoCaptionsLength) const userPageTagsToDisplay = computed(() => config.value.userPageTagsToDisplay) + return { loadConfigState, refreshConfig, @@ -185,6 +189,9 @@ export const useAppConfig = defineStore('dashboardAppConfig', () => { approvalConfUserTagLabel, projectMetricsTagCharts, maxDailyUserEvents, + allowedVideoUploadMimeTypes, + videoUploadWarningMessage, + maxVideoCaptionsLength, userPageTagsToDisplay } }) \ No newline at end of file diff --git a/dashboard-prime/src/common-components/video/VideoPlayer.vue b/dashboard-prime/src/common-components/video/VideoPlayer.vue index 3d6359e116..fc1a300d6e 100644 --- a/dashboard-prime/src/common-components/video/VideoPlayer.vue +++ b/dashboard-prime/src/common-components/video/VideoPlayer.vue @@ -13,89 +13,84 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ + + - - + \ No newline at end of file diff --git a/dashboard-prime/src/components/video/VideoConfigPage.vue b/dashboard-prime/src/components/video/VideoConfigPage.vue index 837fb48486..23f88e395b 100644 --- a/dashboard-prime/src/components/video/VideoConfigPage.vue +++ b/dashboard-prime/src/components/video/VideoConfigPage.vue @@ -1,8 +1,592 @@ diff --git a/dashboard-prime/src/components/video/VideoFileInput.vue b/dashboard-prime/src/components/video/VideoFileInput.vue new file mode 100644 index 0000000000..3ff7f4913a --- /dev/null +++ b/dashboard-prime/src/components/video/VideoFileInput.vue @@ -0,0 +1,110 @@ + + + + + \ No newline at end of file diff --git a/dashboard-prime/src/components/video/VideoService.js b/dashboard-prime/src/components/video/VideoService.js new file mode 100644 index 0000000000..d016f3d2a6 --- /dev/null +++ b/dashboard-prime/src/components/video/VideoService.js @@ -0,0 +1,34 @@ +/* + * Copyright 2020 SkillTree + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import axios from 'axios'; + +export default { + saveVideoSettings(projectId, skillId, videoSettings) { + const url = `/admin/projects/${projectId}/skills/${skillId}/video`; + return axios.post(url, videoSettings) + .then((response) => response.data); + }, + deleteVideoSettings(projectId, skillId) { + const url = `/admin/projects/${projectId}/skills/${skillId}/video`; + return axios.delete(url) + .then((response) => response.data); + }, + getVideoSettings(projectId, skillId) { + const url = `/admin/projects/${projectId}/skills/${skillId}/video`; + return axios.get(url) + .then((response) => response.data); + }, +}; diff --git a/dashboard-prime/src/main.js b/dashboard-prime/src/main.js index 827c7cdbcb..c09a5a8c5d 100644 --- a/dashboard-prime/src/main.js +++ b/dashboard-prime/src/main.js @@ -72,6 +72,7 @@ import 'material-icons/css/material-icons.css'; import 'material-icons/iconfont/material-icons.css'; import '@toast-ui/editor/dist/toastui-editor.css'; // import 'primevue/resources/themes/lara-light-green/theme.css' +import 'video.js/dist/video-js.css' log.setLevel('trace')