diff --git a/src/components/routes/submit.tsx b/src/components/routes/submit.tsx index 4aaf41199..97252ee45 100644 --- a/src/components/routes/submit.tsx +++ b/src/components/routes/submit.tsx @@ -204,6 +204,23 @@ function Submit() { flow.upload(); }; + const isSelected = service_name => { + let selected = false; + settings.services.forEach(cat => { + cat.services.forEach(srv => { + if (srv.name === service_name) { + selected = srv.selected; + } + }); + }); + return selected; + }; + + const anySelected = () => { + const serviceList = settings.service_spec.map(srv => srv.name); + return serviceList.some(isSelected); + }; + const setFileDropperFile = selectedFile => { setFile(selectedFile); }; @@ -621,82 +638,88 @@ function Submit() { - {settings && settings.service_spec.length !== 0 ? ( + {settings && settings.service_spec.length !== 0 && anySelected() ? (
{t('options.service_spec')} {settings.service_spec.map((service, idx) => { return ( -
- - {service.name} - - {service.params.map((param, pidx) => { - return ( -
- {param.type === 'bool' ? ( -
- setParam(idx, pidx, !param.value)} - /> - } - label={ - + isSelected(service.name) && ( +
+ + {service.name} + + {service.params.map((param, pidx) => { + return ( +
+ {param.type === 'bool' ? ( +
+ setParam(idx, pidx, !param.value)} + /> + } + label={ + + {param.name.replace(/_/g, ' ')} + + } + className={classes.item} + /> +
+ ) : ( + <> +
+ {param.name.replace(/_/g, ' ')} - } - className={classes.item} - /> -
- ) : ( - <> -
- - {param.name.replace(/_/g, ' ')} - -
- {param.type === 'list' ? ( - - ) : ( - setParamAsync(idx, pidx, event.target.value)} - /> - )} - - )} -
- ); - })} -
+
+ {param.type === 'list' ? ( + + ) : ( + setParamAsync(idx, pidx, event.target.value)} + /> + )} + + )} +
+ ); + })} +
+ ) ); })}