diff --git a/src/Pages/GlobalConfigurations/BuildInfra/services.tsx b/src/Pages/GlobalConfigurations/BuildInfra/services.tsx index ab6d398e3..63ba497c0 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/services.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/services.tsx @@ -14,6 +14,7 @@ import { CreateBuildInfraServiceConfigurationType, GetBuildInfraProfileType, UpdateBuildInfraProfileType, + BuildInfraConfigurationMapWithoutDefaultType, } from './types' const getBaseProfileObject = ( @@ -45,13 +46,13 @@ export const getTransformedBuildInfraProfileResponse = ({ defaultConfigurations?.reduce((acc, configuration) => { acc[configuration.key] = configuration return acc - }, {}) ?? {} + }, {} as BuildInfraConfigurationMapWithoutDefaultType) ?? ({} as BuildInfraConfigurationMapWithoutDefaultType) const profileConfigurations = profile?.configurations?.reduce((acc, configuration) => { acc[configuration.key] = configuration return acc - }, {}) ?? {} + }, {} as BuildInfraConfigurationMapWithoutDefaultType) ?? ({} as BuildInfraConfigurationMapWithoutDefaultType) const configurations = Object.keys(defaultConfigurationsMap).reduce((acc, key) => { const defaultConfiguration: BuildInfraConfigurationType = defaultConfigurationsMap[key] diff --git a/src/Pages/GlobalConfigurations/BuildInfra/types.tsx b/src/Pages/GlobalConfigurations/BuildInfra/types.tsx index c81fa655b..cb657d2d7 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/types.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/types.tsx @@ -145,6 +145,10 @@ export interface BuildInfraConfigurationType extends BuildInfraConfigValuesType, defaultValue: BuildInfraConfigValuesType } +export type BuildInfraConfigurationMapWithoutDefaultType = { + [key in BuildInfraConfigTypes]: BuildInfraConfigValuesType & BuildInfraProfileConfigBase +} + export type BuildInfraConfigurationMapType = { [key in BuildInfraConfigTypes]: BuildInfraConfigurationType } diff --git a/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx b/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx index 9709b409d..45804a891 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx @@ -210,6 +210,7 @@ export const useBuildInfraForm = ({ currentInputErrors[BuildInfraConfigTypes.CPU_REQUEST] = request.message break } + case BuildInfraConfigTypes.CPU_REQUEST: { currentConfiguration[BuildInfraConfigTypes.CPU_REQUEST] = { ...currentConfiguration[BuildInfraConfigTypes.CPU_REQUEST],