@@ -67,7 +67,143 @@ qx.Class.define("osparc.study.CreateFunction", {
6767 this . __createFunction ( ) ;
6868 }
6969 } , this ) ;
70- this . _add ( createFunctionBtn ) ;
70+
71+
72+ // INPUTS
73+ const inGrid = new qx . ui . layout . Grid ( 6 , 6 ) ;
74+ const inputsLayout = new qx . ui . container . Composite ( inGrid ) . set ( {
75+ allowGrowX : false ,
76+ alignX : "left" ,
77+ alignY : "middle"
78+ } ) ;
79+ this . _add ( inputsLayout ) ;
80+
81+ // header
82+ let row = 0 ;
83+ let column = 0 ;
84+ const nameLabel = new qx . ui . basic . Label ( this . tr ( "Input name" ) ) ;
85+ inputsLayout . add ( nameLabel , {
86+ row,
87+ column,
88+ } ) ;
89+ column ++ ;
90+ const typeLabel = new qx . ui . basic . Label ( this . tr ( "Type" ) ) ;
91+ inputsLayout . add ( typeLabel , {
92+ row,
93+ column,
94+ } ) ;
95+ column ++ ;
96+ const exposedLabel = new qx . ui . basic . Label ( this . tr ( "Exposed" ) ) ;
97+ inputsLayout . add ( exposedLabel , {
98+ row,
99+ column,
100+ } ) ;
101+ column ++ ;
102+ const defaultValue = new qx . ui . basic . Label ( this . tr ( "Default value" ) ) ;
103+ inputsLayout . add ( defaultValue , {
104+ row,
105+ column,
106+ } ) ;
107+ column = 0 ;
108+ row ++ ;
109+
110+ const filePickers = osparc . study . Utils . extractFilePickers ( this . __studyData [ "workbench" ] ) ;
111+ filePickers . forEach ( filePicker => {
112+ const fpLabel = new qx . ui . basic . Label ( filePicker [ "label" ] ) ;
113+ inputsLayout . add ( fpLabel , {
114+ row,
115+ column,
116+ } ) ;
117+ column ++ ;
118+
119+ const fpType = new qx . ui . basic . Label ( "FileID" ) ;
120+ inputsLayout . add ( fpType , {
121+ row,
122+ column,
123+ } ) ;
124+ column ++ ;
125+
126+ const fpExposed = new qx . ui . form . CheckBox ( ) . set ( { value : true } ) ;
127+ inputsLayout . add ( fpExposed , {
128+ row,
129+ column,
130+ } ) ;
131+ column ++ ;
132+
133+ const outputValue = osparc . file . FilePicker . getOutput ( filePicker ) ;
134+ const fpDefaultValue = new qx . ui . basic . Label ( outputValue && outputValue [ "path" ] ? outputValue [ "path" ] : null ) ;
135+ inputsLayout . add ( fpDefaultValue , {
136+ row,
137+ column,
138+ } ) ;
139+ column ++ ;
140+
141+ column = 0 ;
142+ row ++ ;
143+ } ) ;
144+
145+ const parameters = osparc . study . Utils . extractParameters ( this . __studyData [ "workbench" ] ) ;
146+ parameters . forEach ( parameter => {
147+ const parameterLabel = new qx . ui . basic . Label ( parameter [ "label" ] ) ;
148+ inputsLayout . add ( parameterLabel , {
149+ row,
150+ column,
151+ } ) ;
152+ column ++ ;
153+
154+ const parameterMetadata = osparc . store . Services . getMetadata ( parameter [ "key" ] , parameter [ "version" ] ) ;
155+ if ( parameterMetadata ) {
156+ const parameterType = new qx . ui . basic . Label ( osparc . service . Utils . getParameterType ( parameterMetadata ) ) ;
157+ inputsLayout . add ( parameterType , {
158+ row,
159+ column,
160+ } ) ;
161+ }
162+ column ++ ;
163+
164+ const parameterExposed = new qx . ui . form . CheckBox ( ) . set ( { value : true } ) ;
165+ inputsLayout . add ( parameterExposed , {
166+ row,
167+ column,
168+ } ) ;
169+ column ++ ;
170+
171+ const parameterDefaultValue = new qx . ui . basic . Label ( String ( osparc . service . Utils . getParameterValue ( parameter ) ) ) ;
172+ inputsLayout . add ( parameterDefaultValue , {
173+ row,
174+ column,
175+ } ) ;
176+ column ++ ;
177+
178+ column = 0 ;
179+ row ++ ;
180+ } ) ;
181+
182+ // OUTPUTS
183+ const outGrid = new qx . ui . layout . Grid ( 6 , 6 ) ;
184+ const outputsLayout = new qx . ui . container . Composite ( outGrid ) . set ( {
185+ allowGrowX : false ,
186+ alignX : "left" ,
187+ alignY : "middle"
188+ } ) ;
189+ this . _add ( outputsLayout ) ;
190+
191+ // header
192+ const nameLabel2 = new qx . ui . basic . Label ( this . tr ( "Output name" ) ) ;
193+ outputsLayout . add ( nameLabel2 , {
194+ row : 0 ,
195+ column : 0 ,
196+ } ) ;
197+ const typeLabel2 = new qx . ui . basic . Label ( this . tr ( "Type" ) ) ;
198+ outputsLayout . add ( typeLabel2 , {
199+ row : 0 ,
200+ column : 1 ,
201+ } ) ;
202+ const exposedLabel2 = new qx . ui . basic . Label ( this . tr ( "Exposed" ) ) ;
203+ outputsLayout . add ( exposedLabel2 , {
204+ row : 0 ,
205+ column : 2 ,
206+ } ) ;
71207 } ,
72208
73209 __createFunction : function ( ) {
0 commit comments