From a6346c4b3f0ce0a3e09d003ce5d93780b2cb3147 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon <44397098+microbit-matt-hillsdon@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:02:24 +0000 Subject: [PATCH 01/16] Get the welcome video via the deployment not CMS (#1157) This makes more sense than using the CMS as it's not really content in the same way as everything else. --- .github/workflows/build.yml | 2 +- lang/ui.ca.json | 4 ++ lang/ui.de.json | 4 ++ lang/ui.en.json | 4 ++ lang/ui.es-es.json | 4 ++ lang/ui.fr.json | 4 ++ lang/ui.ja.json | 4 ++ lang/ui.ko.json | 4 ++ lang/ui.nl.json | 4 ++ lang/ui.zh-cn.json | 4 ++ lang/ui.zh-tw.json | 4 ++ src/common/YoutubeVideoEmbed.tsx | 63 ++++++++++-------------------- src/deployment/default/index.tsx | 2 + src/deployment/index.ts | 1 + src/messages/ui.ca.json | 6 +++ src/messages/ui.de.json | 6 +++ src/messages/ui.en.json | 6 +++ src/messages/ui.es-es.json | 6 +++ src/messages/ui.fr.json | 6 +++ src/messages/ui.ja.json | 6 +++ src/messages/ui.ko.json | 6 +++ src/messages/ui.nl.json | 6 +++ src/messages/ui.zh-cn.json | 6 +++ src/messages/ui.zh-tw.json | 6 +++ src/workbench/PreReleaseNotice.tsx | 27 +++++++------ src/workbench/ReleaseDialogs.tsx | 12 +++++- src/workbench/WelcomeDialog.tsx | 51 ++++++------------------ 27 files changed, 160 insertions(+), 98 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0468d4d9c..8fc3ce92c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: - run: npm ci env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: npm install --no-save @microbit-foundation/python-editor-v3-microbit@0.2.0-dev.37 @microbit-foundation/website-deploy-aws@0.6.0 @microbit-foundation/website-deploy-aws-config@0.9.0 @microbit-foundation/circleci-npm-package-versioner@1 + - run: npm install --no-save @microbit-foundation/python-editor-v3-microbit@0.2.0-dev.38 @microbit-foundation/website-deploy-aws@0.6.0 @microbit-foundation/website-deploy-aws-config@0.9.0 @microbit-foundation/circleci-npm-package-versioner@1 if: github.repository_owner == 'microbit-foundation' env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/lang/ui.ca.json b/lang/ui.ca.json index f0079db42..2f3e3bc5c 100644 --- a/lang/ui.ca.json +++ b/lang/ui.ca.json @@ -1158,6 +1158,10 @@ "defaultMessage": "Benvingut a l'Editor Python de la micro:bit", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "Amplia", "description": "Text label for zoom in button" diff --git a/lang/ui.de.json b/lang/ui.de.json index 540f14631..d3d8703c1 100644 --- a/lang/ui.de.json +++ b/lang/ui.de.json @@ -1158,6 +1158,10 @@ "defaultMessage": "Willkommen zum micro:bit Python-Editor", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "Vergrößern", "description": "Text label for zoom in button" diff --git a/lang/ui.en.json b/lang/ui.en.json index 88b44ba07..e83ebd588 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -1159,6 +1159,10 @@ "defaultMessage": "Welcome to the micro:bit Python Editor", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "Zoom in", "description": "Text label for zoom in button" diff --git a/lang/ui.es-es.json b/lang/ui.es-es.json index 634e3a867..d615ce3dd 100644 --- a/lang/ui.es-es.json +++ b/lang/ui.es-es.json @@ -1158,6 +1158,10 @@ "defaultMessage": "Bienvenido al Editor de Python de micro:bit", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "Aumentar zoom", "description": "Text label for zoom in button" diff --git a/lang/ui.fr.json b/lang/ui.fr.json index d49bceda8..3c8cf76f4 100644 --- a/lang/ui.fr.json +++ b/lang/ui.fr.json @@ -1158,6 +1158,10 @@ "defaultMessage": "Bienvenue dans l'éditeur Python micro:bit", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "Zoom avant", "description": "Text label for zoom in button" diff --git a/lang/ui.ja.json b/lang/ui.ja.json index 96df79548..b8b56e462 100644 --- a/lang/ui.ja.json +++ b/lang/ui.ja.json @@ -1158,6 +1158,10 @@ "defaultMessage": "micro:bit Pythonエディターへようこそ", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "拡大", "description": "Text label for zoom in button" diff --git a/lang/ui.ko.json b/lang/ui.ko.json index ef5629b1e..47ec75d06 100644 --- a/lang/ui.ko.json +++ b/lang/ui.ko.json @@ -1158,6 +1158,10 @@ "defaultMessage": "micro:bit Python 편집기에 오신 것을 환영합니다", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "글꼴 크게", "description": "Text label for zoom in button" diff --git a/lang/ui.nl.json b/lang/ui.nl.json index 73937fe57..8ab388e35 100644 --- a/lang/ui.nl.json +++ b/lang/ui.nl.json @@ -1158,6 +1158,10 @@ "defaultMessage": "Welkom bij de micro:bit Python Editor", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "Inzoomen", "description": "Text label for zoom in button" diff --git a/lang/ui.zh-cn.json b/lang/ui.zh-cn.json index ca8058c6f..661ee1a8e 100644 --- a/lang/ui.zh-cn.json +++ b/lang/ui.zh-cn.json @@ -1158,6 +1158,10 @@ "defaultMessage": "欢迎使用 micro:bit Python 编辑器", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "放大", "description": "Text label for zoom in button" diff --git a/lang/ui.zh-tw.json b/lang/ui.zh-tw.json index 8b1461881..47d0b0ca5 100644 --- a/lang/ui.zh-tw.json +++ b/lang/ui.zh-tw.json @@ -1158,6 +1158,10 @@ "defaultMessage": "歡迎使用 micro:bit Python 編輯器", "description": "Title for the welcome dialog" }, + "welcome-video-alt": { + "defaultMessage": "video introducing the Python Editor", + "description": "iframe title for the welcome video" + }, "zoom-in-action": { "defaultMessage": "放大", "description": "Text label for zoom in button" diff --git a/src/common/YoutubeVideoEmbed.tsx b/src/common/YoutubeVideoEmbed.tsx index ee3f74fa2..8df16fb07 100644 --- a/src/common/YoutubeVideoEmbed.tsx +++ b/src/common/YoutubeVideoEmbed.tsx @@ -1,56 +1,33 @@ -import { AspectRatio, Box, Text } from "@chakra-ui/react"; -import Spinner from "./Spinner"; +import { AspectRatio, Box } from "@chakra-ui/react"; export interface YoutubeVideo { alt: string; - attribution: string; - caption: string; youtubeId: string; } interface YoutubeVideoProps { - youTubeVideo: YoutubeVideo | undefined; + alt: string; + youtubeId: string; } -const YoutubeVideoEmbed = ({ youTubeVideo }: YoutubeVideoProps) => { - const { alt, attribution, caption, youtubeId } = youTubeVideo || {}; +const YoutubeVideoEmbed = ({ alt, youtubeId }: YoutubeVideoProps) => { return ( - <> - {youTubeVideo ? ( - - - - - {caption && ( - - {caption} - - )} - {attribution && ( - - {attribution} - - )} - - ) : ( - - - - )} - + + +