@@ -410,20 +410,33 @@ export const NonEditableConfig: React.FC<{ details: any }> = ({ details }) => {
410410 }
411411 // const values = [...flavor?.config_schema?.properties];
412412
413- // let result = Object.keys(flavor?.config_schema?.properties).reduce(function (
414- // r: any,
415- // name: any,
416- // ) {
417- // return (
418- // (r[name] =
419- // flavor?.config_schema?.properties[name].type === 'string' &&
420- // flavor?.config_schema?.properties[name].default === undefined
421- // ? ''
422- // : flavor?.config_schema?.properties[name].default),
423- // r
424- // );
425- // },
426- // {});
413+ let result = Object . keys ( flavor ?. config_schema ?. properties ) . reduce ( function (
414+ r : any ,
415+ name : any ,
416+ ) {
417+ return (
418+ ( r [ name ] =
419+ flavor ?. config_schema ?. properties [ name ] . type === 'string' &&
420+ flavor ?. config_schema ?. properties [ name ] . default === undefined
421+ ? ''
422+ : flavor ?. config_schema ?. properties [ name ] . default ) ,
423+ r
424+ ) ;
425+ } ,
426+ { } ) ;
427+
428+ function replaceNullWithEmptyString ( obj : any ) {
429+ for ( let prop in obj ) {
430+ if ( obj [ prop ] === null ) {
431+ obj [ prop ] = '' ;
432+ } else if ( typeof obj [ prop ] === 'object' ) {
433+ replaceNullWithEmptyString ( obj [ prop ] ) ;
434+ }
435+ }
436+ return obj ;
437+ }
438+
439+ replaceNullWithEmptyString ( details ?. configuration ) ;
427440 // let normalizeConfiguration = Object.keys(details?.configuration).reduce(
428441 // function (r: any, name: any) {
429442 // if (details?.configuration[name] === null) {
@@ -469,7 +482,7 @@ export const NonEditableConfig: React.FC<{ details: any }> = ({ details }) => {
469482 // {});
470483
471484 const mappedObject = {
472- // ...result,
485+ ...result ,
473486 ...details ?. configuration ,
474487 } ;
475488 console . log (
0 commit comments