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

Commit f89c55b

Browse files
Merge branch 'master' into features/check-suite-annotations
2 parents 0af2495 + adb4119 commit f89c55b

File tree

45 files changed

+1473
-1184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1473
-1184
lines changed

GitHubVS.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Wpf", "submodule
133133
EndProject
134134
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InstallAndStart", "test\Launcher\InstallAndStart.csproj", "{79F32BE1-2764-4DBA-97F6-21053DE44270}"
135135
EndProject
136+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.TeamFoundation.16", "src\GitHub.TeamFoundation.16\GitHub.TeamFoundation.16.csproj", "{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}"
137+
EndProject
136138
Global
137139
GlobalSection(SolutionConfigurationPlatforms) = preSolution
138140
Debug|Any CPU = Debug|Any CPU
@@ -542,6 +544,16 @@ Global
542544
{79F32BE1-2764-4DBA-97F6-21053DE44270}.Release|Any CPU.Build.0 = Release|Any CPU
543545
{79F32BE1-2764-4DBA-97F6-21053DE44270}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
544546
{79F32BE1-2764-4DBA-97F6-21053DE44270}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
547+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
548+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
549+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.DebugCodeAnalysis|Any CPU.ActiveCfg = DebugCodeAnalysis|Any CPU
550+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.DebugCodeAnalysis|Any CPU.Build.0 = DebugCodeAnalysis|Any CPU
551+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.DebugWithoutVsix|Any CPU.ActiveCfg = DebugCodeAnalysis|Any CPU
552+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.DebugWithoutVsix|Any CPU.Build.0 = DebugCodeAnalysis|Any CPU
553+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
554+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.Release|Any CPU.Build.0 = Release|Any CPU
555+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
556+
{F08BD4BC-B5DF-4193-9B01-6D0BBE101BD7}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
545557
EndGlobalSection
546558
GlobalSection(SolutionProperties) = preSolution
547559
HideSolutionNode = FALSE
1.39 MB
Binary file not shown.
698 KB
Binary file not shown.
1.09 MB
Binary file not shown.
36.8 KB
Binary file not shown.
1.66 MB
Binary file not shown.
552 KB
Binary file not shown.
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
using System;
2-
using System.Collections.ObjectModel;
3-
using System.Diagnostics.CodeAnalysis;
4-
using System.Reactive;
1+
using System.Diagnostics.CodeAnalysis;
2+
using System.Threading.Tasks;
53
using GitHub.ViewModels;
64
using ReactiveUI;
75

86
namespace GitHub.SampleData
97
{
108
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
11-
public class CommentThreadViewModelDesigner : ICommentThreadViewModel
9+
public class CommentThreadViewModelDesigner : ViewModelBase, ICommentThreadViewModel
1210
{
13-
public ObservableCollection<ICommentViewModel> Comments { get; }
14-
= new ObservableCollection<ICommentViewModel>();
11+
public IReadOnlyReactiveList<ICommentViewModel> Comments { get; }
12+
= new ReactiveList<ICommentViewModel>();
1513

1614
public IActorViewModel CurrentUser { get; set; }
1715
= new ActorViewModel { Login = "shana" };
1816

19-
public ReactiveCommand<string, Unit> PostComment { get; }
20-
public ReactiveCommand<Tuple<string, string>, Unit> EditComment { get; }
21-
public ReactiveCommand<Tuple<int, int>, Unit> DeleteComment { get; }
17+
public Task DeleteComment(int pullRequestId, int commentId) => Task.CompletedTask;
18+
public Task EditComment(string id, string body) => Task.CompletedTask;
19+
public Task PostComment(string body) => Task.CompletedTask;
2220
}
2321
}

