Uh oh!
There was an error while loading. Please reload this page.
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
Remove repository responsibilities from TeamExplorerServiceHolder (repository refactor part 2)#2025
Closed
jcansdale
wants to merge
5
commits into
fixes/2007-refactor-repository-models
from
refactor/ITeamExplorerServiceHolder
Uh oh!
There was an error while loading. Please reload this page.
Closed
Remove repository responsibilities from TeamExplorerServiceHolder (repository refactor part 2) #2025
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
eb7f1db
Remove repo watching responsibilities from TESH
jcansdale 925279f
Remove obsolete RefreshCloneUrl API
jcansdale c16c91c
Remove unused logger
jcansdale 5fddfa8
Add xmldocs to ITeamExplorerServiceHolder
jcansdale 2b160f8
Fix error CA2214
jcansdale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
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
34 changes: 31 additions & 3 deletions
34 src/GitHub.TeamFoundation.14/Base/TeamExplorerNavigationItemBase.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
122 changes: 6 additions & 116 deletions
122 src/GitHub.TeamFoundation.14/Base/TeamExplorerServiceHolder.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
14 changes: 8 additions & 6 deletions
14 src/GitHub.TeamFoundation.14/Connect/GitHubConnectSection.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 |
|---|---|---|
| @@ -28,6 +28,8 @@ namespace GitHub.VisualStudio.TeamExplorer.Connect | ||
| public class GitHubConnectSection : TeamExplorerSectionBase, IGitHubConnectSection | ||
| { | ||
| static readonly ILogger log = LogManager.ForContext<GitHubConnectSection>(); | ||
| readonly ISimpleApiClientFactory apiFactory; | ||
| readonly ITeamExplorerServiceHolder holder; | ||
| readonly IPackageSettings packageSettings; | ||
| readonly ITeamExplorerServices teamExplorerServices; | ||
| readonly int sectionIndex; | ||
| @@ -101,8 +103,6 @@ public ILocalRepositoryModel SelectedRepository | ||
| public ICommand Clone { get; } | ||
| internal ITeamExplorerServiceHolder Holder => holder; | ||
| public GitHubConnectSection(IGitHubServiceProvider serviceProvider, | ||
| ISimpleApiClientFactory apiFactory, | ||
| ITeamExplorerServiceHolder holder, | ||
| @@ -127,6 +127,8 @@ public GitHubConnectSection(IGitHubServiceProvider serviceProvider, | ||
| IsVisible = false; | ||
| sectionIndex = index; | ||
| this.apiFactory = apiFactory; | ||
| this.holder = holder; | ||
| this.packageSettings = packageSettings; | ||
| this.teamExplorerServices = teamExplorerServices; | ||
| this.localRepositories = localRepositories; | ||
| @@ -325,7 +327,7 @@ async void UpdateRepositoryList(object sender, NotifyCollectionChangedEventArgs | ||
| try | ||
| { | ||
| // TODO: Cache the icon state. | ||
| var api = await ApiFactory.Create(newrepo.CloneUrl); | ||
| var api = await apiFactory.Create(newrepo.CloneUrl); | ||
| var repo = await api.GetRepository(); | ||
| newrepo.SetIcon(repo.Private, repo.Fork); | ||
| } | ||
| @@ -344,13 +346,13 @@ async void UpdateRepositoryList(object sender, NotifyCollectionChangedEventArgs | ||
| .Cast<ILocalRepositoryModel>() | ||
| .ForEach(async r => | ||
| { | ||
| if (Equals(Holder.ActiveRepo, r)) | ||
| if (Equals(holder.TeamExplorerContext.ActiveRepository, r)) | ||
| SelectedRepository = r; | ||
| try | ||
| { | ||
| // TODO: Cache the icon state. | ||
| var api = await ApiFactory.Create(r.CloneUrl); | ||
| var api = await apiFactory.Create(r.CloneUrl); | ||
| var repo = await api.GetRepository(); | ||
| r.SetIcon(repo.Private, repo.Fork); | ||
| } | ||
| @@ -457,7 +459,7 @@ public void Retry() | ||
| public bool OpenRepository() | ||
| { | ||
| var old = Repositories.FirstOrDefault(x => x.Equals(Holder.ActiveRepo)); | ||
| var old = Repositories.FirstOrDefault(x => x.Equals(holder.TeamExplorerContext.ActiveRepository)); | ||
grokys marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if (!Equals(SelectedRepository, old)) | ||
| { | ||
| try | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.