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

Commit b95fe58

Browse files
authored
Merge branch 'master' into fixes/403-create-gist-avatar-fix
2 parents 9702197 + 5eed546 commit b95fe58

File tree

8 files changed

+209
-31
lines changed

8 files changed

+209
-31
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
url = [email protected]:github/VisualStudioBuildScripts
1919
[submodule "submodules/externalpackages/StartPage"]
2020
path = submodules/externalpackages/StartPage
21-
url = git@github.com:editor-tools/StartPage.git
21+
url = https://github.com/editor-tools/StartPage.git

documentation/manifest.md

Lines changed: 119 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# First Launch
2+
- **Start page is displayed by default on first launch**
3+
- **Click on GitHub link on start page under Open > Checkout from**
4+
- [ ] Team Explorer Window exposed
5+
- [ ] Clone a GitHub Repository dialog visible
26
- **If last solution was in a git repo hosted on GitHub**
37
- **Team Explorer Home page shows:**
48
- [ ] GitHub header, repo information
@@ -21,7 +25,7 @@
2125
- [ ] Connect dialog disappears
2226
- [ ] GitHub invitation section in Connect page disappears
2327
- [ ] GitHub connection appears above Hosted Service Providers area with Clone, Create and Sign out action links. As long as it's above Local Git Repositories, it's good
24-
28+
2529
# In Team Explorer Connect page (logged in)
2630
- [ ] **Click on Clone action link**
2731
- [ ] Clone dialog appears
@@ -38,7 +42,7 @@
3842
- [ ] **Select a repository and click Clone**
3943
- [ ] Clone dialog disappears
4044
- [ ] Progress bar appears in the Team Explorer Connect page with cloning progress (depending on repo size)
41-
- [ ] Notification appears in Team Explorer Connect page: "The repository was cloned successfully. username/repo-name has been successfully created. Create a new project or solution." with proper links displayed.
45+
- [ ] Notification appears in Team Explorer Connect page: "The repository was cloned successfully. username/repo-name has been successfully created. Create a new project or solution." with proper links displayed.
4246
- [ ] Repository shows up in the "Local Git Repositories" list
4347
- [ ] **Double-click the cloned repository in the "Local Git Repositories" list**
4448
- [ ] Team Explorer view changes to Home page
@@ -83,9 +87,9 @@
8387
- [ ] Progress bar appears above Synchronization title
8488
- [ ] Team Explorer view changes to Home page
8589
- [ ] Notification appears: "Repository published successfully"
86-
- [ ] Publish a private repo and verify on .com that it's private
87-
- [ ] **Project section (Home button)***
88-
- [ ] Click on "Home" icon
90+
- [ ] Publish a private repo and verify on .com that it's private
91+
- [ ] **Project section (Home button)***
92+
- [ ] Click on "Home" icon
8993
- [ ] Verify Project has the following sections/buttons when signed into GitHub.com and the Repository is enabled: Pull Requests, Pulse, Graphs, Issues, Wikis
9094
- [ ] Verify Pulse button navigates to Pulse page on Github.com
9195
- [ ] Verify Graphs button navigates to Graphs page on GitHub.com
@@ -109,7 +113,116 @@
109113
- [ ] Team Explorer Connect page: GitHub section appears above TFS section with Clone | Create | Login links
110114
- [ ] Disconnect from TFS (right click on project and "Remove"
111115
- [ ] Team Explorer Connect page: GitHub invitation section appears in Hosted Service Providers with Connect.. and Sign up links
112-
116+
117+
# In GitHub pane (logged into GitHub)
118+
- [ ] **Go to Team Explorer > Home > Pull Requests**
119+
- [ ] List of pull requests is displayed.
120+
- [ ] Pane title displays "GitHub | (current repository)"
121+
- [ ] Selected pane tab title (on the bottom) displays "GitHub"
122+
- [ ] Changing the open/close/all filter dropdown filters the pull request list, by selected option (confirm on .com)
123+
- [ ] Changing the Assignee filter dropdown filters the pull request list to display only selected user assigned (confirm on .com)
124+
- [ ] Changing the Author filter dropdown filters the pull request list to display pull requests the user created (confirm on .com)
125+
- [ ] Filter author selection displays recent pull request authors
126+
- [ ] "Create New" Link button is displayed
127+
- [ ] Clicking on a pull request title opens browser window to pull request on .com
128+
- [ ] Clicking on a pull request number opens browser window to pull request on .com
129+
- [ ] **Create a new branch (can alternatively make commits on an existing branch)**
130+
- [ ] **Switch Git context to new branch**
131+
- [ ] **Click on Create New button**
132+
- [ ] Pane title displays "GitHub | (current repository)"
133+
- [ ] Selected pane tab title (on the bottom) displays "GitHub"
134+
- [ ] Create Pull Request button is disabled.
135+
- [ ] Default/target branch name is displayed to the left of the arrow (<)
136+
- [ ] Source branch is displayed to the right of the arrow
137+
- [ ] Default/target branch is a dropdown of all branches
138+
- [ ] Clicking on Cancel button navigates back to the pull request list
139+
- [ ] Setting the target and source branch as the same branches disables the "Create Pull Request" button and displays an error message at the top of pane
140+
- [ ] **Fill out pull request Title**
141+
- [ ] "Create Pull Request" button is enabled.
142+
- [ ] **Click on Create Pull Request**
143+
- [ ] Pull request list is displayed with new pull request (that was just created) at the top of the list
144+
- [ ] "The Pull Request has been created at [target branch]" message is displayed at the top of the GitHub pane
145+
- [ ] Verify all non pushed commits prior to pull request creation have been pushed and exist on .com
146+
147+
148+
# In VS text/code Editor (logged in to GitHub, open a file that is hosted on Github)
149+
- [ ] **Highlight code or text within solution, then right click.**
150+
- [ ] GitHub context menu is visible
151+
- [ ] Open on Github is visible if code is hosted on GitHub repository
152+
- [ ] Copy link to clipboard is visible if code is hosted on GitHub repository
153+
- [ ] "Create a GitHub Gist" is visible (repo independent)
154+
- [ ] **Click "Open on GitHub"**
155+
- [ ] Default browser navigates to last pushed commit on GitHub repo and highlights lines that were highlighted in editor.
156+
- [ ] **Click "Copy link to clipboard"**
157+
- [ ] Pasting into browser pastes a link to the last pushed commit on GitHub repo and highlights lines that were highlighted in editor.
158+
- [ ] **Click "Create a GitHub Gist"**
159+
- [ ] Create gist dialog appears
160+
- [ ] File name textbox populated with name of file that highlighted source code came from
161+
- [ ] Private Gist checkbox unchecked
162+
- [ ] Create button enabled
163+
- [ ] Clearing file name textbox disables the Create button
164+
- [ ] **Click create button**
165+
- [ ] Dialog disappears
166+
- [ ] Default browser navigates to newly created Gist
167+
- [ ] Create private gist and verify it's private on .com
168+
169+
# In VS text/code Editor (NOT logged in to GitHub, open a file that is hosted on Github)
170+
- [ ] **Highlight code or text within solution, then right click.**
171+
- [ ] GitHub context menu is visible
172+
- [ ] Open on Github is visible
173+
- [ ] Copy link to clipboard is visible
174+
- [ ] "Create a GitHub Gist" is visible (repo independent)
175+
- [ ] **Click "Open on GitHub"**
176+
- [ ] Default browser navigates to last pushed commit on GitHub repo and highlights lines that were highlighted in editor.
177+
- [ ] **Click "Copy link to clipboard"**
178+
- [ ] Pasting into browser pastes a link to the last pushed commit on GitHub repo and highlights lines that were highlighted in editor.
179+
- [ ] **Click "Create a GitHub Gist"**
180+
- [ ] "Connect to GitHub" dialog appears
181+
- [ ] Create gist dialog appears (after logging in)
182+
- [ ] File name textbox populated with name of file that highlighted source code came from
183+
- [ ] Private Gist checkbox unchecked
184+
- [ ] Create button enabled
185+
- [ ] Clearing file name textbox disables the Create button
186+
- [ ] **Click create button**
187+
- [ ] Dialog disappears
188+
- [ ] Default browser navigates to newly created Gist
189+
- [ ] Create private gist and verify it's private on .com
190+
191+
# In VS text/code Editor (logged in to GitHub, open a file that is NOT hosted on Github)
192+
- [ ] **Highlight code or text within solution, then right click.**
193+
- [ ] GitHub context menu is visible
194+
- [ ] Open on Github is NOT visible
195+
- [ ] Copy link to clipboard is NOT visible
196+
- [ ] "Create a GitHub Gist" is visible (repo independent)
197+
- [ ] **Click "Create a GitHub Gist"**
198+
- [ ] Create gist dialog appears
199+
- [ ] File name textbox populated with name of file that highlighted source code came from
200+
- [ ] Private Gist checkbox unchecked
201+
- [ ] Create button enabled
202+
- [ ] Clearing file name textbox disables the Create button
203+
- [ ] **Click create button**
204+
- [ ] Dialog disappears
205+
- [ ] Default browser navigates to newly created Gist
206+
- [ ] Create private gist and verify it's private on .com browser navigates to newly created Gist
207+
208+
# In VS text/code Editor (NOT logged in to GitHub, open a file that is NOT hosted on Github)
209+
- [ ] **Highlight code or text within solution, then right click.**
210+
- [ ] GitHub context menu is visible
211+
- [ ] Open on Github is NOT visible
212+
- [ ] Copy link to clipboard is NOT visible
213+
- [ ] "Create a GitHub Gist" is visible (repo independent)
214+
- [ ] **Click "Create a GitHub Gist"**
215+
- [ ] "Connect to GitHub" dialog appears
216+
- [ ] Create gist dialog appears (after logging in)
217+
- [ ] File name textbox populated with name of file that highlighted source code came from
218+
- [ ] Private Gist checkbox unchecked
219+
- [ ] Create button enabled
220+
- [ ] Clearing file name textbox disables the Create button
221+
- [ ] **Click create button**
222+
- [ ] Dialog disappears
223+
- [ ] Default browser navigates to newly created Gist
224+
- [ ] Create private gist and verify it's private on .com browser navigates to newly created Gist
225+
113226
# Connections
114227
- [ ] **Login to GitHub.com, then click on the "Manage Connections" header and "Connect to GitHub"**
115228
- [ ] Login dialog appears

src/GitHub.App/Services/RepositoryPublishService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ public string LocalRepositoryName
4040
{
4141
return Observable.Defer(() => apiClient.CreateRepository(newRepository, account.Login, account.IsUser)
4242
.Select(remoteRepo => new { RemoteRepo = remoteRepo, LocalRepo = activeRepository }))
43-
.Select(async repo =>
43+
.SelectMany(async repo =>
4444
{
4545
await gitClient.SetRemote(repo.LocalRepo, "origin", new Uri(repo.RemoteRepo.CloneUrl));
4646
await gitClient.Push(repo.LocalRepo, "master", "origin");
4747
await gitClient.Fetch(repo.LocalRepo, "origin");
4848
await gitClient.SetTrackingBranch(repo.LocalRepo, "master", "origin");
4949
return repo.RemoteRepo;
50-
})
51-
.Select(t => t.Result);
50+
});
5251
}
5352
}
5453
}

