Skip to content

Commit b88fa72

Browse files
feat!: added notifications plugin slot (#641)
feat!: added notifications plugin slot (#641) Breaking Change: Added notification slot and remove notification tray
1 parent 17944f3 commit b88fa72

33 files changed

+19
-2203
lines changed

package-lock.json

+1-73
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,12 @@
6161
"@openedx/frontend-plugin-framework": "^1.2.1",
6262
"@openedx/paragon": "^21.11.0",
6363
"@reduxjs/toolkit": "1.9.7",
64-
"axios-mock-adapter": "1.22.0",
6564
"babel-polyfill": "6.26.0",
6665
"classnames": "2.5.1",
6766
"core-js": "3.40.0",
68-
"dompurify": "^3.1.7",
69-
"lodash": "4.17.21",
7067
"react-responsive": "^10.0.0",
7168
"react-transition-group": "4.4.5",
72-
"regenerator-runtime": "0.14.1",
73-
"rosie": "2.1.1",
74-
"timeago.js": "4.0.2"
69+
"regenerator-runtime": "0.14.1"
7570
},
7671
"peerDependencies": {
7772
"@edx/frontend-platform": "^7.0.1 || ^8.0.0",

src/DesktopHeader.jsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import { getConfig } from '@edx/frontend-platform';
55
import { AvatarButton, Dropdown } from '@openedx/paragon';
66

77
// Local Components
8+
import NotificationsSlot from './plugin-slots/NotificationsSlot';
89
import UserMenuGroupItemSlot from './plugin-slots/UserMenuGroupItemSlot';
910
import UserMenuGroupSlot from './plugin-slots/UserMenuGroupSlot';
1011
import UserMenuItem from './common/UserMenuItem';
1112
import { Menu, MenuTrigger, MenuContent } from './Menu';
1213
import { LinkedLogo, Logo } from './Logo';
13-
import withNotifications from './Notification/withNotifications';
14-
import Notifications from './Notification';
1514

1615
// i18n
1716
import messages from './Header.messages';
@@ -155,7 +154,6 @@ class DesktopHeader extends React.Component {
155154
logoDestination,
156155
loggedIn,
157156
intl,
158-
notificationAppData,
159157
} = this.props;
160158
const logoProps = { src: logo, alt: logoAltText, href: logoDestination };
161159
const logoClasses = getConfig().AUTHN_MINIMAL_HEADER ? 'mw-100' : null;
@@ -180,8 +178,7 @@ class DesktopHeader extends React.Component {
180178
? (
181179
<>
182180
{this.renderSecondaryMenu()}
183-
{notificationAppData?.showNotificationsTray
184-
&& <Notifications notificationAppData={notificationAppData} showLeftMargin={false} />}
181+
<NotificationsSlot />
185182
{this.renderUserMenu()}
186183
</>
187184
) : this.renderLoggedOutItems()}
@@ -265,4 +262,4 @@ DesktopHeader.defaultProps = {
265262
},
266263
};
267264

268-
export default injectIntl(withNotifications(DesktopHeader));
265+
export default injectIntl(DesktopHeader);

src/MobileHeader.jsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { getConfig } from '@edx/frontend-platform';
55

66
// Local Components
77
import { AvatarButton } from '@openedx/paragon';
8+
import NotificationsSlot from './plugin-slots/NotificationsSlot';
89
import UserMenuGroupSlot from './plugin-slots/UserMenuGroupSlot';
910
import UserMenuGroupItemSlot from './plugin-slots/UserMenuGroupItemSlot';
1011
import { Menu, MenuTrigger, MenuContent } from './Menu';
1112
import { LinkedLogo, Logo } from './Logo';
1213
import UserMenuItem from './common/UserMenuItem';
13-
import withNotifications from './Notification/withNotifications';
14-
import Notifications from './Notification';
14+
1515
// i18n
1616
import messages from './Header.messages';
1717

@@ -136,7 +136,6 @@ class MobileHeader extends React.Component {
136136
mainMenu,
137137
userMenu,
138138
loggedOutItems,
139-
notificationAppData,
140139
} = this.props;
141140
const logoProps = { src: logo, alt: logoAltText, href: logoDestination };
142141
const stickyClassName = stickyOnMobile ? 'sticky-top' : '';
@@ -175,7 +174,7 @@ class MobileHeader extends React.Component {
175174
</div>
176175
{userMenu.length > 0 || loggedOutItems.length > 0 ? (
177176
<div className="w-100 d-flex justify-content-end align-items-center">
178-
{notificationAppData?.showNotificationsTray && <Notifications notificationAppData={notificationAppData} />}
177+
<NotificationsSlot />
179178
<Menu tag="nav" aria-label={intl.formatMessage(messages['header.label.secondary.nav'])} className="position-static">
180179
<MenuTrigger
181180
tag={AvatarButton}
@@ -271,4 +270,4 @@ MobileHeader.defaultProps = {
271270
},
272271
};
273272

274-
export default injectIntl(withNotifications(MobileHeader));
273+
export default injectIntl(MobileHeader);

src/Notification/NotificationEmptySection.jsx

-42
This file was deleted.

src/Notification/NotificationRowItem.jsx

-96
This file was deleted.

0 commit comments

Comments
 (0)