mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Adding package exporting injection tokens for cluster settings (#7395)
* 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>
This commit is contained in:
1 parent
4a3f08d798
commit
a0d13e8003
12 files changed
+237
-23
No files matched your search
@@ -0,0 +1,30 @@
|
||||
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",
|
||||
});
|
||||
Reference in new issue
Block a user