Skip to content

Commit 5ef44ce

Browse files
committed
Hiding workflow node for now (not implemented)
Added leaf click on item to log
1 parent 912145a commit 5ef44ce

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

src/ToolWindows/GHActionsToolWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
<Expander Header="Current Branch">
4848
<TreeView x:Name="tvCurrentBranch" BorderThickness="0" />
4949
</Expander>
50-
<Expander Header="Workflows">
50+
<!--<Expander Header="Workflows">
5151
<TreeView x:Name="tvWorkflows" BorderThickness="0"/>
52-
</Expander>
52+
</Expander>-->
5353
<Expander Header="Settings">
5454
<TreeView BorderThickness="0">
5555
<TreeViewItem Header="Environments" HeaderTemplate="{DynamicResource EnvironmentHeaderTemplate}" x:Name="tvEnvironments" />

src/ToolWindows/GHActionsToolWindow.xaml.cs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public async Task GetRepoInfoAsync()
8484
private void ClearTreeViews()
8585
{
8686
tvSecrets.Items.Clear();
87-
tvWorkflows.Items.Clear();
87+
//tvWorkflows.Items.Clear();
8888
tvCurrentBranch.Items.Clear();
8989
tvEnvironments.Items.Clear();
9090
}
@@ -110,16 +110,16 @@ private async Task LoadDataAsync()
110110
}
111111

112112
// get workflows
113-
var workflows = await client.Actions?.Workflows?.List(_repoInfo.RepoOwner, _repoInfo.RepoName);
114-
foreach (var workflow in workflows.Workflows)
115-
{
116-
var item = new TreeViewItem
117-
{
118-
Header = workflow.Name,
119-
Tag = workflow
120-
};
121-
tvWorkflows.Items.Add(item);
122-
}
113+
//var workflows = await client.Actions?.Workflows?.List(_repoInfo.RepoOwner, _repoInfo.RepoName);
114+
//foreach (var workflow in workflows.Workflows)
115+
//{
116+
// var item = new TreeViewItem
117+
// {
118+
// Header = workflow.Name,
119+
// Tag = workflow
120+
// };
121+
// tvWorkflows.Items.Add(item);
122+
//}
123123

124124
// get current branch
125125
var runs = await client.Actions?.Workflows?.Runs?.List(_repoInfo.RepoOwner, _repoInfo.RepoName, new WorkflowRunsRequest() { Branch = _repoInfo.CurrentBranch }, new ApiOptions() { PageCount = 2, PageSize = 10 });
@@ -147,8 +147,9 @@ private async Task LoadDataAsync()
147147
var stepItem = new TreeViewItem
148148
{
149149
Header = CreateEmojiContent($"{GetConclusionIndicator(step.Conclusion.Value.StringValue)}: {step.Name}"),
150-
Tag = step
150+
Tag = $"{job.HtmlUrl}#step:{step.Number.ToString()}:1" //https://github.com/timheuer/workflow-playground/actions/runs/5548963145/jobs/10132505381#step:2:7
151151
};
152+
stepItem.MouseDoubleClick += JobItem_MouseDoubleClick;
152153
jobItem.Items.Add(stepItem);
153154
}
154155

@@ -193,7 +194,11 @@ private static GitHubClient GetGitHubClient()
193194

194195
private void JobItem_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
195196
{
196-
throw new NotImplementedException();
197+
// get the items Tag
198+
if (sender is TreeViewItem item && item.Tag is string url)
199+
{
200+
Process.Start(url);
201+
}
197202
}
198203
}
199204

0 commit comments

Comments
 (0)