mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Convert runMany and runManySync to use injectManyWithMeta + move to seperate package (#7244)
* Convert runMany and runManySync to use injectManyWithMeta Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fixup type errors due to new Runnable requirements Signed-off-by: Sebastian Malton <sebastian@malton.name> * Add documentation for verifyRunnablesAreDAG Signed-off-by: Sebastian Malton <sebastian@malton.name> * Simplify convertToWithIdWith Signed-off-by: Sebastian Malton <sebastian@malton.name> * Move all utility functions to separate package Signed-off-by: Sebastian Malton <sebastian@malton.name> * Move testing utilities to separate package Signed-off-by: Sebastian Malton <sebastian@malton.name> * Move run-many and run-many-sync to separate package Signed-off-by: Sebastian Malton <sebastian@malton.name> * Replace all internal uses of utilities with new packages Signed-off-by: Sebastian Malton <sebastian@malton.name> * Use new @k8slens/run-many package in core Signed-off-by: Sebastian Malton <sebastian@malton.name> * Add dep to open-lens Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fixup type errors Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fixup uses of @k8slens/test-utils Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fixup getGlobalOverride Signed-off-by: Sebastian Malton <sebastian@malton.name> * Move tests to new package too Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix type errors Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fixup uses of AsyncResult and autoBind Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fixup remaining import issues Signed-off-by: Sebastian Malton <sebastian@malton.name> * Finial fixups to fix build Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix lint Signed-off-by: Sebastian Malton <sebastian@malton.name> * Revert moving "testUsingFakeTime" to separate package - This fixes tests Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix integration tests Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix unit test failing due to spelling fix Signed-off-by: Sebastian Malton <sebastian@malton.name> --------- Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
ad9bafe2a5
commit
2789bcebcb
754 files changed
+2715
-2752
No files matched your search
@@ -7,8 +7,8 @@ import { computed, observable, makeObservable, action } from "mobx";
|
||||
import { ipcRendererOn } from "../../../../common/ipc";
|
||||
import type { CatalogCategory, CatalogEntity, CatalogEntityData, CatalogCategoryRegistry, CatalogEntityKindData } from "../../../../common/catalog";
|
||||
import "../../../../common/catalog-entities";
|
||||
import { iter } from "../../../utils";
|
||||
import type { Disposer } from "../../../utils";
|
||||
import { iter } from "@k8slens/utilities";
|
||||
import type { Disposer } from "@k8slens/utilities";
|
||||
import { once } from "lodash";
|
||||
import { CatalogRunEvent } from "../../../../common/catalog/catalog-run-event";
|
||||
import { ipcRenderer } from "electron";
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ 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";
|
||||
import type { Disposer } from "../../utils";
|
||||
import { disposer } from "../../utils";
|
||||
import type { Disposer } from "@k8slens/utilities";
|
||||
import { disposer } from "@k8slens/utilities";
|
||||
import catalogEntityRegistryInjectable from "../catalog/entity/registry.injectable";
|
||||
|
||||
export type WatchForGeneralEntityNavigation = () => Disposer;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { observable, makeObservable } from "mobx";
|
||||
import EventEmitter from "events";
|
||||
import type TypedEventEmitter from "typed-emitter";
|
||||
import type { Arguments } from "typed-emitter";
|
||||
import type { Defaulted } from "../utils";
|
||||
import type { Defaulted } from "@k8slens/utilities";
|
||||
import type { DefaultWebsocketApiParams } from "./default-websocket-api-params.injectable";
|
||||
|
||||
interface WebsocketApiParams {
|
||||
|
||||
@@ -12,7 +12,6 @@ const setupAppPathsInjectable = getInjectable({
|
||||
id: "setup-app-paths",
|
||||
|
||||
instantiate: (di) => ({
|
||||
id: "setup-app-paths",
|
||||
run: async () => {
|
||||
const requestFromChannel = di.inject(requestFromChannelInjectionToken);
|
||||
const appPathsState = di.inject(appPathsStateInjectable);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { persistStateToConfigInjectionToken } from "../../common/base-store/save-to-file";
|
||||
import { noop } from "../utils";
|
||||
import { noop } from "@k8slens/utilities";
|
||||
|
||||
const persistStateToConfigInjectable = getInjectable({
|
||||
id: "persist-state-to-config",
|
||||
|
||||
@@ -9,7 +9,6 @@ import { beforeFrameStartsFirstInjectionToken } from "../tokens";
|
||||
const configureImmerInjectable = getInjectable({
|
||||
id: "configure-immer",
|
||||
instantiate: () => ({
|
||||
id: "configure-immer",
|
||||
run: () => {
|
||||
// Docs: https://immerjs.github.io/immer/
|
||||
// Required in `utils/storage-helper.ts`
|
||||
|
||||
@@ -9,7 +9,6 @@ import { beforeFrameStartsFirstInjectionToken } from "../tokens";
|
||||
const configureMobxInjectable = getInjectable({
|
||||
id: "configure-mobx",
|
||||
instantiate: () => ({
|
||||
id: "configure-mobx",
|
||||
run: () => {
|
||||
// Docs: https://mobx.js.org/configuration.html
|
||||
configure({
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
||||
const loadMonacoThemesInjectable = getInjectable({
|
||||
id: "load-monaco-themes",
|
||||
instantiate: (di) => ({
|
||||
id: "load-monaco-themes",
|
||||
run: () => {
|
||||
const customThemes = di.injectMany(customMonacoThemeInjectionToken);
|
||||
const addNewMonacoTheme = di.inject(addNewMonacoThemeInjectable);
|
||||
|
||||
-1
@@ -19,7 +19,6 @@ import maybeKubeApiInjectable from "../../../common/k8s-api/maybe-kube-api.injec
|
||||
const setupAutoRegistrationInjectable = getInjectable({
|
||||
id: "setup-auto-registration",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-auto-registration",
|
||||
run: () => {
|
||||
const autoRegistrationEmitter = di.inject(autoRegistrationEmitterInjectable);
|
||||
const beforeApiManagerInitializationCrds: CustomResourceDefinition[] = [];
|
||||
|
||||
-1
@@ -12,7 +12,6 @@ import { beforeMainFrameStartsFirstInjectionToken } from "../tokens";
|
||||
const setupCurrentClusterBroadcastInjectable = getInjectable({
|
||||
id: "setup-current-cluster-broadcast",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-current-cluster-broadcast",
|
||||
run: () => {
|
||||
const matchedClusterId = di.inject(matchedClusterIdInjectable);
|
||||
const sendMessageToChannel = di.inject(sendMessageToChannelInjectionToken);
|
||||
|
||||
-1
@@ -14,7 +14,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
||||
const setupKubernetesClusterCatalogAddMenuListenerInjectable = getInjectable({
|
||||
id: "setup-kubernetes-cluster-catalog-add-menu-listener",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-kubernetes-cluster-catalog-add-menu-listener",
|
||||
run: () => {
|
||||
const navigateToAddCluster = di.inject(navigateToAddClusterInjectable);
|
||||
const addSyncEntries = di.inject(addSyncEntriesInjectable);
|
||||
|
||||
-1
@@ -13,7 +13,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
||||
const setupKubernetesClusterContextMenuOpenInjectable = getInjectable({
|
||||
id: "setup-kubernetes-cluster-context-menu-open",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-kubernetes-cluster-context-menu-open",
|
||||
run: () => {
|
||||
const catalogCategoryRegistry = di.inject(catalogCategoryRegistryInjectable);
|
||||
const openDeleteClusterDialog = di.inject(openDeleteClusterDialogInjectable);
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ import requestLensProxyCertificateInjectable from "../../certificate/request-len
|
||||
const setupLensProxyCertificateInjectable = getInjectable({
|
||||
id: "setup-lens-proxy-certificate",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-lens-proxy-certificate",
|
||||
run: async () => {
|
||||
const requestLensProxyCertificate = di.inject(requestLensProxyCertificateInjectable);
|
||||
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
||||
|
||||
-1
@@ -9,7 +9,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
||||
const setupRootMacClassnameInjectable = getInjectable({
|
||||
id: "setup-root-mac-classname",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-root-mac-classname",
|
||||
run: () => {
|
||||
const isMac = di.inject(isMacInjectable);
|
||||
const rootElem = document.getElementById("app");
|
||||
|
||||
@@ -10,7 +10,6 @@ import { init } from "@sentry/electron/renderer";
|
||||
const setupSentryInjectable = getInjectable({
|
||||
id: "setup-sentry",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-sentry",
|
||||
run: () => {
|
||||
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
||||
|
||||
|
||||
+3
-4
@@ -9,10 +9,9 @@ import { WeblinkAddCommand } from "../../components/catalog-entities/weblink-add
|
||||
import commandOverlayInjectable from "../../components/command-palette/command-overlay.injectable";
|
||||
import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
||||
|
||||
const setupWeblickContextMenuOpenInjectable = getInjectable({
|
||||
id: "setup-weblick-context-menu-open",
|
||||
const setupWeblinkContextMenuOpenInjectable = getInjectable({
|
||||
id: "setup-weblink-context-menu-open",
|
||||
instantiate: (di) => ({
|
||||
id: "setup-weblick-context-menu-open",
|
||||
run: () => {
|
||||
const catalogCategoryRegistry = di.inject(catalogCategoryRegistryInjectable);
|
||||
const commandOverlay = di.inject(commandOverlayInjectable);
|
||||
@@ -31,4 +30,4 @@ const setupWeblickContextMenuOpenInjectable = getInjectable({
|
||||
injectionToken: beforeFrameStartsSecondInjectionToken,
|
||||
});
|
||||
|
||||
export default setupWeblickContextMenuOpenInjectable;
|
||||
export default setupWeblinkContextMenuOpenInjectable;
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { Runnable } from "../../common/runnable/run-many-for";
|
||||
import type { Runnable } from "@k8slens/run-many";
|
||||
|
||||
// NOTE: these are run before any other token, mostly to set up things that all other runnables need
|
||||
export const beforeFrameStartsFirstInjectionToken = getInjectionToken<Runnable>({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getGlobalOverride } from "../common/test-utils/get-global-override";
|
||||
import { getGlobalOverride } from "@k8slens/test-utils";
|
||||
import bootstrapInjectable from "./bootstrap.injectable";
|
||||
|
||||
export default getGlobalOverride(bootstrapInjectable, () => ({
|
||||
|
||||
@@ -17,7 +17,7 @@ const bootstrapInjectable = getInjectable({
|
||||
await bootstrap(di);
|
||||
},
|
||||
|
||||
runAfter: di.inject(startFrameInjectable),
|
||||
runAfter: startFrameInjectable,
|
||||
}),
|
||||
|
||||
causesSideEffects: true,
|
||||
|
||||
@@ -14,7 +14,7 @@ import React from "react";
|
||||
import * as uuid from "uuid";
|
||||
import { loadConfigFromString, splitConfig } from "../../../common/kube-helpers";
|
||||
import { docsUrl } from "../../../common/vars";
|
||||
import { isDefined, iter } from "../../utils";
|
||||
import { isDefined, iter } from "@k8slens/utilities";
|
||||
import { Button } from "../button";
|
||||
import type { ShowNotification } from "../notifications";
|
||||
import { SettingLayout } from "../layout/setting-layout";
|
||||
|
||||
+1
-1
@@ -10,9 +10,9 @@ import catalogCategoryRegistryInjectable from "../../../../common/catalog/catego
|
||||
import { CatalogCategory } from "../../../api/catalog-entity";
|
||||
import catalogEntityRegistryInjectable from "../../../api/catalog/entity/registry.injectable";
|
||||
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
||||
import { noop } from "../../../utils";
|
||||
import type { CatalogEntityStore } from "../catalog-entity-store.injectable";
|
||||
import catalogEntityStoreInjectable from "../catalog-entity-store.injectable";
|
||||
import { noop } from "@k8slens/utilities";
|
||||
|
||||
class TestEntityOne extends CatalogEntity {
|
||||
public static readonly apiVersion: string = "entity.k8slens.dev/v1alpha1";
|
||||
|
||||
@@ -9,7 +9,6 @@ import { SpeedDial, SpeedDialAction } from "@material-ui/lab";
|
||||
import { Icon } from "../icon";
|
||||
import { observer } from "mobx-react";
|
||||
import { observable, makeObservable, action } from "mobx";
|
||||
import { autoBind } from "../../../common/utils";
|
||||
import type { CatalogCategory, CatalogEntityAddMenu } from "../../api/catalog-entity";
|
||||
import { EventEmitter } from "events";
|
||||
import type { CatalogCategoryRegistry } from "../../../common/catalog";
|
||||
@@ -17,6 +16,7 @@ import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import catalogCategoryRegistryInjectable from "../../../common/catalog/category-registry.injectable";
|
||||
import type { Navigate } from "../../navigation/navigate.injectable";
|
||||
import navigateInjectable from "../../navigation/navigate.injectable";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
export interface CatalogAddButtonProps {
|
||||
category: CatalogCategory;
|
||||
@@ -37,7 +37,7 @@ class NonInjectedCatalogAddButton extends React.Component<CatalogAddButtonProps
|
||||
constructor(props: CatalogAddButtonProps & Dependencies) {
|
||||
super(props);
|
||||
makeObservable(this);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { cssNames, hasDefiniteField } from "../../utils";
|
||||
import { cssNames, hasDefiniteField } from "@k8slens/utilities";
|
||||
import type { MenuActionsProps } from "../menu/menu-actions";
|
||||
import { MenuActions } from "../menu/menu-actions";
|
||||
import type { CatalogEntity, CatalogEntityContextMenu } from "../../api/catalog-entity";
|
||||
|
||||
@@ -9,8 +9,8 @@ import type { IComputedValue, IObservableValue } from "mobx";
|
||||
import { computed, observable, reaction } from "mobx";
|
||||
import type { CatalogEntity } from "../../api/catalog-entity";
|
||||
import type { CatalogCategory } from "../../../common/catalog";
|
||||
import type { Disposer } from "../../../common/utils";
|
||||
import { disposer } from "../../../common/utils";
|
||||
import type { Disposer } from "@k8slens/utilities";
|
||||
import { disposer } from "@k8slens/utilities";
|
||||
import type { ItemListStore } from "../item-object-list";
|
||||
import catalogCategoryRegistryInjectable from "../../../common/catalog/category-registry.injectable";
|
||||
import selectedCatalogEntityParamInjectable from "./entity-details/selected-uid.injectable";
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { TreeItemProps } from "@material-ui/lab";
|
||||
import { TreeItem, TreeView } from "@material-ui/lab";
|
||||
import { Icon } from "../icon";
|
||||
import { StylesProvider } from "@material-ui/core";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { CatalogCategory } from "../../api/catalog-entity";
|
||||
import { observer } from "mobx-react";
|
||||
import { CatalogCategoryLabel } from "./catalog-category-label";
|
||||
|
||||
@@ -17,8 +17,7 @@ import type { CatalogCategory, CatalogCategoryRegistry, CatalogEntity } from "..
|
||||
import { CatalogAddButton } from "./catalog-add-button";
|
||||
import type { ShowNotification } from "../notifications";
|
||||
import { MainLayout } from "../layout/main-layout";
|
||||
import type { StorageLayer } from "../../utils";
|
||||
import { prevDefault } from "../../utils";
|
||||
import { prevDefault } from "@k8slens/utilities";
|
||||
import { CatalogMenu } from "./catalog-menu";
|
||||
import { RenderDelay } from "../render-delay/render-delay";
|
||||
import { Icon } from "../icon";
|
||||
@@ -54,6 +53,7 @@ import type { ShowEntityDetails } from "./entity-details/show.injectable";
|
||||
import showEntityDetailsInjectable from "./entity-details/show.injectable";
|
||||
import type { OnCatalogEntityListClick } from "./entity-details/on-catalog-click.injectable";
|
||||
import onCatalogEntityListClickInjectable from "./entity-details/on-catalog-click.injectable";
|
||||
import type { StorageLayer } from "../../utils/storage-helper";
|
||||
|
||||
interface Dependencies {
|
||||
catalogPreviousActiveTabStorage: StorageLayer<string | null>;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import styles from "../catalog.module.scss";
|
||||
import type { CatalogEntity } from "../../../../common/catalog";
|
||||
import { prevDefault } from "../../../utils";
|
||||
import { prevDefault } from "@k8slens/utilities";
|
||||
import { Avatar } from "../../avatar";
|
||||
import { Icon } from "../../icon";
|
||||
import React from "react";
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx";
|
||||
import { computed } from "mobx";
|
||||
import { getOrInsert, getOrInsertMap } from "../../utils";
|
||||
import { getOrInsert, getOrInsertMap } from "@k8slens/utilities";
|
||||
import { customCatalogCategoryColumnInjectionToken } from "./columns/custom-token";
|
||||
import type { RegisteredAdditionalCategoryColumn } from "./custom-category-columns";
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { IComputedValue } from "mobx";
|
||||
import { computed } from "mobx";
|
||||
import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
|
||||
import rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
||||
import { getOrInsert, getOrInsertMap } from "../../utils";
|
||||
import { getOrInsert, getOrInsertMap } from "@k8slens/utilities";
|
||||
import type { CustomCategoryViewComponents } from "./custom-views";
|
||||
|
||||
interface Dependencies {
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { extensionRegistratorInjectionToken } from "../../../../extensions/extension-loader/extension-registrator-injection-token";
|
||||
import type { LensRendererExtension } from "../../../../extensions/lens-renderer-extension";
|
||||
import type { CatalogEntity } from "../../../api/catalog-entity";
|
||||
import { getRandId } from "../../../utils";
|
||||
import * as uuid from "uuid";
|
||||
import type { CatalogEntityDetailRegistration } from "./token";
|
||||
import { catalogEntityDetailItemInjectionToken } from "./token";
|
||||
|
||||
@@ -28,7 +28,7 @@ const getRegistratorFor = (extension: LensRendererExtension) => ({
|
||||
kind,
|
||||
priority,
|
||||
}: CatalogEntityDetailRegistration<CatalogEntity>) => getInjectable({
|
||||
id: `catalog-entity-detail-item-for-${extension.sanitizedExtensionId}-${getRandId({ sep: "-" })}`,
|
||||
id: `catalog-entity-detail-item-for-${extension.sanitizedExtensionId}-${uuid.v4()}`,
|
||||
instantiate: () => ({
|
||||
apiVersions: new Set(apiVersions),
|
||||
components,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Drawer, DrawerItem } from "../../drawer";
|
||||
import type { CatalogCategory, CatalogEntity } from "../../../../common/catalog";
|
||||
import { Icon } from "../../icon";
|
||||
import { CatalogEntityDrawerMenu } from "../catalog-entity-drawer-menu";
|
||||
import { cssNames } from "../../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { Avatar } from "../../avatar";
|
||||
import type { GetLabelBadges } from "../get-label-badges.injectable";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
|
||||
@@ -12,7 +12,7 @@ import { computed, makeObservable } from "mobx";
|
||||
import { Icon } from "../icon";
|
||||
import { SubHeader } from "../layout/sub-header";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import { cssNames, prevDefault } from "../../utils";
|
||||
import { cssNames, prevDefault } from "@k8slens/utilities";
|
||||
import type { ItemObject } from "../../../common/item.store";
|
||||
import { Spinner } from "../spinner";
|
||||
import type { ApiManager } from "../../../common/k8s-api/api-manager";
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { ChartOptions, ChartPoint } from "chart.js";
|
||||
import type { ClusterOverviewStore } from "./cluster-overview-store/cluster-overview-store";
|
||||
import { MetricType } from "./cluster-overview-store/cluster-overview-store";
|
||||
import { BarChart } from "../chart";
|
||||
import { bytesToUnits, cssNames } from "../../utils";
|
||||
import { bytesToUnits, cssNames } from "@k8slens/utilities";
|
||||
import { Spinner } from "../spinner";
|
||||
import { ZebraStripesPlugin } from "../chart/zebra-stripes.plugin";
|
||||
import { ClusterNoMetrics } from "./cluster-no-metrics";
|
||||
|
||||
@@ -7,7 +7,7 @@ import styles from "./cluster-no-metrics.module.scss";
|
||||
|
||||
import React from "react";
|
||||
import { Icon } from "../icon";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { NavigateToEntitySettings } from "../../../common/front-end-routing/routes/entity-settings/navigate-to-entity-settings.injectable";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import navigateToEntitySettingsInjectable from "../../../common/front-end-routing/routes/entity-settings/navigate-to-entity-settings.injectable";
|
||||
|
||||
+2
-2
@@ -7,12 +7,12 @@ import { action, observable, reaction, when, makeObservable } from "mobx";
|
||||
import type { KubeObjectStoreDependencies } from "../../../../common/k8s-api/kube-object.store";
|
||||
import { KubeObjectStore } from "../../../../common/k8s-api/kube-object.store";
|
||||
import type { Cluster, ClusterApi } from "../../../../common/k8s-api/endpoints";
|
||||
import type { StorageLayer } from "../../../utils";
|
||||
import { autoBind } from "../../../utils";
|
||||
import type { StorageLayer } from "../../../utils/storage-helper";
|
||||
import type { NodeStore } from "../../+nodes/store";
|
||||
import type { ClusterMetricData, RequestClusterMetricsByNodeNames } from "../../../../common/k8s-api/endpoints/metrics.api/request-cluster-metrics-by-node-names.injectable";
|
||||
import type { RequestMetricsParams } from "../../../../common/k8s-api/endpoints/metrics.api/request-metrics.injectable";
|
||||
import { normalizeMetrics } from "../../../../common/k8s-api/endpoints/metrics.api";
|
||||
import autoBind from "auto-bind";
|
||||
|
||||
export enum MetricType {
|
||||
MEMORY = "memory",
|
||||
|
||||
@@ -11,7 +11,7 @@ import { reaction } from "mobx";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import type { NodeStore } from "../+nodes/store";
|
||||
import type { PodStore } from "../+workloads-pods/store";
|
||||
import { interval } from "../../utils";
|
||||
import { interval } from "@k8slens/utilities";
|
||||
import { TabLayout } from "../layout/tab-layout";
|
||||
import { Spinner } from "../spinner";
|
||||
import { ClusterIssues } from "./cluster-issues";
|
||||
|
||||
@@ -15,7 +15,7 @@ import type { NodeStore } from "../+nodes/store";
|
||||
import type { PieChartData } from "../chart";
|
||||
import { PieChart } from "../chart";
|
||||
import { ClusterNoMetrics } from "./cluster-no-metrics";
|
||||
import { bytesToUnits, cssNames } from "../../utils";
|
||||
import { bytesToUnits, cssNames } from "@k8slens/utilities";
|
||||
import type { LensTheme } from "../../themes/lens-theme";
|
||||
import { getMetricLastPoints } from "../../../common/k8s-api/endpoints/metrics.api";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import { Link } from "react-router-dom";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Badge } from "../badge";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { HorizontalPodAutoscalerMetricSpec, HorizontalPodAutoscalerMetricTarget } from "../../../common/k8s-api/endpoints/horizontal-pod-autoscaler.api";
|
||||
import { HorizontalPodAutoscaler, HpaMetricType } from "../../../common/k8s-api/endpoints/horizontal-pod-autoscaler.api";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { observer } from "mobx-react";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import type { HorizontalPodAutoscaler } from "../../../common/k8s-api/endpoints/horizontal-pod-autoscaler.api";
|
||||
import { Badge } from "../badge";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
import { SiblingsInTabLayout } from "../layout/siblings-in-tab-layout";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
|
||||
@@ -13,10 +13,10 @@ import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import { SiblingsInTabLayout } from "../layout/siblings-in-tab-layout";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
import { autoBind } from "../../../common/utils";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import priorityClassStoreInjectable from "./store.injectable";
|
||||
import type { PriorityClassStore } from "./store";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
enum columnId {
|
||||
name = "name",
|
||||
@@ -36,7 +36,7 @@ interface Dependencies {
|
||||
class NonInjectedPriorityClasses extends React.Component<PriorityClassesProps & Dependencies> {
|
||||
constructor(props: PriorityClassesProps & Dependencies) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import React from "react";
|
||||
import kebabCase from "lodash/kebabCase";
|
||||
import { observer } from "mobx-react";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { cpuUnitsToNumber, cssNames, unitsToBytes, metricUnitsToNumber, object, hasDefinedTupleValue } from "../../utils";
|
||||
import { cpuUnitsToNumber, cssNames, unitsToBytes, metricUnitsToNumber, object, hasDefinedTupleValue } from "@k8slens/utilities";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { ResourceQuota } from "../../../common/k8s-api/endpoints/resource-quota.api";
|
||||
import { LineProgress } from "../line-progress";
|
||||
|
||||
@@ -13,10 +13,10 @@ import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import { SiblingsInTabLayout } from "../layout/siblings-in-tab-layout";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
import { autoBind } from "../../../common/utils";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import runtimeClassStoreInjectable from "./store.injectable";
|
||||
import type { RuntimeClassStore } from "./store";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
enum columnId {
|
||||
name = "name",
|
||||
@@ -35,7 +35,7 @@ interface Dependencies {
|
||||
class NonInjectedRuntimeClasses extends React.Component<RuntimeClassesProps & Dependencies> {
|
||||
constructor(props: RuntimeClassesProps & Dependencies) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -20,9 +20,8 @@ import { SubTitle } from "../../layout/sub-title";
|
||||
import { NamespaceSelect } from "../../+namespaces/namespace-select";
|
||||
import { Select } from "../../select";
|
||||
import { Icon } from "../../icon";
|
||||
import { base64, iter } from "../../../utils";
|
||||
import { base64, iter, object } from "@k8slens/utilities";
|
||||
import upperFirst from "lodash/upperFirst";
|
||||
import { fromEntries } from "../../../../common/utils/objects";
|
||||
import type { ShowDetails } from "../../kube-detail-params/show-details.injectable";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import closeAddSecretDialogInjectable from "./close.injectable";
|
||||
@@ -96,7 +95,7 @@ class NonInjectedAddSecretDialog extends React.Component<AddSecretDialogProps &
|
||||
? [key, processValue(value)] as const
|
||||
: undefined
|
||||
))
|
||||
.collect(fromEntries);
|
||||
.collect(object.fromEntries);
|
||||
};
|
||||
|
||||
createSecret = async () => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Input } from "../input";
|
||||
import { Button } from "../button";
|
||||
import type { ShowNotification } from "../notifications";
|
||||
import { base64, toggle } from "../../utils";
|
||||
import { base64, toggle } from "@k8slens/utilities";
|
||||
import { Icon } from "../icon";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { Secret } from "../../../common/k8s-api/endpoints";
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ import { Link } from "react-router-dom";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Badge } from "../badge";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { ContainerScalingMode, ControlledValues, ResourceName, UpdateMode, VerticalPodAutoscaler } from "../../../common/k8s-api/endpoints/vertical-pod-autoscaler.api";
|
||||
import type { PodUpdatePolicy, PodResourcePolicy, VerticalPodAutoscalerStatus } from "../../../common/k8s-api/endpoints/vertical-pod-autoscaler.api";
|
||||
import type { ApiManager } from "../../../common/k8s-api/api-manager";
|
||||
@@ -165,7 +165,7 @@ class NonInjectedVpaDetails extends React.Component<VpaDetailsProps & Dependenci
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { object: vpa, apiManager, getDetailsUrl, logger } = this.props;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import { Badge } from "../badge";
|
||||
import { cssNames, prevDefault } from "../../utils";
|
||||
import { cssNames, prevDefault } from "@k8slens/utilities";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
import { SiblingsInTabLayout } from "../layout/siblings-in-tab-layout";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
|
||||
@@ -9,7 +9,7 @@ import React from "react";
|
||||
import { computed, makeObservable, observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { iter, stopPropagation } from "../../utils";
|
||||
import { iter, stopPropagation } from "@k8slens/utilities";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import { Select } from "../select";
|
||||
import { Icon } from "../icon";
|
||||
|
||||
@@ -7,14 +7,13 @@ import "./crd-resource-details.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames, safeJSONPathValue } from "@k8slens/utilities";
|
||||
import { Badge } from "../badge";
|
||||
import { DrawerItem } from "../drawer";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { Input } from "../input";
|
||||
import type { AdditionalPrinterColumnsV1 } from "../../../common/k8s-api/endpoints/custom-resource-definition.api";
|
||||
import { CustomResourceDefinition } from "../../../common/k8s-api/endpoints/custom-resource-definition.api";
|
||||
import { safeJSONPathValue } from "../../utils/jsonPath";
|
||||
import type { KubeObjectMetadata, KubeObjectStatus } from "../../../common/k8s-api/kube-object";
|
||||
import { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
import type { Logger } from "../../../common/logger";
|
||||
|
||||
@@ -11,7 +11,7 @@ import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import { computed, makeObservable } from "mobx";
|
||||
import type { ApiManager } from "../../../common/k8s-api/api-manager";
|
||||
import { formatJSONValue, safeJSONPathValue } from "../../utils/jsonPath";
|
||||
import { formatJSONValue, safeJSONPathValue } from "@k8slens/utilities";
|
||||
import { TabLayout } from "../layout/tab-layout-2";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import customResourcesRouteParametersInjectable from "./custom-resources-route-parameters.injectable";
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
import { computed, reaction, makeObservable } from "mobx";
|
||||
import type { KubeObjectStoreDependencies, KubeObjectStoreOptions } from "../../../common/k8s-api/kube-object.store";
|
||||
import { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
||||
import { autoBind } from "../../utils";
|
||||
import type { CustomResourceDefinition, CustomResourceDefinitionApi } from "../../../common/k8s-api/endpoints/custom-resource-definition.api";
|
||||
import type { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
import type TypedEventEmitter from "typed-emitter";
|
||||
import type { LegacyAutoRegistration } from "../../../common/k8s-api/api-manager/auto-registration-emitter.injectable";
|
||||
import autoBind from "auto-bind";
|
||||
|
||||
export interface CustomResourceDefinitionStoreDependencies extends KubeObjectStoreDependencies {
|
||||
readonly autoRegistration: TypedEventEmitter<LegacyAutoRegistration>;
|
||||
|
||||
@@ -20,7 +20,7 @@ import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import type { GetDetailsUrl } from "../kube-detail-params/get-details-url.injectable";
|
||||
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
|
||||
import getDetailsUrlInjectable from "../kube-detail-params/get-details-url.injectable";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
|
||||
export interface EventDetailsProps extends KubeObjectDetailsProps<KubeEvent> {
|
||||
|
||||
@@ -18,8 +18,8 @@ import type { TableSortCallbacks, TableSortParams } from "../table";
|
||||
import type { HeaderCustomizer } from "../item-object-list";
|
||||
import { Tooltip } from "../tooltip";
|
||||
import { Link } from "react-router-dom";
|
||||
import type { IClassName } from "../../utils";
|
||||
import { cssNames, stopPropagation } from "../../utils";
|
||||
import type { IClassName } from "@k8slens/utilities";
|
||||
import { cssNames, stopPropagation } from "@k8slens/utilities";
|
||||
import { Icon } from "../icon";
|
||||
import type { ApiManager } from "../../../common/k8s-api/api-manager";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
|
||||
@@ -9,7 +9,7 @@ import React from "react";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { LocaleDate } from "../locale-date";
|
||||
import type { EventStore } from "./store";
|
||||
import type { Logger } from "../../../common/logger";
|
||||
|
||||
@@ -8,7 +8,7 @@ import "./kube-event-icon.scss";
|
||||
import React from "react";
|
||||
import { Icon } from "../icon";
|
||||
import type { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { KubeEvent } from "../../../common/k8s-api/endpoints/events.api";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
import type { EventStore } from "./store";
|
||||
|
||||
@@ -7,11 +7,11 @@ import groupBy from "lodash/groupBy";
|
||||
import compact from "lodash/compact";
|
||||
import type { KubeObjectStoreDependencies, KubeObjectStoreOptions } from "../../../common/k8s-api/kube-object.store";
|
||||
import { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
||||
import { autoBind } from "../../utils";
|
||||
import type { KubeEvent, KubeEventApi } from "../../../common/k8s-api/endpoints/events.api";
|
||||
import type { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
import { Pod } from "../../../common/k8s-api/endpoints/pod.api";
|
||||
import type { GetPodById } from "../+workloads-pods/get-pod-by-id.injectable";
|
||||
import autoBind from "auto-bind";
|
||||
|
||||
export interface EventStoreDependencies extends KubeObjectStoreDependencies {
|
||||
getPodById: GetPodById;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { isObject } from "../../../common/utils";
|
||||
import { isObject } from "@k8slens/utilities";
|
||||
import React from "react";
|
||||
import { SemVer } from "semver";
|
||||
import URLParse from "url-parse";
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ import getExtensionDestFolderInjectable from "./get-extension-dest-folder.inject
|
||||
import type { CreateTempFilesAndValidate } from "./create-temp-files-and-validate.injectable";
|
||||
import createTempFilesAndValidateInjectable from "./create-temp-files-and-validate.injectable";
|
||||
import extensionInstallationStateStoreInjectable from "../../../../extensions/extension-installation-state-store/extension-installation-state-store.injectable";
|
||||
import type { Disposer } from "../../../../common/utils";
|
||||
import { disposer } from "../../../../common/utils";
|
||||
import type { Disposer } from "@k8slens/utilities";
|
||||
import { disposer } from "@k8slens/utilities";
|
||||
import type { ShowNotification } from "../../notifications";
|
||||
import { Button } from "../../button";
|
||||
import type { ExtensionLoader } from "../../../../extensions/extension-loader";
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
import getExtensionDestFolderInjectable from "./get-extension-dest-folder.injectable";
|
||||
import extensionInstallationStateStoreInjectable from "../../../../extensions/extension-installation-state-store/extension-installation-state-store.injectable";
|
||||
import type { Disposer } from "../../../../common/utils";
|
||||
import { noop } from "../../../../common/utils";
|
||||
import type { Disposer } from "@k8slens/utilities";
|
||||
import { noop } from "@k8slens/utilities";
|
||||
import { extensionDisplayName } from "../../../../extensions/lens-extension";
|
||||
import { getMessageFromError } from "../get-message-from-error/get-message-from-error";
|
||||
import path from "path";
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { LensExtensionManifest } from "../../../../extensions/lens-extension";
|
||||
import { hasTypedProperty, isObject, isString, listTarEntries, readFileFromTar } from "../../../../common/utils";
|
||||
import { hasTypedProperty, isObject, isString, listTarEntries, readFileFromTar } from "@k8slens/utilities";
|
||||
import { manifestFilename } from "../../../../extensions/extension-discovery/extension-discovery";
|
||||
import path from "path";
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { hasTypedProperty, isDefined } from "../../../utils";
|
||||
import { hasTypedProperty, isDefined } from "@k8slens/utilities";
|
||||
|
||||
export function getMessageFromError(error: unknown): string {
|
||||
if (!error || typeof error !== "object") {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import React from "react";
|
||||
import type { ExtendableDisposer } from "../../../common/utils";
|
||||
import type { ExtendableDisposer } from "@k8slens/utilities";
|
||||
import { InputValidators } from "../input";
|
||||
import { getMessageFromError } from "./get-message-from-error/get-message-from-error";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import styles from "./install.module.scss";
|
||||
import React from "react";
|
||||
import { prevDefault } from "../../utils";
|
||||
import { prevDefault } from "@k8slens/utilities";
|
||||
import { Button } from "../button";
|
||||
import { Icon } from "../icon";
|
||||
import { observer } from "mobx-react";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Icon } from "../icon";
|
||||
import { List } from "../list/list";
|
||||
import { MenuActions, MenuItem } from "../menu";
|
||||
import { Spinner } from "../spinner";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { observer } from "mobx-react";
|
||||
import type { Row } from "react-table";
|
||||
import type { LensExtensionId } from "../../../extensions/lens-extension";
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import styles from "./notice.module.scss";
|
||||
import type { DOMAttributes } from "react";
|
||||
import React from "react";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
|
||||
export interface NoticeProps extends DOMAttributes<any> {
|
||||
className?: string;
|
||||
|
||||
@@ -9,7 +9,7 @@ import React, { Component } from "react";
|
||||
import type { HelmChart } from "../../../common/k8s-api/endpoints/helm-charts.api";
|
||||
import { observer } from "mobx-react";
|
||||
import { Drawer, DrawerItem } from "../drawer";
|
||||
import { autoBind, stopPropagation } from "../../utils";
|
||||
import { stopPropagation } from "@k8slens/utilities";
|
||||
import { MarkdownViewer } from "../markdown-viewer";
|
||||
import { Spinner } from "../spinner";
|
||||
import { Button } from "../button";
|
||||
@@ -25,6 +25,7 @@ import versionsOfSelectedHelmChartInjectable from "./details/versions-of-selecte
|
||||
import type { HelmChartDetailsVersionSelection } from "./details/versions/helm-chart-details-version-selection.injectable";
|
||||
import helmChartDetailsVersionSelectionInjectable from "./details/versions/helm-chart-details-version-selection.injectable";
|
||||
import assert from "assert";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
export interface HelmChartDetailsProps {
|
||||
hideDetails(): void;
|
||||
@@ -48,7 +49,7 @@ interface Dependencies {
|
||||
class NonInjectedHelmChartDetails extends Component<HelmChartDetailsProps & Dependencies> {
|
||||
constructor(props: HelmChartDetailsProps & Dependencies) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
get chart() {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { HelmChart } from "../../../../common/k8s-api/endpoints/helm-charts.api";
|
||||
import requestHelmChartVersionsInjectable from "../../../../common/k8s-api/endpoints/helm-charts.api/request-versions.injectable";
|
||||
import type { HelmRelease } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import { sortBySemverVersion } from "../../../utils";
|
||||
import { sortBySemverVersion } from "@k8slens/utilities";
|
||||
import type { HelmChartVersion } from "./versions";
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import React from "react";
|
||||
|
||||
import { Link } from "react-router-dom";
|
||||
import { DrawerItem, DrawerTitle } from "../../drawer";
|
||||
import { stopPropagation } from "../../../utils";
|
||||
import { stopPropagation } from "@k8slens/utilities";
|
||||
import { observer } from "mobx-react";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import type { ConfigurationInput, MinimalResourceGroup, OnlyUserSuppliedValuesAreShownToggle, ReleaseDetailsModel } from "./release-details-model/release-details-model.injectable";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import "./release-details.scss";
|
||||
import React from "react";
|
||||
|
||||
import { Drawer } from "../../drawer";
|
||||
import { cssNames } from "../../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { observer } from "mobx-react";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import type { TargetHelmRelease } from "./target-helm-release.injectable";
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ import type { HelmReleaseDto } from "../../../../../common/k8s-api/endpoints/hel
|
||||
import requestHelmReleasesInjectable from "../../../../../common/k8s-api/endpoints/helm-releases.api/request-releases.injectable";
|
||||
import type { HelmReleaseDetails } from "../../../../../common/k8s-api/endpoints/helm-releases.api/request-details.injectable";
|
||||
import requestHelmReleaseDetailsInjectable from "../../../../../common/k8s-api/endpoints/helm-releases.api/request-details.injectable";
|
||||
import type { AsyncResult } from "../../../../../common/utils/async-result";
|
||||
import type { AsyncResult } from "@k8slens/utilities";
|
||||
|
||||
export interface DetailedHelmRelease {
|
||||
release: HelmReleaseDto;
|
||||
@@ -17,7 +17,7 @@ export interface DetailedHelmRelease {
|
||||
export type RequestDetailedHelmRelease = (
|
||||
name: string,
|
||||
namespace: string
|
||||
) => Promise<AsyncResult<DetailedHelmRelease>>;
|
||||
) => AsyncResult<DetailedHelmRelease>;
|
||||
|
||||
const requestDetailedHelmReleaseInjectable = getInjectable({
|
||||
id: "request-detailed-helm-release",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import React from "react";
|
||||
import type { HelmRelease } from "../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { MenuActionsProps } from "../menu/menu-actions";
|
||||
import { MenuActions } from "../menu/menu-actions";
|
||||
import { MenuItem } from "../menu";
|
||||
|
||||
@@ -8,7 +8,7 @@ import { when } from "mobx";
|
||||
import helmChartVersionsInjectable from "../+helm-charts/helm-charts/versions.injectable";
|
||||
import type { HelmRelease, HelmReleaseDto } from "../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import { getMillisecondsFromUnixEpoch } from "../../../common/utils/date/get-current-date-time";
|
||||
import { formatDuration } from "../../utils";
|
||||
import { formatDuration } from "@k8slens/utilities";
|
||||
|
||||
export type ToHelmRelease = (release: HelmReleaseDto) => HelmRelease;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ import namespaceStoreInjectable from "../store.injectable";
|
||||
import addNamespaceDialogStateInjectable
|
||||
from "./state.injectable";
|
||||
import type { NamespaceStore } from "../store";
|
||||
import { autoBind } from "../../../utils";
|
||||
import type { ShowCheckedErrorNotification } from "../../notifications/show-checked-error.injectable";
|
||||
import showCheckedErrorNotificationInjectable from "../../notifications/show-checked-error.injectable";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
export interface AddNamespaceDialogProps extends DialogProps {
|
||||
onSuccess?(ns: Namespace): void;
|
||||
@@ -42,7 +42,7 @@ class NonInjectedAddNamespaceDialog extends React.Component<AddNamespaceDialogPr
|
||||
constructor(props: AddNamespaceDialogProps & Dependencies) {
|
||||
super(props);
|
||||
makeObservable(this);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
@action
|
||||
|
||||
@@ -9,7 +9,7 @@ import React from "react";
|
||||
import { computed, makeObservable } from "mobx";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { DrawerItem } from "../drawer";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { Namespace } from "../../../common/k8s-api/endpoints";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
@@ -13,7 +13,7 @@ import type {
|
||||
} from "./namespace-select-filter-model/filter-by-namespace.injectable";
|
||||
import filterByNamespaceInjectable
|
||||
from "./namespace-select-filter-model/filter-by-namespace.injectable";
|
||||
import { prevDefault, cssNames } from "../../utils";
|
||||
import { prevDefault, cssNames } from "@k8slens/utilities";
|
||||
|
||||
export interface NamespaceSelectBadgeProps extends BadgeProps {
|
||||
namespace: string;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import type { NamespaceStore } from "../store";
|
||||
import type { ActionMeta, MultiValue } from "react-select";
|
||||
import { Icon } from "../../icon";
|
||||
import type { SelectOption } from "../../select";
|
||||
import { observableCrate } from "../../../utils";
|
||||
import { observableCrate } from "@k8slens/utilities";
|
||||
import type { IsMultiSelectionKey } from "./is-selection-key.injectable";
|
||||
import type { ClusterContext } from "../../../cluster-frame-context/cluster-frame-context";
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ import hostedClusterInjectable from "../../cluster-frame-context/hosted-cluster.
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
||||
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
||||
import type { Disposer } from "../../utils";
|
||||
import { disposer } from "../../utils";
|
||||
import type { Disposer } from "@k8slens/utilities";
|
||||
import { disposer } from "@k8slens/utilities";
|
||||
import { renderFor } from "../test-utils/renderFor";
|
||||
import { NamespaceSelectFilter } from "./namespace-select-filter";
|
||||
import type { NamespaceStore } from "./store";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { computed } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import type { SelectProps } from "../select";
|
||||
import { Select } from "../select";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { Icon } from "../icon";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import clusterFrameContextForNamespacedResourcesInjectable from "../../cluster-frame-context/for-namespaced-resources.injectable";
|
||||
|
||||
@@ -16,7 +16,7 @@ import type { GetDetailsUrl } from "../kube-detail-params/get-details-url.inject
|
||||
import getDetailsUrlInjectable from "../kube-detail-params/get-details-url.injectable";
|
||||
import { SubnamespaceBadge } from "./subnamespace-badge";
|
||||
import hierarchicalNamespacesInjectable from "./hierarchical-namespaces.injectable";
|
||||
import { prevDefault } from "../../utils";
|
||||
import { prevDefault } from "@k8slens/utilities";
|
||||
import type { NamespaceTree } from "./store";
|
||||
|
||||
interface NamespaceTreeViewProps {
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
|
||||
import type { IComputedValue, IReactionDisposer } from "mobx";
|
||||
import { action, comparer, computed, makeObservable, reaction } from "mobx";
|
||||
import type { StorageLayer } from "../../utils";
|
||||
import { autoBind, noop, toggle } from "../../utils";
|
||||
import type { StorageLayer } from "../../utils/storage-helper";
|
||||
import { noop, toggle } from "@k8slens/utilities";
|
||||
import type { KubeObjectStoreDependencies, KubeObjectStoreLoadingParams } from "../../../common/k8s-api/kube-object.store";
|
||||
import { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
||||
import type { NamespaceApi } from "../../../common/k8s-api/endpoints/namespace.api";
|
||||
import { Namespace } from "../../../common/k8s-api/endpoints/namespace.api";
|
||||
import autoBind from "auto-bind";
|
||||
|
||||
export interface NamespaceTree {
|
||||
id: string;
|
||||
|
||||
@@ -6,7 +6,7 @@ import styles from "./subnamespace-badge.module.scss";
|
||||
|
||||
import React from "react";
|
||||
import { Tooltip } from "../tooltip";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
|
||||
interface SubnamespaceBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
||||
id: string;
|
||||
|
||||
@@ -11,11 +11,11 @@ import type { EndpointSubset, Endpoints, EndpointAddress } from "../../../common
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import type { ApiManager } from "../../../common/k8s-api/api-manager";
|
||||
import { Link } from "react-router-dom";
|
||||
import { autoBind } from "../../../common/utils";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import type { GetDetailsUrl } from "../kube-detail-params/get-details-url.injectable";
|
||||
import apiManagerInjectable from "../../../common/k8s-api/api-manager/manager.injectable";
|
||||
import getDetailsUrlInjectable from "../kube-detail-params/get-details-url.injectable";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
export interface EndpointSubsetListProps {
|
||||
subset: Required<EndpointSubset>;
|
||||
@@ -31,7 +31,7 @@ interface Dependencies {
|
||||
class NonInjectedEndpointSubsetList extends React.Component<EndpointSubsetListProps & Dependencies> {
|
||||
constructor(props: EndpointSubsetListProps & Dependencies) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
getAddressTableRow(ip: string) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import type { IngressClassStore } from "./ingress-class-store";
|
||||
import ingressClassStoreInjectable from "./ingress-class-store.injectable";
|
||||
import type { IngressClass } from "../../../common/k8s-api/endpoints/ingress-class.api";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { Icon } from "../icon";
|
||||
|
||||
enum columnId {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import { Link } from "react-router-dom";
|
||||
import type { PortForwardItem } from "../../port-forward";
|
||||
import { portForwardAddress } from "../../port-forward";
|
||||
import { Drawer, DrawerItem } from "../drawer";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { PodApi, ServiceApi } from "../../../common/k8s-api/endpoints";
|
||||
import { PortForwardMenu } from "./port-forward-menu";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { autoBind, cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { PortForwardItem, PortForwardStore } from "../../port-forward";
|
||||
import type { MenuActionsProps } from "../menu/menu-actions";
|
||||
import { MenuActions } from "../menu/menu-actions";
|
||||
@@ -17,6 +17,7 @@ import portForwardStoreInjectable from "../../port-forward/port-forward-store/po
|
||||
import type { OpenPortForward } from "../../port-forward/open-port-forward.injectable";
|
||||
import openPortForwardInjectable from "../../port-forward/open-port-forward.injectable";
|
||||
import showErrorNotificationInjectable from "../notifications/show-error-notification.injectable";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
export interface PortForwardMenuProps extends MenuActionsProps {
|
||||
portForward: PortForwardItem;
|
||||
@@ -33,7 +34,7 @@ interface Dependencies {
|
||||
class NonInjectedPortForwardMenu<Props extends PortForwardMenuProps & Dependencies> extends React.Component<Props> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
remove() {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
import { observer } from "mobx-react";
|
||||
import React from "react";
|
||||
import { Table, TableHead, TableCell, TableRow } from "../table";
|
||||
import { prevDefault } from "../../utils";
|
||||
import { prevDefault } from "@k8slens/utilities";
|
||||
import type { Logger } from "../../../common/logger";
|
||||
import { Endpoints } from "../../../common/k8s-api/endpoints";
|
||||
import type { ShowDetails } from "../kube-detail-params/show-details.injectable";
|
||||
|
||||
@@ -9,7 +9,7 @@ import React from "react";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import type { Service, ServicePort } from "../../../common/k8s-api/endpoints";
|
||||
import { action, makeObservable, observable, reaction } from "mobx";
|
||||
import { cssNames } from "../../utils";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import type { ShowNotification } from "../notifications";
|
||||
import { Button } from "../button";
|
||||
import type { ForwardedPort, PortForwardStore } from "../../port-forward";
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
import "./nodes.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { cssNames, interval } from "../../utils";
|
||||
import { bytesToUnits, cssNames, interval } from "@k8slens/utilities";
|
||||
import { TabLayout } from "../layout/tab-layout-2";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import type { Node } from "../../../common/k8s-api/endpoints/node.api";
|
||||
import { formatNodeTaint } from "../../../common/k8s-api/endpoints/node.api";
|
||||
import { LineProgress } from "../line-progress";
|
||||
import { bytesToUnits } from "../../../common/utils/convertMemory";
|
||||
import { Tooltip, TooltipPosition } from "../tooltip";
|
||||
import kebabCase from "lodash/kebabCase";
|
||||
import upperFirst from "lodash/upperFirst";
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import autoBind from "auto-bind";
|
||||
import { sum } from "lodash";
|
||||
import { computed, makeObservable } from "mobx";
|
||||
|
||||
import type { Node, NodeApi } from "../../../common/k8s-api/endpoints";
|
||||
import type { KubeObjectStoreDependencies, KubeObjectStoreOptions } from "../../../common/k8s-api/kube-object.store";
|
||||
import { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
||||
import { autoBind } from "../../utils";
|
||||
|
||||
export class NodeStore extends KubeObjectStore<Node, NodeApi> {
|
||||
constructor(dependencies: KubeObjectStoreDependencies, api: NodeApi, opts?: KubeObjectStoreOptions) {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import type { GetDetailsUrl } from "../kube-detail-params/get-details-url.inject
|
||||
import type { PodStore } from "../+workloads-pods/store";
|
||||
import getDetailsUrlInjectable from "../kube-detail-params/get-details-url.injectable";
|
||||
import podStoreInjectable from "../+workloads-pods/store.injectable";
|
||||
import { stopPropagation } from "../../../renderer/utils";
|
||||
import { stopPropagation } from "@k8slens/utilities";
|
||||
import storageClassApiInjectable from "../../../common/k8s-api/endpoints/storage-class.api.injectable";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import { unitsToBytes } from "../../../common/utils/convertMemory";
|
||||
import { stopPropagation } from "../../utils";
|
||||
import { unitsToBytes, stopPropagation } from "@k8slens/utilities";
|
||||
import type { StorageClassApi } from "../../../common/k8s-api/endpoints";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
import { SiblingsInTabLayout } from "../layout/siblings-in-tab-layout";
|
||||
|
||||
@@ -9,7 +9,7 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import type { PersistentVolume } from "../../../common/k8s-api/endpoints/persistent-volume.api";
|
||||
import { TableRow } from "../table/table-row";
|
||||
import { cssNames, prevDefault } from "../../utils";
|
||||
import { cssNames, prevDefault } from "@k8slens/utilities";
|
||||
import { TableCell } from "../table/table-cell";
|
||||
import { Spinner } from "../spinner/spinner";
|
||||
import { DrawerTitle } from "../drawer/drawer-title";
|
||||
|
||||
@@ -15,7 +15,7 @@ import type { PersistentVolumeClaimApi, StorageClassApi } from "../../../common/
|
||||
import { PersistentVolume } from "../../../common/k8s-api/endpoints";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import type { Logger } from "../../../common/logger";
|
||||
import { stopPropagation } from "../../../renderer/utils";
|
||||
import { stopPropagation } from "@k8slens/utilities";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
import type { GetDetailsUrl } from "../kube-detail-params/get-details-url.injectable";
|
||||
|
||||
@@ -9,7 +9,7 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { KubeObjectListLayout } from "../kube-object-list-layout";
|
||||
import { stopPropagation } from "../../utils";
|
||||
import { stopPropagation } from "@k8slens/utilities";
|
||||
import type { PersistentVolumeClaimApi, StorageClassApi } from "../../../common/k8s-api/endpoints";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
import { SiblingsInTabLayout } from "../layout/siblings-in-tab-layout";
|
||||
|
||||
+3
-2
@@ -10,7 +10,7 @@ import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import React from "react";
|
||||
|
||||
import type { ClusterRoleBinding } from "../../../../common/k8s-api/endpoints";
|
||||
import { autoBind, ObservableHashSet, prevDefault } from "../../../utils";
|
||||
import { ObservableHashSet, prevDefault } from "@k8slens/utilities";
|
||||
import { AddRemoveButtons } from "../../add-remove-buttons";
|
||||
import { DrawerTitle } from "../../drawer";
|
||||
import type { KubeObjectDetailsProps } from "../../kube-object-details";
|
||||
@@ -23,6 +23,7 @@ import type { ClusterRoleBindingStore } from "./store";
|
||||
import type { OpenClusterRoleBindingDialog } from "./dialog/open.injectable";
|
||||
import openClusterRoleBindingDialogInjectable from "./dialog/open.injectable";
|
||||
import clusterRoleBindingStoreInjectable from "./store.injectable";
|
||||
import autoBindReact from "auto-bind/react";
|
||||
|
||||
export interface ClusterRoleBindingDetailsProps extends KubeObjectDetailsProps<ClusterRoleBinding> {
|
||||
}
|
||||
@@ -39,7 +40,7 @@ class NonInjectedClusterRoleBindingDetails extends React.Component<ClusterRoleBi
|
||||
|
||||
constructor(props: ClusterRoleBindingDetailsProps & Dependencies) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
autoBindReact(this);
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import { Icon } from "../../../icon";
|
||||
import { SubTitle } from "../../../layout/sub-title";
|
||||
import { onMultiSelectFor, Select } from "../../../select";
|
||||
import { Wizard, WizardStep } from "../../../wizard";
|
||||
import { ObservableHashSet, nFircate } from "../../../../utils";
|
||||
import { ObservableHashSet, iter } from "@k8slens/utilities";
|
||||
import { Input } from "../../../input";
|
||||
import { TooltipPosition } from "../../../tooltip";
|
||||
import type { Subject } from "../../../../../common/k8s-api/endpoints/types/subject";
|
||||
@@ -124,7 +124,7 @@ class NonInjectedClusterRoleBindingDialog extends React.Component<ClusterRoleBin
|
||||
.items
|
||||
.find(item => item.getName() === binding.roleRef.name);
|
||||
|
||||
const [saSubjects, uSubjects, gSubjects] = nFircate(binding.getSubjects(), "kind", ["ServiceAccount", "User", "Group"]);
|
||||
const [saSubjects, uSubjects, gSubjects] = iter.nFircate(binding.getSubjects(), "kind", ["ServiceAccount", "User", "Group"]);
|
||||
const accountNames = new Set(saSubjects.map(acc => acc.name));
|
||||
|
||||
this.selectedAccounts.replace(
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
import type { ClusterRoleBinding, ClusterRoleBindingApi, ClusterRoleBindingData } from "../../../../common/k8s-api/endpoints";
|
||||
import type { Subject } from "../../../../common/k8s-api/endpoints/types/subject";
|
||||
import { KubeObjectStore } from "../../../../common/k8s-api/kube-object.store";
|
||||
import { HashSet } from "../../../utils";
|
||||
import { HashSet } from "@k8slens/utilities";
|
||||
import { hashSubject } from "../hashers";
|
||||
|
||||
export class ClusterRoleBindingStore extends KubeObjectStore<ClusterRoleBinding, ClusterRoleBindingApi, ClusterRoleBindingData> {
|
||||
|
||||
@@ -9,12 +9,11 @@ import { reaction } from "mobx";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import React from "react";
|
||||
import type { RoleBinding } from "../../../../common/k8s-api/endpoints";
|
||||
import { prevDefault } from "../../../utils";
|
||||
import { prevDefault, ObservableHashSet } from "@k8slens/utilities";
|
||||
import { AddRemoveButtons } from "../../add-remove-buttons";
|
||||
import { DrawerTitle } from "../../drawer";
|
||||
import type { KubeObjectDetailsProps } from "../../kube-object-details";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../../table";
|
||||
import { ObservableHashSet } from "../../../../common/utils/hash-set";
|
||||
import { hashSubject } from "../hashers";
|
||||
import type { OpenConfirmDialog } from "../../confirm-dialog/open.injectable";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ import type { SelectOption } from "../../../select";
|
||||
import { onMultiSelectFor, Select } from "../../../select";
|
||||
import { Wizard, WizardStep } from "../../../wizard";
|
||||
import { Input } from "../../../input";
|
||||
import { ObservableHashSet, nFircate } from "../../../../utils";
|
||||
import { ObservableHashSet, iter } from "@k8slens/utilities";
|
||||
import type { Subject } from "../../../../../common/k8s-api/endpoints/types/subject";
|
||||
import type { RoleBindingDialogState } from "./state.injectable";
|
||||
import type { RoleBindingStore } from "../store";
|
||||
@@ -147,7 +147,7 @@ class NonInjectedRoleBindingDialog extends React.Component<RoleBindingDialogProp
|
||||
this.bindingName = binding.getName();
|
||||
this.bindingNamespace = binding.getNs();
|
||||
|
||||
const [saSubjects, uSubjects, gSubjects] = nFircate(binding.getSubjects(), "kind", ["ServiceAccount", "User", "Group"]);
|
||||
const [saSubjects, uSubjects, gSubjects] = iter.nFircate(binding.getSubjects(), "kind", ["ServiceAccount", "User", "Group"]);
|
||||
const accountNames = new Set(saSubjects.map(acc => acc.name));
|
||||
|
||||
this.selectedAccounts.replace(
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import type { RoleBinding, RoleBindingApi, RoleBindingData } from "../../../../common/k8s-api/endpoints";
|
||||
import type { Subject } from "../../../../common/k8s-api/endpoints/types/subject";
|
||||
import { KubeObjectStore } from "../../../../common/k8s-api/kube-object.store";
|
||||
import { HashSet } from "../../../utils";
|
||||
import { HashSet } from "@k8slens/utilities";
|
||||
import { hashSubject } from "../hashers";
|
||||
|
||||
export class RoleBindingStore extends KubeObjectStore<RoleBinding, RoleBindingApi, RoleBindingData> {
|
||||
|
||||
@@ -9,7 +9,7 @@ import moment from "moment";
|
||||
import React from "react";
|
||||
|
||||
import type { Secret } from "../../../../common/k8s-api/endpoints/secret.api";
|
||||
import { prevDefault } from "../../../utils";
|
||||
import { prevDefault } from "@k8slens/utilities";
|
||||
import { Icon } from "../../icon";
|
||||
|
||||
export interface ServiceAccountsSecretProps {
|
||||
|
||||
Loaded 100 of 754 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user