From b8895bef33a2685eef8f259a51b2cc5d140635bb Mon Sep 17 00:00:00 2001 From: Saad Yousaf Date: Fri, 11 Nov 2022 18:08:26 +0500 Subject: [PATCH] fix: show Zoom settings when pii sharing is enabled and make launch email optional (#380) Co-authored-by: Mehak Nasir --- src/pages-and-resources/live/Settings.jsx | 5 +---- src/pages-and-resources/live/ZoomSettings.jsx | 8 ++++---- src/pages-and-resources/live/ZoomSettings.test.jsx | 10 +++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/pages-and-resources/live/Settings.jsx b/src/pages-and-resources/live/Settings.jsx index c33c145ee..d68a19e31 100644 --- a/src/pages-and-resources/live/Settings.jsx +++ b/src/pages-and-resources/live/Settings.jsx @@ -57,10 +57,7 @@ function LiveSettings({ is: (provider, tier) => provider === 'zoom' || (provider === 'big_blue_button' && tier === bbbPlanTypes.commercial), then: Yup.string().required(intl.formatMessage(messages.launchUrlRequired)), }), - launchEmail: Yup.string().when('provider', { - is: 'zoom', - then: Yup.string().required(intl.formatMessage(messages.launchEmailRequired)), - }), + launchEmail: Yup.string(), }; const handleProviderChange = (providerId, setFieldValue, values) => { diff --git a/src/pages-and-resources/live/ZoomSettings.jsx b/src/pages-and-resources/live/ZoomSettings.jsx index afca821b9..d4dede383 100644 --- a/src/pages-and-resources/live/ZoomSettings.jsx +++ b/src/pages-and-resources/live/ZoomSettings.jsx @@ -6,13 +6,13 @@ import { providerNames } from './constants'; import LiveCommonFields from './LiveCommonFields'; import FormikControl from '../../generic/FormikControl'; -function ZoomsSettings({ +function ZoomSettings({ intl, values, }) { return ( <> - {(!values.piiSharingEnable && (values.piiSharingEmail || values.piiSharingUsername)) ? ( + {!values.piiSharingEnable ? (

{intl.formatMessage(messages.requestPiiSharingEnable, { provider: providerNames[values.provider] })}

@@ -37,7 +37,7 @@ function ZoomsSettings({ ); } -ZoomsSettings.propTypes = { +ZoomSettings.propTypes = { intl: intlShape.isRequired, values: PropTypes.shape({ consumerKey: PropTypes.string, @@ -51,4 +51,4 @@ ZoomsSettings.propTypes = { }).isRequired, }; -export default injectIntl(ZoomsSettings); +export default injectIntl(ZoomSettings); diff --git a/src/pages-and-resources/live/ZoomSettings.test.jsx b/src/pages-and-resources/live/ZoomSettings.test.jsx index 59155f632..42d2b917f 100644 --- a/src/pages-and-resources/live/ZoomSettings.test.jsx +++ b/src/pages-and-resources/live/ZoomSettings.test.jsx @@ -80,8 +80,8 @@ describe('Zoom Settings', () => { history.push(liveSettingsUrl); }); - test('LTI fields are visible when pii sharing is enabled and email or username sharing required', async () => { - await mockStore({ emailSharing: true }); + test('LTI fields are visible when pii sharing is enabled', async () => { + await mockStore({ piiSharingAllowed: true }); renderComponent(); const spinner = getByRole(container, 'status'); @@ -103,9 +103,9 @@ describe('Zoom Settings', () => { }); test( - 'Only connect to support message is visible when pii sharing is disabled and email or username sharing is required', + 'Only connect to support message is visible when pii sharing is disabled', async () => { - await mockStore({ emailSharing: true, piiSharingAllowed: false }); + await mockStore({ piiSharingAllowed: false }); renderComponent(); const spinner = getByRole(container, 'status'); @@ -129,7 +129,7 @@ describe('Zoom Settings', () => { test('Provider Configuration should be displayed correctly', async () => { const apiDefaultResponse = generateLiveConfigurationApiResponse(true, true); - await mockStore({ emailSharing: false, piiSharingAllowed: false }); + await mockStore({ piiSharingAllowed: true }); renderComponent(); const spinner = getByRole(container, 'status');