Skip to content

Commit 8cc9277

Browse files
committed
fix: review comments
1 parent 56d6b3a commit 8cc9277

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/Common/CodeEditor/CodeEditor.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
172172
})
173173
}
174174

175-
if (mode === MODES.JSON) {
176-
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
177-
validate: true,
178-
})
179-
}
180-
181175
editorRef.current = editor
182176
monacoRef.current = monaco
183177
}

src/Pages/GlobalConfigurations/DeploymentCharts/types.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ export type DeploymentChartListDTO = Array<{
66
version: string
77
}>
88

9+
interface DeploymentChartVersionsType {
10+
id: number
11+
version: string
12+
description: string
13+
}
14+
915
export interface DeploymentChartType {
1016
name: string
1117
isUserUploaded: boolean
12-
versions: {
13-
id: number
14-
version: string
15-
description: string
16-
}[]
18+
versions: DeploymentChartVersionsType[]
1719
}
1820

1921
export enum DEVTRON_DEPLOYMENT_CHART_NAMES {

src/Pages/GlobalConfigurations/DeploymentCharts/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ export const convertDeploymentChartListToChartType = (data: DeploymentChartListD
88
if (!data) {
99
return []
1010
}
11-
const chartMap: Record<string, DeploymentChartType> = data.reduce(
11+
const chartMap = data.reduce(
1212
(acc, { id, version, chartDescription: description = '', name, isUserUploaded = true }) => {
13+
if (!name || !id || !version) {
14+
return acc
15+
}
1316
const detail = acc[name]
1417
if (detail) {
1518
detail.versions.push({
@@ -26,7 +29,7 @@ export const convertDeploymentChartListToChartType = (data: DeploymentChartListD
2629
}
2730
return acc
2831
},
29-
{},
32+
{} as Record<string, DeploymentChartType>,
3033
)
3134
const result = Object.values(chartMap).map((element) => {
3235
element.versions?.sort((a, b) => versionComparatorBySortOrder(a, b, 'version', SortingOrder.DESC))

0 commit comments

Comments
 (0)