Skip to content

Commit 935766c

Browse files
committed
bitbucket-ui: add Bitbucket Windows UI
Add a port of the Bitbucket UI from the old GCM for Windows, and update the UI to git with the new refreshed design.
1 parent bda6030 commit 935766c

21 files changed

+1596
-14
lines changed

src/shared/Microsoft.Git.CredentialManager/EnsureArgument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Microsoft.Git.CredentialManager
66
{
77
public static class EnsureArgument
88
{
9-
public static void NotNull<T>(T arg, string name) where T : class
9+
public static void NotNull<T>(T arg, string name)
1010
{
1111
if (arg is null)
1212
{

src/windows/Atlassian.Bitbucket.UI.Windows/Atlassian.Bitbucket.UI.Windows.csproj

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,34 @@
1818
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
1919
</ItemGroup>
2020

21+
<ItemGroup>
22+
<None Remove="Images\[email protected]" />
23+
<None Remove="Images\Bitbucket-16x16.ico" />
24+
<None Remove="Images\error.png" />
25+
<Resource Include="Images\[email protected]" />
26+
<Resource Include="Images\Bitbucket-16x16.ico" />
27+
<Resource Include="Images\error.png" />
28+
</ItemGroup>
29+
30+
<ItemGroup>
31+
<Compile Update="BitbucketResources.Designer.cs">
32+
<DesignTime>True</DesignTime>
33+
<AutoGen>True</AutoGen>
34+
<DependentUpon>BitbucketResources.resx</DependentUpon>
35+
</Compile>
36+
</ItemGroup>
37+
38+
<ItemGroup>
39+
<EmbeddedResource Update="BitbucketResources.resx">
40+
<Generator>PublicResXFileCodeGenerator</Generator>
41+
<LastGenOutput>BitbucketResources.Designer.cs</LastGenOutput>
42+
</EmbeddedResource>
43+
</ItemGroup>
44+
45+
<ItemGroup>
46+
<Page Update="Styles.xaml">
47+
<Generator>MSBuild:Compile</Generator>
48+
</Page>
49+
</ItemGroup>
50+
2151
</Project>

src/windows/Atlassian.Bitbucket.UI.Windows/AuthenticationPrompts.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
3+
using Atlassian.Bitbucket.UI.Controls;
4+
using Atlassian.Bitbucket.UI.ViewModels;
35
using Microsoft.Git.CredentialManager.UI;
46

57
namespace Atlassian.Bitbucket.UI
@@ -15,13 +17,24 @@ public AuthenticationPrompts(IGui gui)
1517

1618
public bool ShowCredentialsPrompt(ref string username, out string password)
1719
{
18-
password = null;
19-
return false;
20+
// If there is a user in the remote URL then populate the UI with it.
21+
var credentialViewModel = new CredentialsViewModel(username);
22+
23+
bool credentialValid = _gui.ShowDialogWindow(credentialViewModel, () => new CredentialsControl());
24+
25+
username = credentialViewModel.Login;
26+
password = credentialViewModel.Password.ToUnsecureString();
27+
28+
return credentialValid;
2029
}
2130

2231
public bool ShowOAuthPrompt()
2332
{
24-
return false;
33+
var oauthViewModel = new OAuthViewModel();
34+
35+
bool useOAuth = _gui.ShowDialogWindow(oauthViewModel, () => new OAuthControl());
36+
37+
return useOAuth;
2538
}
2639
}
2740
}

src/windows/Atlassian.Bitbucket.UI.Windows/BitbucketResources.Designer.cs

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

0 commit comments

Comments
 (0)