-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RHCLOUD-33811] Move notification drawer to its own module #661
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the logic should stay in Chrome OR we need to leverage some other techniques (federated modules 😉 ) so we can reach feature parity with the current approach.
export const notificationDrawerDataAtom = atom<NotificationData[]>([]); | ||
export const notificationDrawerCountAtom = atom(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the initial data should be passed from chrome as well as props. The notifications module should only consume them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than removing the cypress config, changing Atoms to Redux and utilizing JS clients just a few minor improvements.
config/webpack.cy.config.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should not add cypress config. We have a seperate ticket for that work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR did get big pretty quick haha. I threw these (imperfect) cypress stuff in a draft PR for you all to start with #667
key="manage-event" | ||
onClick={() => | ||
onNavigateTo( | ||
`/settings/notifications/configure-events?bundle=${notification.bundle}&tab=configuration` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are in the notifications application I think all links needs to be updated and the /settings
should be removed. I would have to however have to check it locally what needs to remain and what can be removed.
<DropdownItem key="quick links" description="Quick links" />, | ||
<DropdownItem | ||
key="notifications log" | ||
onClick={() => onNavigateTo('/settings/notifications/notificationslog')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as with the to
links. I think we can remove the /settings
URL. But I'd have to check this locally to see what can remain and what can be removed.
const onMarkAsRead = () => { | ||
axios | ||
.put('/api/notifications/v1/notifications/drawer/read', { | ||
notification_ids: [notification.id], | ||
read_status: !notification.read, | ||
}) | ||
.then(() => { | ||
updateNotificationRead(notification.id, !notification.read); | ||
setIsDropdownOpen(false); | ||
}) | ||
.catch((e) => { | ||
console.error('failed to update notification read status', e); | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the JS client for this function as well.
Description
Creates a new component for the NotificationDrawer. The functionality was previously in the insights-chrome
repo and will now live here and be called as a
ScalprumComponent
RHCLOUD-33811
Checklist ☑️