This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathPullRequestAnnotationsViewModelDesigner.cs
More file actions
91 lines (87 loc) · 3.82 KB
/
PullRequestAnnotationsViewModelDesigner.cs
File metadata and controls
91 lines (87 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
using System.Threading.Tasks;
using GitHub.Models;
using GitHub.ViewModels.GitHubPane;
using ReactiveUI;
namespace GitHub.SampleData
{
[ExcludeFromCodeCoverage]
public sealed class PullRequestAnnotationsViewModelDesigner : PanePageViewModelBase, IPullRequestAnnotationsViewModel
{
public LocalRepositoryModel LocalRepository { get; set; }
public string RemoteRepositoryOwner { get; set; }
public int PullRequestNumber { get; set; } = 123;
public string CheckRunId { get; set; }
public ReactiveCommand<Unit, Unit> NavigateToPullRequest { get; }
public string PullRequestTitle { get; } = "Fixing stuff in this PR";
public string CheckSuiteName { get; } = "Awesome Check Suite";
public string CheckRunSummary { get; } = "Awesome Check Run Summary";
public string CheckRunText { get; } = "Awesome Check Run Text";
public IReadOnlyDictionary<string, IPullRequestAnnotationItemViewModel[]> AnnotationsDictionary { get; }
= new Dictionary<string, IPullRequestAnnotationItemViewModel[]>
{
{
"asdf/asdf.cs",
new IPullRequestAnnotationItemViewModel[]
{
new PullRequestAnnotationItemViewModelDesigner
{
Annotation = new CheckRunAnnotationModel
{
AnnotationLevel = CheckAnnotationLevel.Warning,
StartLine = 3,
EndLine = 4,
Path = "asdf/asdf.cs",
Message = "; is expected",
Title = "CS 12345"
},
IsExpanded = true,
IsFileInPullRequest = true
},
new PullRequestAnnotationItemViewModelDesigner
{
Annotation = new CheckRunAnnotationModel
{
AnnotationLevel = CheckAnnotationLevel.Failure,
StartLine = 3,
EndLine = 4,
Path = "asdf/asdf.cs",
Message = "; is expected",
Title = "CS 12345"
},
IsExpanded = true,
IsFileInPullRequest = true
},
}
},
{
"blah.cs",
new IPullRequestAnnotationItemViewModel[]
{
new PullRequestAnnotationItemViewModelDesigner
{
Annotation = new CheckRunAnnotationModel
{
AnnotationLevel = CheckAnnotationLevel.Notice,
StartLine = 3,
EndLine = 4,
Path = "blah.cs",
Message = "; is expected",
Title = "CS 12345"
},
IsExpanded = true,
}
}
},
};
public string CheckRunName { get; } = "Psuedo Check Run";
public Task InitializeAsync(LocalRepositoryModel localRepository, IConnection connection, string owner,
string repo,
int pullRequestNumber, string checkRunId)
{
return Task.CompletedTask;
}
}
}