Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 9dcae6e

Browse files
Merge branch 'features/check-suite-annotations' into features/check-suite-annotations-inline
# Conflicts: # src/GitHub.App/ViewModels/GitHubPane/PullRequestAnnotationsViewModel.cs
2 parents 35f80ec + bb87286 commit 9dcae6e

File tree

17 files changed

+52
-27
lines changed

17 files changed

+52
-27
lines changed
201 KB
Binary file not shown.

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
<ItemGroup>
2929
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.1" />
3030
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
31-
<PackageReference Include="Octokit.GraphQL" Version="0.1.1-beta" />
31+
<PackageReference Include="Octokit.GraphQL" Version="0.1.2-beta" />
3232
</ItemGroup>
3333
</Project>

src/GitHub.App/GitHub.App.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<PackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="15.0.17" />
6060
<PackageReference Include="Microsoft.VisualStudio.Shell.14.0" Version="14.3.25407" />
6161
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
62-
<PackageReference Include="Octokit.GraphQL" Version="0.1.1-beta" />
62+
<PackageReference Include="Octokit.GraphQL" Version="0.1.2-beta" />
6363
<PackageReference Include="Rothko" Version="0.0.3-ghfvs" />
6464
<PackageReference Include="Rx-Main" Version="2.2.5-custom" targetFramework="net45" />
6565
<PackageReference Include="Serilog" Version="2.5.0" />

src/GitHub.App/SampleData/PullRequestAnnotationsViewModelDesigner.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Diagnostics.CodeAnalysis;
33
using System.Threading.Tasks;
44
using GitHub.App.ViewModels.GitHubPane;
@@ -17,6 +17,7 @@ public sealed class PullRequestAnnotationsViewModelDesigner : PanePageViewModelB
1717
public int CheckRunId { get; set; }
1818
public ReactiveCommand<object> NavigateToPullRequest { get; }
1919
public string PullRequestTitle { get; } = "Fixing stuff in this PR";
20+
public string CheckSuiteName { get; } = "Awesome Check Suite";
2021
public string CheckRunName { get; } = "Psuedo Check Run";
2122
public IReadOnlyList<IPullRequestAnnotationItemViewModel> Annotations { get; } = new[]
2223
{

src/GitHub.App/SampleData/PullRequestCheckViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Windows.Media.Imaging;
33
using GitHub.Models;
44
using GitHub.ViewModels;

src/GitHub.App/Services/PullRequestService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public async Task<Page<PullRequestListItemModel>> ReadPullRequests(
115115
{
116116
Conclusion = run.Conclusion.FromGraphQl(),
117117
Status = run.Status.FromGraphQl()
118-
}).ToList()
118+
}).ToList(),
119+
ApplicationName = suite.App.Name,
119120
}).ToList(),
120121
Statuses = commit.Commit.Status
121122
.Select(context =>
@@ -1020,6 +1021,8 @@ class LastCommitSummaryAdapter
10201021
class CheckSuiteSummaryModel
10211022
{
10221023
public List<CheckRunSummaryModel> CheckRuns { get; set; }
1024+
1025+
public string ApplicationName { get; set; }
10231026
}
10241027

10251028
class CheckRunSummaryModel

src/GitHub.App/ViewModels/GitHubPane/PullRequestAnnotationsViewModel.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class PullRequestAnnotationsViewModel : PanePageViewModelBase, IPullReque
2020

2121
IPullRequestSession session;
2222
string title;
23+
string checkSuiteName;
2324
string checkRunName;
2425
IReadOnlyList<IPullRequestAnnotationItemViewModel> annotations;
2526

@@ -85,6 +86,13 @@ public string PullRequestTitle
8586
private set { this.RaiseAndSetIfChanged(ref title, value); }
8687
}
8788

89+
/// <inheritdoc/>
90+
public string CheckSuiteName
91+
{
92+
get { return checkSuiteName; }
93+
private set { this.RaiseAndSetIfChanged(ref checkSuiteName, value); }
94+
}
95+
8896
/// <inheritdoc/>
8997
public string CheckRunName
9098
{
@@ -108,13 +116,15 @@ async Task Load(PullRequestDetailModel pullRequest)
108116
await Task.Delay(0);
109117
PullRequestTitle = pullRequest.Title;
110118

111-
var checkRunModel = pullRequest
112-
.CheckSuites.SelectMany(checkSuite => checkSuite.CheckRuns.Select(checkRun => new {checkSuite, checkRun}))
113-
.First(model => model.checkRun.DatabaseId == CheckRunId);
119+
var checkSuiteRun = pullRequest
120+
.CheckSuites.SelectMany(checkSuite => checkSuite.CheckRuns
121+
.Select(checkRun => new{checkSuite, checkRun}))
122+
.First(arg => arg.checkRun.DatabaseId == CheckRunId);
114123

115-
CheckRunName = checkRunModel.checkRun.Name;
116-
Annotations = checkRunModel.checkRun.Annotations
117-
.Select(annotation => new PullRequestAnnotationItemViewModel(checkRunModel.checkSuite, checkRunModel.checkRun, annotation, session, pullRequestEditorService))
124+
CheckSuiteName = checkSuiteRun.checkSuite.ApplicationName;
125+
CheckRunName = checkSuiteRun.checkRun.Name;
126+
Annotations = checkSuiteRun.checkRun.Annotations
127+
.Select(annotation => new PullRequestAnnotationItemViewModel(checkSuiteRun.checkSuite, checkSuiteRun.checkRun, annotation, session, pullRequestEditorService))
118128
.ToArray();
119129
}
120130
finally

src/GitHub.App/ViewModels/GitHubPane/PullRequestCheckViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.ComponentModel.Composition;
44
using System.Linq;

src/GitHub.Exports.Reactive/ViewModels/GitHubPane/IPullRequestAnnotationsViewModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Threading.Tasks;
33
using GitHub.Models;
44
using ReactiveUI;
@@ -54,6 +54,11 @@ public interface IPullRequestAnnotationsViewModel : IPanePageViewModel
5454
/// </summary>
5555
IReadOnlyList<IPullRequestAnnotationItemViewModel> Annotations { get; }
5656

57+
/// <summary>
58+
/// Name of the Check Suite.
59+
/// </summary>
60+
string CheckSuiteName { get; }
61+
5762
/// <summary>
5863
/// Initializes the view model.
5964
/// </summary>

src/GitHub.Exports.Reactive/ViewModels/GitHubPane/IPullRequestCheckViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Windows.Media.Imaging;
33
using GitHub.Models;
44
using ReactiveUI;

0 commit comments

Comments
 (0)