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

Commit df89a29

Browse files
Merge branch 'features/check-suite-annotations' into features/check-suite-annotations-inline
# Conflicts: # src/GitHub.App/ViewModels/GitHubPane/PullRequestAnnotationItemViewModel.cs # src/GitHub.Exports.Reactive/ViewModels/GitHubPane/IPullRequestAnnotationItemViewModel.cs # src/GitHub.Exports/Models/CheckRunModel.cs
2 parents af51110 + 7f8a0f5 commit df89a29

File tree

4 files changed

+33
-18
lines changed

4 files changed

+33
-18
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
namespace GitHub.App.ViewModels.GitHubPane
1111
{
12-
/// <summary>
13-
/// The viewmodel for a single annotation item in a list
14-
/// </summary>
12+
/// <inheritdoc cref="IPullRequestAnnotationItemViewModel"/>
1513
public class PullRequestAnnotationItemViewModel : ViewModelBase, IPullRequestAnnotationItemViewModel
1614
{
1715
readonly CheckSuiteModel checkSuite;
@@ -21,6 +19,10 @@ public class PullRequestAnnotationItemViewModel : ViewModelBase, IPullRequestAnn
2119

2220
bool isExpanded;
2321

22+
/// <summary>
23+
/// Initializes the <see cref="PullRequestAnnotationItemViewModel"/>.
24+
/// </summary>
25+
/// <param name="annotation">The check run annotation model.</param>
2426
public PullRequestAnnotationItemViewModel(CheckSuiteModel checkSuite,
2527
CheckRunModel checkRun,
2628
CheckRunAnnotationModel annotation,
@@ -43,21 +45,15 @@ public PullRequestAnnotationItemViewModel(CheckSuiteModel checkSuite,
4345

4446
public bool IsFileInPullRequest { get; }
4547

46-
/// <summary>
47-
/// Gets the annotation model.
48-
/// </summary>
48+
/// <inheritdoc />
4949
public CheckRunAnnotationModel Annotation { get; }
5050

51-
/// <summary>
52-
/// Gets a formatted descriptor of the line(s) the annotation is about.
53-
/// </summary>
51+
/// <inheritdoc />
5452
public string LineDescription => $"{Annotation.StartLine}:{Annotation.EndLine}";
5553

5654
public ReactiveCommand<Unit> OpenAnnotation { get; }
5755

58-
/// <summary>
59-
/// Gets or sets a flag to control the expanded state.
60-
/// </summary>
56+
/// <inheritdoc />
6157
public bool IsExpanded
6258
{
6359
get { return isExpanded; }

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@
44

55
namespace GitHub.ViewModels.GitHubPane
66
{
7+
/// <summary>
8+
/// The viewmodel for a single annotation item in a list
9+
/// </summary>
710
public interface IPullRequestAnnotationItemViewModel
811
{
12+
/// <summary>
13+
/// Gets the annotation model.
14+
/// </summary>
915
CheckRunAnnotationModel Annotation { get; }
10-
bool IsExpanded { get; set; }
16+
17+
/// <summary>
18+
/// Gets a formatted descriptor of the line(s) the annotation is about.
19+
/// </summary>
1120
string LineDescription { get; }
21+
22+
/// <summary>
23+
/// Gets or sets a flag to control the expanded state.
24+
/// </summary>
25+
bool IsExpanded { get; set; }
26+
1227
bool IsFileInPullRequest { get; }
1328
ReactiveCommand<Unit> OpenAnnotation { get; }
1429
}

src/GitHub.Exports/Models/CheckRunModel.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ public class CheckRunModel
2323
/// </summary>
2424
public DateTimeOffset? CompletedAt { get; set; }
2525

26-
/// <summary>The check run's annotations.</summary>
26+
/// <summary>
27+
/// The check run's annotations.
28+
/// </summary>
2729
public List<CheckRunAnnotationModel> Annotations { get; set; }
2830

29-
/// <summary>The name of the check for this check run.</summary>
31+
/// <summary>
32+
/// The name of the check for this check run.
33+
/// </summary>
3034
public string Name { get; set; }
3135

3236
/// <summary>
@@ -40,7 +44,7 @@ public class CheckRunModel
4044
public string Summary { get; set; }
4145

4246
/// <summary>
43-
/// The check run Id
47+
/// The database id of a Check Run.
4448
/// </summary>
4549
public int DatabaseId { get; set; }
4650
}

test/GitHub.App.UnitTests/ViewModels/GitHubPane/PullRequestFilesViewModelTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task ShouldCreateChangesTreeAsync()
5757
Assert.That(readme.FileName, Is.EqualTo("readme.md"));
5858
}
5959

60-
[Test, Ignore("I broke it")]
60+
[Test]
6161
public async Task FileCommentCountShouldTrackSessionInlineCommentsAsync()
6262
{
6363
var outdatedThread = CreateThread(-1);
@@ -88,7 +88,7 @@ public async Task FileCommentCountShouldTrackSessionInlineCommentsAsync()
8888
RaisePropertyChanged(file, nameof(file.InlineCommentThreads));
8989
Assert.That(((IPullRequestFileNode)target.Items[0]).CommentCount, Is.EqualTo(2));
9090

91-
file.Received(1).PropertyChanged += Arg.Any<PropertyChangedEventHandler>();
91+
file.Received(2).PropertyChanged += Arg.Any<PropertyChangedEventHandler>();
9292
}
9393

9494
static PullRequestFilesViewModel CreateTarget()

0 commit comments

Comments
 (0)