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

Linter fixes

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2023-03-22 11:28:59 +03:00
parent 66c4930ac5
commit 62abe4f4ef
3 changed files with 12 additions and 8 deletions

View File

@ -12,10 +12,6 @@ export interface ClusterIconMenuItem {
onClick: (preferences: ClusterPreferences) => void; onClick: (preferences: ClusterPreferences) => void;
} }
export const clusterIconSettingsMenuInjectionToken = getInjectionToken<ClusterIconMenuItem>({
id: "cluster-icon-settings-menu-injection-token",
});
export interface ClusterIconSettingComponentProps { export interface ClusterIconSettingComponentProps {
preferences: ClusterPreferences; preferences: ClusterPreferences;
} }
@ -25,6 +21,10 @@ export interface ClusterIconSettingsComponent {
Component: React.ComponentType<ClusterIconSettingComponentProps>; Component: React.ComponentType<ClusterIconSettingComponentProps>;
} }
export const clusterIconSettingsMenuInjectionToken = getInjectionToken<ClusterIconMenuItem>({
id: "cluster-icon-settings-menu-injection-token",
});
export const clusterIconSettingsComponentInjectionToken = getInjectionToken<ClusterIconSettingsComponent>({ export const clusterIconSettingsComponentInjectionToken = getInjectionToken<ClusterIconSettingsComponent>({
id: "cluster-icon-settings-component-injection-token", id: "cluster-icon-settings-component-injection-token",
}); });

View File

@ -12,7 +12,8 @@ import { renderFor } from "../../test-utils/renderFor";
import { ClusterIconSetting } from "../icon-settings"; import { ClusterIconSetting } from "../icon-settings";
import { screen } from "@testing-library/react"; import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event"; import userEvent from "@testing-library/user-event";
import { ClusterIconSettingComponentProps, clusterIconSettingsComponentInjectionToken, clusterIconSettingsMenuInjectionToken } from "@k8slens/cluster-settings"; import type { ClusterIconSettingComponentProps } from "@k8slens/cluster-settings";
import { clusterIconSettingsComponentInjectionToken, clusterIconSettingsMenuInjectionToken } from "@k8slens/cluster-settings";
import { runInAction } from "mobx"; import { runInAction } from "mobx";
import { getInjectable, type DiContainer } from "@ogre-tools/injectable"; import { getInjectable, type DiContainer } from "@ogre-tools/injectable";
@ -59,7 +60,10 @@ function customSettingsComponent(props: ClusterIconSettingComponentProps) {
return ( return (
<div data-testid="my-react-component"> <div data-testid="my-react-component">
<span>Test React Component</span> <span>Test React Component</span>
<span>Cluster {props.preferences.clusterName}</span> <span>
Cluster
{props.preferences.clusterName}
</span>
</div> </div>
); );
} }

View File

@ -15,8 +15,8 @@ import { FilePicker, OverSizeLimitStyle } from "../file-picker";
import { MenuActions, MenuItem } from "../menu"; import { MenuActions, MenuItem } from "../menu";
import type { ShowNotification } from "../notifications"; import type { ShowNotification } from "../notifications";
import showErrorNotificationInjectable from "../notifications/show-error-notification.injectable"; import showErrorNotificationInjectable from "../notifications/show-error-notification.injectable";
import { ClusterIconSettingsComponent, clusterIconSettingsComponentInjectionToken, clusterIconSettingsMenuInjectionToken } from "@k8slens/cluster-settings"; import { clusterIconSettingsComponentInjectionToken, clusterIconSettingsMenuInjectionToken } from "@k8slens/cluster-settings";
import type { ClusterIconMenuItem } from "@k8slens/cluster-settings"; import type { ClusterIconMenuItem, ClusterIconSettingsComponent } from "@k8slens/cluster-settings";
export interface ClusterIconSettingProps { export interface ClusterIconSettingProps {
cluster: Cluster; cluster: Cluster;