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

Commit 657292e

Browse files
Renaming models and adding InlineAnnotationViewModel
1 parent a9d69db commit 657292e

22 files changed

+114
-90
lines changed

src/GitHub.InlineReviews/GitHub.InlineReviews.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<Compile Include="Peek\InlineCommentPeekResultPresentation.cs" />
103103
<Compile Include="Peek\InlineCommentPeekResultPresenter.cs" />
104104
<Compile Include="Properties\AssemblyInfo.cs" />
105-
<Compile Include="SampleData\CommentThreadViewModelDesigner.cs" />
105+
<Compile Include="SampleData\InlineReviewViewModelDesigner.cs" />
106106
<Compile Include="Services\IInlineCommentPeekService.cs" />
107107
<Compile Include="Services\IPullRequestSessionService.cs" />
108108
<Compile Include="Services\InlineCommentPeekService.cs" />
@@ -118,11 +118,11 @@
118118
</Compile>
119119
<Compile Include="ViewModels\PullRequestFileMarginViewModel.cs" />
120120
<Compile Include="ViewModels\CommentViewModel.cs" />
121-
<Compile Include="ViewModels\ICommentThreadViewModel.cs" />
122-
<Compile Include="ViewModels\CommentThreadViewModel.cs" />
123-
<Compile Include="ViewModels\InlineCommentPeekViewModel.cs" />
121+
<Compile Include="ViewModels\IInlineReviewViewModel.cs" />
122+
<Compile Include="ViewModels\InlineReviewViewModel.cs" />
123+
<Compile Include="ViewModels\InlineReviewPeekViewModel.cs" />
124124
<Compile Include="ViewModels\IPullRequestReviewCommentViewModel.cs" />
125-
<Compile Include="ViewModels\NewInlineCommentThreadViewModel.cs" />
125+
<Compile Include="ViewModels\NewCommentThreadInlineReviewViewModel.cs" />
126126
<Compile Include="ViewModels\PullRequestReviewCommentViewModel.cs" />
127127
<Compile Include="ViewModels\PullRequestStatusViewModel.cs" />
128128
<Compile Include="Views\PullRequestFileMarginView.xaml.cs">
@@ -149,7 +149,7 @@
149149
<Compile Include="Tags\ShowInlineTag.cs" />
150150
<Compile Include="Tags\InlineTagger.cs" />
151151
<Compile Include="Tags\InlineCommentTaggerProvider.cs" />
152-
<Compile Include="ViewModels\InlineCommentThreadViewModel.cs" />
152+
<Compile Include="ViewModels\CommentThreadInlineReviewViewModel.cs" />
153153
<Compile Include="ViewModels\ICommentViewModel.cs" />
154154
<Compile Include="Views\CommentThreadView.xaml.cs">
155155
<DependentUpon>CommentThreadView.xaml</DependentUpon>

