diff --git a/src/dashboard/Synapse.Dashboard/Components/TaskInstanceDetails/TaskInstanceDetails.razor b/src/dashboard/Synapse.Dashboard/Components/TaskInstanceDetails/TaskInstanceDetails.razor index f09b6042..87983c2f 100644 --- a/src/dashboard/Synapse.Dashboard/Components/TaskInstanceDetails/TaskInstanceDetails.razor +++ b/src/dashboard/Synapse.Dashboard/Components/TaskInstanceDetails/TaskInstanceDetails.razor @@ -71,32 +71,6 @@ } -
Executed Tasks
- @if (SubTasks == null || SubTasks.Count() == 0) - { - @("-") - } - else - { - - - - - - - - - - - - - @foreach (var task in SubTasks) - { - - } - -
NameStatusStart TimeEnd TimeDuration
- }
Runs
@if (TaskInstance.Runs == null || TaskInstance.Runs.Count == 0) { @@ -163,13 +137,4 @@ @code { [Parameter] public TaskInstance? TaskInstance { get; set; } - [Parameter] public IEnumerable? Tasks { get; set; } - - IEnumerable SubTasks - { - get - { - return TaskInstance == null ? [] : (this.Tasks ?? []).Where(t => t.ParentId == TaskInstance.Id); - } - } } diff --git a/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/TaskInstanceRow.razor b/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/TaskInstanceRow.razor index 8e0ba828..0e80c728 100644 --- a/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/TaskInstanceRow.razor +++ b/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/TaskInstanceRow.razor @@ -18,6 +18,17 @@ @if (TaskInstance != null) { + + @if (HasChildren) { + @for(var i = 0; i + } + + + + } + @TaskInstance.Reference @(TaskInstance.Status ?? TaskInstanceStatus.Pending) @(TaskInstance.StartedAt?.RelativeFormat() ?? "-") @@ -38,7 +49,7 @@ - + @@ -47,9 +58,12 @@ @code { [Parameter] public TaskInstance? TaskInstance { get; set; } - [Parameter] public IEnumerable? Tasks { get; set; } + [Parameter] public bool HasChildren { get; set; } + [Parameter] public EventCallback<( string, int )> OnToggleChildrenClick { get; set; } + [Parameter] public int Depth { get; set; } bool isOpen = false; Collapse? collapse; + bool showChildren = false; async Task OnToggleRow() { @@ -62,4 +76,13 @@ } StateHasChanged(); } + + async Task ToggleChildrenVisibility() + { + showChildren = !showChildren; + if (OnToggleChildrenClick.HasDelegate && TaskInstance != null) + { + await OnToggleChildrenClick.InvokeAsync((TaskInstance.Id, Depth )); + } + } } diff --git a/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/WorkflowInstanceDetails.razor b/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/WorkflowInstanceDetails.razor index 32cfaf20..1dea1fd6 100644 --- a/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/WorkflowInstanceDetails.razor +++ b/src/dashboard/Synapse.Dashboard/Components/WorkflowInstanceDetails/WorkflowInstanceDetails.razor @@ -77,6 +77,7 @@ + @@ -86,9 +87,9 @@ - @foreach (var task in workflowInstance.Status.Tasks.Where(task => string.IsNullOrWhiteSpace(task.ParentId)) ) + @foreach (var task in workflowInstance.Status.Tasks.Where(task => string.IsNullOrWhiteSpace(task.ParentId) || expandedTasks.ContainsKey(task.ParentId)) ) { - + }
Name Status Start Time
@@ -186,6 +187,7 @@ @code { private WorkflowInstance? workflowInstance; [Parameter] public WorkflowInstance? WorkflowInstance { get; set; } + private Dictionary expandedTasks = new(); protected override void OnParametersSet() { @@ -204,4 +206,27 @@ shouldRender = false; return true; } + + protected void CloseChildrenTask(string taskId) + { + if (expandedTasks.ContainsKey(taskId)) + { + expandedTasks.Remove(taskId); + } + foreach (var child in workflowInstance?.Status?.Tasks?.Where(task => task.ParentId == taskId) ?? []) + { + CloseChildrenTask(child.Id); + } + } + + protected void ToggleChildrenTask((string, int) e) + { + (string taskId, int depth) = e; + if (expandedTasks.ContainsKey(taskId)) + { + CloseChildrenTask(taskId); + } + else expandedTasks.Add(taskId, depth); + shouldRender = true; + } }