mirror of
https://github.com/lensapp/lens.git
synced 2024-09-11 09:25:26 +03:00
chore: Move around Custom Resource and Custom Resource Definition files to simplify names
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
66a7615e9c
commit
b1a988e133
@ -145,5 +145,5 @@ export type { NamespaceStore } from "../../renderer/components/namespaces/store"
|
|||||||
export type { ServiceAccountStore as ServiceAccountsStore } from "../../renderer/components/user-management/service-accounts/store";
|
export type { ServiceAccountStore as ServiceAccountsStore } from "../../renderer/components/user-management/service-accounts/store";
|
||||||
export type { RoleStore as RolesStore } from "../../renderer/components/user-management/roles/store";
|
export type { RoleStore as RolesStore } from "../../renderer/components/user-management/roles/store";
|
||||||
export type { RoleBindingStore as RoleBindingsStore } from "../../renderer/components/user-management/role-bindings/store";
|
export type { RoleBindingStore as RoleBindingsStore } from "../../renderer/components/user-management/role-bindings/store";
|
||||||
export type { CustomResourceDefinitionStore as CRDStore } from "../../renderer/components/custom-resources/definition.store";
|
export type { CustomResourceDefinitionStore as CRDStore } from "../../renderer/components/custom-resource-definitions/store";
|
||||||
export type { CustomResourceStore as CRDResourceStore } from "../../common/k8s-api/api-manager/resource.store";
|
export type { CustomResourceStore as CRDResourceStore } from "../../common/k8s-api/api-manager/resource.store";
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
import type { RenderResult } from "@testing-library/react";
|
import type { RenderResult } from "@testing-library/react";
|
||||||
import { CustomResourceDefinition } from "../../extensions/common-api/k8s-api";
|
import { CustomResourceDefinition } from "../../extensions/common-api/k8s-api";
|
||||||
import type { CustomResourceDefinitionStore } from "../../renderer/components/custom-resources/definition.store";
|
import type { CustomResourceDefinitionStore } from "../../renderer/components/custom-resource-definitions/store";
|
||||||
import customResourceDefinitionStoreInjectable from "../../renderer/components/custom-resources/definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "../../renderer/components/custom-resource-definitions/store.injectable";
|
||||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="navItem"
|
class="navItem"
|
||||||
data-testid="sidebar-item-link-for-workloads"
|
data-testid="link-for-sidebar-item-workloads"
|
||||||
href="/"
|
href="/"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
@ -129,6 +129,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<i
|
<i
|
||||||
class="Icon expandIcon material focusable"
|
class="Icon expandIcon material focusable"
|
||||||
|
data-testid="expand-icon-for-sidebar-item-workloads"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="icon"
|
class="icon"
|
||||||
@ -139,31 +140,6 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
</i>
|
</i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class="SidebarItem"
|
|
||||||
data-is-active-test="false"
|
|
||||||
data-testid="sidebar-item-config"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
class="navItem"
|
|
||||||
data-testid="sidebar-item-link-for-config"
|
|
||||||
href="/"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
class="Icon material focusable"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="icon"
|
|
||||||
data-icon-name="list"
|
|
||||||
>
|
|
||||||
list
|
|
||||||
</span>
|
|
||||||
</i>
|
|
||||||
<span>
|
|
||||||
Config
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
class="SidebarItem"
|
class="SidebarItem"
|
||||||
data-is-active-test="false"
|
data-is-active-test="false"
|
||||||
@ -171,7 +147,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="navItem"
|
class="navItem"
|
||||||
data-testid="sidebar-item-link-for-network"
|
data-testid="link-for-sidebar-item-network"
|
||||||
href="/"
|
href="/"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
@ -189,6 +165,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<i
|
<i
|
||||||
class="Icon expandIcon material focusable"
|
class="Icon expandIcon material focusable"
|
||||||
|
data-testid="expand-icon-for-sidebar-item-network"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="icon"
|
class="icon"
|
||||||
@ -199,31 +176,6 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
</i>
|
</i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class="SidebarItem"
|
|
||||||
data-is-active-test="false"
|
|
||||||
data-testid="sidebar-item-storage"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
class="navItem"
|
|
||||||
data-testid="sidebar-item-link-for-storage"
|
|
||||||
href="/"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
class="Icon material focusable"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="icon"
|
|
||||||
data-icon-name="storage"
|
|
||||||
>
|
|
||||||
storage
|
|
||||||
</span>
|
|
||||||
</i>
|
|
||||||
<span>
|
|
||||||
Storage
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
class="SidebarItem"
|
class="SidebarItem"
|
||||||
data-is-active-test="false"
|
data-is-active-test="false"
|
||||||
@ -231,7 +183,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="navItem"
|
class="navItem"
|
||||||
data-testid="sidebar-item-link-for-helm"
|
data-testid="link-for-sidebar-item-helm"
|
||||||
href="/"
|
href="/"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
@ -283,67 +235,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<i
|
<i
|
||||||
class="Icon expandIcon material focusable"
|
class="Icon expandIcon material focusable"
|
||||||
>
|
data-testid="expand-icon-for-sidebar-item-helm"
|
||||||
<span
|
|
||||||
class="icon"
|
|
||||||
data-icon-name="keyboard_arrow_down"
|
|
||||||
>
|
|
||||||
keyboard_arrow_down
|
|
||||||
</span>
|
|
||||||
</i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="SidebarItem"
|
|
||||||
data-is-active-test="false"
|
|
||||||
data-testid="sidebar-item-user-management"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
class="navItem"
|
|
||||||
data-testid="sidebar-item-link-for-user-management"
|
|
||||||
href="/"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
class="Icon material focusable"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="icon"
|
|
||||||
data-icon-name="security"
|
|
||||||
>
|
|
||||||
security
|
|
||||||
</span>
|
|
||||||
</i>
|
|
||||||
<span>
|
|
||||||
Access Control
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="SidebarItem"
|
|
||||||
data-is-active-test="true"
|
|
||||||
data-testid="sidebar-item-custom-resources"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
aria-current="page"
|
|
||||||
class="navItem active"
|
|
||||||
data-testid="sidebar-item-link-for-custom-resources"
|
|
||||||
href="/"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
class="Icon material focusable"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="icon"
|
|
||||||
data-icon-name="extension"
|
|
||||||
>
|
|
||||||
extension
|
|
||||||
</span>
|
|
||||||
</i>
|
|
||||||
<span>
|
|
||||||
Custom Resources
|
|
||||||
</span>
|
|
||||||
<i
|
|
||||||
class="Icon expandIcon material focusable"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="icon"
|
class="icon"
|
||||||
@ -371,7 +263,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
class=""
|
class=""
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ItemListLayout flex column KubeObjectListLayout CrdResources"
|
class="ItemListLayout flex column KubeObjectListLayout CustomResources"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="header flex gaps align-center"
|
class="header flex gaps align-center"
|
||||||
@ -419,7 +311,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
class="items box grow flex column"
|
class="items box grow flex column"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="Table flex column KubeObjectListLayout CrdResources box grow dark selectable scrollable sortable autoSize virtual"
|
class="Table flex column KubeObjectListLayout CustomResources box grow dark selectable scrollable sortable autoSize virtual"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="TableHead sticky nowrap topLine"
|
class="TableHead sticky nowrap topLine"
|
||||||
@ -521,7 +413,7 @@ exports[`Viewing Custom Resources with extra columns renders 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="VirtualList KubeObjectListLayout CrdResources box grow dark"
|
class="VirtualList KubeObjectListLayout CustomResources box grow dark"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
|
@ -9,8 +9,8 @@ import type { RenderResult } from "@testing-library/react";
|
|||||||
import navigateToCustomResourcesInjectable from "../../common/front-end-routing/routes/cluster/custom-resources/navigate-to-custom-resources.injectable";
|
import navigateToCustomResourcesInjectable from "../../common/front-end-routing/routes/cluster/custom-resources/navigate-to-custom-resources.injectable";
|
||||||
import apiManagerInjectable from "../../common/k8s-api/api-manager/manager.injectable";
|
import apiManagerInjectable from "../../common/k8s-api/api-manager/manager.injectable";
|
||||||
import type { CustomResourceStore } from "../../common/k8s-api/api-manager/resource.store";
|
import type { CustomResourceStore } from "../../common/k8s-api/api-manager/resource.store";
|
||||||
import type { CustomResourceDefinitionStore } from "../../renderer/components/custom-resources/definition.store";
|
import type { CustomResourceDefinitionStore } from "../../renderer/components/custom-resource-definitions/store";
|
||||||
import customResourceDefinitionStoreInjectable from "../../renderer/components/custom-resources/definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "../../renderer/components/custom-resource-definitions/store.injectable";
|
||||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import { KubeObject } from "@k8slens/kube-object";
|
|||||||
import maybeKubeApiInjectable from "../../../common/k8s-api/maybe-kube-api.injectable";
|
import maybeKubeApiInjectable from "../../../common/k8s-api/maybe-kube-api.injectable";
|
||||||
import { loggerInjectionToken } from "@k8slens/logger";
|
import { loggerInjectionToken } from "@k8slens/logger";
|
||||||
import { injectableDifferencingRegistratorWith } from "../../../common/utils/registrator-helper";
|
import { injectableDifferencingRegistratorWith } from "../../../common/utils/registrator-helper";
|
||||||
import customResourceDefinitionStoreInjectable from "../../components/custom-resources/definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "../../components/custom-resource-definitions/store.injectable";
|
||||||
import { beforeClusterFrameStartsSecondInjectionToken } from "../tokens";
|
import { beforeClusterFrameStartsSecondInjectionToken } from "../tokens";
|
||||||
|
|
||||||
const setupAutoCrdApiCreationsInjectable = getInjectable({
|
const setupAutoCrdApiCreationsInjectable = getInjectable({
|
||||||
|
@ -7,7 +7,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
import type { IComputedValue } from "mobx";
|
import type { IComputedValue } from "mobx";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import type { CustomResourceDefinition } from "@k8slens/kube-object";
|
import type { CustomResourceDefinition } from "@k8slens/kube-object";
|
||||||
import customResourceDefinitionsInjectable from "../../custom-resources/custom-resources.injectable";
|
import customResourceDefinitionsInjectable from "../../custom-resource-definitions/definitions.injectable";
|
||||||
import type { LensRendererExtension } from "../../../../extensions/lens-renderer-extension";
|
import type { LensRendererExtension } from "../../../../extensions/lens-renderer-extension";
|
||||||
import rendererExtensionsInjectable from "../../../../extensions/renderer-extensions.injectable";
|
import rendererExtensionsInjectable from "../../../../extensions/renderer-extensions.injectable";
|
||||||
import type { CommandRegistration, RegisteredCommand } from "./commands";
|
import type { CommandRegistration, RegisteredCommand } from "./commands";
|
||||||
|
@ -7,7 +7,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
||||||
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
||||||
import customResourceDefinitionStoreInjectable from "./definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "./store.injectable";
|
||||||
|
|
||||||
const customResourceDefinitionsInjectable = getInjectable({
|
const customResourceDefinitionsInjectable = getInjectable({
|
||||||
id: "custom-resource-definitions",
|
id: "custom-resource-definitions",
|
@ -3,11 +3,11 @@
|
|||||||
* 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 "crd.mixins";
|
@import "./mixins.scss";
|
||||||
|
|
||||||
.CRDDetails {
|
.CustomResourceDefinitionDetails {
|
||||||
.conditions {
|
.conditions {
|
||||||
@include crd-condition-bgc;
|
@include custom-resource-definitions-condition-colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Table {
|
.Table {
|
@ -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 "./crd-details.scss";
|
import "./details.scss";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
@ -19,7 +19,7 @@ import type { Logger } from "@k8slens/logger";
|
|||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import { loggerInjectionToken } from "@k8slens/logger";
|
import { loggerInjectionToken } from "@k8slens/logger";
|
||||||
|
|
||||||
export interface CRDDetailsProps extends KubeObjectDetailsProps<CustomResourceDefinition> {
|
export interface CustomResourceDefinitionDetailsProps extends KubeObjectDetailsProps<CustomResourceDefinition> {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Dependencies {
|
interface Dependencies {
|
||||||
@ -27,7 +27,7 @@ interface Dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
class NonInjectedCRDDetails extends React.Component<CRDDetailsProps & Dependencies> {
|
class NonInjectedCustomResourceDefinitionDetails extends React.Component<CustomResourceDefinitionDetailsProps & Dependencies> {
|
||||||
render() {
|
render() {
|
||||||
const { object: crd } = this.props;
|
const { object: crd } = this.props;
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class NonInjectedCRDDetails extends React.Component<CRDDetailsProps & Dependenci
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(crd instanceof CustomResourceDefinition)) {
|
if (!(crd instanceof CustomResourceDefinition)) {
|
||||||
this.props.logger.error("[CRDDetails]: passed object that is not an instanceof CustomResourceDefinition", crd);
|
this.props.logger.error("[CustomResourceDefinitionDetails]: passed object that is not an instanceof CustomResourceDefinition", crd);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ class NonInjectedCRDDetails extends React.Component<CRDDetailsProps & Dependenci
|
|||||||
const validation = crd.getValidation();
|
const validation = crd.getValidation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="CRDDetails">
|
<div className="CustomResourceDefinitionDetails">
|
||||||
<DrawerItem name="Group">
|
<DrawerItem name="Group">
|
||||||
{crd.getGroup()}
|
{crd.getGroup()}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
@ -159,7 +159,7 @@ class NonInjectedCRDDetails extends React.Component<CRDDetailsProps & Dependenci
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CRDDetails = withInjectables<Dependencies, CRDDetailsProps>(NonInjectedCRDDetails, {
|
export const CustomResourceDefinitionDetails = withInjectables<Dependencies, CustomResourceDefinitionDetailsProps>(NonInjectedCustomResourceDefinitionDetails, {
|
||||||
getProps: (di, props) => ({
|
getProps: (di, props) => ({
|
||||||
...props,
|
...props,
|
||||||
logger: di.inject(loggerInjectionToken),
|
logger: di.inject(loggerInjectionToken),
|
@ -14,8 +14,8 @@ import navigateToCustomResourcesInjectable from "../../../common/front-end-routi
|
|||||||
import { shouldShowResourceInjectionToken } from "../../../features/cluster/showing-kube-resources/common/allowed-resources-injection-token";
|
import { shouldShowResourceInjectionToken } from "../../../features/cluster/showing-kube-resources/common/allowed-resources-injection-token";
|
||||||
import routeIsActiveInjectable from "../../routes/route-is-active.injectable";
|
import routeIsActiveInjectable from "../../routes/route-is-active.injectable";
|
||||||
import routePathParametersInjectable from "../../routes/route-path-parameters.injectable";
|
import routePathParametersInjectable from "../../routes/route-path-parameters.injectable";
|
||||||
import customResourcesSidebarItemInjectable from "./custom-resources-sidebar-item.injectable";
|
import customResourcesSidebarItemInjectable from "../custom-resources/sidebar-item.injectable";
|
||||||
import customResourceDefinitionsInjectable from "./custom-resources.injectable";
|
import customResourceDefinitionsInjectable from "./definitions.injectable";
|
||||||
|
|
||||||
const titleCaseSplitRegex = /(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/;
|
const titleCaseSplitRegex = /(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/;
|
||||||
|
|
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
import { reaction } from "mobx";
|
import { reaction } from "mobx";
|
||||||
import { injectableDifferencingRegistratorWith } from "../../../common/utils/registrator-helper";
|
import { injectableDifferencingRegistratorWith } from "../../../common/utils/registrator-helper";
|
||||||
import { beforeClusterFrameStartsSecondInjectionToken } from "../../before-frame-starts/tokens";
|
import { beforeClusterFrameStartsSecondInjectionToken } from "../../before-frame-starts/tokens";
|
||||||
import customResourceDefinitionGroupsSidebarItemsComputedInjectable from "./custom-resource-definition-groups-sidebar-items-computed.injectable";
|
import customResourceDefinitionGroupsSidebarItemsComputedInjectable from "./groups-sidebar-items-computed.injectable";
|
||||||
|
|
||||||
const customResourceDefinitionGroupsSidebarItemsRegistratorInjectable = getInjectable({
|
const customResourceDefinitionGroupsSidebarItemsRegistratorInjectable = getInjectable({
|
||||||
id: "custom-resource-definition-groups-sidebar-items-registrator",
|
id: "custom-resource-definition-groups-sidebar-items-registrator",
|
@ -3,8 +3,8 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// CRD conditions from here https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apis/apiextensions/types.go
|
// ref: https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apis/apiextensions/types.go
|
||||||
$crd-condition-colors: (
|
$custom-resource-definitions-condition-colors: (
|
||||||
Established: var(--colorSuccess),
|
Established: var(--colorSuccess),
|
||||||
NamesAccepted: var(--colorOk),
|
NamesAccepted: var(--colorOk),
|
||||||
NonStructuralSchema: var(--colorError),
|
NonStructuralSchema: var(--colorError),
|
||||||
@ -12,8 +12,8 @@ $crd-condition-colors: (
|
|||||||
KubernetesAPIApprovalPolicyConformant: var(--colorWarning)
|
KubernetesAPIApprovalPolicyConformant: var(--colorWarning)
|
||||||
);
|
);
|
||||||
|
|
||||||
@mixin crd-condition-bgc {
|
@mixin custom-resource-definitions-condition-colors {
|
||||||
@each $status, $color in $crd-condition-colors {
|
@each $status, $color in $custom-resource-definitions-condition-colors {
|
||||||
.#{$status} {
|
.#{$status} {
|
||||||
background: $color;
|
background: $color;
|
||||||
color: white;
|
color: white;
|
@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token";
|
||||||
|
import customResourceDefinitionsRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resource-definitions.injectable";
|
||||||
|
import { CustomResourceDefinitions } from "./view";
|
||||||
|
|
||||||
|
const customResourceDefinitionsRouteComponentInjectable = getInjectable({
|
||||||
|
id: "custom-resource-definitions-route-component",
|
||||||
|
|
||||||
|
instantiate: (di) => ({
|
||||||
|
route: di.inject(customResourceDefinitionsRouteInjectable),
|
||||||
|
Component: CustomResourceDefinitions,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: routeSpecificComponentInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default customResourceDefinitionsRouteComponentInjectable;
|
@ -5,16 +5,18 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import createPageParamInjectable from "../../navigation/create-page-param.injectable";
|
import createPageParamInjectable from "../../navigation/create-page-param.injectable";
|
||||||
|
|
||||||
const crdGroupsUrlParamInjectable = getInjectable({
|
const selectedCustomResourceDefinitionGroupsUrlParamInjectable = getInjectable({
|
||||||
id: "crd-groups-url-param",
|
id: "crd-groups-url-param",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
const createPageParam = di.inject(createPageParamInjectable);
|
const createPageParam = di.inject(createPageParamInjectable);
|
||||||
|
|
||||||
return createPageParam<string[]>({
|
return createPageParam({
|
||||||
name: "groups",
|
name: "groups",
|
||||||
defaultValue: [],
|
defaultValue: new Set<string>(),
|
||||||
|
parse: (value: string[]) => new Set<string>(value),
|
||||||
|
stringify: (value) => Array.from(value),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default crdGroupsUrlParamInjectable;
|
export default selectedCustomResourceDefinitionGroupsUrlParamInjectable;
|
@ -7,7 +7,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
import customResourceDefinitionsRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resource-definitions.injectable";
|
import customResourceDefinitionsRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resource-definitions.injectable";
|
||||||
import navigateToCustomResourceDefinitionsInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/navigate-to-custom-resource-definitions.injectable";
|
import navigateToCustomResourceDefinitionsInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/navigate-to-custom-resource-definitions.injectable";
|
||||||
import routeIsActiveInjectable from "../../routes/route-is-active.injectable";
|
import routeIsActiveInjectable from "../../routes/route-is-active.injectable";
|
||||||
import customResourcesSidebarItemInjectable from "./custom-resources-sidebar-item.injectable";
|
import customResourcesSidebarItemInjectable from "../custom-resources/sidebar-item.injectable";
|
||||||
|
|
||||||
const customResourceDefinitionsSidebarItemInjectable = getInjectable({
|
const customResourceDefinitionsSidebarItemInjectable = getInjectable({
|
||||||
id: "sidebar-item-custom-resource-definitions",
|
id: "sidebar-item-custom-resource-definitions",
|
@ -9,7 +9,7 @@ import customResourceDefinitionApiInjectable from "../../../common/k8s-api/endpo
|
|||||||
import { loggerInjectionToken } from "@k8slens/logger";
|
import { loggerInjectionToken } from "@k8slens/logger";
|
||||||
import clusterFrameContextForClusterScopedResourcesInjectable from "../../cluster-frame-context/for-cluster-scoped-resources.injectable";
|
import clusterFrameContextForClusterScopedResourcesInjectable from "../../cluster-frame-context/for-cluster-scoped-resources.injectable";
|
||||||
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
||||||
import { CustomResourceDefinitionStore } from "./definition.store";
|
import { CustomResourceDefinitionStore } from "./store";
|
||||||
|
|
||||||
const customResourceDefinitionStoreInjectable = getInjectable({
|
const customResourceDefinitionStoreInjectable = getInjectable({
|
||||||
id: "custom-resource-definition-store",
|
id: "custom-resource-definition-store",
|
@ -3,9 +3,9 @@
|
|||||||
* 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 "crd.mixins";
|
@import "./mixins.scss";
|
||||||
|
|
||||||
.CrdList {
|
.CustomResourceDefinitions {
|
||||||
.TableCell {
|
.TableCell {
|
||||||
&.kind {
|
&.kind {
|
||||||
flex: 1.5;
|
flex: 1.5;
|
@ -3,10 +3,10 @@
|
|||||||
* 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 "./crd-list.scss";
|
import "./view.scss";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { computed, makeObservable, observable } from "mobx";
|
import { computed, makeObservable } from "mobx";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { iter, stopPropagation } from "@k8slens/utilities";
|
import { iter, stopPropagation } from "@k8slens/utilities";
|
||||||
@ -16,10 +16,10 @@ import { Icon } from "@k8slens/icon";
|
|||||||
import { KubeObjectAge } from "../kube-object/age";
|
import { KubeObjectAge } from "../kube-object/age";
|
||||||
import { TabLayout } from "../layout/tab-layout-2";
|
import { TabLayout } from "../layout/tab-layout-2";
|
||||||
import type { PageParam } from "../../navigation/page-param";
|
import type { PageParam } from "../../navigation/page-param";
|
||||||
import type { CustomResourceDefinitionStore } from "./definition.store";
|
import type { CustomResourceDefinitionStore } from "./store";
|
||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import crdGroupsUrlParamInjectable from "./crd-groups-url-param.injectable";
|
import selectedCustomResourceDefinitionGroupsUrlParamInjectable from "./selected-groups-url-param.injectable";
|
||||||
import customResourceDefinitionStoreInjectable from "./definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "./store.injectable";
|
||||||
|
|
||||||
enum columnId {
|
enum columnId {
|
||||||
kind = "kind",
|
kind = "kind",
|
||||||
@ -30,53 +30,54 @@ enum columnId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface Dependencies {
|
interface Dependencies {
|
||||||
crdGroupsUrlParam: PageParam<string[]>;
|
selectedGroups: PageParam<Set<string>>;
|
||||||
customResourceDefinitionStore: CustomResourceDefinitionStore;
|
customResourceDefinitionStore: CustomResourceDefinitionStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
class NonInjectedCustomResourceDefinitions extends React.Component<Dependencies> {
|
class NonInjectedCustomResourceDefinitions extends React.Component<Dependencies> {
|
||||||
private readonly selectedGroups = observable.set(this.props.crdGroupsUrlParam.get());
|
|
||||||
|
|
||||||
constructor(props: Dependencies) {
|
constructor(props: Dependencies) {
|
||||||
super(props);
|
super(props);
|
||||||
makeObservable(this);
|
makeObservable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get items() {
|
@computed get items() {
|
||||||
if (this.selectedGroups.size) {
|
const selectedGroups = this.props.selectedGroups.get();
|
||||||
return this.props.customResourceDefinitionStore.items.filter(item => this.selectedGroups.has(item.getGroup()));
|
|
||||||
|
if (selectedGroups.size) {
|
||||||
|
return this.props.customResourceDefinitionStore.items.filter(item => selectedGroups.has(item.getGroup()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.props.customResourceDefinitionStore.items; // show all by default
|
return this.props.customResourceDefinitionStore.items; // show all by default
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get groupSelectOptions() {
|
@computed get groupSelectOptions() {
|
||||||
|
const selectedGroups = this.props.selectedGroups.get();
|
||||||
|
|
||||||
return Object.keys(this.props.customResourceDefinitionStore.groups)
|
return Object.keys(this.props.customResourceDefinitionStore.groups)
|
||||||
.map(group => ({
|
.map(group => ({
|
||||||
value: group,
|
value: group,
|
||||||
label: group,
|
label: group,
|
||||||
isSelected: this.selectedGroups.has(group),
|
isSelected: selectedGroups.has(group),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSelection = (options: readonly ({ value: string })[]) => {
|
toggleSelection = (options: readonly ({ value: string })[]) => {
|
||||||
const groups = options.map(({ value }) => value);
|
this.props.selectedGroups.setRaw(options.map(({ value }) => value));
|
||||||
|
|
||||||
this.selectedGroups.replace(groups);
|
|
||||||
this.props.crdGroupsUrlParam.set(groups);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private getPlaceholder() {
|
private getPlaceholder() {
|
||||||
if (this.selectedGroups.size === 0) {
|
const selectedGroups = this.props.selectedGroups.get();
|
||||||
|
|
||||||
|
if (selectedGroups.size === 0) {
|
||||||
return "All groups";
|
return "All groups";
|
||||||
}
|
}
|
||||||
|
|
||||||
const prefix = this.selectedGroups.size === 1
|
const prefix = selectedGroups.size === 1
|
||||||
? "Group"
|
? "Group"
|
||||||
: "Groups";
|
: "Groups";
|
||||||
|
|
||||||
return `${prefix}: ${iter.join(this.selectedGroups.values(), ", ")}`;
|
return `${prefix}: ${iter.join(selectedGroups.values(), ", ")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -85,7 +86,7 @@ class NonInjectedCustomResourceDefinitions extends React.Component<Dependencies>
|
|||||||
<KubeObjectListLayout
|
<KubeObjectListLayout
|
||||||
isConfigurable
|
isConfigurable
|
||||||
tableId="crd"
|
tableId="crd"
|
||||||
className="CrdList"
|
className="CustomResourceDefinitions"
|
||||||
store={this.props.customResourceDefinitionStore}
|
store={this.props.customResourceDefinitionStore}
|
||||||
// Don't subscribe the `customResourceDefinitionStore` because <Sidebar> already has and is always mounted
|
// Don't subscribe the `customResourceDefinitionStore` because <Sidebar> already has and is always mounted
|
||||||
subscribeStores={false}
|
subscribeStores={false}
|
||||||
@ -166,7 +167,7 @@ class NonInjectedCustomResourceDefinitions extends React.Component<Dependencies>
|
|||||||
export const CustomResourceDefinitions = withInjectables<Dependencies>(NonInjectedCustomResourceDefinitions, {
|
export const CustomResourceDefinitions = withInjectables<Dependencies>(NonInjectedCustomResourceDefinitions, {
|
||||||
getProps: (di, props) => ({
|
getProps: (di, props) => ({
|
||||||
...props,
|
...props,
|
||||||
crdGroupsUrlParam: di.inject(crdGroupsUrlParamInjectable),
|
selectedGroups: di.inject(selectedCustomResourceDefinitionGroupsUrlParamInjectable),
|
||||||
customResourceDefinitionStore: di.inject(customResourceDefinitionStoreInjectable),
|
customResourceDefinitionStore: di.inject(customResourceDefinitionStoreInjectable),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
@ -3,7 +3,7 @@
|
|||||||
exports[`<CustomResourceDetails /> with a CRD with a boolean field should display false in an additionalPrinterColumn as 'false' 1`] = `
|
exports[`<CustomResourceDetails /> with a CRD with a boolean field should display false in an additionalPrinterColumn as 'false' 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="CrdResourceDetails MyCrd"
|
class="CustomResourceDetails MyCrd"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="DrawerItem"
|
class="DrawerItem"
|
||||||
@ -26,7 +26,7 @@ exports[`<CustomResourceDetails /> with a CRD with a boolean field should displa
|
|||||||
exports[`<CustomResourceDetails /> with a CRD with a boolean field should display true in an additionalPrinterColumn as 'true' 1`] = `
|
exports[`<CustomResourceDetails /> with a CRD with a boolean field should display true in an additionalPrinterColumn as 'true' 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="CrdResourceDetails MyCrd"
|
class="CustomResourceDetails MyCrd"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="DrawerItem"
|
class="DrawerItem"
|
||||||
@ -49,7 +49,7 @@ exports[`<CustomResourceDetails /> with a CRD with a boolean field should displa
|
|||||||
exports[`<CustomResourceDetails /> with a CRD with a number field should display 0 in an additionalPrinterColumn as '0' 1`] = `
|
exports[`<CustomResourceDetails /> with a CRD with a number field should display 0 in an additionalPrinterColumn as '0' 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="CrdResourceDetails MyCrd"
|
class="CustomResourceDetails MyCrd"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="DrawerItem"
|
class="DrawerItem"
|
||||||
@ -72,7 +72,7 @@ exports[`<CustomResourceDetails /> with a CRD with a number field should display
|
|||||||
exports[`<CustomResourceDetails /> with a CRD with a number field should display 1234 in an additionalPrinterColumn as '1234' 1`] = `
|
exports[`<CustomResourceDetails /> with a CRD with a number field should display 1234 in an additionalPrinterColumn as '1234' 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="CrdResourceDetails MyCrd"
|
class="CustomResourceDetails MyCrd"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="DrawerItem"
|
class="DrawerItem"
|
||||||
|
@ -8,7 +8,7 @@ import { CustomResourceDefinition, KubeObject } from "@k8slens/kube-object";
|
|||||||
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
||||||
import type { DiRender } from "../../test-utils/renderFor";
|
import type { DiRender } from "../../test-utils/renderFor";
|
||||||
import { renderFor } from "../../test-utils/renderFor";
|
import { renderFor } from "../../test-utils/renderFor";
|
||||||
import { CustomResourceDetails } from "../crd-resource-details";
|
import { CustomResourceDetails } from "../details";
|
||||||
|
|
||||||
describe("<CustomResourceDetails />", () => {
|
describe("<CustomResourceDetails />", () => {
|
||||||
let render: DiRender;
|
let render: DiRender;
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
|
||||||
import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token";
|
|
||||||
import crdListRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resource-definitions.injectable";
|
|
||||||
import { CustomResourceDefinitions } from "./crd-list";
|
|
||||||
|
|
||||||
const crdListRouteComponentInjectable = getInjectable({
|
|
||||||
id: "crd-list-route-component",
|
|
||||||
|
|
||||||
instantiate: (di) => ({
|
|
||||||
route: di.inject(crdListRouteInjectable),
|
|
||||||
Component: CustomResourceDefinitions,
|
|
||||||
}),
|
|
||||||
|
|
||||||
injectionToken: routeSpecificComponentInjectionToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
export default crdListRouteComponentInjectable;
|
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.CrdResourceDetails {
|
.CustomResourceDetails {
|
||||||
.status {
|
.status {
|
||||||
.ready {
|
.ready {
|
||||||
color: white;
|
color: white;
|
@ -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 "./crd-resource-details.scss";
|
import "./details.scss";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
@ -131,7 +131,7 @@ class NonInjectedCustomResourceDetails extends React.Component<CustomResourceDet
|
|||||||
const extraColumns = crd.getPrinterColumns();
|
const extraColumns = crd.getPrinterColumns();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cssNames("CrdResourceDetails", crd.getResourceKind())}>
|
<div className={cssNames("CustomResourceDetails", crd.getResourceKind())}>
|
||||||
{this.renderAdditionalColumns(object, extraColumns)}
|
{this.renderAdditionalColumns(object, extraColumns)}
|
||||||
{this.renderStatus(object, extraColumns)}
|
{this.renderStatus(object, extraColumns)}
|
||||||
</div>
|
</div>
|
@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export * from "./crd-list";
|
|
||||||
export * from "./crd-details";
|
|
||||||
export * from "./crd-resources";
|
|
||||||
export * from "./crd-resource-details";
|
|
@ -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 { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { CustomResources } from "./crd-resources";
|
import { CustomResources } from "./view";
|
||||||
import customResourcesRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resources-route.injectable";
|
import customResourcesRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resources-route.injectable";
|
||||||
import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token";
|
import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token";
|
||||||
|
|
@ -3,5 +3,5 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.CrdResources {
|
.CustomResources {
|
||||||
}
|
}
|
@ -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 "./crd-resources.scss";
|
import "./view.scss";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
@ -14,11 +14,11 @@ import type { ApiManager } from "../../../common/k8s-api/api-manager";
|
|||||||
import { formatJSONValue, safeJSONPathValue } from "@k8slens/utilities";
|
import { formatJSONValue, safeJSONPathValue } from "@k8slens/utilities";
|
||||||
import { TabLayout } from "../layout/tab-layout-2";
|
import { TabLayout } from "../layout/tab-layout-2";
|
||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import customResourcesRouteParametersInjectable from "./custom-resources-route-parameters.injectable";
|
import customResourcesRouteParametersInjectable from "./route-parameters.injectable";
|
||||||
import { KubeObjectAge } from "../kube-object/age";
|
import { KubeObjectAge } from "../kube-object/age";
|
||||||
import type { CustomResourceDefinitionStore } from "./definition.store";
|
import type { CustomResourceDefinitionStore } from "../custom-resource-definitions/store";
|
||||||
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
|
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
|
||||||
import customResourceDefinitionStoreInjectable from "./definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "../custom-resource-definitions/store.injectable";
|
||||||
import { NamespaceSelectBadge } from "../namespaces/namespace-select-badge";
|
import { NamespaceSelectBadge } from "../namespaces/namespace-select-badge";
|
||||||
import type { TableCellProps } from "@k8slens/list-layout";
|
import type { TableCellProps } from "@k8slens/list-layout";
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ class NonInjectedCustomResources extends React.Component<Dependencies> {
|
|||||||
isConfigurable
|
isConfigurable
|
||||||
key={`crd_resources_${crd.getResourceApiBase()}`}
|
key={`crd_resources_${crd.getResourceApiBase()}`}
|
||||||
tableId="crd_resources"
|
tableId="crd_resources"
|
||||||
className="CrdResources"
|
className="CustomResources"
|
||||||
store={store}
|
store={store}
|
||||||
sortingCallbacks={{
|
sortingCallbacks={{
|
||||||
[columnId.name]: customResource => customResource.getName(),
|
[columnId.name]: customResource => customResource.getName(),
|
@ -5,8 +5,8 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { CustomResourceDetails } from "../custom-resources";
|
import { CustomResourceDetails } from "../custom-resources/details";
|
||||||
import customResourceDefinitionStoreInjectable from "../custom-resources/definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "../custom-resource-definitions/store.injectable";
|
||||||
import currentKubeObjectInDetailsInjectable from "./current-kube-object-in-details.injectable";
|
import currentKubeObjectInDetailsInjectable from "./current-kube-object-in-details.injectable";
|
||||||
import { kubeObjectDetailItemInjectionToken } from "./kube-object-detail-items/kube-object-detail-item-injection-token";
|
import { kubeObjectDetailItemInjectionToken } from "./kube-object-detail-items/kube-object-detail-item-injection-token";
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { kubeObjectDetailItemInjectionToken } from "../kube-object-detail-item-injection-token";
|
import { kubeObjectDetailItemInjectionToken } from "../kube-object-detail-item-injection-token";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import { CRDDetails } from "../../../custom-resources";
|
import { CustomResourceDefinitionDetails } from "../../../custom-resource-definitions/details";
|
||||||
import { kubeObjectMatchesToKindAndApiVersion } from "../kube-object-matches-to-kind-and-api-version";
|
import { kubeObjectMatchesToKindAndApiVersion } from "../kube-object-matches-to-kind-and-api-version";
|
||||||
import currentKubeObjectInDetailsInjectable from "../../current-kube-object-in-details.injectable";
|
import currentKubeObjectInDetailsInjectable from "../../current-kube-object-in-details.injectable";
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ const customResourceDefinitionsDetailItemInjectable = getInjectable({
|
|||||||
const kubeObject = di.inject(currentKubeObjectInDetailsInjectable);
|
const kubeObject = di.inject(currentKubeObjectInDetailsInjectable);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
Component: CRDDetails,
|
Component: CustomResourceDefinitionDetails,
|
||||||
enabled: computed(() => isCustomResourceDefinition(kubeObject.value.get()?.object)),
|
enabled: computed(() => isCustomResourceDefinition(kubeObject.value.get()?.object)),
|
||||||
orderNumber: 10,
|
orderNumber: 10,
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
import { waitUntilDefined } from "@k8slens/utilities";
|
import { waitUntilDefined } from "@k8slens/utilities";
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import customResourceDefinitionStoreInjectable from "../custom-resources/definition.store.injectable";
|
import customResourceDefinitionStoreInjectable from "../custom-resource-definitions/store.injectable";
|
||||||
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
|
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
|
||||||
import type { Namespace } from "@k8slens/kube-object";
|
import type { Namespace } from "@k8slens/kube-object";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user