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
Display an "Add comment" box at the bottom of a PR.
- Loading branch information
commit abeb1b8f125e6f46bd03cc04481c35a70aae543b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/GitHub.App/ViewModels/Documents/IIssueishCommentViewModel.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Reactive; | ||
using System.Threading.Tasks; | ||
using GitHub.Models; | ||
using ReactiveUI; | ||
|
||
namespace GitHub.ViewModels.Documents | ||
{ | ||
/// <summary> | ||
/// View model for comments on an issue or pull request. | ||
/// </summary> | ||
public interface IIssueishCommentViewModel : ICommentViewModel | ||
{ | ||
/// <summary> | ||
/// Gets a value indicating whether the comment will show a | ||
/// a button for <see cref="CloseIssueish"/>. | ||
/// </summary> | ||
bool CanCloseIssueish { get; } | ||
|
||
/// <summary> | ||
/// Gets a a caption for the <see cref="CloseIssueish"/> command. | ||
/// </summary> | ||
string CloseIssueishCaption { get; } | ||
|
||
/// <summary> | ||
/// Gets a command which when executed will close the issue or pull request. | ||
/// </summary> | ||
ReactiveCommand<Unit, Unit> CloseIssueish { get; } | ||
|
||
/// <summary> | ||
/// Initializes the view model with data. | ||
/// </summary> | ||
/// <param name="thread">The thread that the comment is a part of.</param> | ||
/// <param name="currentUser">The current user.</param> | ||
/// <param name="comment">The comment model. May be null.</param> | ||
/// <param name="closeCaption"> | ||
/// The caption for the <see cref="CloseIssueish"/> command, or null if the user cannot | ||
/// close the issue/pr from this comment. | ||
/// </param> | ||
Task InitializeAsync( | ||
ICommentThreadViewModel thread, | ||
ActorModel currentUser, | ||
CommentModel comment, | ||
string closeCaption); | ||
} | ||
} |
86 changes: 0 additions & 86 deletions
86
src/GitHub.App/ViewModels/Documents/IssueishCommentThreadViewModel.cs
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
src/GitHub.App/ViewModels/Documents/IssueishCommentViewModel.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Reactive; | ||
using System.Threading.Tasks; | ||
using GitHub.Models; | ||
using GitHub.Services; | ||
using ReactiveUI; | ||
|
||
namespace GitHub.ViewModels.Documents | ||
{ | ||
/// <summary> | ||
/// View model for comments on an issue or pull request. | ||
/// </summary> | ||
[Export(typeof(IIssueishCommentViewModel))] | ||
[PartCreationPolicy(CreationPolicy.NonShared)] | ||
public class IssueishCommentViewModel : CommentViewModel, IIssueishCommentViewModel | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CommentViewModel"/> class. | ||
/// </summary> | ||
/// <param name="commentService">The comment service.</param> | ||
[ImportingConstructor] | ||
public IssueishCommentViewModel(ICommentService commentService) | ||
: base(commentService) | ||
{ | ||
} | ||
|
||
/// <inheritdoc/> | ||
public bool CanCloseIssueish { get; private set; } | ||
|
||
/// <inheritdoc/> | ||
public string CloseIssueishCaption { get; private set; } | ||
|
||
/// <inheritdoc/> | ||
public ReactiveCommand<Unit, Unit> CloseIssueish { get; } | ||
|
||
/// <inheritdoc/> | ||
public async Task InitializeAsync( | ||
ICommentThreadViewModel thread, | ||
ActorModel currentUser, | ||
CommentModel comment, | ||
string closeCaption) | ||
{ | ||
await base.InitializeAsync( | ||
thread, | ||
currentUser, | ||
comment, | ||
comment == null ? CommentEditState.Editing : CommentEditState.None) | ||
.ConfigureAwait(true); | ||
|
||
CanCloseIssueish = closeCaption != null; | ||
CloseIssueishCaption = closeCaption; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request conversation view #2017
Uh oh!
There was an error while loading. Please reload this page.
Pull Request conversation view #2017
Changes from 1 commit
38cae06
50b04ac
cfb1dd3
02bc4ee
102e337
424439d
f976412
abeb1b8
b724525
d296739
0b91c87
1200c4c
057c4e4
fe66df5
a8d4da6
d246ad2
6165f30
996aac3
6da33e6
c3f9778
1308c0e
6e88e35
8697cb7
624b5be
d7d5969
d12b441
a03c85f
aeb7c45
b508e6a
39d0b5f
b317753
7ebcfb9
815ee14
7535c64
1d57ce8
8340942
7b6a032
5308404
01676fe
ed0b3a4
448ccac
3ca7340
2ae522c
4edf726
6ac2d95
8f327c2
dc8a865
5be7e2f
72fb28b
e307b36
d3caa17
abb4661
a28d75a
b1b49a3
e10d6fb
84dd7ff
08bfdc9
d8cf315
d05a0ce
8e42868
4bdfa13
c8579c8
5958982
5702cb3
e504484
ae6935a
17f3f93
3f43625
abce76d
a8df4e6
fd9eab5
f144895
89f33ac
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.