From a895c28c4c39ef5bfe4e9d22ad9f4319f62e18b9 Mon Sep 17 00:00:00 2001 From: jansenk Date: Tue, 14 Mar 2023 15:24:45 -0400 Subject: [PATCH] feat: hide checkbox when video share not enabled for course --- .../__snapshots__/index.test.jsx.snap | 147 ++++++++++++++++++ .../components/VideoSourceWidget/index.jsx | 59 ++++--- .../VideoSourceWidget/index.test.jsx | 29 +++- src/editors/data/constants/requests.js | 1 + src/editors/data/redux/requests/reducer.js | 1 + .../data/redux/thunkActions/requests.js | 12 ++ .../data/redux/thunkActions/requests.test.js | 16 ++ src/editors/data/redux/thunkActions/video.js | 5 + .../data/redux/thunkActions/video.test.js | 23 ++- src/editors/data/redux/video/reducer.js | 1 + src/editors/data/redux/video/selectors.js | 1 + src/editors/data/services/cms/api.js | 6 + src/editors/data/services/cms/api.test.js | 10 ++ src/editors/data/services/cms/mockApi.js | 4 + src/editors/data/services/cms/urls.js | 4 + src/editors/data/services/cms/urls.test.js | 7 + 16 files changed, 297 insertions(+), 29 deletions(-) diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap index dd3b00c8b..3e636814e 100644 --- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap @@ -122,6 +122,152 @@ exports[`VideoSourceWidget snapshots snapshots: renders as expected with default /> + + +
+ + +`; + +exports[`VideoSourceWidget snapshots snapshots: renders as expected with videoSharingEnabledForCourse=true 1`] = ` + + +
+ + + + + + + + +
+
+ +
+
+ +
+ + + + + + +
+ +
+
+ + + + } + placement="top" + > + + + +
+ +
{ const dispatch = useDispatch(); const { @@ -127,27 +131,32 @@ export const VideoSourceWidget = ({ - -
- -
-
- - - - )} - > - - + {videoSharingEnabledForCourse && ( + + +
+ +
+
+ + + + )} + > + + + +
+ )}