mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Use Subnamespace badge in namespace list (#7132)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
6184325507
commit
8110da9e28
@ -22,4 +22,8 @@
|
|||||||
@include namespaceStatus;
|
@include namespaceStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.subnamespaceBadge {
|
||||||
|
margin-inline-start: var(--margin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import { withInjectables } from "@ogre-tools/injectable-react";
|
|||||||
import namespaceStoreInjectable from "./store.injectable";
|
import namespaceStoreInjectable from "./store.injectable";
|
||||||
import { KubeObjectAge } from "../kube-object/age";
|
import { KubeObjectAge } from "../kube-object/age";
|
||||||
import openAddNamepaceDialogInjectable from "./add-dialog/open.injectable";
|
import openAddNamepaceDialogInjectable from "./add-dialog/open.injectable";
|
||||||
|
import { SubnamespaceBadge } from "./subnamespace-badge";
|
||||||
|
|
||||||
enum columnId {
|
enum columnId {
|
||||||
name = "name",
|
name = "name",
|
||||||
@ -55,7 +56,12 @@ const NonInjectedNamespacesRoute = ({ namespaceStore, openAddNamespaceDialog }:
|
|||||||
{ title: "Status", className: "status", sortBy: columnId.status, id: columnId.status },
|
{ title: "Status", className: "status", sortBy: columnId.status, id: columnId.status },
|
||||||
]}
|
]}
|
||||||
renderTableContents={namespace => [
|
renderTableContents={namespace => [
|
||||||
namespace.getName(),
|
<>
|
||||||
|
{namespace.getName()}
|
||||||
|
{namespace.isSubnamespace() && (
|
||||||
|
<SubnamespaceBadge className="subnamespaceBadge" id={`namespace-list-badge-for-${namespace.getId()}`} />
|
||||||
|
)}
|
||||||
|
</>,
|
||||||
<KubeObjectStatusIcon key="icon" object={namespace} />,
|
<KubeObjectStatusIcon key="icon" object={namespace} />,
|
||||||
namespace.getLabels().map(label => (
|
namespace.getLabels().map(label => (
|
||||||
<Badge
|
<Badge
|
||||||
|
|||||||
@ -6,16 +6,17 @@ import styles from "./subnamespace-badge.module.scss";
|
|||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Tooltip } from "../tooltip";
|
import { Tooltip } from "../tooltip";
|
||||||
|
import { cssNames } from "../../utils";
|
||||||
|
|
||||||
interface SubnamespaceBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
interface SubnamespaceBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SubnamespaceBadge({ id, ...other }: SubnamespaceBadgeProps) {
|
export function SubnamespaceBadge({ id, className, ...other }: SubnamespaceBadgeProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<span
|
<span
|
||||||
className={styles.subnamespaceBadge}
|
className={cssNames(styles.subnamespaceBadge, className)}
|
||||||
data-testid={id}
|
data-testid={id}
|
||||||
id={id}
|
id={id}
|
||||||
{...other}
|
{...other}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user