From 648ffe5884cc16974beb11894f63c4868fbe7720 Mon Sep 17 00:00:00 2001
From: Awais Ansari <79941147+awais-ansari@users.noreply.github.com>
Date: Tue, 26 Apr 2022 17:27:52 +0500
Subject: [PATCH] fix: remove PII sharing flag from live configuration (#296)
---
src/pages-and-resources/live/Settings.jsx | 70 +++++++++----------
.../live/Settings.test.jsx | 30 +-------
src/pages-and-resources/live/data/thunks.js | 2 -
.../live/factories/mockApiResponses.jsx | 3 -
src/pages-and-resources/live/messages.js | 5 --
5 files changed, 35 insertions(+), 75 deletions(-)
diff --git a/src/pages-and-resources/live/Settings.jsx b/src/pages-and-resources/live/Settings.jsx
index 90f380165..6a11217c6 100644
--- a/src/pages-and-resources/live/Settings.jsx
+++ b/src/pages-and-resources/live/Settings.jsx
@@ -74,45 +74,39 @@ function LiveSettings({
))}
- {values.piiSharingEnable ? (
- <>
-
- {intl.formatMessage(messages.providerHelperText, { providerName: values.provider })}
-
- {intl.formatMessage(messages.formInstructions)}
-
-
-
-
- >
- ) : (
-
- {intl.formatMessage(messages.requestPiiSharingEnable, { provider: values.provider })}
+ <>
+
+ {intl.formatMessage(messages.providerHelperText, { providerName: values.provider })}
- )}
+ {intl.formatMessage(messages.formInstructions)}
+
+
+
+
+ >
>
)
}
diff --git a/src/pages-and-resources/live/Settings.test.jsx b/src/pages-and-resources/live/Settings.test.jsx
index 727079f44..7d741e2c0 100644
--- a/src/pages-and-resources/live/Settings.test.jsx
+++ b/src/pages-and-resources/live/Settings.test.jsx
@@ -97,7 +97,7 @@ describe('LiveSettings', () => {
const fetchProviderConfigUrl = `${providerConfigurationApiUrl}/${courseId}/`;
axiosMock.onGet(fetchProviderConfigUrl).reply(
200,
- generateLiveConfigurationApiResponse(false, false),
+ generateLiveConfigurationApiResponse(false),
);
await executeThunk(fetchLiveConfiguration(courseId), store.dispatch);
renderComponent();
@@ -114,7 +114,7 @@ describe('LiveSettings', () => {
const fetchProviderConfigUrl = `${providerConfigurationApiUrl}/${courseId}/`;
axiosMock.onGet(fetchProviderConfigUrl).reply(
200,
- generateLiveConfigurationApiResponse(false, true),
+ generateLiveConfigurationApiResponse(false),
);
await executeThunk(fetchLiveConfiguration(courseId), store.dispatch);
renderComponent();
@@ -129,7 +129,7 @@ describe('LiveSettings', () => {
);
});
- test('Only helper text and lti fields are visible when pii sharing is enabled', async () => {
+ test('Displays helper text and lti fields for selected provider', async () => {
const fetchProviderConfigUrl = `${providerConfigurationApiUrl}/${courseId}/`;
axiosMock.onGet(fetchProviderConfigUrl).reply(
200,
@@ -153,30 +153,6 @@ describe('LiveSettings', () => {
expect(launchEmail.lastChild).toHaveTextContent(messages.launchEmail.defaultMessage);
});
- test('Only connect to support is visible when pii sharing is disabled', async () => {
- const fetchProviderConfigUrl = `${providerConfigurationApiUrl}/${courseId}/`;
- axiosMock.onGet(fetchProviderConfigUrl).reply(
- 200,
- generateLiveConfigurationApiResponse(false, false),
- );
- await executeThunk(fetchLiveConfiguration(courseId), store.dispatch);
- renderComponent();
-
- const requestPiiText = queryByTestId(container, 'request-pii-sharing');
- const consumerKey = container.querySelector('input[name="consumerKey"]');
- const consumerSecret = container.querySelector('input[name="consumerSecret"]');
- const launchUrl = container.querySelector('input[name="launchUrl"]');
- const launchEmail = container.querySelector('input[name="launchEmail"]');
-
- expect(requestPiiText).toHaveTextContent(
- messages.requestPiiSharingEnable.defaultMessage.replaceAll('{provider}', 'zoom'),
- );
- expect(consumerKey).not.toBeInTheDocument();
- expect(consumerSecret).not.toBeInTheDocument();
- expect(launchUrl).not.toBeInTheDocument();
- expect(launchEmail).not.toBeInTheDocument();
- });
-
test('Form should be submitted and closed when valid data is provided', async () => {
const fetchProviderConfigUrl = `${providerConfigurationApiUrl}/${courseId}/`;
const apiDefaultResponse = generateLiveConfigurationApiResponse();
diff --git a/src/pages-and-resources/live/data/thunks.js b/src/pages-and-resources/live/data/thunks.js
index f57021d5e..2603c9695 100644
--- a/src/pages-and-resources/live/data/thunks.js
+++ b/src/pages-and-resources/live/data/thunks.js
@@ -15,7 +15,6 @@ function normalizeLiveConfig(config) {
configuration.launchUrl = config?.ltiConfiguration?.lti1P1LaunchUrl || '';
configuration.launchEmail = config?.ltiConfiguration?.ltiConfig?.additionalParameters?.customInstructorEmail || '';
configuration.provider = config?.providerType || 'zoom';
- configuration.piiSharingEnable = config?.piiSharingAllowed || false;
return configuration;
}
@@ -35,7 +34,6 @@ function deNormalizeLiveConfig(config) {
},
},
};
- configuration.pii_sharing_allowed = config?.piiSharingEnable || false;
return configuration;
}
diff --git a/src/pages-and-resources/live/factories/mockApiResponses.jsx b/src/pages-and-resources/live/factories/mockApiResponses.jsx
index ab7f2c2fd..c882c41cb 100644
--- a/src/pages-and-resources/live/factories/mockApiResponses.jsx
+++ b/src/pages-and-resources/live/factories/mockApiResponses.jsx
@@ -56,7 +56,6 @@ export const initialState = {
launchUrl: '',
launchEmail: '',
provider: 'zoom',
- piiSharingEnable: true,
},
saveStatus: 'successful',
configuredProvider: 'zoom',
@@ -65,7 +64,6 @@ export const initialState = {
export const generateLiveConfigurationApiResponse = (
enabled = true,
- piiSharingAllowed = true,
) => ({
course_key: courseId,
provider_type: 'zoom',
@@ -81,5 +79,4 @@ export const generateLiveConfigurationApiResponse = (
},
},
},
- pii_sharing_allowed: piiSharingAllowed,
});
diff --git a/src/pages-and-resources/live/messages.js b/src/pages-and-resources/live/messages.js
index b18d3fe84..5280acc33 100644
--- a/src/pages-and-resources/live/messages.js
+++ b/src/pages-and-resources/live/messages.js
@@ -91,11 +91,6 @@ const messages = defineMessages({
defaultMessage: 'This configuration will require sharing username and emails of learners and the course team with {providerName}.',
description: 'Tells the user that sharing username and email is required for configuration',
},
- requestPiiSharingEnable: {
- id: 'authoring.live.requestPiiSharingEnable',
- defaultMessage: 'This configuration will require sharing usernames and emails of learners and the course team with {provider}. To access the LTI configuration for {provider}, please request your edX project coordinator to get PII sharing enabled for this course.',
- description: 'Tells the user that request edx project coordinator to enable the PII sharing to access the LTI configuration for a provider.',
- },
general: {
id: 'authoring.live.appDocInstructions.documentationLink',
defaultMessage: 'General documentation',