1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Add KubeEventDetails empty placeholder (#6978)

* KubeEventDetails empty placeholder

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Updaing snapshots

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2023-01-19 13:27:33 +03:00 committed by GitHub
parent a5c62da002
commit b8d1ef708e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 14 deletions

View File

@ -104,12 +104,17 @@ exports[`disable kube object detail items when cluster is not relevant given ext
</div> </div>
<div> <div>
<div <div
class="DrawerTitle flex gaps align-center title" class="DrawerTitle title"
> >
<span> <span>
Events Events
</span> </span>
</div> </div>
<div
class="empty"
>
No events found
</div>
</div> </div>
</div> </div>
</div> </div>
@ -725,12 +730,17 @@ exports[`disable kube object detail items when cluster is not relevant given ext
</div> </div>
<div> <div>
<div <div
class="DrawerTitle flex gaps align-center title" class="DrawerTitle title"
> >
<span> <span>
Events Events
</span> </span>
</div> </div>
<div
class="empty"
>
No events found
</div>
</div> </div>
</div> </div>
</div> </div>
@ -1346,12 +1356,17 @@ exports[`disable kube object detail items when cluster is not relevant given not
</div> </div>
<div> <div>
<div <div
class="DrawerTitle flex gaps align-center title" class="DrawerTitle title"
> >
<span> <span>
Events Events
</span> </span>
</div> </div>
<div
class="empty"
>
No events found
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -99,12 +99,17 @@ exports[`reactively hide kube object detail item renders 1`] = `
</div> </div>
<div> <div>
<div <div
class="DrawerTitle flex gaps align-center title" class="DrawerTitle title"
> >
<span> <span>
Events Events
</span> </span>
</div> </div>
<div
class="empty"
>
No events found
</div>
</div> </div>
</div> </div>
</div> </div>
@ -725,12 +730,17 @@ exports[`reactively hide kube object detail item when the item is shown renders
</div> </div>
<div> <div>
<div <div
class="DrawerTitle flex gaps align-center title" class="DrawerTitle title"
> >
<span> <span>
Events Events
</span> </span>
</div> </div>
<div
class="empty"
>
No events found
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -22,8 +22,8 @@
} }
} }
} }
}
.no-items {
text-align: center; .empty {
} opacity: 0.6;
} }

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import "./kube-event-details.scss"; import styles from "./kube-event-details.module.scss";
import React from "react"; import React from "react";
import { disposeOnUnmount, observer } from "mobx-react"; import { disposeOnUnmount, observer } from "mobx-react";
@ -57,14 +57,14 @@ class NonInjectedKubeEventDetails extends React.Component<KubeEventDetailsProps
return ( return (
<div> <div>
<DrawerTitle className="flex gaps align-center"> <DrawerTitle>
<span>Events</span> <span>Events</span>
</DrawerTitle> </DrawerTitle>
{events.length > 0 && ( {events.length > 0 && (
<div className="KubeEventDetails"> <div className={styles.KubeEventDetails}>
{events.map(event => ( {events.map(event => (
<div className="event" key={event.getId()}> <div className={styles.event} key={event.getId()}>
<div className={cssNames("title", { warning: event.isWarning() })}> <div className={cssNames(styles.title, { [styles.warning]: event.isWarning() })}>
{event.message} {event.message}
</div> </div>
<DrawerItem name="Source"> <DrawerItem name="Source">
@ -85,6 +85,11 @@ class NonInjectedKubeEventDetails extends React.Component<KubeEventDetailsProps
))} ))}
</div> </div>
)} )}
{events.length === 0 && (
<div className={styles.empty}>
No events found
</div>
)}
</div> </div>
); );
} }