File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
src/lib/components/v2/workflow Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 3434 let mode = ' run' ;
3535 let replaceExistingDataset = true ;
3636
37+ let newDatasetName = ' ' ;
38+
39+ $: selectedDataset = datasets .find ((d ) => d .id === selectedDatasetId);
40+
3741 /**
3842 * @param {'run'|'restart'|'continue'} action
3943 */
175179 }
176180 }
177181
178- let newDatasetName = ' ' ;
179-
180182 function computeNewDatasetName () {
181183 newDatasetName = generateNewUniqueDatasetName (datasets, getSelectedDataset ().name );
182184 }
248250 </select >
249251 </div >
250252 {#if mode === ' restart' && ! replaceExistingDataset }
251- <div class =" mb-3" >
253+ <div class =" mb-3 has-validation " >
252254 <label for =" newDatasetName" class =" form-label" >New dataset name</label >
253255 <input
254256 id =" newDatasetName"
255257 class =" form-control"
256258 type =" text"
257259 bind:value ={newDatasetName }
258260 disabled ={checkingConfiguration }
261+ class:is-invalid ={newDatasetName === selectedDataset ?.name }
259262 />
263+ <span class =" invalid-feedback" >
264+ The new dataset name must be different than the original dataset name
265+ </span >
260266 </div >
261267 {/if }
262268 <div class =" mb-3" >
384390 Confirm
385391 </button >
386392 {:else }
387- <button class ="btn btn-primary" on:click ={() => (checkingConfiguration = true )}> Run </button >
393+ <button
394+ class =" btn btn-primary"
395+ on:click ={() => (checkingConfiguration = true )}
396+ disabled ={mode === ' restart' &&
397+ ! replaceExistingDataset &&
398+ newDatasetName === selectedDataset ?.name }
399+ >
400+ Run
401+ </button >
388402 {/if }
389403 </svelte:fragment >
390404</Modal >
You can’t perform that action at this time.
0 commit comments