Skip to content

Commit b2e5c95

Browse files
committed
Clean the code after rewriting the notification drawer
1 parent ed7059a commit b2e5c95

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

app/javascript/components/toast-list/toast-list.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import {
55
} from 'patternfly-react';
66
import { markNotificationRead, removeToastNotification } from '../../miq-redux/actions/notifications-actions';
77

8+
const notificationTimerDelay = 8000;
9+
810
const ToastList = () => {
911
const dispatch = useDispatch();
1012
const toastNotifications = useSelector(({ notificationReducer: { toastNotifications } }) => toastNotifications);
11-
const notificationTimerDelay = 8000;
1213

1314
return (
1415
toastNotifications.length > 0 ? (

app/javascript/components/top-navbar/notifications.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';
22
import { Icon } from 'patternfly-react';
33
import { useDispatch, useSelector } from 'react-redux';
44
import { saveNotificationDrawerVisibility } from '../notification-drawer/helpers';
5+
import { TOGGLE_DRAWER_VISIBILITY } from '../../miq-redux/actions/notifications-actions';
56

67
const Notifications = () => {
78
const dispatch = useDispatch();
@@ -19,7 +20,7 @@ const Notifications = () => {
1920
className="nav-item-iconic drawer-pf-trigger-icon"
2021
title={`${unreadCount} ${__('unread notifications')}`}
2122
onClick={() => {
22-
dispatch({ type: '@@notifications/toggleDrawerVisibility' });
23+
dispatch({ type: TOGGLE_DRAWER_VISIBILITY });
2324
}}
2425
>
2526
<Icon type="fa" name="bell" />

app/javascript/spec/fixtures/notifications.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
"type": "success",
2020
"unread": true
2121
}
22-
]
22+
]

app/javascript/spec/fixtures/resources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
"seen": false,
2121
"href": "http://localhost:3000/api/notifications/10000000017255"
2222
}]
23-
}
23+
}

0 commit comments

Comments
 (0)