@@ -196,10 +196,10 @@ const parsePlatformServerConfigIntoUIConfig = (
196
196
} )
197
197
198
198
return {
199
- useFormProps : cmSecretFormProps ,
200
- defaultValue : cmSecretFormProps ,
201
- initialResponse : configMapSecretData ,
202
- defaultValueInitialResponse : configMapSecretData ,
199
+ useFormProps : structuredClone ( cmSecretFormProps ) ,
200
+ defaultValue : structuredClone ( cmSecretFormProps ) ,
201
+ initialResponse : structuredClone ( configMapSecretData ) ,
202
+ defaultValueInitialResponse : structuredClone ( configMapSecretData ) ,
203
203
id : getUniqueId ( ) ,
204
204
isOverridden : true ,
205
205
canOverride : ! isDefaultProfile ,
@@ -265,18 +265,21 @@ const getConfigurationMapWithoutDefaultFallback = (
265
265
{ } as BuildInfraConfigurationMapTypeWithoutDefaultFallback ,
266
266
) ?? ( { } as BuildInfraConfigurationMapTypeWithoutDefaultFallback )
267
267
268
- acc [ platformName ] = platformConfigValuesMap
268
+ acc [ platformName ] = structuredClone ( platformConfigValuesMap )
269
269
270
270
return acc
271
271
} , { } )
272
272
273
273
const getPlatformConfigurationsWithDefaultValues = ( {
274
- profileConfigurationsMap,
275
- defaultConfigurationsMap,
274
+ profileConfigurationsMap : profileConfigurationsMapProp ,
275
+ defaultConfigurationsMap : defaultConfigurationsMapProp ,
276
276
platformName,
277
277
isDefaultProfile = false ,
278
- } : GetPlatformConfigurationsWithDefaultValuesParamsType ) : BuildInfraConfigurationMapType =>
279
- Object . values ( BuildInfraConfigTypes ) . reduce < BuildInfraConfigurationMapType > ( ( acc , configType ) => {
278
+ } : GetPlatformConfigurationsWithDefaultValuesParamsType ) : BuildInfraConfigurationMapType => {
279
+ const profileConfigurationsMap = structuredClone ( profileConfigurationsMapProp )
280
+ const defaultConfigurationsMap = structuredClone ( defaultConfigurationsMapProp )
281
+
282
+ return Object . values ( BuildInfraConfigTypes ) . reduce < BuildInfraConfigurationMapType > ( ( acc , configType ) => {
280
283
const defaultConfiguration = defaultConfigurationsMap [ configType ]
281
284
const profileConfiguration = profileConfigurationsMap [ configType ] ?. active
282
285
? profileConfigurationsMap [ configType ]
@@ -313,7 +316,9 @@ const getPlatformConfigurationsWithDefaultValues = ({
313
316
314
317
const finalValues : BuildInfraCMCSValueType [ ] =
315
318
( profileConfiguration ?. value as BuildInfraCMCSValueType [ ] ) ?. map ( ( configMapSecretData ) => {
316
- const defaultConfigInfo = defaultConfigurationValueMap [ configMapSecretData . useFormProps . name ]
319
+ const defaultConfigInfo = structuredClone (
320
+ defaultConfigurationValueMap [ configMapSecretData . useFormProps . name ] ,
321
+ )
317
322
318
323
return {
319
324
...configMapSecretData ,
@@ -365,6 +370,7 @@ const getPlatformConfigurationsWithDefaultValues = ({
365
370
366
371
return acc
367
372
} , { } as BuildInfraConfigurationMapType )
373
+ }
368
374
369
375
// Would receive a single profile and return transformed response
370
376
export const getTransformedBuildInfraProfileResponse = ( {
0 commit comments