File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
src/dashboard/Synapse.Dashboard/Features/Workflows/WorkflowEditor Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 35
35
<td >Name</td >
36
36
<td >
37
37
<input name =" name" type =" text" placeholder =" Name" required class =" form-control" value =" @state.Name"
38
- @onchange =" async e => await OnPropertyChangedAsync(nameof(state.Name), s => s.Name = (string)e.Value! )" />
38
+ @onchange =" async e => await OnPropertyChangedAsync(nameof(state.Name), this.PatchStateName(e) )" />
39
39
</td >
40
40
</tr >
41
41
<tr >
190
190
}
191
191
}
192
192
193
+ protected virtual Action <StateDefinition > PatchStateName (ChangeEventArgs e ) {
194
+ return (StateDefinition state ) => {
195
+ var previousName = state .Name ;
196
+ state .Name = (string )e .Value ! ;
197
+ if (this .Workflow .StartStateName == previousName ) {
198
+ this .Workflow .StartStateName = state .Name ;
199
+ }
200
+ this .Workflow .States .ForEach (s =>
201
+ {
202
+ if (! state .UsedForCompensation ) {
203
+ if (s .TransitionToStateName == previousName ) {
204
+ s .TransitionToStateName = state .Name ;
205
+ }
206
+ }
207
+ else if (s .CompensatedBy == previousName ) {
208
+ s .CompensatedBy = state .Name ;
209
+ }
210
+ // todo: update conditions when errors/timeout are implemented
211
+ });
212
+ };
213
+ }
214
+
193
215
protected virtual async Task OnStateTypeChangedAsync (StateType stateType )
194
216
{
195
217
var stateIndex = this .Workflow .States .IndexOf (this .state );
You can’t perform that action at this time.
0 commit comments