src/GitHub.InlineReviews/Peek/InlineCommentPeekResult.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace GitHub.InlineReviews.Peek
77
{
88
sealed class InlineCommentPeekResult : IPeekResult
99
{
10-
public InlineCommentPeekResult(InlineCommentPeekViewModel viewModel)
10+
public InlineCommentPeekResult(InlineReviewPeekViewModel viewModel)
1111
{
1212
Guard.ArgumentNotNull(viewModel, nameof(viewModel));
1313

1414
this.ViewModel = viewModel;
1515
}
1616

1717
public bool CanNavigateTo => true;
18-
public InlineCommentPeekViewModel ViewModel { get; }
18+
public InlineReviewPeekViewModel ViewModel { get; }
1919

2020
public IPeekResultDisplayInfo DisplayInfo { get; }
2121
= new PeekResultDisplayInfo("Review", null, "GitHub Review", "GitHub Review");

src/GitHub.InlineReviews/Peek/InlineCommentPeekResultPresentation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ namespace GitHub.InlineReviews.Peek
99
class InlineCommentPeekResultPresentation : IPeekResultPresentation, IDesiredHeightProvider
1010
{
1111
const double PeekBorders = 28.0;
12-
readonly InlineCommentPeekViewModel viewModel;
12+
readonly InlineReviewPeekViewModel viewModel;
1313
InlineCommentPeekView view;
1414
double desiredHeight;
1515

1616
public bool IsDirty => false;
1717
public bool IsReadOnly => true;
1818

19-
public InlineCommentPeekResultPresentation(InlineCommentPeekViewModel viewModel)
19+
public InlineCommentPeekResultPresentation(InlineReviewPeekViewModel viewModel)
2020
{
2121
this.viewModel = viewModel;
2222
}

src/GitHub.InlineReviews/Peek/InlineCommentPeekableItem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ namespace GitHub.InlineReviews.Peek
77
{
88
class InlineCommentPeekableItem : IPeekableItem
99
{
10-
public InlineCommentPeekableItem(InlineCommentPeekViewModel viewModel)
10+
public InlineCommentPeekableItem(InlineReviewPeekViewModel viewModel)
1111
{
1212
ViewModel = viewModel;
1313
}
1414

1515
public string DisplayName => "GitHub Code Review";
16-
public InlineCommentPeekViewModel ViewModel { get; }
16+
public InlineReviewPeekViewModel ViewModel { get; }
1717

1818
public IEnumerable<IPeekRelationship> Relationships => new[] { InlineCommentPeekRelationship.Instance };
1919

src/GitHub.InlineReviews/Peek/InlineCommentPeekableItemSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void AugmentPeekSession(IPeekSession session, IList<IPeekableItem> peekab
3535
{
3636
if (session.RelationshipName == InlineCommentPeekRelationship.Instance.Name)
3737
{
38-
var viewModel = new InlineCommentPeekViewModel(
38+
var viewModel = new InlineReviewPeekViewModel(
3939
peekService,
4040
session,
4141
sessionManager,

src/GitHub.InlineReviews/Peek/InlineCommentPeekableResultSource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ namespace GitHub.InlineReviews.Peek
77
{
88
class InlineCommentPeekableResultSource : IPeekResultSource
99
{
10-
readonly InlineCommentPeekViewModel viewModel;
10+
readonly InlineReviewPeekViewModel viewModel;
1111

12-
public InlineCommentPeekableResultSource(InlineCommentPeekViewModel viewModel)
12+
public InlineCommentPeekableResultSource(InlineReviewPeekViewModel viewModel)
1313
{
1414
this.viewModel = viewModel;
1515
}

src/GitHub.InlineReviews/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 IsReadOnly { get; set; }
2525
public bool IsSubmitting { get; set; }
2626
public bool CanDelete { get; } = true;
27-
public ICommentThreadViewModel Thread { get; }
27+
public IInlineReviewViewModel Thread { get; }
2828
public DateTimeOffset UpdatedAt => DateTime.Now.Subtract(TimeSpan.FromDays(3));
2929
public IActorViewModel Author { get; set; }
3030
public Uri WebUrl { get; }

src/GitHub.InlineReviews/SampleData/CommentThreadViewModelDesigner.cs renamed to src/GitHub.InlineReviews/SampleData/InlineReviewViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace GitHub.InlineReviews.SampleData
1111
{
1212
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
13-
class CommentThreadViewModelDesigner : ICommentThreadViewModel
13+
class InlineReviewViewModelDesigner : IInlineReviewViewModel
1414
{
1515
public ObservableCollection<ICommentViewModel> Comments { get; }
1616
= new ObservableCollection<ICommentViewModel>();

src/GitHub.InlineReviews/ViewModels/InlineCommentThreadViewModel.cs renamed to src/GitHub.InlineReviews/ViewModels/CommentThreadInlineReviewViewModel.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ namespace GitHub.InlineReviews.ViewModels
1414
/// <summary>
1515
/// A thread of inline comments (aka Pull Request Review Comments).
1616
/// </summary>
17-
public class InlineCommentThreadViewModel : CommentThreadViewModel
17+
public class CommentThreadInlineReviewViewModel : InlineReviewViewModel
1818
{
1919
/// <summary>
20-
/// Initializes a new instance of the <see cref="InlineCommentThreadViewModel"/> class.
20+
/// Initializes a new instance of the <see cref="CommentThreadInlineReviewViewModel"/> class.
2121
/// </summary>
2222
/// <param name="commentService">The comment service</param>
2323
/// <param name="session">The current PR review session.</param>
24+
/// <param name="annotationModels"></param>
2425
/// <param name="comments">The comments to display in this inline review.</param>
25-
public InlineCommentThreadViewModel(ICommentService commentService, IPullRequestSession session,
26+
public CommentThreadInlineReviewViewModel(ICommentService commentService, IPullRequestSession session,
27+
InlineAnnotationViewModel[] annotationModels,
2628
IEnumerable<InlineCommentModel> comments)
27-
: base(session.User)
29+
: base(session.User, annotationModels)
2830
{
2931
Guard.ArgumentNotNull(session, nameof(session));
3032

src/GitHub.InlineReviews/ViewModels/CommentViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class CommentViewModel : ReactiveObject, ICommentViewModel
4646
/// <param name="webUrl"></param>
4747
protected CommentViewModel(
4848
ICommentService commentService,
49-
ICommentThreadViewModel thread,
49+
IInlineReviewViewModel thread,
5050
IActorViewModel currentUser,
5151
int pullRequestId,
5252
string commentId,
@@ -114,7 +114,7 @@ protected CommentViewModel(
114114
/// <param name="model">The comment model.</param>
115115
protected CommentViewModel(
116116
ICommentService commentService,
117-
ICommentThreadViewModel thread,
117+
IInlineReviewViewModel thread,
118118
ActorModel currentUser,
119119
CommentModel model)
120120
: this(
@@ -270,7 +270,7 @@ public DateTimeOffset UpdatedAt
270270
public IActorViewModel CurrentUser { get; }
271271

272272
/// <inheritdoc/>
273-
public ICommentThreadViewModel Thread { get; }
273+
public IInlineReviewViewModel Thread { get; }
274274

275275
/// <inheritdoc/>
276276
public IActorViewModel Author { get; }

0 commit comments

Comments
 (0)