From 4daa7ef971a177390d6de9136a4c07cf3dfbe063 Mon Sep 17 00:00:00 2001 From: Ayesha Waris Date: Thu, 22 May 2025 18:49:40 +0500 Subject: [PATCH] feat: removed ora staff notification settings banner --- src/App.jsx | 2 - src/__snapshots__/App.test.jsx.snap | 2 - .../NotificationsBanner.test.jsx | 31 ------------ .../NotificationsBanner.test.jsx.snap | 48 ------------------- src/containers/NotificationsBanner/index.jsx | 37 -------------- .../NotificationsBanner/messages.js | 18 ------- 6 files changed, 138 deletions(-) delete mode 100644 src/containers/NotificationsBanner/NotificationsBanner.test.jsx delete mode 100644 src/containers/NotificationsBanner/__snapshots__/NotificationsBanner.test.jsx.snap delete mode 100644 src/containers/NotificationsBanner/index.jsx delete mode 100644 src/containers/NotificationsBanner/messages.js diff --git a/src/App.jsx b/src/App.jsx index 53bfc0d0e..42a174f23 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -9,7 +9,6 @@ import { LearningHeader as Header } from '@edx/frontend-component-header'; import { selectors } from 'data/redux'; import DemoWarning from 'containers/DemoWarning'; -import NotificationsBanner from 'containers/NotificationsBanner'; import ListView from 'containers/ListView'; import './App.scss'; @@ -26,7 +25,6 @@ export const App = ({ courseMetadata, isEnabled }) => ( data-testid="header" /> {!isEnabled && } -
diff --git a/src/__snapshots__/App.test.jsx.snap b/src/__snapshots__/App.test.jsx.snap index ee7d6a61d..4101d1433 100644 --- a/src/__snapshots__/App.test.jsx.snap +++ b/src/__snapshots__/App.test.jsx.snap @@ -11,7 +11,6 @@ exports[`App router component snapshot: disabled (show demo warning) 1`] = ` data-testid="header" /> -
@@ -32,7 +31,6 @@ exports[`App router component snapshot: enabled 1`] = ` courseTitle="course-title" data-testid="header" /> -
diff --git a/src/containers/NotificationsBanner/NotificationsBanner.test.jsx b/src/containers/NotificationsBanner/NotificationsBanner.test.jsx deleted file mode 100644 index eb3a36869..000000000 --- a/src/containers/NotificationsBanner/NotificationsBanner.test.jsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; -import { shallow } from '@edx/react-unit-test-utils'; -import { getConfig } from '@edx/frontend-platform'; - -import { NotificationsBanner } from '.'; - -jest.mock('@edx/frontend-platform', () => ({ - getConfig: jest.fn(), -})); - -describe('NotificationsBanner component', () => { - afterEach(() => { - jest.clearAllMocks(); - }); - - test('snapshots with empty ACCOUNT_SETTINGS_URL', () => { - getConfig.mockReturnValue({ - ACCOUNT_SETTINGS_URL: '', - }); - const el = shallow(); - expect(el.snapshot).toMatchSnapshot(); - }); - - test('snapshots with ACCOUNT_SETTINGS_URL', () => { - getConfig.mockReturnValue({ - ACCOUNT_SETTINGS_URL: 'http://localhost:1997', - }); - const el = shallow(); - expect(el.snapshot).toMatchSnapshot(); - }); -}); diff --git a/src/containers/NotificationsBanner/__snapshots__/NotificationsBanner.test.jsx.snap b/src/containers/NotificationsBanner/__snapshots__/NotificationsBanner.test.jsx.snap deleted file mode 100644 index 8942e4355..000000000 --- a/src/containers/NotificationsBanner/__snapshots__/NotificationsBanner.test.jsx.snap +++ /dev/null @@ -1,48 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NotificationsBanner component snapshots with ACCOUNT_SETTINGS_URL 1`] = ` - - - - - - - - -`; - -exports[`NotificationsBanner component snapshots with empty ACCOUNT_SETTINGS_URL 1`] = ` - - - - - - -`; diff --git a/src/containers/NotificationsBanner/index.jsx b/src/containers/NotificationsBanner/index.jsx deleted file mode 100644 index dd90b11d1..000000000 --- a/src/containers/NotificationsBanner/index.jsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; - -import { getConfig } from '@edx/frontend-platform'; -import { FormattedMessage } from '@edx/frontend-platform/i18n'; -import { PageBanner, Hyperlink } from '@openedx/paragon'; - -import messages from './messages'; - -export const NotificationsBanner = () => ( - - - - { - ( - getConfig().ACCOUNT_SETTINGS_URL === null - || getConfig().ACCOUNT_SETTINGS_URL === undefined - || getConfig().ACCOUNT_SETTINGS_URL.trim().length === 0 - ) ? ( - - ) : ( - - - - ) - } - - -); - -export default NotificationsBanner; diff --git a/src/containers/NotificationsBanner/messages.js b/src/containers/NotificationsBanner/messages.js deleted file mode 100644 index e92f4f4bf..000000000 --- a/src/containers/NotificationsBanner/messages.js +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable quotes */ -import { defineMessages } from '@edx/frontend-platform/i18n'; -import { StrictDict } from 'utils'; - -const messages = defineMessages({ - infoMessage: { - id: 'ora-grading.NotificationsBanner.Message', - defaultMessage: 'You can now enable notifications for ORA assignments that require staff grading, from the ', - description: 'user info message that user can enable notifications for ORA assignments', - }, - notificationsBannerPreferencesCenterMessage: { - id: 'ora-grading.NotificationsBanner.linkMessage', - defaultMessage: 'preferences center.', - description: 'placeholder for the preferences center link', - }, -}); - -export default StrictDict(messages);