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
Display a message when project isn't a git/github repository. #374
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
210e167
Started adding "Not a GitHub repository" view
grokys 6ffc20f
Removed check for uiController
grokys 2f94c4c
Make WPF XAML compiler not crash.
grokys 64ef6c6
Add UI content
donokuda df55907
Merge remote-tracking branch 'refs/remotes/origin/shana/stop-ui-contr…
grokys 71b8bcf
Wire up "not a github repo" view to VM
grokys bd791b9
Make the "not a github repos" button work.
grokys a30727c
Display message when project is not a repository
grokys a3d471e
Updated message.
grokys ef3c597
Place messages in Resources.resx.
grokys 2f6b7d9
Added RepositoryOrigin.Unknown
grokys c47d50d
Re-enable CodeAnalysis on GitHub.App.
grokys 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
44 changes: 44 additions & 0 deletions
44
src/GitHub.App/ViewModels/NotAGitHubRepositoryViewModel.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,44 @@ | ||
| using System; | ||
| using System.ComponentModel.Composition; | ||
| using GitHub.Exports; | ||
| using GitHub.Models; | ||
| using GitHub.Services; | ||
| using GitHub.UI; | ||
| using ReactiveUI; | ||
|
|
||
| namespace GitHub.ViewModels | ||
| { | ||
| /// <summary> | ||
| /// The view model for the "Not a GitHub repository" view in the GitHub pane. | ||
| /// </summary> | ||
| [ExportViewModel(ViewType = UIViewType.NotAGitHubRepository)] | ||
| [PartCreationPolicy(CreationPolicy.NonShared)] | ||
| public class NotAGitHubRepositoryViewModel : BaseViewModel, INotAGitHubRepositoryViewModel | ||
| { | ||
| ITeamExplorerServices teamExplorerServices; | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="NotAGitHubRepositoryViewModel"/> class. | ||
| /// </summary> | ||
| [ImportingConstructor] | ||
| public NotAGitHubRepositoryViewModel(ITeamExplorerServices teamExplorerServices) | ||
| { | ||
| this.teamExplorerServices = teamExplorerServices; | ||
| Publish = ReactiveCommand.Create(); | ||
| Publish.Subscribe(_ => OnPublish()); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the command executed when the user clicks the "Publish to GitHub" link. | ||
| /// </summary> | ||
| public IReactiveCommand<object> Publish { get; } | ||
|
|
||
| /// <summary> | ||
| /// Called when the <see cref="Publish"/> command is executed. | ||
| /// </summary> | ||
| private void OnPublish() | ||
| { | ||
| teamExplorerServices.ShowPublishSection(); | ||
| } | ||
| } | ||
| } |
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,19 @@ | ||
| using System; | ||
| using System.ComponentModel.Composition; | ||
| using GitHub.Exports; | ||
| using GitHub.Models; | ||
| using GitHub.Services; | ||
| using GitHub.UI; | ||
| using ReactiveUI; | ||
|
|
||
| namespace GitHub.ViewModels | ||
| { | ||
| /// <summary> | ||
| /// The view model for the "Not a Git repository" view in the GitHub pane. | ||
| /// </summary> | ||
| [ExportViewModel(ViewType = UIViewType.NotAGitRepository)] | ||
| [PartCreationPolicy(CreationPolicy.NonShared)] | ||
| public class NotAGitRepositoryViewModel : BaseViewModel, INotAGitRepositoryViewModel | ||
| { | ||
| } | ||
| } |
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
15 changes: 15 additions & 0 deletions
15
src/GitHub.Exports.Reactive/ViewModels/INotAGitHubRepositoryViewModel.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,15 @@ | ||
| using ReactiveUI; | ||
|
|
||
| namespace GitHub.ViewModels | ||
| { | ||
| /// <summary> | ||
| /// Defines the view model for the "Sign in to GitHub" view in the GitHub pane. | ||
| /// </summary> | ||
| public interface INotAGitHubRepositoryViewModel : IViewModel | ||
| { | ||
| /// <summary> | ||
| /// Gets the command executed when the user clicks the "Publish to GitHub" link. | ||
| /// </summary> | ||
| IReactiveCommand<object> Publish { get; } | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/GitHub.Exports.Reactive/ViewModels/INotAGitRepositoryViewModel.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,10 @@ | ||
| namespace GitHub.ViewModels | ||
| { | ||
| /// <summary> | ||
| /// Defines the view model for the "Not a git repository" view in the GitHub pane. | ||
| /// </summary> | ||
| [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces")] | ||
| public interface INotAGitRepositoryViewModel : IViewModel | ||
| { | ||
| } | ||
| } |
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
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
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,11 @@ | ||
| namespace GitHub.VisualStudio.UI | ||
| { | ||
| public enum RepositoryOrigin | ||
| { | ||
| Unknown, | ||
| DotCom, | ||
| Enterprise, | ||
| Other, | ||
| NonGitRepository, | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Move the
Othervalue up to the first position, or add aNonevalue. enums always have a default value, and distinguishing betweenDotComandhaven't probed yet / this is a defaultis hard if they're the same value.EDIT: maybe
Unknown...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.
Well strictly speaking, the
Unknownstate isRepositoryOrigin == nullas theRepositoryOriginproperty is currently nullable, because it came from the nullableIsGitHubRepoproperty. However I agree that it would be better the have thatUnknownvalue as an enum value rather than the null state: will change.