src/GitHub.App/SampleData/CommentViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public CommentViewModelDesigner()
2424
public bool IsSubmitting { get; set; }
2525
public bool CanDelete { get; } = true;
2626
public ICommentThreadViewModel Thread { get; }
27-
public DateTimeOffset UpdatedAt => DateTime.Now.Subtract(TimeSpan.FromDays(3));
27+
public DateTimeOffset CreatedAt => DateTime.Now.Subtract(TimeSpan.FromDays(3));
2828
public IActorViewModel Author { get; set; }
2929
public Uri WebUrl { get; }
3030

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,53 @@
1-
using System;
2-
using System.Collections.ObjectModel;
3-
using System.Reactive;
1+
using System.ComponentModel.Composition;
2+
using System.Threading.Tasks;
43
using GitHub.Extensions;
54
using GitHub.Models;
6-
using GitHub.ViewModels;
75
using ReactiveUI;
86

9-
namespace GitHub.InlineReviews.ViewModels
7+
namespace GitHub.ViewModels
108
{
119
/// <summary>
1210
/// Base view model for a thread of comments.
1311
/// </summary>
1412
public abstract class CommentThreadViewModel : ReactiveObject, ICommentThreadViewModel
1513
{
16-
ReactiveCommand<string, Unit> postComment;
17-
ReactiveCommand<Tuple<string, string>, Unit> editComment;
18-
ReactiveCommand<Tuple<int, int>, Unit> deleteComment;
14+
readonly ReactiveList<ICommentViewModel> comments = new ReactiveList<ICommentViewModel>();
15+
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="CommentThreadViewModel"/> class.
18+
/// </summary>
19+
[ImportingConstructor]
20+
public CommentThreadViewModel()
21+
{
22+
}
1923

2024
/// <summary>
2125
/// Intializes a new instance of the <see cref="CommentThreadViewModel"/> class.
2226
/// </summary>
2327
/// <param name="currentUser">The current user.</param>
24-
protected CommentThreadViewModel(ActorModel currentUser)
28+
protected Task InitializeAsync(ActorModel currentUser)
2529
{
2630
Guard.ArgumentNotNull(currentUser, nameof(currentUser));
27-
28-
Comments = new ObservableCollection<ICommentViewModel>();
2931
CurrentUser = new ActorViewModel(currentUser);
32+
return Task.CompletedTask;
3033
}
3134

3235
/// <inheritdoc/>
33-
public ObservableCollection<ICommentViewModel> Comments { get; }
36+
public IReactiveList<ICommentViewModel> Comments => comments;
3437

3538
/// <inheritdoc/>
36-
public ReactiveCommand<string, Unit> PostComment
37-
{
38-
get { return postComment; }
39-
protected set
40-
{
41-
Guard.ArgumentNotNull(value, nameof(value));
42-
postComment = value;
43-
44-
// We want to ignore thrown exceptions from PostComment - the error should be handled
45-
// by the CommentViewModel that trigged PostComment.Execute();
46-
value.ThrownExceptions.Subscribe(_ => { });
47-
}
48-
}
39+
public IActorViewModel CurrentUser { get; private set; }
4940

50-
public ReactiveCommand<Tuple<string, string>, Unit> EditComment
51-
{
52-
get { return editComment; }
53-
protected set
54-
{
55-
Guard.ArgumentNotNull(value, nameof(value));
56-
editComment = value;
57-
58-
value.ThrownExceptions.Subscribe(_ => { });
59-
}
60-
}
41+
/// <inheritdoc/>
42+
IReadOnlyReactiveList<ICommentViewModel> ICommentThreadViewModel.Comments => comments;
6143

62-
public ReactiveCommand<Tuple<int, int>, Unit> DeleteComment
63-
{
64-
get { return deleteComment; }
65-
protected set
66-
{
67-
Guard.ArgumentNotNull(value, nameof(value));
68-
deleteComment = value;
44+
/// <inheritdoc/>
45+
public abstract Task PostComment(string body);
6946

70-
value.ThrownExceptions.Subscribe(_ => { });
71-
}
72-
}
47+
/// <inheritdoc/>
48+
public abstract Task EditComment(string id, string body);
7349

7450
/// <inheritdoc/>
75-
public IActorViewModel CurrentUser { get; }
51+
public abstract Task DeleteComment(int pullRequestId, int commentId);
7652
}
7753
}

0 commit comments

Comments
 (0)