Skip to content
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

Notification Drawer Update #2571

Merged
merged 21 commits into from
Sep 7, 2023

Conversation

arivepr
Copy link
Contributor

@arivepr arivepr commented Jul 17, 2023

Addressing the following JIRA card
Note: This PR nor card are intended to address getting real data in. This is purely UI based for now with dummy data hard-coded in.

3EEE0C25-1117-4AE9-B322-1B367F8F4ABF

752A8544-6DCD-4C07-AAC6-83EC7861D947

@arivepr arivepr force-pushed the notification-drawer-items branch from 3ca4569 to 5aaf9e6 Compare July 26, 2023 18:01
@arivepr arivepr changed the title Notification Drawer Update - DRAFT Notification Drawer Update Jul 26, 2023
@arivepr
Copy link
Contributor Author

arivepr commented Jul 26, 2023

Note
Unit testing seems to be failing, though not entirely sure how to fix what it's complaining about (not something i touched in this PR)
Additionally, had to comment out some of the useFlags as they weren't being used according to my lint check, left them there just in case rather than outright deleting. Just let me know how you'd like me to handle those @karelhala

:)

Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! A couple of changes and we'll be golden!

package-lock.json Outdated Show resolved Hide resolved
src/components/Header/Tools.tsx Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
src/redux/action-types.ts Outdated Show resolved Hide resolved
src/redux/chromeReducers.ts Outdated Show resolved Hide resolved
src/redux/chromeReducers.ts Outdated Show resolved Hide resolved
src/redux/chromeReducers.ts Outdated Show resolved Hide resolved
src/redux/chromeReducers.ts Outdated Show resolved Hide resolved
@arivepr arivepr force-pushed the notification-drawer-items branch from 2a44e1f to e09c99b Compare August 10, 2023 12:03
@arivepr arivepr requested a review from florkbr as a code owner August 10, 2023 12:03
@arivepr arivepr force-pushed the notification-drawer-items branch 2 times, most recently from ffb9320 to c4e188e Compare August 17, 2023 12:04
@ryelo ryelo requested a review from karelhala August 17, 2023 12:15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update these tests to reflect what actual notifications would look like?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well im taking those out once i get the green light on everything else (just to save time), but if we have live examples somewhere I'm happy to replace them for screenshots or what not

@arivepr
Copy link
Contributor Author

arivepr commented Aug 18, 2023

Should be good to go now, everything tested before last commit.
I propose refactoring the header for the drawer panel into its own subcomponent just to keep things tidy, but I can do that in a separate PR after this gets connected to actual data.

Once the green light is given for the overall changes, test data will be taken out

Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking hella good! Just a few nitpicks and we are golden!

src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/NotificationItem.tsx Outdated Show resolved Hide resolved
@arivepr arivepr force-pushed the notification-drawer-items branch from 2b335d3 to e971de9 Compare August 22, 2023 18:04
@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2023

Codecov Report

Merging #2571 (9dd2ce6) into master (0b9357a) will decrease coverage by 0.20%.
The diff coverage is 40.62%.

❗ Current head 9dd2ce6 differs from pull request most recent head 668c93f. Consider uploading reports for the commit 668c93f to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2571      +/-   ##
==========================================
- Coverage   57.38%   57.19%   -0.20%     
==========================================
  Files          91       92       +1     
  Lines        2783     2815      +32     
  Branches      648      581      -67     
==========================================
+ Hits         1597     1610      +13     
- Misses       1111     1204      +93     
+ Partials       75        1      -74     
Files Changed Coverage
src/redux/index.ts ø
src/redux/chromeReducers.ts 17.39%
...nts/NotificationsDrawer/notificationDrawerUtils.ts 100.00%
src/redux/action-types.ts 100.00%
src/redux/actions.ts 100.00%

@arivepr
Copy link
Contributor Author

arivepr commented Aug 22, 2023

I'm seeing a bunch of new errors after rebasing, trying to figure out what that all is about.

@arivepr arivepr force-pushed the notification-drawer-items branch from 2957739 to 9f63bc5 Compare August 23, 2023 19:46
Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use lodash's sortBy instead of manual sort to have proper sorting and once the commented out feature flag options are removed and eslint if fixed we can merge it!

src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
@arivepr
Copy link
Contributor Author

arivepr commented Aug 29, 2023

Switching to lodash now per request, just btw, we do have proper sorting as is 😉 😆

I take it back, this is way better/easier lol

@arivepr arivepr force-pushed the notification-drawer-items branch from 9f63bc5 to 5fa9ff3 Compare August 29, 2023 21:36
Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Just nitpick about DateFormat and importing testing data, but overall looks good

src/redux/chromeReducers.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just remove the filter by source dropdown a it's done in other ticket.

package.json Outdated Show resolved Hide resolved
@Hyperkid123
Copy link
Contributor

/retest

2 similar comments
@Hyperkid123
Copy link
Contributor

/retest

@Hyperkid123
Copy link
Contributor

/retest

@arivepr arivepr force-pushed the notification-drawer-items branch from d7c831f to cd35821 Compare September 5, 2023 13:09
@arivepr arivepr force-pushed the notification-drawer-items branch from cd35821 to 58dcec0 Compare September 5, 2023 13:19
@arivepr
Copy link
Contributor Author

arivepr commented Sep 5, 2023

Unsure if I did something to cause that new failing test, seems to complaint about missing dockerfile 😕

@arivepr arivepr force-pushed the notification-drawer-items branch from a75ba08 to d40694e Compare September 5, 2023 18:24
src/components/NotificationsDrawer/NotificationItem.tsx Outdated Show resolved Hide resolved
src/redux/index.ts Outdated Show resolved Hide resolved
src/components/NotificationsDrawer/DrawerPanelContent.tsx Outdated Show resolved Hide resolved
<DropdownList>
{filterConfig.map((source) => (
<DropdownItem key={source.value} onClick={() => onFilterSelect(source.value)} isDisabled={notifications.length === 0}>
<Checkbox isChecked={activeFilters.includes(source.value)} id={source.value} className="pf-v5-u-mr-sm" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkbox is partially uncontrolled which prints an error in a console.

Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components

There is a build in PF way of creating menu item checkboxes: https://www.patternfly.org/components/menus/menu

DropdownItem shares props with MenuItems. It's just a wrapper around it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I misunderstood what you meant with the menu wrapper before 👍

@karelhala karelhala merged commit 392b9dd into RedHatInsights:master Sep 7, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants