From 3fca235aa2b91e141d5562cdfe127e1acd70a805 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Sat, 19 Sep 2020 14:07:21 +0100 Subject: [PATCH 1/7] Show a big scary warning when using non-production versions --- .env | 1 + .gitignore | 1 + Jenkinsfile | 2 +- src/showplanner/PISModal.tsx | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 30d7d95..c8c1b1e 100644 --- a/.env +++ b/.env @@ -1,5 +1,6 @@ HOST=local-development.ury.org.uk REACT_APP_VERSION=$npm_package_version +REACT_APP_HOMEPAGE=$npm_package_homepage REACT_APP_MYRADIO_NONAPI_BASE=https://ury.org.uk/myradio-staging REACT_APP_MYRADIO_BASE=https://ury.org.uk/api-staging/v2 REACT_APP_BROADCAST_API_BASE=https://ury.org.uk/webstudio/api/v1 diff --git a/.gitignore b/.gitignore index 3e11a7f..b24cd4f 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ yarn-error.log* .mypy_cache/ env/ env.ci/ +venv/ serverconfig.ini diff --git a/Jenkinsfile b/Jenkinsfile index e163177..170896f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,7 +71,7 @@ pipeline { } steps { sh 'sed -i -e \'s/ury.org.uk\\/webstudio-dev/ury.org.uk\\/webstudio/\' package.json' - sh 'REACT_APP_GIT_SHA=`git rev-parse --short HEAD` yarn build' + sh 'REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_PRODUCTION=true yarn build' sshagent(credentials: ['ury']) { sh 'rsync -av --delete-after build/ deploy@ury:/usr/local/www/webstudio' } diff --git a/src/showplanner/PISModal.tsx b/src/showplanner/PISModal.tsx index 54ba90b..ab01b61 100644 --- a/src/showplanner/PISModal.tsx +++ b/src/showplanner/PISModal.tsx @@ -3,6 +3,20 @@ import Modal from "react-modal"; import { getLatestNewsItem, NewsEntry } from "../api"; import { Button } from "reactstrap"; +function DevWarning() { + if (process.env.REACT_APP_PRODUCTION === "true") { + return null; + } + return ( +
+

Development Version

