@@ -13,7 +13,7 @@ import { VisitInput, visitToText } from '@diamondlightsource/sci-react-ui';
1313import Loader from '@/components/loader/Loader' ;
1414import { useLoader } from '@/contexts/LoaderContext' ;
1515import { SubmissionFormSharedFragment$key } from '@/components/workflows/__generated__/SubmissionFormSharedFragment.graphql' ;
16- import { sharedFragment } from './Submission' ;
16+ import { sharedFragment } from '.. /Submission' ;
1717import WorkflowStatus from '@/components/workflows/WorkflowStatus' ;
1818import SweepResultViewer from '@/components/workflows/sweepPipeline/SweepResultViewer' ;
1919import ParameterSweepForm , {
@@ -112,10 +112,10 @@ const SubmissionFormCOR = (props: {
112112 // ---- Pipeline JSON (unchanged from your current version) ----
113113 const generateConfigArray = ( formParams : any ) => {
114114 let updatedLoaderParams = { ...loaderParams } ;
115-
115+
116116 if ( ! isContextValid ( ) ) {
117117 if ( ! updatedLoaderParams . data_path || updatedLoaderParams . data_path . trim ( ) === '' ) {
118- updatedLoaderParams . data_path = null ;
118+ updatedLoaderParams . data_path = null ;
119119 }
120120 if (
121121 typeof updatedLoaderParams . rotation_angles === 'string' ||
@@ -124,9 +124,9 @@ const SubmissionFormCOR = (props: {
124124 updatedLoaderParams . rotation_angles . data_path . trim ( ) === '' ||
125125 updatedLoaderParams . rotation_angles . data_path === 'auto'
126126 ) {
127- updatedLoaderParams . rotation_angles = { data_path : null } ;
127+ updatedLoaderParams . rotation_angles = { data_path : null } ;
128128 }
129-
129+
130130 const hasDarks =
131131 updatedLoaderParams . darks &&
132132 updatedLoaderParams . darks . file &&
@@ -135,18 +135,18 @@ const SubmissionFormCOR = (props: {
135135 updatedLoaderParams . flats &&
136136 updatedLoaderParams . flats . file &&
137137 updatedLoaderParams . flats . file . trim ( ) !== '' ;
138-
138+
139139 if ( hasDarks && hasFlats ) {
140140 delete updatedLoaderParams . image_key_path ;
141141 } else if (
142142 ! updatedLoaderParams . image_key_path ||
143143 updatedLoaderParams . image_key_path . trim ( ) === '' ||
144144 updatedLoaderParams . image_key_path === 'auto'
145145 ) {
146- updatedLoaderParams . image_key_path = null ;
146+ updatedLoaderParams . image_key_path = null ;
147147 }
148148 }
149-
149+
150150 return [
151151 {
152152 method : method ,
@@ -189,41 +189,41 @@ const SubmissionFormCOR = (props: {
189189 stop : sweepValues . stop ,
190190 step : sweepValues . step ,
191191 } ;
192-
192+
193193 // Generate config as array (for validation)
194194 const configArray = generateConfigArray ( mergedParams ) ;
195-
195+
196196 // Build validation object with correct backend key names
197197 const validationObject = {
198198 config : configArray ,
199199 input : wfValues . input === "" ? null : wfValues . input ,
200200 output : wfValues . output === "" ? null : wfValues . output ,
201201 nprocs : wfValues . nprocs ,
202202 memory : wfValues . memory ,
203- "httomo-outdir-name" : wfValues . httomo_outdir_name === "" ? null : wfValues . httomo_outdir_name ,
203+ "httomo-outdir-name" : wfValues . httomo_outdir_name === "" ? null : wfValues . httomo_outdir_name ,
204204 } ;
205-
205+
206206 // Validate against schema
207207 const validate = ajv . compile ( schema ) ;
208- if ( ! validate ( validationObject ) ) {
208+ if ( ! validate ( validationObject ) ) {
209209 setErrorMessages ( formatAjvErrors ( validate . errors , validationObject ) ) ;
210210 return ; // Stop submission
211211 }
212-
212+
213213 // Build final submission payload (config as string)
214214 const finalParams = {
215215 ...validationObject ,
216216 config : JSON . stringify ( configArray )
217217 } ;
218-
218+
219219 // Submit
220220 props . onSubmit ( visit , finalParams , ( workflowName : string ) => {
221221 setSubmittedWorkflowName ( workflowName ) ;
222222 setSubmittedVisit ( visit ) ;
223223 setErrorMessages ( [ ] ) ;
224224 } ) ;
225225 } ;
226-
226+
227227
228228 const handleCloseSnackbar = ( ) => setSubmitted ( false ) ;
229229
@@ -241,7 +241,7 @@ const SubmissionFormCOR = (props: {
241241
242242 < Divider />
243243 < Loader />
244-
244+
245245 { errorMessages . length > 0 && (
246246 < Alert severity = "error" >
247247 < strong > Validation failed:</ strong >
@@ -271,7 +271,7 @@ const SubmissionFormCOR = (props: {
271271 step = { parameters . step as number }
272272 />
273273 ) }
274-
274+
275275
276276 { ! isContextValid ( ) && (
277277 < Alert severity = "info" >
@@ -295,18 +295,18 @@ const SubmissionFormCOR = (props: {
295295 onChange = { setWfValues }
296296 />
297297
298-
299-
298+
299+
300300
301301 < Divider />
302302
303-
303+
304304 < VisitInput
305- visit = { props . visit }
306- onSubmit = { doSubmit }
307- parameters = { parameters }
308- submitOnReturn = { false }
309- submitButton = { true }
305+ visit = { props . visit }
306+ onSubmit = { doSubmit }
307+ parameters = { parameters }
308+ submitOnReturn = { false }
309+ submitButton = { true }
310310 />
311311
312312 < Snackbar
0 commit comments