src/GitHub.App/ViewModels/RepositoryCloneViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ public RepositoryCloneViewModel(
7575
repositories.Filter = FilterRepository;
7676
repositories.NewerComparer = OrderedComparer<IRemoteRepositoryModel>.OrderByDescending(x => x.UpdatedAt).Compare;
7777

78-
filterTextIsEnabled = this.WhenAny(x => x.IsLoading, x => x.Value)
79-
.Select(x => !x && repositories.UnfilteredCount > 0)
78+
filterTextIsEnabled = this.WhenAny(x => x.IsLoading,
79+
loading => loading.Value || repositories.UnfilteredCount > 0 && !LoadingFailed)
8080
.ToProperty(this, x => x.FilterTextIsEnabled);
8181

82-
this.WhenAny(x => x.FilterTextIsEnabled, x => x.IsLoading, x => x.LoadingFailed
83-
, (any, loading, failed) => !any.Value && !loading.Value && !failed.Value)
82+
this.WhenAny(x => x.IsLoading, x => x.LoadingFailed,
83+
(loading, failed) => !loading.Value && !failed.Value && repositories.UnfilteredCount == 0)
8484
.Subscribe(x => NoRepositoriesFound = x);
8585

8686
this.WhenAny(x => x.FilterText, x => x.Value)

src/GitHub.VisualStudio.UI/Resources.Designer.cs

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GitHub.VisualStudio.UI/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@
333333
<data name="filterBranchesText" xml:space="preserve">
334334
<value>Filter branches</value>
335335
</data>
336-
<data name="GetStartedLink" xml:space="preserve">
337-
<value>Get Started</value>
336+
<data name="PublishToGitHubButton" xml:space="preserve">
337+
<value>Publish to GitHub</value>
338338
</data>
339339
<data name="GetStartedText" xml:space="preserve">
340340
<value>Get Started</value>

src/GitHub.VisualStudio.UI/UI/Views/GitHubInvitationContent.xaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
mc:Ignorable="d"
1010
DataContext="{Binding ViewModel}" d:DesignWidth="230" d:DesignHeight="120"
1111
KeyboardNavigation.TabNavigation="Local"
12-
Background="{DynamicResource GitHubVsToolWindowBackground}"
13-
>
12+
Background="{DynamicResource GitHubVsToolWindowBackground}">
1413

1514
<UserControl.Style>
1615
<Style TargetType="{x:Type UserControl}">
@@ -30,6 +29,7 @@
3029
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml" />
3130
</ResourceDictionary.MergedDictionaries>
3231
<ui:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
32+
<Style x:Key="VSStyledButton" BasedOn="{StaticResource VsButtonStyleKey}" TargetType="{x:Type Button}"/>
3333
</ResourceDictionary>
3434
</UserControl.Resources>
3535

@@ -74,9 +74,7 @@
7474
Foreground="{DynamicResource GitHubVsToolWindowText}" />
7575
<Button Grid.Column="2" KeyboardNavigation.TabIndex="1" Style="{StaticResource ActionLinkButton}" HorizontalAlignment="Left" x:Name="signup" Click="signup_Click" Content="{x:Static prop:Resources.SignUpLink}"
7676
Visibility="{Binding ShowSignup, Converter={StaticResource BooleanToVisibilityConverter}}"/>
77-
<Button Grid.Column="3" KeyboardNavigation.TabIndex="2" Style="{StaticResource ActionLinkButton}" HorizontalAlignment="Right" x:Name="connect" Click="connect_Click" Content="{x:Static prop:Resources.GetStartedLink}"
78-
Visibility="{Binding ShowGetStarted, Converter={StaticResource BooleanToVisibilityConverter}}"/>
79-
<Rectangle Grid.Column="4" Width="16" Height="16" Margin="8,0,0,0" Fill="{StaticResource ConnectArrowBrush}"
77+
<Button Grid.Column="3" KeyboardNavigation.TabIndex="2" Style="{StaticResource VSStyledButton}" HorizontalAlignment="Right" x:Name="connect" Click="connect_Click" Content="{x:Static prop:Resources.PublishToGitHubButton}"
8078
Visibility="{Binding ShowGetStarted, Converter={StaticResource BooleanToVisibilityConverter}}"/>
8179
</Grid>
8280

src/UnitTests/GitHub.App/ViewModels/RepositoryCloneViewModelTests.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,74 @@ public void IsTrueWhenLoadingCompleteNotFailedAndNoRepositories()
209209
}
210210
}
211211