+ You are using a development version of WebStudio. This version is NOT tested and may have severe bugs and performance problems.
+ DO NOT BROADCAST LIVE SHOWS USING THIS VERSION!
+ For the latest and greatest tested WebStudio, go to {process.env.REACT_APP_HOMEPAGE}. +
+ ); +} + export function PisModal({ close, isOpen, @@ -35,6 +49,7 @@ export function PisModal({ return ( +

Presenter News

{(news === "loading" || news === "not_loaded") && (

Loading the news...

From 1d25dc95cb133ee2ab2411155ff9ee18c0ea258e Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Sat, 19 Sep 2020 14:11:49 +0100 Subject: [PATCH 2/7] And make it pretty --- src/showplanner/PISModal.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/showplanner/PISModal.tsx b/src/showplanner/PISModal.tsx index ab01b61..e93fe28 100644 --- a/src/showplanner/PISModal.tsx +++ b/src/showplanner/PISModal.tsx @@ -9,10 +9,19 @@ function DevWarning() { } return (
-

Development Version

- You are using a development version of WebStudio. This version is NOT tested and may have severe bugs and performance problems.
- DO NOT BROADCAST LIVE SHOWS USING THIS VERSION!
- For the latest and greatest tested WebStudio, go to {process.env.REACT_APP_HOMEPAGE}. +

Development Version

+ You are using a development version of WebStudio. This + version is NOT tested and may have severe bugs and performance problems. +
+ + DO NOT BROADCAST LIVE SHOWS USING THIS VERSION! + +
+ For the latest and greatest tested WebStudio, go to{" "} + + {process.env.REACT_APP_HOMEPAGE} + + .
); } From 6ca73a89b79b23007956703b4468dca69ca21f88 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 19 Sep 2020 17:46:55 +0100 Subject: [PATCH 3/7] Pretties, move the close to top. --- src/showplanner/PISModal.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/showplanner/PISModal.tsx b/src/showplanner/PISModal.tsx index e93fe28..3207e4e 100644 --- a/src/showplanner/PISModal.tsx +++ b/src/showplanner/PISModal.tsx @@ -2,13 +2,15 @@ import React, { useEffect, useState } from "react"; import Modal from "react-modal"; import { getLatestNewsItem, NewsEntry } from "../api"; import { Button } from "reactstrap"; +import { FaTimes } from "react-icons/fa"; function DevWarning() { if (process.env.REACT_APP_PRODUCTION === "true") { return null; } return ( -
+ <> +

Development Version

You are using a development version of WebStudio. This version is NOT tested and may have severe bugs and performance problems. @@ -23,6 +25,8 @@ function DevWarning() { .
+
+ ); } @@ -58,6 +62,12 @@ export function PisModal({ return ( +
+ +
+

Presenter News

{(news === "loading" || news === "not_loaded") && ( @@ -75,9 +85,7 @@ export function PisModal({
)} - +
); } From 197d513cdde583c57151abb784303b2f497bea3d Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 19 Sep 2020 17:53:39 +0100 Subject: [PATCH 4/7] Prettier --- src/showplanner/PISModal.tsx | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/showplanner/PISModal.tsx b/src/showplanner/PISModal.tsx index 3207e4e..6b65f5c 100644 --- a/src/showplanner/PISModal.tsx +++ b/src/showplanner/PISModal.tsx @@ -10,22 +10,22 @@ function DevWarning() { } return ( <> -
-

Development Version

- You are using a development version of WebStudio. This - version is NOT tested and may have severe bugs and performance problems. -
- - DO NOT BROADCAST LIVE SHOWS USING THIS VERSION! - -
- For the latest and greatest tested WebStudio, go to{" "} - - {process.env.REACT_APP_HOMEPAGE} - - . -
-
+
+

Development Version

+ You are using a development version of WebStudio. This + version is NOT tested and may have severe bugs and performance problems. +
+ + DO NOT BROADCAST LIVE SHOWS USING THIS VERSION! + +
+ For the latest and greatest tested WebStudio, go to{" "} + + {process.env.REACT_APP_HOMEPAGE} + + . +
+
); } @@ -85,7 +85,6 @@ export function PisModal({ )} - ); } From c8352d3cd1c268c6610af2262a139f33053d6b63 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 19 Sep 2020 17:56:17 +0100 Subject: [PATCH 5/7] Use the background instead. --- src/showplanner/PISModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/showplanner/PISModal.tsx b/src/showplanner/PISModal.tsx index 6b65f5c..7849ebe 100644 --- a/src/showplanner/PISModal.tsx +++ b/src/showplanner/PISModal.tsx @@ -10,7 +10,7 @@ function DevWarning() { } return ( <> -
+

Development Version

You are using a development version of WebStudio. This version is NOT tested and may have severe bugs and performance problems. From 0648d20b6f4da5e014066383dccbbb890b7c5d70 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 19 Sep 2020 18:05:34 +0100 Subject: [PATCH 6/7] A few style changes --- src/showplanner/PISModal.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/showplanner/PISModal.tsx b/src/showplanner/PISModal.tsx index 7849ebe..67705dd 100644 --- a/src/showplanner/PISModal.tsx +++ b/src/showplanner/PISModal.tsx @@ -10,7 +10,7 @@ function DevWarning() { } return ( <> -
+

Development Version

You are using a development version of WebStudio. This version is NOT tested and may have severe bugs and performance problems. @@ -63,8 +63,8 @@ export function PisModal({ return (
-

@@ -85,6 +85,10 @@ export function PisModal({
)} +
+ ); } From a19e367513a931df67094c3e6e92c66591f31bcd Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 19 Sep 2020 18:07:04 +0100 Subject: [PATCH 7/7] One more border fix. --- src/showplanner/PISModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/showplanner/PISModal.tsx b/src/showplanner/PISModal.tsx index 67705dd..9876a28 100644 --- a/src/showplanner/PISModal.tsx +++ b/src/showplanner/PISModal.tsx @@ -67,7 +67,7 @@ export function PisModal({
-
+

Presenter News

{(news === "loading" || news === "not_loaded") && (