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

Commit 6cc105b

Browse files
authored
Merge branch 'master' into fixes/969-missing-automation-ids
2 parents 8fa7d9c + ad6b434 commit 6cc105b

File tree

62 files changed

+836
-1400
lines changed

Some content is hidden

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

62 files changed

+836
-1400
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ProjectConfiguration>
2+
<Settings>
3+
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully>
4+
</Settings>
5+
</ProjectConfiguration>

GitHubVS.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ Global
231231
{E4ED0537-D1D9-44B6-9212-3096D7C3F7A1}.Release|x86.ActiveCfg = Release|Any CPU
232232
{E4ED0537-D1D9-44B6-9212-3096D7C3F7A1}.Release|x86.Build.0 = Release|Any CPU
233233
{B1F5C227-456F-437D-BD5F-4C11B7A8D1A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
234+
{B1F5C227-456F-437D-BD5F-4C11B7A8D1A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
234235
{B1F5C227-456F-437D-BD5F-4C11B7A8D1A0}.Debug|x86.ActiveCfg = Debug|Any CPU
235236
{B1F5C227-456F-437D-BD5F-4C11B7A8D1A0}.Debug|x86.Build.0 = Debug|Any CPU
236237
{B1F5C227-456F-437D-BD5F-4C11B7A8D1A0}.Publish|Any CPU.ActiveCfg = Release|Any CPU

GitHubVS.v3.ncrunchsolution

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
</AdditionalFilesForGridProcessing>
77
<AdditionalFilesToIncludeForSolution>
88
<Value>lib\**.*</Value>
9+
<Value>packages\Brutal.Dev.StrongNameSigner.2.1.3\build\**.*</Value>
910
</AdditionalFilesToIncludeForSolution>
1011
<AllowParallelTestExecution>False</AllowParallelTestExecution>
1112
<ProjectConfigStoragePathRelativeToSolutionDir>.ncrunch</ProjectConfigStoragePathRelativeToSolutionDir>

src/GitHub.App/GitHub.App.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
<ItemGroup>
135135
<Compile Include="Models\IssueCommentModel.cs" />
136136
<Compile Include="Models\PullRequestReviewCommentModel.cs" />
137+
<Compile Include="Models\PullRequestDetailArgument.cs" />
137138
<Compile Include="ViewModels\ViewModelBase.cs" />
138139
<None Include="..\..\script\Key.snk" Condition="$(Buildtype) == 'Internal'">
139140
<Link>Key.snk</Link>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using GitHub.ViewModels;
3+
4+
namespace GitHub.Models
5+
{
6+
/// <summary>
7+
/// Passes arguments to a <see cref="PullRequestDetailViewModel"/>
8+
/// </summary>
9+
public class PullRequestDetailArgument
10+
{
11+
/// <summary>
12+
/// Gets or sets the repository containing the pull request.
13+
/// </summary>
14+
public IRemoteRepositoryModel Repository { get; set; }
15+
16+
/// <summary>
17+
/// Gets or sets the number of the pull request.
18+
/// </summary>
19+
public int Number { get; set; }
20+
}
21+
}

src/GitHub.App/Models/RemoteRepositoryModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class RemoteRepositoryModel : RepositoryModel, IRemoteRepositoryModel,
2020
/// <param name="isPrivate">Whether the repository is private.</param>
2121
/// <param name="isFork">Whether the repository is a fork.</param>
2222
/// <param name="ownerAccount">The repository owner account.</param>
23-
public RemoteRepositoryModel(long id, string name, UriString cloneUrl, bool isPrivate, bool isFork, IAccount ownerAccount)
23+
/// <param name="parent">The parent repository if this repository is a fork.</param>
24+
public RemoteRepositoryModel(long id, string name, UriString cloneUrl, bool isPrivate, bool isFork, IAccount ownerAccount, IRemoteRepositoryModel parent)
2425
: base(name, cloneUrl)
2526
{
2627
Guard.ArgumentNotEmptyString(name, nameof(name));
@@ -33,6 +34,7 @@ public RemoteRepositoryModel(long id, string name, UriString cloneUrl, bool isPr
3334
// this is an assumption, we'd have to load the repo information from octokit to know for sure
3435
// probably not worth it for this ctor
3536
DefaultBranch = new BranchModel("master", this);
37+
Parent = parent;
3638
}
3739

3840
/// <summary>

src/GitHub.App/SampleData/PullRequestDetailViewModelDesigner.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public PullRequestDetailViewModelDesigner()
7373

7474
public IPullRequestModel Model { get; }
7575
public IPullRequestSession Session { get; }
76-
public ILocalRepositoryModel Repository { get; }
76+
public ILocalRepositoryModel LocalRepository { get; }
77+
public IRemoteRepositoryModel RemoteRepository { get; }
7778
public string SourceBranchDisplayName { get; set; }
7879
public string TargetBranchDisplayName { get; set; }
7980
public int CommentCount { get; set; }

src/GitHub.App/SampleData/PullRequestListViewModelDesigner.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public PullRequestListViewModelDesigner()
5555
SelectedAuthor = Authors.ElementAt(1);
5656
}
5757

58+
public IReadOnlyList<IRemoteRepositoryModel> Repositories { get; }
59+
public IRemoteRepositoryModel SelectedRepository { get; set; }
60+
5861
public ITrackingCollection<IPullRequestModel> PullRequests { get; set; }
5962
public IPullRequestModel SelectedPullRequest { get; set; }
6063

@@ -63,6 +66,8 @@ public PullRequestListViewModelDesigner()
6366

6467
public ObservableCollection<IAccount> Authors { get; set; }
6568
public IAccount SelectedAuthor { get; set; }
69+
public bool RepositoryIsFork { get; set; } = true;
70+
public bool ShowPullRequestsForFork { get; set; }
6671

6772
public ObservableCollection<IAccount> Assignees { get; set; }
6873
public IAccount SelectedAssignee { get; set; }

src/GitHub.App/SampleData/SampleViewModels.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public static IRemoteRepositoryModel Create(string name = null, string owner = n
321321
{
322322
name = name ?? "octocat";
323323
owner = owner ?? "github";
324-
return new RemoteRepositoryModel(0, name, new UriString("http://github.com/" + name + "/" + owner), false, false, new AccountDesigner() { Login = owner });
324+
return new RemoteRepositoryModel(0, name, new UriString("http://github.com/" + name + "/" + owner), false, false, new AccountDesigner() { Login = owner }, null);
325325
}
326326
}
327327

src/GitHub.App/Services/AvatarProvider.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
using System;
2+
using System.IO.Packaging;
23
using System.ComponentModel.Composition;
34
using System.Diagnostics;
45
using System.Reactive;
56
using System.Reactive.Linq;
6-
using System.Windows;
77
using System.Windows.Media.Imaging;
88
using Akavache;
99
using GitHub.Caches;
1010
using GitHub.Extensions;
1111
using GitHub.Models;
12+
using System.Windows;
1213

1314
namespace GitHub.Services
1415
{
@@ -24,13 +25,9 @@ public class AvatarProvider : IAvatarProvider
2425

2526
static AvatarProvider()
2627
{
27-
// NB: If this isn't explicitly set, WPF will try to guess it via
28-
// GetEntryAssembly, which in a unit test runner will be null
29-
// This is needed for the pack:// URL format to be understood.
30-
if (Application.ResourceAssembly == null)
31-
{
32-
Application.ResourceAssembly = typeof(AvatarProvider).Assembly;
33-
}
28+
// Calling `Application.Current` will install pack URI scheme via Application.cctor.
29+
// This is needed when unit testing for the pack:// URL format to be understood.
30+
if (Application.Current != null) { }
3431
}
3532

3633
[ImportingConstructor]
@@ -71,7 +68,7 @@ public IObservable<BitmapSource> GetAvatar(IAvatarContainer apiAccount)
7168
return imageCache.GetImage(avatarUrl)
7269
.Catch<BitmapSource, Exception>(_ => Observable.Return(DefaultAvatar(apiAccount)));
7370
}
74-
71+
7572
public IObservable<Unit> InvalidateAvatar(IAvatarContainer apiAccount)
7673
{
7774
return String.IsNullOrWhiteSpace(apiAccount?.Login)
@@ -87,7 +84,7 @@ BitmapImage DefaultAvatar(IAvatarContainer apiAccount)
8784
}
8885

8986
protected virtual void Dispose(bool disposing)
90-
{}
87+
{ }
9188

9289
public void Dispose()
9390
{

0 commit comments

Comments
 (0)