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

Commit d5ddf0d

Browse files
authored
Merge pull request #1712 from github/refactor/pr-models
Refactoring Pull Request Models.
2 parents 9e03d68 + d1bc28c commit d5ddf0d

File tree

100 files changed

+2281
-2288
lines changed

Some content is hidden

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

100 files changed

+2281
-2288
lines changed
-161 KB
Binary file not shown.
176 KB
Binary file not shown.

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
<HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
5252
<Private>True</Private>
5353
</Reference>
54-
<Reference Include="Octokit.GraphQL, Version=0.0.2.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
55-
<HintPath>..\..\packages\Octokit.GraphQL.0.0.2-alpha\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
54+
<Reference Include="Octokit.GraphQL, Version=0.0.4.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
55+
<HintPath>..\..\packages\Octokit.GraphQL.0.0.4-alpha\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
5656
<Private>True</Private>
5757
</Reference>
58-
<Reference Include="Octokit.GraphQL.Core, Version=0.0.2.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
59-
<HintPath>..\..\packages\Octokit.GraphQL.0.0.2-alpha\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
58+
<Reference Include="Octokit.GraphQL.Core, Version=0.0.4.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
59+
<HintPath>..\..\packages\Octokit.GraphQL.0.0.4-alpha\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
6060
<Private>True</Private>
6161
</Reference>
6262
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">

src/GitHub.Api/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
4-
<package id="Octokit.GraphQL" version="0.0.2-alpha" targetFramework="net461" />
4+
<package id="Octokit.GraphQL" version="0.0.4-alpha" targetFramework="net461" />
55
<package id="Serilog" version="2.5.0" targetFramework="net461" />
66
</packages>

