11import { OrderedList } from '@inkjs/ui' ;
2- import { PlanResponseData } from 'codify-schemas' ;
2+ import { PlanResponseData , ResourceOperation } from 'codify-schemas' ;
33import { Box , Text } from 'ink' ;
44import React from 'react' ;
55
@@ -8,6 +8,7 @@ import { ResourceText } from './resource-text.js';
88export function PlanComponent ( props : {
99 plan : PlanResponseData [ ]
1010} ) {
11+ const filteredPlan = props . plan . filter ( ( p ) => p . operation !== ResourceOperation . NOOP ) ;
1112 // console.log(JSON.stringify(props.plan, null, 2));
1213
1314 return < Box flexDirection = "column" >
@@ -18,25 +19,24 @@ export function PlanComponent(props: {
1819 < Text > </ Text >
1920 < Box marginLeft = { 1 } >
2021 < OrderedList > {
21- props . plan . map ( ( p , idx ) =>
22+ filteredPlan . map ( ( p , idx ) =>
2223 < OrderedList . Item key = { idx } >
2324 < Box flexDirection = "column" marginBottom = { 1 } >
2425 < ResourceText plan = { p } />
2526 < Text >
2627 < Text > Parameters: </ Text >
2728 < Text > { JSON . stringify ( p . parameters , null , 2 ) } </ Text >
28- { /* <Box flexDirection='column' marginLeft={2}>{ */ }
29+ { /* <Box flexDirection='column' marginLeft={2} width={300} >{ */ }
2930 { /* p.parameters.map((parameter, idx2) => */ }
30- { /* <Box key={idx2}> */ }
31- { /* /!* <ParameterOperationSymbol parameterOperation={parameter.operation}/> *!/ */ }
32- { /* /!* <Text>{parameter.name}</Text> *!/ */ }
33- { /* /!* <Spacer/> *!/ */ }
34- { /* /!* <Text> *!/ */ }
35- { /* /!* <Text>{String(parameter.previousValue)}</Text> *!/ */ }
36- { /* /!* <Text>{' -> '}</Text> *!/ */ }
37- { /* /!* <Text>{String(parameter.newValue)}</Text> *!/ */ }
38- { /* /!* </Text> *!/ */ }
39- { /* <Text>{JSON.stringify(parameter, null, 2)}</Text> */ }
31+ { /* <Box flexDirection = 'row' justifyContent='space-between' key={idx2}> */ }
32+ { /* <ParameterOperationSymbol parameterOperation={parameter.operation}/> */ }
33+ { /* <Text>{parameter.name}</Text> */ }
34+ { /* <Text> */ }
35+ { /* <Text>{JSON.stringify(parameter.previousValue, null, 2)}</Text> */ }
36+ { /* <Text>{' -> '}</Text> */ }
37+ { /* <Text>{JSON.stringify(parameter.newValue, null, 2)}</Text> */ }
38+ { /* </Text> */ }
39+ { /* /!* <Text>{JSON.stringify(parameter, null, 2)}</Text> *!/ */ }
4040 { /* </Box> */ }
4141 { /* ) */ }
4242 { /* }</Box> */ }
0 commit comments