Skip to content

Commit f79a5bc

Browse files
Merge pull request #915 from devtron-labs/fix/cluster-form-field-errors
fix: cluster form field errors
2 parents 36ac807 + c208828 commit f79a5bc

6 files changed

Lines changed: 14 additions & 17 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.20.5-pre-6",
3+
"version": "1.20.5-pre-7",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Common.service.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -651,17 +651,6 @@ export const getDetailedClusterList = async (
651651
...res
652652
}) => {
653653
const costModuleInstallationStatus = costModuleConfig?.installationStatus || 'NotInstalled'
654-
// Need to remove following keys from config if present: openCostServiceName, openCostServicePort, releaseName, namespace
655-
const sanitizedCostConfig = costModuleConfig?.config
656-
? Object.fromEntries(
657-
Object.entries(costModuleConfig.config).filter(
658-
([key]) =>
659-
!['openCostServiceName', 'openCostServicePort', 'releaseName', 'namespace'].includes(
660-
key,
661-
),
662-
),
663-
)
664-
: undefined
665654

666655
return {
667656
...res,
@@ -678,7 +667,10 @@ export const getDetailedClusterList = async (
678667
status: clusterStatus,
679668
costModuleConfig: {
680669
enabled: costModuleConfig?.enabled || false,
681-
config: sanitizedCostConfig,
670+
config: {
671+
...(costModuleConfig?.config || {}),
672+
detectedProvider: costModuleConfig?.config?.detectedProvider,
673+
},
682674
installationStatus: costModuleInstallationStatus,
683675
...(costModuleInstallationStatus === 'Failed'
684676
? {

src/Common/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export const URLS = {
138138
// AI RECOMMENDATIONS
139139
AI_RECOMMENDATIONS: AI_RECOMMENDATIONS_ROOT,
140140
AI_RECOMMENDATIONS_OVERVIEW: `${AI_RECOMMENDATIONS_ROOT}/overview`,
141+
EXTERNAL_APPS: 'ea',
141142
} as const
142143

143144
export const ROUTES = {

src/Common/Types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
} from '.'
4343
import { IllustrationName, SelectPickerOptionType } from '@Shared/Components'
4444
import { ClusterStatusType } from '@Pages/ResourceBrowser'
45+
import { ClusterProviderType } from '@PagesDevtron2.0/CostVisibility'
4546

4647
/**
4748
* Generic response type object with support for overriding the result type
@@ -1126,7 +1127,9 @@ export type EnvironmentsGroupedByClustersType = {
11261127
export type ClusterCostModuleConfigPayload =
11271128
| {
11281129
enabled: true
1129-
config?: Record<string, any>
1130+
config?: Record<string, any> & {
1131+
detectedProvider: ClusterProviderType
1132+
}
11301133
}
11311134
| {
11321135
enabled: false

src/Shared/Components/PrometheusConfigurations/PrometheusConfigCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const PromoetheusConfigCard = ({
1313
onPrometheusAuthTypeChange,
1414
}: PromoetheusConfigProps) => {
1515
const { endpoint, authType, userName, password, prometheusTlsClientCert, prometheusTlsClientKey } = prometheusConfig
16+
const isBasicAuthError = authType.value === AuthenticationType.BASIC && (userName.error || password.error)
1617

1718
return (
1819
<div className="bg__primary p-20 br-8 flexbox-col dc__gap-16 border__secondary">
@@ -22,7 +23,7 @@ const PromoetheusConfigCard = ({
2223
Devtron uses prometheus to store and track cluster metrics
2324
</span>
2425
</div>
25-
{(userName.error || password.error || endpoint.error) && (
26+
{(isBasicAuthError || endpoint.error) && (
2627
<InfoBlock
2728
variant="error"
2829
description="Fill all the required fields OR turn off the above switch to skip configuring prometheus."

0 commit comments

Comments
 (0)