Skip to content

Commit a55a3e5

Browse files
committed
removed unused function
1 parent 144b88b commit a55a3e5

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/Pages/ResourceBrowser/Helper.tsx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,6 @@ import { AggregationKeys, NodeType, Nodes } from '../../Shared'
22
import { SIDEBAR_KEYS } from './Constants'
33
import { ApiResourceGroupType, K8SObjectType } from './ResourceBrowser.Types'
44

5-
export function createClusterEnvGroup<T extends Record<string, string>>(
6-
list: T[],
7-
propKey: string,
8-
optionLabel?: string,
9-
optionValue?: string,
10-
): { label: string; options: T[]; isVirtualEnvironment?: boolean }[] {
11-
const objList: Record<string, T[]> = list.reduce((acc, obj) => {
12-
const key = obj[propKey]
13-
if (!acc[key]) {
14-
acc[key] = []
15-
}
16-
acc[key].push(
17-
optionLabel
18-
? {
19-
label: obj[optionLabel],
20-
value: obj[optionValue || optionLabel],
21-
description: obj.description,
22-
isVirtualEnvironment: obj.isVirtualEnvironment,
23-
isClusterCdActive: obj.isClusterCdActive,
24-
}
25-
: obj,
26-
)
27-
return acc
28-
}, {})
29-
30-
return Object.entries(objList)
31-
.sort((a, b) => a[0].localeCompare(b[0]))
32-
.map(([key, value]) => ({
33-
label: key,
34-
options: value,
35-
isVirtualEnvironment: !!value[0].isVirtualEnvironment, // All the values will be having similar isVirtualEnvironment
36-
}))
37-
}
38-
395
export function getAggregator(nodeType: NodeType, defaultAsOtherResources?: boolean): AggregationKeys {
406
switch (nodeType) {
417
case Nodes.DaemonSet:

0 commit comments

Comments
 (0)