-
Notifications
You must be signed in to change notification settings - Fork 30
Conversation
Pull Request Test Coverage Report for Build 1356
💛 - Coveralls |
c92b942
to
2fc3b83
Compare
import { AlertsBody } from '../../Dashboard/Alert/AlertsBody'; | ||
import { filterAlerts } from './utils'; | ||
|
||
export const Alerts = ({ alertsResponse }) => { |
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 we return null from this component instead?
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.
done
export const AlertItem = ({ alert }) => ( | ||
<Row className="kubevirt-alert__item"> | ||
<Col lg={1} md={1} sm={1} xs={1}> | ||
{getSeverityIcon(get(alert, 'labels.severity'))} |
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 we make selectors for alerts?
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.
added alerts
selectors to prometheus
folder
|
||
export const AlertItem = ({ alert }) => ( | ||
<Row className="kubevirt-alert__item"> | ||
<Col lg={1} md={1} sm={1} xs={1}> |
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't we rather use css with a margin here?
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.
done
<GridItem span={6}> | ||
<ComplianceConnected /> | ||
<GridItem span={12}> | ||
<div className="kubevirt-cluster-overview__health-combined"> |
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.
wouldn't using another Grid
+ GridItem
's be simpler here?
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.
right :) using Grid
and GridItem
now
|
||
export const AlertsBody = ({ alerts }) => ( | ||
<div className="kubevirt-alert__alerts-body"> | ||
{alerts.map((alert, index) => ( |
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 we render the alerts as children (AlertItem) for better reusability?
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.
done
}; | ||
|
||
Alerts.propTypes = { | ||
alertsResponse: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), |
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 we rather send an empty array from web-ui
? This would make things a bit cleaner here
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.
Im not sure, even though there is no Not Available
state yet I think that in the future we will want to notify user that AlertManager
is not available/accessible and object
as alertsResponse
will serve its purpose.
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.
ok
Can you please also add alerts to ClusteOverview fixture? |
2fc3b83
to
3e36930
Compare
3e36930
to
a89f059
Compare
added |
}; | ||
|
||
Alerts.propTypes = { | ||
alertsResponse: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), |
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.
ok
const alerts = filterAlerts(alertsResponse); | ||
|
||
return alerts.length > 0 ? ( | ||
<DashboardCard className="kubevirt-alerts__card"> |
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 top border probably shouldn't go to Alerts card
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.
Im passing className to Alerts
from ClusterOverview
now
a89f059
to
6d4c96e
Compare
According to design we should have a dropdown which would allow filtering alerts by severity. Severity is defined by labels and label values can be anything so its up to alert creator to set the key and value. For this reason Im not adding dropdown yet. I try to recognize critical alerts by looking for label
severity: critical
. All others are evaluated aswarning
severity