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

Commit b829ea7

Browse files
Merge branch 'features/check-suite-annotations' into features/check-suite-annotations-inline
# Conflicts: # src/GitHub.App/ViewModels/GitHubPane/PullRequestAnnotationsViewModel.cs
2 parents f3ca06b + 597d651 commit b829ea7

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/GitHub.App/SampleData/PullRequestAnnotationsViewModelDesigner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public sealed class PullRequestAnnotationsViewModelDesigner : PanePageViewModelB
2020
public ReactiveCommand<Unit, Unit> NavigateToPullRequest { get; }
2121
public string PullRequestTitle { get; } = "Fixing stuff in this PR";
2222
public string CheckSuiteName { get; } = "Awesome Check Suite";
23-
public IReadOnlyDictionary<string, IReadOnlyList<IPullRequestAnnotationItemViewModel>> AnnotationsDictionary { get; }
24-
= new Dictionary<string, IReadOnlyList<IPullRequestAnnotationItemViewModel>>
23+
public IReadOnlyDictionary<string, IPullRequestAnnotationItemViewModel[]> AnnotationsDictionary { get; }
24+
= new Dictionary<string, IPullRequestAnnotationItemViewModel[]>
2525
{
2626
{
2727
"asdf/asdf.cs",

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class PullRequestAnnotationsViewModel : PanePageViewModelBase, IPullReque
2525
string title;
2626
string checkSuiteName;
2727
string checkRunName;
28-
IReadOnlyDictionary<string, IReadOnlyList<IPullRequestAnnotationItemViewModel>> annotationsDictionary;
28+
IReadOnlyDictionary<string, IPullRequestAnnotationItemViewModel[]> annotationsDictionary;
2929

3030
/// <summary>
3131
/// Initializes a new instance of the <see cref="PullRequestAnnotationsViewModel"/> class.
@@ -105,7 +105,7 @@ public string CheckRunName
105105
private set { this.RaiseAndSetIfChanged(ref checkRunName, value); }
106106
}
107107

108-
public IReadOnlyDictionary<string, IReadOnlyList<IPullRequestAnnotationItemViewModel>> AnnotationsDictionary
108+
public IReadOnlyDictionary<string, IPullRequestAnnotationItemViewModel[]> AnnotationsDictionary
109109
{
110110
get { return annotationsDictionary; }
111111
private set { this.RaiseAndSetIfChanged(ref annotationsDictionary, value); }
@@ -131,8 +131,11 @@ void Load(PullRequestDetailModel pullRequest)
131131
.GroupBy(annotation => annotation.Path)
132132
.ToDictionary(
133133
grouping => grouping.Key,
134-
grouping => (IReadOnlyList<IPullRequestAnnotationItemViewModel>) grouping
135-
.Select(annotation => new PullRequestAnnotationItemViewModel(checkSuiteRun.checkSuite, checkSuiteRun.checkRun, annotation, session, pullRequestEditorService)));
134+
grouping => grouping
135+
.Select(annotation => new PullRequestAnnotationItemViewModel(checkSuiteRun.checkSuite, checkSuiteRun.checkRun, annotation, session, pullRequestEditorService))
136+
.Cast<IPullRequestAnnotationItemViewModel>()
137+
.ToArray()
138+
);
136139
}
137140
finally
138141
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public interface IPullRequestAnnotationsViewModel : IPanePageViewModel
5959
/// <summary>
6060
/// Gets a dictionary of annotations by file path.
6161
/// </summary>
62-
IReadOnlyDictionary<string, IReadOnlyList<IPullRequestAnnotationItemViewModel>> AnnotationsDictionary { get; }
62+
IReadOnlyDictionary<string, IPullRequestAnnotationItemViewModel[]> AnnotationsDictionary { get; }
6363

6464
/// <summary>
6565
/// Initializes the view model.

0 commit comments

Comments
 (0)