Add implementation for injection token

This commit is contained in:
Juho Heikka committed 2023-03-16 10:13:56 +02:00
1 parent 4b2b4ad399
commit eae90f64f5
11 files changed
+82 -100

No files matched your search

+1 -1
View File
@@ -329,9 +329,9 @@
"xterm-addon-fit": "^0.5.0"
},
"peerDependencies": {
"@k8slens/metrics": "^6.5.0-alpha.1",
"@k8slens/application": "^6.5.0-alpha.0",
"@k8slens/application-for-electron-main": "^6.5.0-alpha.0",
"@k8slens/metrics": "^6.5.0-alpha.0",
"@k8slens/run-many": "^1.0.0-alpha.1",
"@k8slens/test-utils": "^1.0.0-alpha.1",
"@k8slens/utilities": "^1.0.0-alpha.1",
@@ -81,7 +81,7 @@ class NonInjectedClusterOverview extends React.Component<Dependencies> {
<>
<ClusterMetrics/>
{this.props.uiBlocks.map((block) => (
<block.component key={block.id} />
<div key={block.id}>{block.text}</div>
))}
lol
<ClusterPieCharts/>
@@ -0,0 +1,19 @@
/**
* 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 { clusterOverviewUIBlockInjectionToken } from "@k8slens/metrics";
const uiBlock = getInjectable({
id: "lol",
instantiate: () => {
return {
id: "lol-id",
text: "lol",
};
},
injectionToken: clusterOverviewUIBlockInjectionToken,
});
export default uiBlock;