66 Paragraph ,
77 Container ,
88 FullWidthSpinner ,
9- icons ,
9+ // icons,
1010} from '../../../../components' ;
1111import styles from './index.module.scss' ;
1212import { useService } from './useService' ;
@@ -21,7 +21,7 @@ import {
2121 showToasterAction ,
2222 stackComponentsActions ,
2323} from '../../../../../redux/actions' ;
24- import { iconColors , toasterTypes } from '../../../../../constants' ;
24+ import { toasterTypes } from '../../../../../constants' ;
2525
2626export const Configuration : React . FC < { stackId : TId } > = ( { stackId } ) => {
2727 const { stackComponent, flavor } = useService ( {
@@ -208,11 +208,11 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
208208 onCallApi ( updateConfig ) ;
209209 } ;
210210
211- const handleAddFields = ( ) => {
212- const values = [ ...inputFields ] ;
213- values . push ( { key : '' , value : '' } ) ;
214- setInputFields ( values ) ;
215- } ;
211+ // const handleAddFields = () => {
212+ // const values = [...inputFields];
213+ // values.push({ key: '', value: '' });
214+ // setInputFields(values);
215+ // };
216216 const handleInputChange = ( index : any , event : any , label : any , type : any ) => {
217217 const values = [ ...inputFields ] ;
218218 if ( type === 'key' ) {
@@ -222,17 +222,18 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
222222 }
223223 setInputFields ( values ) ;
224224 } ;
225- const handleRemoveFields = ( index : any ) => {
226- const values = [ ...inputFields ] ;
227- values . splice ( index , 1 ) ;
228- setInputFields ( values ) ;
229- } ;
225+ // const handleRemoveFields = (index: any) => {
226+ // const values = [...inputFields];
227+ // values.splice(index, 1);
228+ // setInputFields(values);
229+ // };
230230
231231 const getFormElement : any = ( elementName : any , elementSchema : any ) => {
232232 if ( typeof elementSchema === 'string' ) {
233233 return (
234234 < Box marginVertical = { 'md' } style = { { width : '100%' } } >
235235 < EditField
236+ disabled
236237 onKeyDown = { ( e : any ) => onPressEnter ( e , 'string' , elementName ) }
237238 onChangeText = { ( e : any ) => onPressEnter ( e , 'string' , elementName ) }
238239 label = { titleCase ( elementName ) }
@@ -254,7 +255,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
254255 { Object . keys ( elementSchema ) . length < 1 && (
255256 < FlexBox . Row >
256257 < EditField
257- // disabled
258+ disabled
258259 onKeyDown = { ( e : any ) =>
259260 onPressEnterForEmpty (
260261 e ,
@@ -277,28 +278,19 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
277278
278279 < div style = { { width : '10%' } } > </ div >
279280 < EditField
280- // disabled
281- // marginRight={'md'}
281+ disabled
282282 onKeyDown = { ( e : any ) =>
283- onPressEnterForEmpty (
284- e ,
285- 'value' ,
286- elementName ,
287- // index,
288- )
289- }
290- onChangeText = {
291- ( event : any ) => { }
292- // handleInputChange(0, event, elementName, 'value')
283+ onPressEnterForEmpty ( e , 'value' , elementName )
293284 }
285+ onChangeText = { ( event : any ) => { } }
294286 label = "Value"
295287 // optional={true}
296288 // value={''}
297289 placeholder = ""
298290 hasError = { false }
299291 className = { styles . field }
300292 />
301- < div
293+ { /* <div
302294 className="col-sx-2 "
303295 style={{
304296 justifyContent: 'space-between',
@@ -307,21 +299,18 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
307299 marginLeft: '5px',
308300 }}
309301 >
310- { /* <button className={styles.fieldButton} type="button"> */ }
311302 <icons.plusCircle
312303 onClick={() => handleAddFields()}
313- // className={styles.fieldButton}
314304 color={iconColors.primary}
315305 />
316- { /* </button> */ }
317- </ div >
306+ </div> */ }
318307 </ FlexBox . Row >
319308 ) }
320309 { Object . entries ( elementSchema ) . map ( ( [ key , value ] , index ) => (
321310 < >
322311 < FlexBox . Row >
323312 < EditField
324- // disabled
313+ disabled
325314 onKeyDown = { ( e : any ) =>
326315 onPressEnter ( e , 'key' , elementName , key )
327316 }
@@ -338,7 +327,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
338327 />
339328 < div style = { { width : '10%' } } > </ div >
340329 < EditField
341- // disabled
330+ disabled
342331 // marginRight={'md'}
343332 onKeyDown = { ( e : any ) =>
344333 onPressEnter ( e , 'value' , elementName , key , index )
@@ -353,8 +342,8 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
353342 placeholder = ""
354343 hasError = { false }
355344 className = { styles . field }
356- /> { ' ' }
357- { index === Object . entries ( elementSchema ) . length - 1 &&
345+ />
346+ { /* { index === Object.entries(elementSchema).length - 1 &&
358347 !inputFields.length && (
359348 <div
360349 className="col-sx-2 "
@@ -365,35 +354,12 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
365354 marginLeft: '5px',
366355 }}
367356 >
368- { /* <button
369- className={styles.fieldButton}
370- type="button"
371-
372- > */ }
373357 <icons.plusCircle
374358 onClick={() => handleAddFields()}
375359 color={iconColors.primary}
376360 />
377- { /* </button> */ }
378361 </div>
379- ) }
380- { /* <div
381- className="col-sx-2 "
382- style={{
383- justifyContent: 'space-between',
384- display: 'flex',
385- marginTop: '10px',
386- }}
387- >
388- <div
389- style={{
390- display: 'flex',
391- flexDirection: 'row',
392- justifyContent: 'space-between',
393- alignItems: 'center',
394- }}
395- ></div>
396- </div> */ }
362+ )} */ }
397363 </ FlexBox . Row >
398364 </ >
399365 ) ) }
@@ -415,6 +381,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
415381 onChangeText = { ( event : any ) =>
416382 handleInputChange ( index , event , elementName , 'key' )
417383 }
384+ disabled
418385 label = { 'Key' }
419386 className = { styles . field }
420387 value = { inputField ?. key }
@@ -432,6 +399,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
432399 // index,
433400 )
434401 }
402+ disabled
435403 className = { styles . field }
436404 onChangeText = { ( event : any ) =>
437405 handleInputChange ( index , event , elementName , 'value' )
@@ -441,13 +409,12 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
441409 placeholder = { '' }
442410 />
443411 { /* </div> */ }
444- < div
412+ { /* <div
445413 className="col-sx-2 "
446414 style={{
447415 justifyContent: 'space-between',
448416 display: 'flex',
449417 marginBottom: '10px',
450- // marginTop: '10px',
451418 }}
452419 >
453420 <div
@@ -460,35 +427,20 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
460427 marginLeft: '5px',
461428 }}
462429 >
463- { /* <button
464- className={styles.fieldButton}
465- style={{}}
466- type="button"
467- // disabled={inputFields.length === 1}
468- onClick={() => handleRemoveFields(index)}
469- > */ }
470430 <icons.minusCircle
471431 onClick={() => handleRemoveFields(index)}
472432 color={iconColors.primary}
473433 />
474- { /* </button> */ }
434+
475435 {index === inputFields.length - 1 && (
476- // <button
477- // className={styles.fieldButton}
478- // type="button"
479- // onClick={() => handleAddFields()}
480- // >
481436 <icons.plusCircle
482437 onClick={() => handleAddFields()}
483438 color={iconColors.primary}
484439 />
485- // </button>
486440 )}
487441 </div>
488- </ div >
489- { /* </div> */ }
442+ </div> */ }
490443 </ FlexBox . Row >
491- // </div>
492444 ) ) }
493445 </ Box >
494446 ) ;
@@ -502,6 +454,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
502454 < Paragraph > { titleCase ( elementName ) } </ Paragraph >
503455 < label className = { styles . switch } >
504456 < input
457+ disabled
505458 type = "checkbox"
506459 defaultChecked = { elementSchema }
507460 onChange = { ( ) =>
@@ -551,7 +504,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
551504 < Container >
552505 < Box style = { { width : '79%' } } >
553506 < EditField
554- // disabled
507+ disabled
555508 onKeyDown = { ( e : any ) => onPressEnter ( e , 'name' ) }
556509 onChangeText = { ( e : any ) => onPressEnter ( e , 'name' ) }
557510 label = { 'Component Name' }
@@ -571,6 +524,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
571524 { console . log ( stackComponent , 'asdasdasda2222122sdasd' ) }
572525 < input
573526 type = "checkbox"
527+ disabled
574528 defaultChecked = { stackComponent . isShared }
575529 // checked={stackComponent.isShared}
576530 onChange = { ( ) =>
0 commit comments