mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Add clusterIconSettingsComponentInjectionToken Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding tests for new token Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Create cluster-settings package Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fix cluster-settings package build process Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Use tolens from @k8slens/cluster-settings Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Linter fixes Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Remove typescript 5.x.x from cluster-settings package Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding prepare:test command to package.json Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Test small cleanup Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fix getByText check Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Clean up Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Linter fix Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> --------- Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
30 lines
868 B
TypeScript
30 lines
868 B
TypeScript
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
|
|
type ClusterPreferences = {
|
|
clusterName?: string;
|
|
icon?: string | null;
|
|
}
|
|
|
|
export interface ClusterIconMenuItem {
|
|
id: string;
|
|
title: string;
|
|
disabled?: (preferences: ClusterPreferences) => boolean;
|
|
onClick: (preferences: ClusterPreferences) => void;
|
|
}
|
|
|
|
export interface ClusterIconSettingComponentProps {
|
|
preferences: ClusterPreferences;
|
|
}
|
|
|
|
export interface ClusterIconSettingsComponent {
|
|
id: string;
|
|
Component: React.ComponentType<ClusterIconSettingComponentProps>;
|
|
}
|
|
|
|
export const clusterIconSettingsMenuInjectionToken = getInjectionToken<ClusterIconMenuItem>({
|
|
id: "cluster-icon-settings-menu-injection-token",
|
|
});
|
|
|
|
export const clusterIconSettingsComponentInjectionToken = getInjectionToken<ClusterIconSettingsComponent>({
|
|
id: "cluster-icon-settings-component-injection-token",
|
|
}); |