mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
7b77f18376
commit
dcf253e7d5
401 files changed
+2018
-40
No files matched your search
@@ -21,9 +21,11 @@ interface Props extends KubeObjectDetailsProps<KubeEvent> {
|
||||
export class EventDetails extends React.Component<Props> {
|
||||
render() {
|
||||
const { object: event } = this.props;
|
||||
|
||||
if (!event) return;
|
||||
const { message, reason, count, type, involvedObject } = event;
|
||||
const { kind, name, namespace, fieldPath } = involvedObject;
|
||||
|
||||
return (
|
||||
<div className="EventDetails">
|
||||
<KubeObjectMeta object={event}/>
|
||||
|
||||
@@ -28,6 +28,7 @@ export class EventStore extends KubeObjectStore<KubeEvent> {
|
||||
if(obj.kind == "Node") {
|
||||
return obj.getName() == evt.involvedObject.uid && evt.involvedObject.kind == "Node";
|
||||
}
|
||||
|
||||
return obj.getId() == evt.involvedObject.uid;
|
||||
});
|
||||
}
|
||||
@@ -38,12 +39,16 @@ export class EventStore extends KubeObjectStore<KubeEvent> {
|
||||
const eventsWithError = Object.values(groupsByInvolvedObject).map(events => {
|
||||
const recent = events[0];
|
||||
const { kind, uid } = recent.involvedObject;
|
||||
|
||||
if (kind == Pod.kind) { // Wipe out running pods
|
||||
const pod = podsStore.items.find(pod => pod.getId() == uid);
|
||||
|
||||
if (!pod || (!pod.hasIssues() && pod.spec.priority < 500000)) return;
|
||||
}
|
||||
|
||||
return recent;
|
||||
});
|
||||
|
||||
return compact(eventsWithError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ export class Events extends React.Component<Props> {
|
||||
const tooltipId = `message-${event.getId()}`;
|
||||
const isWarning = type === "Warning";
|
||||
const detailsUrl = getDetailsUrl(lookupApiLink(involvedObject, event));
|
||||
|
||||
return [
|
||||
{
|
||||
className: { warning: isWarning },
|
||||
@@ -114,9 +115,11 @@ export class Events extends React.Component<Props> {
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
if (compact) {
|
||||
return events;
|
||||
}
|
||||
|
||||
return (
|
||||
<TabLayout>
|
||||
{events}
|
||||
|
||||
@@ -21,6 +21,7 @@ export class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
|
||||
render() {
|
||||
const { object } = this.props;
|
||||
const events = eventStore.getEventsByObject(object);
|
||||
|
||||
if (!events.length) {
|
||||
return (
|
||||
<DrawerTitle className="flex gaps align-center">
|
||||
@@ -28,6 +29,7 @@ export class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
|
||||
</DrawerTitle>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<DrawerTitle className="flex gaps align-center">
|
||||
@@ -36,6 +38,7 @@ export class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
|
||||
<div className="KubeEventDetails">
|
||||
{events.map(evt => {
|
||||
const { message, count, lastTimestamp, involvedObject } = evt;
|
||||
|
||||
return (
|
||||
<div className="event" key={evt.getId()}>
|
||||
<div className={cssNames("title", { warning: evt.isWarning() })}>
|
||||
|
||||
@@ -24,11 +24,14 @@ export class KubeEventIcon extends React.Component<Props> {
|
||||
const { object, showWarningsOnly, filterEvents } = this.props;
|
||||
const events = eventStore.getEventsByObject(object);
|
||||
let warnings = events.filter(evt => evt.isWarning());
|
||||
|
||||
if (filterEvents) warnings = filterEvents(warnings);
|
||||
|
||||
if (!events.length || (showWarningsOnly && !warnings.length)) {
|
||||
return null;
|
||||
}
|
||||
const event = [...warnings, ...events][0]; // get latest event
|
||||
|
||||
return (
|
||||
<Icon
|
||||
material="warning"
|
||||
|
||||
Reference in new issue
Block a user