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

Commit e19d3c1

Browse files
committed
Merge branch 'refactor/pr-models' into refactor/pr-list
2 parents f1c3255 + 10d1cf2 commit e19d3c1

File tree

6 files changed

+28
-10
lines changed

6 files changed

+28
-10
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.5.3.{build}'
1+
version: '2.5.4.{build}'
22
skip_tags: true
33
install:
44
- ps: |

src/GitHub.InlineReviews/ViewModels/CommentViewModel.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class CommentViewModel : ReactiveObject, ICommentViewModel
2525
CommentEditState state;
2626
DateTimeOffset updatedAt;
2727
string undoBody;
28-
bool canDelete;
28+
ObservableAsPropertyHelper<bool> canDelete;
2929

3030
/// <summary>
3131
/// Initializes a new instance of the <see cref="CommentViewModel"/> class.
@@ -60,13 +60,13 @@ protected CommentViewModel(
6060
UpdatedAt = updatedAt;
6161
WebUrl = webUrl;
6262

63-
var canDelete = this.WhenAnyValue(
63+
var canDeleteObservable = this.WhenAnyValue(
6464
x => x.EditState,
6565
x => x == CommentEditState.None && author.Login == currentUser.Login);
6666

67-
canDelete.ToProperty(this, x => x.CanDelete);
67+
canDelete = canDeleteObservable.ToProperty(this, x => x.CanDelete);
6868

69-
Delete = ReactiveCommand.CreateAsyncTask(canDelete, DoDelete);
69+
Delete = ReactiveCommand.CreateAsyncTask(canDeleteObservable, DoDelete);
7070

7171
var canEdit = this.WhenAnyValue(
7272
x => x.EditState,
@@ -144,6 +144,7 @@ void DoBeginEdit(object unused)
144144
{
145145
if (state != CommentEditState.Editing)
146146
{
147+
ErrorMessage = null;
147148
undoBody = Body;
148149
EditState = CommentEditState.Editing;
149150
}
@@ -228,8 +229,7 @@ public bool IsSubmitting
228229

229230
public bool CanDelete
230231
{
231-
get { return canDelete; }
232-
private set { this.RaiseAndSetIfChanged(ref canDelete, value); }
232+
get { return canDelete.Value; }
233233
}
234234

235235
/// <inheritdoc/>

src/GitHub.InlineReviews/Views/CommentView.xaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,23 @@
9494
Margin="0 2 0 0"
9595
Foreground="{DynamicResource VsBrush.WindowText}"
9696
Markdown="{Binding Body}"/>
97+
98+
<DockPanel Grid.Column="1" Grid.Row="2"
99+
Margin="0 4"
100+
HorizontalAlignment="Left"
101+
TextBlock.Foreground="Red">
102+
<DockPanel.Style>
103+
<Style TargetType="FrameworkElement">
104+
<Style.Triggers>
105+
<DataTrigger Binding="{Binding ErrorMessage}" Value="{x:Null}">
106+
<Setter Property="Visibility" Value="Collapsed"/>
107+
</DataTrigger>
108+
</Style.Triggers>
109+
</Style>
110+
</DockPanel.Style>
111+
<ui:OcticonImage DockPanel.Dock="Left" Icon="alert" Margin="0 0 4 0"/>
112+
<TextBlock Text="{Binding ErrorMessage}" TextWrapping="Wrap"/>
113+
</DockPanel>
97114
</StackPanel>
98115

99116
<!-- Displays edit view or a reply placeholder-->

src/GitHub.VisualStudio/source.extension.vsixmanifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="c3d3dc68-c977-411f-b3e8-03b0dccf7dfc" Version="2.5.3.0" Language="en-US" Publisher="GitHub, Inc" />
4+
<Identity Id="c3d3dc68-c977-411f-b3e8-03b0dccf7dfc" Version="2.5.4.0" Language="en-US" Publisher="GitHub, Inc" />
55
<DisplayName>GitHub Extension for Visual Studio</DisplayName>
66
<Description xml:space="preserve">A Visual Studio Extension that brings the GitHub Flow into Visual Studio.</Description>
77
<PackageId>GitHub.VisualStudio</PackageId>
@@ -39,4 +39,4 @@
3939
<Prerequisites>
4040
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0.25824.0,16.0)" DisplayName="Visual Studio core editor" />
4141
</Prerequisites>
42-
</PackageManifest>
42+
</PackageManifest>

src/common/SolutionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
namespace System
1919
{
2020
internal static class AssemblyVersionInformation {
21-
internal const string Version = "2.5.3.0";
21+
internal const string Version = "2.5.4.0";
2222
}
2323
}

test/GitHub.InlineReviews.UnitTests/Services/PullRequestSessionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace GitHub.InlineReviews.UnitTests.Services
1818
public class PullRequestSessionTests
1919
{
2020
const int PullRequestNumber = 5;
21+
const string PullRequestNodeId = "pull_request_id";
2122
const string RepoUrl = "https://foo.bar/owner/repo";
2223
const string FilePath = "test.cs";
2324

0 commit comments

Comments
 (0)