src/GitHub.App/Factories/ModelServiceFactory.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace GitHub.Factories
1616
public sealed class ModelServiceFactory : IModelServiceFactory, IDisposable
1717
{
1818
readonly IApiClientFactory apiClientFactory;
19-
readonly IGraphQLClientFactory graphQLClientFactory;
2019
readonly IHostCacheFactory hostCacheFactory;
2120
readonly IAvatarProvider avatarProvider;
2221
readonly Dictionary<IConnection, ModelService> cache = new Dictionary<IConnection, ModelService>();
@@ -25,12 +24,10 @@ public sealed class ModelServiceFactory : IModelServiceFactory, IDisposable
2524
[ImportingConstructor]
2625
public ModelServiceFactory(
2726
IApiClientFactory apiClientFactory,
28-
IGraphQLClientFactory graphQLClientFactory,
2927
IHostCacheFactory hostCacheFactory,
3028
IAvatarProvider avatarProvider)
3129
{
3230
this.apiClientFactory = apiClientFactory;
33-
this.graphQLClientFactory = graphQLClientFactory;
3431
this.hostCacheFactory = hostCacheFactory;
3532
this.avatarProvider = avatarProvider;
3633
}
@@ -47,7 +44,6 @@ public async Task<IModelService> CreateAsync(IConnection connection)
4744
{
4845
result = new ModelService(
4946
await apiClientFactory.Create(connection.HostAddress),
50-
await graphQLClientFactory.CreateConnection(connection.HostAddress),
5147
await hostCacheFactory.Create(connection.HostAddress),
5248
avatarProvider);
5349
result.InsertUser(AccountCacheItem.Create(connection.User));

src/GitHub.App/GitHub.App.csproj

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@
145145
<HintPath>..\..\packages\Microsoft.VisualStudio.Utilities.14.3.25407\lib\net45\Microsoft.VisualStudio.Utilities.dll</HintPath>
146146
<Private>True</Private>
147147
</Reference>
148-
<Reference Include="Octokit.GraphQL, Version=0.0.2.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
149-
<HintPath>..\..\packages\Octokit.GraphQL.0.0.2-alpha\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
148+
<Reference Include="Octokit.GraphQL, Version=0.0.4.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
149+
<HintPath>..\..\packages\Octokit.GraphQL.0.0.4-alpha\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
150150
<Private>True</Private>
151151
</Reference>
152-
<Reference Include="Octokit.GraphQL.Core, Version=0.0.2.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
153-
<HintPath>..\..\packages\Octokit.GraphQL.0.0.2-alpha\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
152+
<Reference Include="Octokit.GraphQL.Core, Version=0.0.4.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
153+
<HintPath>..\..\packages\Octokit.GraphQL.0.0.4-alpha\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
154154
<Private>True</Private>
155155
</Reference>
156156
<Reference Include="PresentationCore" />
@@ -209,12 +209,10 @@
209209
<Compile Include="Commands\UsageTrackingCommand.cs" />
210210
<Compile Include="Factories\ViewViewModelFactory.cs" />
211211
<Compile Include="Factories\ModelServiceFactory.cs" />
212-
<Compile Include="Models\IssueCommentModel.cs" />
213-
<Compile Include="Models\PullRequestReviewCommentModel.cs" />
214212
<Compile Include="Models\PullRequestDetailArgument.cs" />
213+
<Compile Include="Models\PullRequestModel.cs" />
215214
<Compile Include="SampleData\ForkRepositoryExecuteViewModelDesigner.cs" />
216215
<Compile Include="SampleData\ForkRepositorySelectViewModelDesigner.cs" />
217-
<Compile Include="Models\PullRequestReviewModel.cs" />
218216
<Compile Include="SampleData\GitServiceDesigner.cs" />
219217
<Compile Include="SampleData\ForkRepositorySwitchViewModelDesigner.cs" />
220218
<Compile Include="SampleData\PullRequestFilesViewModelDesigner.cs" />
@@ -225,6 +223,7 @@
225223
<Compile Include="Services\EnterpriseCapabilitiesService.cs" />
226224
<Compile Include="Services\GlobalConnection.cs" />
227225
<Compile Include="Services\RepositoryForkService.cs" />
226+
<Compile Include="ViewModels\ActorViewModel.cs" />
228227
<Compile Include="ViewModels\Dialog\ForkRepositoryExecuteViewModel.cs" />
229228
<Compile Include="ViewModels\Dialog\ForkRepositorySwitchViewModel.cs" />
230229
<Compile Include="ViewModels\Dialog\ForkRepositoryViewModel.cs" />
@@ -256,7 +255,7 @@
256255
<Compile Include="ViewModels\GitHubPane\NotAGitHubRepositoryViewModel.cs" />
257256
<Compile Include="ViewModels\GitHubPane\NotAGitRepositoryViewModel.cs" />
258257
<Compile Include="ViewModels\GitHubPane\PullRequestReviewAuthoringViewModel.cs" />
259-
<Compile Include="ViewModels\GitHubPane\PullRequestReviewFileCommentViewModel.cs" />
258+
<Compile Include="ViewModels\GitHubPane\PullRequestReviewCommentViewModel.cs" />
260259
<Compile Include="ViewModels\GitHubPane\PullRequestReviewSummaryViewModel.cs" />
261260
<Compile Include="ViewModels\GitHubPane\PullRequestReviewViewModel.cs" />
262261
<Compile Include="ViewModels\GitHubPane\PullRequestUserReviewsViewModel.cs" />
@@ -268,8 +267,6 @@
268267
<Compile Include="Extensions\AkavacheExtensions.cs" />
269268
<Compile Include="Extensions\EnvironmentExtensions.cs" />
270269
<Compile Include="GlobalSuppressions.cs" />
271-
<Compile Include="Models\PullRequestFileModel.cs" />
272-
<Compile Include="Models\PullRequestModel.cs" />
273270
<Compile Include="Resources.Designer.cs">
274271
<AutoGen>True</AutoGen>
275272
<DesignTime>True</DesignTime>

src/GitHub.App/Models/IssueCommentModel.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/GitHub.App/Models/PullRequestFileModel.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/GitHub.App/Models/PullRequestModel.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -162,32 +162,6 @@ public string Body
162162
public DateTimeOffset CreatedAt { get; set; }
163163
public DateTimeOffset UpdatedAt { get; set; }
164164
public IAccount Author { get; set; }
165-
public IReadOnlyList<IPullRequestFileModel> ChangedFiles { get; set; } = new IPullRequestFileModel[0];
166-
public IReadOnlyList<ICommentModel> Comments { get; set; } = new ICommentModel[0];
167-
168-
IReadOnlyList<IPullRequestReviewModel> reviews = new IPullRequestReviewModel[0];
169-
public IReadOnlyList<IPullRequestReviewModel> Reviews
170-
{
171-
get { return reviews; }
172-
set
173-
{
174-
Guard.ArgumentNotNull(value, nameof(value));
175-
reviews = value;
176-
this.RaisePropertyChange();
177-
}
178-
}
179-
180-
IReadOnlyList<IPullRequestReviewCommentModel> reviewComments = new IPullRequestReviewCommentModel[0];
181-
public IReadOnlyList<IPullRequestReviewCommentModel> ReviewComments
182-
{
183-
get { return reviewComments; }
184-
set
185-
{
186-
Guard.ArgumentNotNull(value, nameof(value));
187-
reviewComments = value;
188-
this.RaisePropertyChange();
189-
}
190-
}
191165

192166
IAccount assignee;
193167
public IAccount Assignee

src/GitHub.App/Models/PullRequestReviewCommentModel.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)