212+
public class TheFilterTextEnabledProperty : TestBaseClass
213+
{
214+
[Fact]
215+
public void IsTrueInitially()
216+
{
217+
var repoSubject = new Subject<IRemoteRepositoryModel>();
218+
var col = TrackingCollection.Create(repoSubject);
219+
var repositoryHost = Substitute.For<IRepositoryHost>();
220+
repositoryHost.ModelService.GetRepositories(Arg.Any<ITrackingCollection<IRemoteRepositoryModel>>()).Returns(_ => col);
221+
var cloneService = Substitute.For<IRepositoryCloneService>();
222+
223+
var vm = GetVM(
224+
repositoryHost,
225+
cloneService,
226+
Substitute.For<IOperatingSystem>(),
227+
Substitute.For<INotificationService>(),
228+
Substitute.For<IUsageTracker>());
229+
230+
Assert.False(vm.LoadingFailed);
231+
Assert.True(vm.FilterTextIsEnabled);
232+
}
233+
234+
[Fact]
235+
public void IsFalseIfLoadingReposFails()
236+
{
237+
var repoSubject = new Subject<IRemoteRepositoryModel>();
238+
var col = TrackingCollection.Create(repoSubject);
239+
var repositoryHost = Substitute.For<IRepositoryHost>();
240+
repositoryHost.ModelService.GetRepositories(Arg.Any<ITrackingCollection<IRemoteRepositoryModel>>()).Returns(_ => col);
241+
var cloneService = Substitute.For<IRepositoryCloneService>();
242+
var vm = GetVM(
243+
repositoryHost,
244+
cloneService,
245+
Substitute.For<IOperatingSystem>(),
246+
Substitute.For<INotificationService>(),
247+
Substitute.For<IUsageTracker>());
248+
249+
Assert.False(vm.LoadingFailed);
250+
251+
repoSubject.OnError(new InvalidOperationException("Doh!"));
252+
253+
Assert.True(vm.LoadingFailed);
254+
Assert.False(vm.FilterTextIsEnabled);
255+
repoSubject.OnCompleted();
256+
}
257+
258+
[Fact]
259+
public void IsFalseWhenLoadingCompleteNotFailedAndNoRepositories()
260+
{
261+
var repoSubject = new Subject<IRemoteRepositoryModel>();
262+
var col = TrackingCollection.Create(repoSubject);
263+
var repositoryHost = Substitute.For<IRepositoryHost>();
264+
repositoryHost.ModelService.GetRepositories(Arg.Any<ITrackingCollection<IRemoteRepositoryModel>>()).Returns(_ => col);
265+
266+
var cloneService = Substitute.For<IRepositoryCloneService>();
267+
var vm = GetVM(
268+
repositoryHost,
269+
cloneService,
270+
Substitute.For<IOperatingSystem>(),
271+
Substitute.For<INotificationService>(),
272+
Substitute.For<IUsageTracker>());
273+
274+
repoSubject.OnCompleted();
275+
276+
Assert.False(vm.FilterTextIsEnabled);
277+
}
278+
}
279+
212280
public class TheLoadingFailedProperty : TestBaseClass
213281
{
214282
[Fact]

0 commit comments

Comments
 (0)