|
4 | 4 | import { displayStandardErrorAlert } from '$lib/common/errors'; |
5 | 5 | import FormBuilder from './FormBuilder.svelte'; |
6 | 6 | import ImportExportArgs from './ImportExportArgs.svelte'; |
7 | | - import { stripNullAndEmptyObjectsAndArrays } from '$lib/components/common/jschema/schema_management'; |
| 7 | + import { |
| 8 | + stripNullAndEmptyObjectsAndArrays, |
| 9 | + stripSchemaProperties |
| 10 | + } from '$lib/components/common/jschema/schema_management'; |
8 | 11 |
|
9 | 12 | const SUPPORTED_SCHEMA_VERSIONS = ['pydantic_v1']; |
10 | 13 |
|
|
127 | 130 | function argsSchemaVersionValid(argsSchemaVersion) { |
128 | 131 | return argsSchemaVersion && SUPPORTED_SCHEMA_VERSIONS.includes(argsSchemaVersion); |
129 | 132 | } |
| 133 | +
|
| 134 | + $: showNonParallelTitle = |
| 135 | + !workflowTask.is_legacy_task && |
| 136 | + workflowTask.task.args_schema_non_parallel && |
| 137 | + Object.keys( |
| 138 | + stripSchemaProperties(workflowTask.task.args_schema_non_parallel, workflowTask.is_legacy_task) |
| 139 | + .properties |
| 140 | + ).length; |
| 141 | +
|
| 142 | + $: showParallelTitle = |
| 143 | + argsSchemaParallel && |
| 144 | + Object.keys(stripSchemaProperties(argsSchemaParallel, workflowTask.is_legacy_task).properties) |
| 145 | + .length; |
130 | 146 | </script> |
131 | 147 |
|
132 | 148 | <div id="workflow-arguments-schema-panel"> |
133 | 149 | <div id="json-schema-validation-errors" /> |
134 | 150 | {#if workflowTask.task_type === 'non_parallel' || workflowTask.task_type === 'compound'} |
135 | | - <h5 class="ps-2 mt-3">Args non parallel</h5> |
| 151 | + {#if showNonParallelTitle} |
| 152 | + <h5 class="ps-2 mt-3">Initialisation Parameters</h5> |
| 153 | + {/if} |
136 | 154 | {#if !workflowTask.is_legacy_task && workflowTask.task.args_schema_non_parallel && isSchemaValid} |
137 | 155 | <div class="args-list"> |
138 | 156 | <JSchema |
|
153 | 171 | </div> |
154 | 172 | {/if} |
155 | 173 | {/if} |
156 | | - {#if workflowTask.task_type === 'compound'} |
| 174 | + {#if workflowTask.task_type === 'compound' && showParallelTitle} |
157 | 175 | <hr /> |
158 | 176 | {/if} |
159 | 177 | {#if workflowTask.task_type === 'parallel' || workflowTask.task_type === 'compound'} |
160 | | - <h5 class="ps-2 mt-3"> |
161 | | - {#if workflowTask.is_legacy_task} |
162 | | - Args (legacy task) |
163 | | - {:else} |
164 | | - Args parallel |
165 | | - {/if} |
166 | | - </h5> |
| 178 | + {#if showParallelTitle} |
| 179 | + <h5 class="ps-2 mt-3">Compute Parameters</h5> |
| 180 | + {/if} |
167 | 181 | {#if argsSchemaParallel && isSchemaValid} |
168 | 182 | <div class="args-list"> |
169 | 183 | <JSchema |
|
184 | 198 | </div> |
185 | 199 | {/if} |
186 | 200 | {/if} |
| 201 | + {#if !showNonParallelTitle && !showParallelTitle} |
| 202 | + <p class="mt-3 ps-3">No arguments</p> |
| 203 | + {/if} |
187 | 204 | <div class="d-flex jschema-controls-bar p-3"> |
188 | 205 | <ImportExportArgs |
189 | 206 | {workflowTask} |
|
0 commit comments