File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/lib/components/workflow/common Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 4242 const entryType = typeof entry
4343 const isArray = Array .isArray (entry)
4444 if (entryType === ' object' && ! isArray) {
45+ // Check that the property name is not already used
46+ if (Object .hasOwn (entry, propertyName)) {
47+ const error = document .getElementById (' submitEntryError' )
48+ error .textContent = ` Property name "${ propertyName} " is already used`
49+ const input = document .getElementById (' submitEntryName' )
50+ input .classList .add (' is-invalid' )
51+ return
52+ }
4553 entry[propertyName] = propertyValue
4654 } else if (isArray) {
4755 entry .push (propertyValue)
7684 <form id ={uuid } on:submit |preventDefault ={handleSubmitEntry }>
7785 <div class =" input-group mb-3" >
7886 {#if ! isListItem }
79- <input type ="text" class ="form-control" placeholder ="Arg name" bind:value ={propertyName } required >
87+ <input id = "submitEntryName" type ="text" class ="form-control" placeholder ="Arg name" bind:value ={propertyName } required >
8088 {/if }
8189 {#if propertyType === ' string' }
8290 <input type ="text" class ="form-control w-50 font-monospace" placeholder ="Argument default value" bind:value ={propertyValue }>
95103 <option value =" object" >Object</option >
96104 <option value =" array" >Array</option >
97105 </select >
106+ <div id =" submitEntryError" class =" invalid-feedback" >
107+ </div >
98108 </div >
99109 </form >
100110 </div >
You can’t perform that action at this time.
0 commit comments