Skip to content

Commit

Permalink
fix: show Zoom settings when pii sharing is enabled and make launch e…
Browse files Browse the repository at this point in the history
…mail optional (#380)

Co-authored-by: Mehak Nasir <[email protected]>
  • Loading branch information
saadyousafarbi and mehaknasir authored Nov 11, 2022
1 parent 89d0d12 commit b8895be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
5 changes: 1 addition & 4 deletions src/pages-and-resources/live/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions src/pages-and-resources/live/ZoomSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<p data-testid="request-pii-sharing">
{intl.formatMessage(messages.requestPiiSharingEnable, { provider: providerNames[values.provider] })}
</p>
Expand All @@ -37,7 +37,7 @@ function ZoomsSettings({
);
}

ZoomsSettings.propTypes = {
ZoomSettings.propTypes = {
intl: intlShape.isRequired,
values: PropTypes.shape({
consumerKey: PropTypes.string,
Expand All @@ -51,4 +51,4 @@ ZoomsSettings.propTypes = {
}).isRequired,
};

export default injectIntl(ZoomsSettings);
export default injectIntl(ZoomSettings);
10 changes: 5 additions & 5 deletions src/pages-and-resources/live/ZoomSettings.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit b8895be

Please sign in to comment.