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
Pull Requests w/ Statuses #1788
Merged
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
d1d60ff
Attempting to query all Check Suites with Pull Requests
StanleyGoldman bfd6bfb
Trying to get a Check and Status summary
StanleyGoldman 8622f21
Experimenting with ways to get the data via GraphQL
StanleyGoldman 518c8c0
Updating nuget package
StanleyGoldman c3d3b1c
Adding models
StanleyGoldman 047ba1a
Adding pull request summary state to the list
StanleyGoldman ae00f33
Merge branch 'master' into stanley/check-suites-pull-request-model-1
StanleyGoldman c6cd36f
We're three columns now
donokuda eb575e6
Move comment count and status into its own column
donokuda 756e733
Set a minimum width
donokuda 389d49a
Right align pull request status and comment count
donokuda 9c60db1
Functionality to display Checks on PullRequestDetailView
StanleyGoldman 2405755
Restrain the size of the CheckRun display until it gets proper designs
StanleyGoldman 42bb263
Adding a Hyperlink
StanleyGoldman 533506f
Merge branch 'master' into stanley/check-suites-pull-request-model-1
StanleyGoldman 42fbab6
Separating models
StanleyGoldman b086078
Removing functionality to read CheckSuites
StanleyGoldman bade798
Code cleanup
StanleyGoldman 6d4c4ca
Add a bit of spacing
donokuda e7e26d9
Attempting to open up a browser link
StanleyGoldman 2f3e739
Merge pull request #1793 from github/donokuda/check-suites-polish
StanleyGoldman 2236973
Changing column order
StanleyGoldman 10b1fdd
Correcting functionality to open the browser
StanleyGoldman 7107bdc
Merge branch 'master' into stanley/check-suites-pull-request-model-1
StanleyGoldman 4074fea
Add missing argument
StanleyGoldman 5a7775c
Adjust some row/column definitions
donokuda 9c6c5da
make the avatar smaller
donokuda 276549b
Hide this description
donokuda 5c2c0f7
Use the primitive dot octicon for pending checks
donokuda 5edce94
Add a lil' bit of right margin
donokuda af979f2
Merge branch 'master' into stanley/check-suites-pull-request-model-1
StanleyGoldman 9db38a9
Try out a GridView
donokuda d279d06
Use IsSharedSizeScope so that Grid Rendering works
donokuda 86b3942
Remove extra line
donokuda b0cdcf0
Fix text color for dark theme
donokuda 7ced79b
Merge pull request #1813 from github/donokuda/polish-check-details
StanleyGoldman 967e91d
Adding metrics to the UsageTracker
StanleyGoldman e890055
Hiding Status Avatars until we get a way to query them through the Gr…
StanleyGoldman 0974944
Merge branch 'master' into stanley/check-suites-pull-request-model-1
StanleyGoldman b45bcc8
Attempting to use the view locator correctly
StanleyGoldman 5c2b93c
Merge pull request #1808 from github/view-locator-tears
StanleyGoldman 035915d
Merge branch 'master' into stanley/check-suites-pull-request-model-1
StanleyGoldman ee83908
Merge branch 'master' into stanley/check-suites-pull-request-model-1
grokys 2b8cee3
Removing Checks from PullRequestModel
StanleyGoldman f964972
Making StatusSummaryModel an inner class
StanleyGoldman 14d5eca
Merge branch 'master' into stanley/check-suites-pull-request-model-1
StanleyGoldman a026bab
Making properties of PullRequestCheckViewModel read only
StanleyGoldman 6a6c565
Making member readonly
StanleyGoldman cfa7c20
Renaming PullRequestCheckStatusEnum
StanleyGoldman 35ba4b2
Renaming PullRequestChecksEnum
StanleyGoldman e6bf1bf
Inlining variable
StanleyGoldman d5d633e
Renaming StatusStateEnum
StanleyGoldman f9f8d9a
Formatting code
StanleyGoldman 3639807
Creating a PullRequestCheckViewModelDesigner
StanleyGoldman 48f180d
Removing viewLocator
StanleyGoldman e55e47a
Removing designer usage
StanleyGoldman d6a95f7
Making several properties read only
StanleyGoldman 1fe4822
Merge remote-tracking branch 'origin/master' into stanley/check-suite…
StanleyGoldman 86df2bc
Final nitpicks
StanleyGoldman 01efca2
Cleanup view imports
StanleyGoldman 57b4f31
Adding some xmlcomments
StanleyGoldman 923ad51
More xmldocs
StanleyGoldman f4d59bb
Formatting and xmldocs
StanleyGoldman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
25 changes: 25 additions & 0 deletions
25
src/GitHub.App/SampleData/PullRequestCheckViewModelDesigner.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,25 @@ | ||
| using System; | ||
| using System.Windows.Media.Imaging; | ||
| using GitHub.ViewModels; | ||
| using GitHub.ViewModels.GitHubPane; | ||
| using ReactiveUI; | ||
|
|
||
| namespace GitHub.SampleData | ||
| { | ||
| public sealed class PullRequestCheckViewModelDesigner : ViewModelBase, IPullRequestCheckViewModel | ||
| { | ||
| public string Title { get; set; } = "continuous-integration/appveyor/pr"; | ||
|
|
||
| public string Description { get; set; } = "AppVeyor build failed"; | ||
|
|
||
| public PullRequestCheckStatus Status { get; set; } = PullRequestCheckStatus.Failure; | ||
|
|
||
| public Uri DetailsUrl { get; set; } = new Uri("http://github.com"); | ||
|
|
||
| public string AvatarUrl { get; set; } = "https://avatars1.githubusercontent.com/u/417571?s=88&v=4"; | ||
|
|
||
| public BitmapImage Avatar { get; set; } = null; | ||
|
|
||
| public ReactiveCommand<object> OpenDetailsUrl { get; set; } = null; | ||
| } | ||
| } |
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
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
86 changes: 86 additions & 0 deletions
86
src/GitHub.App/ViewModels/GitHubPane/PullRequestCheckViewModel.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,86 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel.Composition; | ||
| using System.Linq; | ||
| using System.Reactive; | ||
| using System.Reactive.Linq; | ||
| using System.Windows.Media.Imaging; | ||
| using GitHub.Extensions; | ||
| using GitHub.Factories; | ||
| using GitHub.Models; | ||
| using GitHub.Services; | ||
| using ReactiveUI; | ||
|
|
||
| namespace GitHub.ViewModels.GitHubPane | ||
| { | ||
| [Export(typeof(IPullRequestCheckViewModel))] | ||
| [PartCreationPolicy(CreationPolicy.NonShared)] | ||
| public class PullRequestCheckViewModel: ViewModelBase, IPullRequestCheckViewModel | ||
| { | ||
| private readonly IUsageTracker usageTracker; | ||
| const string DefaultAvatar = "pack://application:,,,/GitHub.App;component/Images/default_user_avatar.png"; | ||
|
|
||
| public static IEnumerable<IPullRequestCheckViewModel> Build(IViewViewModelFactory viewViewModelFactory, PullRequestDetailModel pullRequest) | ||
| { | ||
| return pullRequest.Statuses?.Select(model => | ||
| { | ||
| PullRequestCheckStatus checkStatus; | ||
| switch (model.State) | ||
| { | ||
| case StatusState.Expected: | ||
| case StatusState.Error: | ||
| case StatusState.Failure: | ||
| checkStatus = PullRequestCheckStatus.Failure; | ||
| break; | ||
| case StatusState.Pending: | ||
| checkStatus = PullRequestCheckStatus.Pending; | ||
| break; | ||
| case StatusState.Success: | ||
| checkStatus = PullRequestCheckStatus.Success; | ||
| break; | ||
| default: | ||
| throw new InvalidOperationException("Unkown PullRequestCheckStatusEnum"); | ||
| } | ||
|
|
||
| var pullRequestCheckViewModel = (PullRequestCheckViewModel) viewViewModelFactory.CreateViewModel<IPullRequestCheckViewModel>(); | ||
| pullRequestCheckViewModel.Title = model.Context; | ||
| pullRequestCheckViewModel.Description = model.Description; | ||
| pullRequestCheckViewModel.Status = checkStatus; | ||
| pullRequestCheckViewModel.DetailsUrl = new Uri(model.TargetUrl); | ||
| pullRequestCheckViewModel.AvatarUrl = model.AvatarUrl ?? DefaultAvatar; | ||
| pullRequestCheckViewModel.Avatar = model.AvatarUrl != null | ||
| ? new BitmapImage(new Uri(model.AvatarUrl)) | ||
| : AvatarProvider.CreateBitmapImage(DefaultAvatar); | ||
|
|
||
| return pullRequestCheckViewModel; | ||
|
|
||
| }) ?? new PullRequestCheckViewModel[0]; | ||
| } | ||
|
|
||
| [ImportingConstructor] | ||
| public PullRequestCheckViewModel(IUsageTracker usageTracker) | ||
| { | ||
| this.usageTracker = usageTracker; | ||
| OpenDetailsUrl = ReactiveCommand.Create().OnExecuteCompleted(DoOpenDetailsUrl); | ||
| } | ||
|
|
||
| private void DoOpenDetailsUrl(object obj) | ||
| { | ||
| usageTracker.IncrementCounter(x => x.NumberOfPRCheckStatusesOpenInGitHub).Forget(); | ||
| } | ||
|
|
||
| public string Title { get; private set; } | ||
|
|
||
| public string Description { get; private set; } | ||
|
|
||
| public PullRequestCheckStatus Status{ get; private set; } | ||
|
|
||
| public Uri DetailsUrl { get; private set; } | ||
|
|
||
| public string AvatarUrl { get; private set; } | ||
|
|
||
| public BitmapImage Avatar { get; private set; } | ||
|
|
||
| public ReactiveCommand<object> OpenDetailsUrl { get; } | ||
| } | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing these :D