mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into wrap-pod-logs
This commit is contained in:
commit
6d0d524f4f
43 files changed
+2372
-4136
No files matched your search
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { reaction, when } from "mobx";
|
||||
import type { GeneralEntity } from "../../../common/catalog-entities";
|
||||
import generalCategoryInjectable from "../../../common/catalog/categories/general.injectable";
|
||||
import isActiveRouteInjectable from "../../navigation/is-route-active.injectable";
|
||||
import observableHistoryInjectable from "../../navigation/observable-history.injectable";
|
||||
@@ -30,7 +31,7 @@ const watchForGeneralEntityNavigationInjectable = getInjectable({
|
||||
dispose.push(reaction(
|
||||
() => observableHistory.location,
|
||||
() => {
|
||||
const entities = entityRegistry.getItemsForCategory(generalCategory);
|
||||
const entities = entityRegistry.getItemsForCategory(generalCategory) as GeneralEntity[];
|
||||
const activeEntity = entities.find(entity => isActiveRoute(entity.spec.path));
|
||||
|
||||
if (activeEntity) {
|
||||
|
||||
@@ -54,7 +54,7 @@ class NonInjectedMainLayout extends React.Component<MainLayoutProps & Dependenci
|
||||
getCurrentExtent={() => sidebarWidth}
|
||||
onDrag={this.onSidebarResize}
|
||||
onDoubleClick={() => this.onSidebarResize(defaultSidebarWidth)}
|
||||
minExtent={120}
|
||||
minExtent={150}
|
||||
maxExtent={400}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
.SidebarItem {
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
user-select: none;
|
||||
|
||||
> .nav-item {
|
||||
text-decoration: none;
|
||||
padding: $unit * 0.3846 $unit * 0.625; // ≈ floor($unit / 2.6) floor($unit / 1.6)
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
|
||||
> .link-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.expand-icon {
|
||||
--size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
$borderSize: 4px;
|
||||
border-left: $borderSize solid transparent;
|
||||
|
||||
> .SidebarItem {
|
||||
color: var(--textColorPrimary);
|
||||
padding-left: 30px + $borderSize;
|
||||
line-height: 22px;
|
||||
|
||||
.SidebarItem {
|
||||
padding-left: $padding * 2; // 3rd+ menu level
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
&.expandable {
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Make less flaky.
|
||||
.sidebar-active-status {
|
||||
> .SidebarItem {
|
||||
.nav-item {
|
||||
&.active, &:hover {
|
||||
background: var(--blue);
|
||||
color: var(--sidebarActiveColor);
|
||||
}
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
&.active {
|
||||
border-left-color: var(--blue);
|
||||
}
|
||||
|
||||
> .SidebarItem {
|
||||
.nav-item {
|
||||
&.active, &:hover {
|
||||
color: var(--sidebarSubmenuActiveColor);
|
||||
background: none;
|
||||
}
|
||||
|
||||
&.expandable {
|
||||
color: var(--textColorPrimary)
|
||||
}
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
&.active {
|
||||
border-left-color: transparent;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
&.active, &:hover {
|
||||
color: var(--sidebarSubmenuActiveColor);
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import "./sidebar-item.scss";
|
||||
import styles from "./sidebar-items.module.scss";
|
||||
|
||||
import React from "react";
|
||||
import { computed, makeObservable } from "mobx";
|
||||
@@ -70,7 +70,7 @@ class NonInjectedSidebarItem extends React.Component<
|
||||
}
|
||||
|
||||
return (
|
||||
<ul className={cssNames("sub-menu", { active: this.isActive })}>
|
||||
<ul className={cssNames(styles.subMenu, { [styles.active]: this.isActive })}>
|
||||
{this.props.item.children.map(item => <SidebarItem key={item.registration.id} item={item} />)}
|
||||
</ul>
|
||||
);
|
||||
@@ -79,7 +79,7 @@ class NonInjectedSidebarItem extends React.Component<
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
className={cssNames("SidebarItem")}
|
||||
className={styles.SidebarItem}
|
||||
data-testid={`sidebar-item-${this.id}`}
|
||||
data-is-active-test={this.isActive}
|
||||
data-parent-id-test={this.registration.parentId}
|
||||
@@ -87,11 +87,7 @@ class NonInjectedSidebarItem extends React.Component<
|
||||
<NavLink
|
||||
to={""}
|
||||
isActive={() => this.isActive}
|
||||
|
||||
className={cssNames("nav-item flex gaps align-center", {
|
||||
expandable: this.isExpandable,
|
||||
})}
|
||||
|
||||
className={styles.navItem}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
@@ -105,10 +101,10 @@ class NonInjectedSidebarItem extends React.Component<
|
||||
data-testid={`sidebar-item-link-for-${this.id}`}
|
||||
>
|
||||
{this.registration.getIcon?.()}
|
||||
<span className="link-text box grow">{this.registration.title}</span>
|
||||
<span>{this.registration.title}</span>
|
||||
{this.isExpandable && (
|
||||
<Icon
|
||||
className="expand-icon box right"
|
||||
className={styles.expandIcon}
|
||||
material={
|
||||
this.expanded ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
.SidebarItem {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
user-select: none;
|
||||
|
||||
> .navItem {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
text-decoration: none;
|
||||
padding: 6px 8px 6px 10px;
|
||||
cursor: pointer;
|
||||
|
||||
&:global(.active), &:hover {
|
||||
background: var(--blue);
|
||||
color: var(--sidebarActiveColor);
|
||||
}
|
||||
|
||||
span {
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.expandIcon {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.subMenu {
|
||||
border-left: 4px solid transparent;
|
||||
|
||||
&.active {
|
||||
border-color: var(--blue);
|
||||
}
|
||||
|
||||
.SidebarItem {
|
||||
color: var(--textColorPrimary);
|
||||
padding-left: 25px;
|
||||
|
||||
.navItem {
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
|
||||
&:global(.active), &:hover {
|
||||
color: var(--sidebarSubmenuActiveColor);
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3rd menu level
|
||||
.subMenu .subMenu {
|
||||
&.active {
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.SidebarItem {
|
||||
padding-left: calc(var(--padding) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,5 @@
|
||||
|
||||
.sidebarNav :global(.Icon) {
|
||||
box-sizing: content-box;
|
||||
padding: 3px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
class="nav-item flex gaps align-center active"
|
||||
class="navItem active"
|
||||
data-testid="sidebar-item-link-for-cluster-overview"
|
||||
href="/"
|
||||
>
|
||||
@@ -50,9 +50,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Cluster
|
||||
</span>
|
||||
</a>
|
||||
@@ -63,7 +61,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-nodes"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-nodes"
|
||||
href="/"
|
||||
>
|
||||
@@ -74,9 +72,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Nodes
|
||||
</span>
|
||||
</a>
|
||||
@@ -87,7 +83,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-workloads"
|
||||
href="/"
|
||||
>
|
||||
@@ -98,13 +94,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Workloads
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -121,7 +115,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-config"
|
||||
href="/"
|
||||
>
|
||||
@@ -135,9 +129,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
list
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Config
|
||||
</span>
|
||||
</a>
|
||||
@@ -148,7 +140,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-network"
|
||||
href="/"
|
||||
>
|
||||
@@ -162,13 +154,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
device_hub
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Network
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -185,7 +175,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-storage"
|
||||
href="/"
|
||||
>
|
||||
@@ -199,9 +189,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
storage
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Storage
|
||||
</span>
|
||||
</a>
|
||||
@@ -212,7 +200,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-namespaces"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-namespaces"
|
||||
href="/"
|
||||
>
|
||||
@@ -226,9 +214,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
layers
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Namespaces
|
||||
</span>
|
||||
</a>
|
||||
@@ -239,7 +225,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-helm"
|
||||
href="/"
|
||||
>
|
||||
@@ -250,13 +236,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Helm
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -273,7 +257,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-user-management"
|
||||
href="/"
|
||||
>
|
||||
@@ -287,9 +271,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
security
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Access Control
|
||||
</span>
|
||||
</a>
|
||||
@@ -300,7 +282,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-custom-resources"
|
||||
href="/"
|
||||
>
|
||||
@@ -314,13 +296,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
extension
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Custom Resources
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -518,7 +498,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
class="nav-item flex gaps align-center active"
|
||||
class="navItem active"
|
||||
data-testid="sidebar-item-link-for-cluster-overview"
|
||||
href="/"
|
||||
>
|
||||
@@ -529,9 +509,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Cluster
|
||||
</span>
|
||||
</a>
|
||||
@@ -542,7 +520,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-nodes"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-nodes"
|
||||
href="/"
|
||||
>
|
||||
@@ -553,9 +531,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Nodes
|
||||
</span>
|
||||
</a>
|
||||
@@ -566,7 +542,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-workloads"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-workloads"
|
||||
href="/"
|
||||
>
|
||||
@@ -577,13 +553,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Workloads
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -600,7 +574,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-config"
|
||||
href="/"
|
||||
>
|
||||
@@ -614,9 +588,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
list
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Config
|
||||
</span>
|
||||
</a>
|
||||
@@ -627,7 +599,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-network"
|
||||
href="/"
|
||||
>
|
||||
@@ -641,13 +613,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
device_hub
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Network
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -664,7 +634,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-storage"
|
||||
href="/"
|
||||
>
|
||||
@@ -678,9 +648,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
storage
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Storage
|
||||
</span>
|
||||
</a>
|
||||
@@ -691,7 +659,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-namespaces"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-namespaces"
|
||||
href="/"
|
||||
>
|
||||
@@ -705,9 +673,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
layers
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Namespaces
|
||||
</span>
|
||||
</a>
|
||||
@@ -718,7 +684,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-helm"
|
||||
href="/"
|
||||
>
|
||||
@@ -729,13 +695,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Helm
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -752,7 +716,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-user-management"
|
||||
href="/"
|
||||
>
|
||||
@@ -766,9 +730,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
security
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Access Control
|
||||
</span>
|
||||
</a>
|
||||
@@ -779,7 +741,7 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-custom-resources"
|
||||
href="/"
|
||||
>
|
||||
@@ -793,13 +755,11 @@ exports[`<ClusterFrame /> given cluster with list nodes and namespaces permissio
|
||||
extension
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Custom Resources
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -1004,7 +964,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
>
|
||||
<a
|
||||
aria-current="page"
|
||||
class="nav-item flex gaps align-center expandable active"
|
||||
class="navItem active"
|
||||
data-testid="sidebar-item-link-for-workloads"
|
||||
href="/"
|
||||
>
|
||||
@@ -1015,13 +975,11 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Workloads
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -1038,7 +996,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
data-testid="sidebar-item-config"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-config"
|
||||
href="/"
|
||||
>
|
||||
@@ -1052,9 +1010,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
list
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Config
|
||||
</span>
|
||||
</a>
|
||||
@@ -1065,7 +1021,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
data-testid="sidebar-item-network"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-network"
|
||||
href="/"
|
||||
>
|
||||
@@ -1079,13 +1035,11 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
device_hub
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Network
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -1102,7 +1056,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
data-testid="sidebar-item-storage"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-storage"
|
||||
href="/"
|
||||
>
|
||||
@@ -1116,9 +1070,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
storage
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Storage
|
||||
</span>
|
||||
</a>
|
||||
@@ -1129,7 +1081,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
data-testid="sidebar-item-namespaces"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-namespaces"
|
||||
href="/"
|
||||
>
|
||||
@@ -1143,9 +1095,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
layers
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Namespaces
|
||||
</span>
|
||||
</a>
|
||||
@@ -1156,7 +1106,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
data-testid="sidebar-item-helm"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-helm"
|
||||
href="/"
|
||||
>
|
||||
@@ -1167,13 +1117,11 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
class="icon"
|
||||
/>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Helm
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
@@ -1190,7 +1138,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
data-testid="sidebar-item-user-management"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-user-management"
|
||||
href="/"
|
||||
>
|
||||
@@ -1204,9 +1152,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
security
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Access Control
|
||||
</span>
|
||||
</a>
|
||||
@@ -1217,7 +1163,7 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
data-testid="sidebar-item-custom-resources"
|
||||
>
|
||||
<a
|
||||
class="nav-item flex gaps align-center expandable"
|
||||
class="navItem"
|
||||
data-testid="sidebar-item-link-for-custom-resources"
|
||||
href="/"
|
||||
>
|
||||
@@ -1231,13 +1177,11 @@ exports[`<ClusterFrame /> given cluster without list nodes, but with namespaces
|
||||
extension
|
||||
</span>
|
||||
</i>
|
||||
<span
|
||||
class="link-text box grow"
|
||||
>
|
||||
<span>
|
||||
Custom Resources
|
||||
</span>
|
||||
<i
|
||||
class="Icon expand-icon box right material focusable"
|
||||
class="Icon expandIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import { asLegacyGlobalFunctionForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
||||
import { asLegacyGlobalForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||
import matchRouteInjectable from "./match-route.injectable";
|
||||
import navigateInjectable from "./navigate.injectable";
|
||||
import observableHistoryInjectable from "./observable-history.injectable";
|
||||
|
||||
@@ -21,9 +20,4 @@ export const navigation = asLegacyGlobalForExtensionApi(observableHistoryInjecta
|
||||
*/
|
||||
export const navigate = asLegacyGlobalFunctionForExtensionApi(navigateInjectable);
|
||||
|
||||
/**
|
||||
* @deprecated use `di.inject(matchRouteInjectable)` instead
|
||||
*/
|
||||
export const matchRoute = asLegacyGlobalFunctionForExtensionApi(matchRouteInjectable);
|
||||
|
||||
export * from "./page-param";
|
||||
@@ -7,7 +7,7 @@ import type { match, RouteProps } from "react-router";
|
||||
import { matchPath } from "react-router";
|
||||
import observableHistoryInjectable from "./observable-history.injectable";
|
||||
|
||||
export type MatchRoute = <Params>(route: string | string[] | RouteProps) => match<Params> | null;
|
||||
export type MatchRoute = <Params extends { [K in keyof Params]?: string }>(route: string | string[] | RouteProps) => match<Params> | null;
|
||||
|
||||
const matchRouteInjectable = getInjectable({
|
||||
id: "match-route",
|
||||
|
||||
@@ -9,6 +9,7 @@ import type { Draft } from "immer";
|
||||
import { produce, isDraft } from "immer";
|
||||
import { isEqual, isPlainObject } from "lodash";
|
||||
import logger from "../../main/logger";
|
||||
import assert from "assert";
|
||||
|
||||
export interface StorageChange<T> {
|
||||
key: string;
|
||||
@@ -154,8 +155,9 @@ export class StorageHelper<T> implements StorageLayer<T> {
|
||||
}
|
||||
|
||||
@action
|
||||
merge(value: Partial<T> | ((draft: Draft<T>) => Partial<T> | void)) {
|
||||
merge(value: T extends object ? Partial<T> | ((draft: Draft<T>) => Partial<T> | void) : never) {
|
||||
const nextValue = produce<T>(toJS(this.get()), (draft) => {
|
||||
assert(typeof draft === "object" && draft);
|
||||
|
||||
if (typeof value == "function") {
|
||||
const newValue = value(draft);
|
||||
|
||||
Reference in new issue
Block a user