|
19 | 19 | @inject MonacoInterop MonacoInterop
|
20 | 20 | @inject IJsonSerializer Serializer
|
21 | 21 |
|
22 |
| -<MonacoEditor OnTextChanged="OnTextChanged" ModelName="@modelName" /> |
| 22 | +<MonacoEditor OnTextChanged="OnTextChanged" ModelName="@modelName" Document="input" /> |
23 | 23 | <div class="text-center">
|
24 | 24 | <Button Outline="true" Color="ButtonColor.Primary" class="m-auto mt-3" @onclick="async (_) => await OnStart()">
|
25 | 25 | <Icon Name="IconName.Play" />
|
|
30 | 30 | @code {
|
31 | 31 | string payload = string.Empty;
|
32 | 32 | string modelName = string.Empty;
|
| 33 | + EquatableDictionary<string, object>? input; |
33 | 34 |
|
34 | 35 | [Parameter] public WorkflowDefinition? WorkflowDefinition { get; set; }
|
| 36 | + [Parameter] public EquatableDictionary<string, object>? Input { get; set; } |
35 | 37 | [Parameter] public EventCallback<string> OnCreate { get; set; }
|
36 | 38 |
|
37 | 39 | void OnTextChanged(string value)
|
|
50 | 52 | protected override async Task OnParametersSetAsync()
|
51 | 53 | {
|
52 | 54 | await base.OnParametersSetAsync();
|
53 |
| - if (this.WorkflowDefinition?.Input?.Schema?.Document != null) |
| 55 | + if (Input != input) |
54 | 56 | {
|
55 |
| - modelName = this.WorkflowDefinition.Document.Name + "-" + this.WorkflowDefinition.Document.Version; |
56 |
| - await this.MonacoInterop.AddValidationSchemaAsync(this.Serializer.SerializeToText(this.WorkflowDefinition.Input.Schema.Document), $"https://synapse.io/schemas/{modelName}.json", $"{modelName}*").ConfigureAwait(false); |
57 |
| - } |
58 |
| - |
| 57 | + input = Input; |
| 58 | + } |
| 59 | + if (WorkflowDefinition?.Input?.Schema?.Document != null) |
| 60 | + { |
| 61 | + modelName = WorkflowDefinition.Document.Name + "-" + WorkflowDefinition.Document.Version; |
| 62 | + await MonacoInterop.AddValidationSchemaAsync(Serializer.SerializeToText(WorkflowDefinition.Input.Schema.Document), $"https://synapse.io/schemas/{modelName}.json", $"{modelName}*").ConfigureAwait(false); |
| 63 | + } |
59 | 64 | }
|
60 | 65 |
|
61 | 66 | }
|
0 commit comments