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 component for console. #3899
Conversation
2d69cc2
to
a7ffc57
Compare
/retest |
frontend/packages/patternfly/src/components/notification-drawer/notification-drawer.tsx
Outdated
Show resolved
Hide resolved
<DrawerContent>{children}</DrawerContent> | ||
<DrawerPanelContent noPadding> | ||
<NotificationDrawerHeading count={alertData.length + updateData.length}> | ||
<NotificationTypeHeading |
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.
Type
, I ponder if Category
is more clear. We don't mean anything that already exists, like a Kind
, or a programmatic type
. Not a strong feeling atm, just thinking out loud.
}) => { | ||
const [isAlertExpanded, toggleAlertExpanded] = React.useState<boolean>(true); | ||
const [isAvailableUpdateExpanded, toggleAvailableUpdateExpanded] = React.useState<boolean>(false); | ||
const criticalAlerts = _.isEmpty(alertData) ? emptyState(toggleExpanded) : alertData; |
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.
So Critical Alerts
appears to be both Critical
and Warning
lvl. Is this correct? When I open the drawer in my cluster, I have 18
total Alerts. I have to scroll to find the Critical
ones. It does seem like noise pushes the urgent issues blow the fold. For example, I have a lot of UsingDeprecatedAPIAppsV1beta2
warnings, prob don't care a ton about these, but the KubePodCrashLooping
I probably do care about:
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.
@benjaminapetersen good point. @cshinn, do we want to display all alerts or just the warning/critical? Currently they are sorted by time...is that correct?
thanks @sg00dwin for testing out the drawer interactions. really appreciate it. |
/test e2e-gcp-console |
@benjaminapetersen had some code in my pocket, just uploaded that fix. |
</EmptyStateSecondaryActions> | ||
</EmptyState> | ||
); | ||
const criticalCompare = (a): boolean => getAlertSeverity(a) === 'critical'; |
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.
(a)
is any
or can we type?
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.
(alert: Alert)
?
} from '../module/k8s'; | ||
import { getSortedUpdates } from './modals/cluster-update-modal'; | ||
|
||
const emptyState = (toggleExpanded) => ( |
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.
type the callbacks?
const emptyState = (toggleExpanded:() => void) => (
const criticalCompare = (a): boolean => getAlertSeverity(a) === 'critical'; | ||
const otherAlertCompare = (a): boolean => getAlertSeverity(a) !== 'critical'; | ||
|
||
const getAlertNotificationEntries = ( |
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.
const getAlertNotificationEntries = (
isLoaded: boolean,
alertData: someStructure?,
toggleNotificationDrawer: boolean,
isCritical: boolean,
): React.ReactNode[] =>
)) | ||
: []; | ||
|
||
const getUpdateNotificationEntries = ( |
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.
Can type as well.
/test analyze |
@@ -0,0 +1,262 @@ | |||
import * as _ from 'lodash'; |
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.
So at this point I would think we want to add new components to frontend/packages/console-app/components
rather than public/components
. Thinking console-app
instead of console-shared
as this is an app wide singleton component.
@jcaianirh pretty good with where this landed, remaining 2 thoughts:
Thanks! |
@benjaminapetersen can add unit and or end to end tests as a follow on pr in the testing sprints. not sure on the move to console/app move....we could talk about it in scrum? not sure what the rules are for these two locations. if these are the two final items, lets get this merged for now, and tackle them as next steps. I added the test comments to the description under follow on pr section. all other follow ons listed have been completed. |
@jcaianirh agree, realizing as I look we have other conventions if we move it (one component per file, etc etc). Tests can come in the upcoming sprints. Just as good as bug fixes. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benjaminapetersen, jcaianirh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
For jira story: https://issues.redhat.com/browse/CONSOLE-1945
Add Notification Drawer component and add some initial test notifications from the dashboard as well as some fake update alerts.
Includes:
To Do (can be done in follow on pr's):
1. redux work to populate notifications2. Component updates based on visual inspection
3. add real update notifications
4. responsive strategy with drawer (push content left vs hover over)
5. add warning icon in masthead when alerts present in mobile
6. unit / end to end tests