This repository was archived by the owner on Jun 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,30 +41,33 @@ const ParameterContainer = (props: {
4141 >
4242 Add Parameter
4343 </ button >
44- { props . values . parameters ?. map ( ( parameter : any ) => (
45- < div
46- key = { parameter . name }
47- className = "p-4 mb-4 w-full border-circle-gray-300 border-2 rounded text-left"
48- >
49- < div className = "flex" >
50- < p className = "font-bold" > { parameter . name } </ p >
51- </ div >
52- { parameter . description && (
53- < p className = "text-sm mt-1 leading-4 whitespace-pre-wrap text-circle-gray-500" >
54- { parameter . description }
55- </ p >
56- ) }
57- { parameter . defaultValue ? (
58- < p className = "text-sm mt-1 leading-4 whitespace-pre-wrap text-circle-gray-500" >
59- { parameter . description }
60- </ p >
61- ) : (
62- < p className = "text-sm mt-1 leading-4 whitespace-pre-wrap text-circle-gray-500" >
63- Required
64- </ p >
65- ) }
66- </ div >
67- ) ) }
44+ { props . values . parameters &&
45+ Object . entries ( props . values . parameters ) . map (
46+ ( [ name , parameter ] : [ string , any ] ) => (
47+ < div
48+ key = { name }
49+ className = "p-4 mb-4 w-full border-circle-gray-300 border-2 rounded text-left"
50+ >
51+ < div className = "flex" >
52+ < p className = "font-bold" > { name } </ p >
53+ </ div >
54+ { parameter . description && (
55+ < p className = "text-sm mt-1 leading-4 whitespace-pre-wrap text-circle-gray-500" >
56+ { parameter . description }
57+ </ p >
58+ ) }
59+ { parameter . defaultValue ? (
60+ < p className = "text-sm mt-1 leading-4 whitespace-pre-wrap text-circle-gray-500" >
61+ { parameter . description }
62+ </ p >
63+ ) : (
64+ < p className = "text-sm mt-1 leading-4 whitespace-pre-wrap text-circle-gray-500" >
65+ Required
66+ </ p >
67+ ) }
68+ </ div >
69+ ) ,
70+ ) }
6871 </ div >
6972 ) }
7073 />
Original file line number Diff line number Diff line change @@ -81,12 +81,12 @@ const InspectorDefinitionMenu = (props: InspectorDefinitionProps) => {
8181 } }
8282 enableReinitialize
8383 onSubmit = { ( values ) => {
84- const newDefinition = dataMapping . transform ( values , definitions ) ;
85- const submitData = props . editing
86- ? { old : unpacked , new : newDefinition }
87- : newDefinition ;
88-
8984 if ( ! props . passBackKey ) {
85+ const newDefinition = dataMapping . transform ( values , definitions ) ;
86+ const submitData = props . editing
87+ ? { old : unpacked , new : newDefinition }
88+ : newDefinition ;
89+
9090 submitToStore ( submitData ) ;
9191 }
9292
@@ -100,14 +100,18 @@ const InspectorDefinitionMenu = (props: InspectorDefinitionProps) => {
100100
101101 navigateBack ( {
102102 distance : 1 ,
103- apply : ( values ) => {
103+ apply : ( parentValues ) => {
104104 if ( props . passBackKey ) {
105- values [ props . passBackKey ] = [
106- ...( values [ props . passBackKey ] || [ ] ) ,
107- newDefinition ,
108- ] ;
105+ const { name, ...args } = values ;
106+
107+ if ( parentValues [ props . passBackKey ] ) {
108+ parentValues [ props . passBackKey ] [ name ] = args ;
109+ } else {
110+ parentValues [ props . passBackKey ] = { [ name ] : args } ;
111+ }
109112 }
110- return values ;
113+
114+ return parentValues ;
111115 } ,
112116 } ) ;
113117 generateConfig ( ) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ const JobMapping: ComponentMapping<Job, WorkflowJob> = {
2222 dependsOn: (definitions) => [definitions.commands, definitions.executors],
2323 */
2424 transform : ( { name, ...values } , definitions ) => {
25+ console . log ( values )
26+
2527 return parsers . parseJob (
2628 name ,
2729 values ,
Original file line number Diff line number Diff line change @@ -247,13 +247,16 @@ const Actions: StoreActions = {
247247 }
248248 }
249249
250+ const values =
251+ payload ?. apply ?.( travelTo . props . values ) || travelTo . props . values ;
252+ const props = {
253+ ...travelTo . props ,
254+ values : values ,
255+ } ;
256+
250257 state . navigation = {
251258 ...travelTo ,
252- props : {
253- ...travelTo . props ,
254- values :
255- payload ?. apply ?.( travelTo . props . values ) || travelTo . props . values ,
256- } ,
259+ props : props ,
257260 jumpedFrom : distance > 1 ? state . navigation : undefined ,
258261 } ;
259262 } else {
You can’t perform that action at this time.
0 commit comments