From c9b986e4e1e3cb6fef9a32f77647fc3fad36556c Mon Sep 17 00:00:00 2001 From: ayeshoali Date: Thu, 4 Jan 2024 18:02:16 +0500 Subject: [PATCH] chore: removed reported_content_email_notifications_flag dependency --- .../apps/openedx/OpenedXConfigForm.jsx | 1 - .../apps/openedx/OpenedXConfigForm.test.jsx | 4 --- .../ReportedContentEmailNotifications.jsx | 31 ++++++++----------- .../DiscussionTopics.test.jsx | 1 - .../discussions/data/api.js | 1 - .../discussions/data/redux.test.js | 1 - .../discussions/factories/mockApiResponses.js | 1 - .../pacing-section/PacingSection.test.jsx | 2 +- 8 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.jsx b/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.jsx index 3f2e95b2d8..ac9c074cf1 100644 --- a/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.jsx +++ b/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.jsx @@ -38,7 +38,6 @@ const OpenedXConfigForm = ({ unitLevelVisibility: true, allowAnonymousPostsPeers: appConfigObj?.allowAnonymousPostsPeers || false, reportedContentEmailNotifications: appConfigObj?.reportedContentEmailNotifications || false, - enableReportedContentEmailNotifications: Boolean(appConfigObj?.enableReportedContentEmailNotifications) || false, restrictedDates: appConfigObj?.restrictedDates || [], discussionTopics: discussionTopicsModel || [], divideByCohorts: appConfigObj?.divideByCohorts || false, diff --git a/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.test.jsx b/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.test.jsx index b242ca736f..ddff4fee9b 100644 --- a/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.test.jsx +++ b/src/pages-and-resources/discussions/app-config-form/apps/openedx/OpenedXConfigForm.test.jsx @@ -48,7 +48,6 @@ const defaultAppConfig = (divideDiscussionIds = []) => ({ allowAnonymousPosts: false, allowAnonymousPostsPeers: false, reportedContentEmailNotifications: false, - enableReportedContentEmailNotifications: false, allowDivisionByUnit: false, restrictedDates: [], cohortsEnabled: false, @@ -141,7 +140,6 @@ describe('OpenedXConfigForm', () => { ...legacyApiResponse, plugin_configuration: { ...legacyApiResponse.plugin_configuration, - reported_content_email_notifications_flag: true, divided_course_wide_discussions: [], available_division_schemes: [], }, @@ -181,7 +179,6 @@ describe('OpenedXConfigForm', () => { ...legacyApiResponse.plugin_configuration, allow_anonymous: true, reported_content_email_notifications: true, - reported_content_email_notifications_flag: true, always_divide_inline_discussions: true, divided_course_wide_discussions: [], available_division_schemes: ['cohorts'], @@ -222,7 +219,6 @@ describe('OpenedXConfigForm', () => { ...legacyApiResponse.plugin_configuration, allow_anonymous: true, reported_content_email_notifications: true, - reported_content_email_notifications_flag: true, always_divide_inline_discussions: true, divided_course_wide_discussions: ['13f106c6-6735-4e84-b097-0456cff55960', 'course'], }, diff --git a/src/pages-and-resources/discussions/app-config-form/apps/shared/ReportedContentEmailNotifications.jsx b/src/pages-and-resources/discussions/app-config-form/apps/shared/ReportedContentEmailNotifications.jsx index 08972f60e8..67fc81896a 100644 --- a/src/pages-and-resources/discussions/app-config-form/apps/shared/ReportedContentEmailNotifications.jsx +++ b/src/pages-and-resources/discussions/app-config-form/apps/shared/ReportedContentEmailNotifications.jsx @@ -13,24 +13,19 @@ const ReportedContentEmailNotifications = ({ intl }) => { } = useFormikContext(); return ( - // eslint-disable-next-line react/jsx-no-useless-fragment - <> - {values.enableReportedContentEmailNotifications && ( -
-
{intl.formatMessage(messages.reportedContentEmailNotifications)}
- - -
- )} - +
+
{intl.formatMessage(messages.reportedContentEmailNotifications)}
+ + +
); }; diff --git a/src/pages-and-resources/discussions/app-config-form/apps/shared/discussion-topics/DiscussionTopics.test.jsx b/src/pages-and-resources/discussions/app-config-form/apps/shared/discussion-topics/DiscussionTopics.test.jsx index 6f9181c2af..7ab9384b82 100644 --- a/src/pages-and-resources/discussions/app-config-form/apps/shared/discussion-topics/DiscussionTopics.test.jsx +++ b/src/pages-and-resources/discussions/app-config-form/apps/shared/discussion-topics/DiscussionTopics.test.jsx @@ -33,7 +33,6 @@ const appConfig = { allowAnonymousPosts: false, allowAnonymousPostsPeers: false, reportedContentEmailNotifications: false, - enableReportedContentEmailNotifications: false, allowDivisionByUnit: false, restrictedDates: [], }; diff --git a/src/pages-and-resources/discussions/data/api.js b/src/pages-and-resources/discussions/data/api.js index 12d0177f87..959457adb2 100644 --- a/src/pages-and-resources/discussions/data/api.js +++ b/src/pages-and-resources/discussions/data/api.js @@ -63,7 +63,6 @@ function normalizePluginConfig(data) { allowAnonymousPosts: data.allow_anonymous, allowAnonymousPostsPeers: data.allow_anonymous_to_peers, reportedContentEmailNotifications: data.reported_content_email_notifications, - enableReportedContentEmailNotifications: data.reported_content_email_notifications_flag, divisionScheme: data.division_scheme, alwaysDivideInlineDiscussions: data.always_divide_inline_discussions, restrictedDates: normalizeRestrictedDates(data.discussion_blackouts), diff --git a/src/pages-and-resources/discussions/data/redux.test.js b/src/pages-and-resources/discussions/data/redux.test.js index ac383c405f..7e8f9fea5a 100644 --- a/src/pages-and-resources/discussions/data/redux.test.js +++ b/src/pages-and-resources/discussions/data/redux.test.js @@ -245,7 +245,6 @@ describe('Data layer integration tests', () => { allowAnonymousPosts: false, allowAnonymousPostsPeers: false, reportedContentEmailNotifications: false, - enableReportedContentEmailNotifications: false, restrictedDates: [], // TODO: Note! As of this writing, all the data below this line is NOT returned in the API // but we add it in during normalization. diff --git a/src/pages-and-resources/discussions/factories/mockApiResponses.js b/src/pages-and-resources/discussions/factories/mockApiResponses.js index e16814935d..e8ce839eff 100644 --- a/src/pages-and-resources/discussions/factories/mockApiResponses.js +++ b/src/pages-and-resources/discussions/factories/mockApiResponses.js @@ -110,7 +110,6 @@ export const generateLegacyApiResponse = () => ({ allow_anonymous: false, allow_anonymous_to_peers: false, reported_content_email_notifications: false, - reported_content_email_notifications_flag: false, always_divide_inline_discussions: false, available_division_schemes: ['enrollment_track'], discussion_topics: { diff --git a/src/schedule-and-details/pacing-section/PacingSection.test.jsx b/src/schedule-and-details/pacing-section/PacingSection.test.jsx index 30f4fe83cf..c8bacc17f1 100644 --- a/src/schedule-and-details/pacing-section/PacingSection.test.jsx +++ b/src/schedule-and-details/pacing-section/PacingSection.test.jsx @@ -43,7 +43,7 @@ describe('', () => { }); it('shows disabled radio inputs correctly', () => { - const pastDate = '2023-12-31'; + const pastDate = '2024-12-31'; const initialProps = { ...props, startDate: pastDate }; const { getAllByRole, queryAllByText } = render( ,