Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic username/password UI to all platforms #871

Merged
merged 8 commits into from
Sep 28, 2022

Conversation

mjcheetham
Copy link
Collaborator

@mjcheetham mjcheetham commented Sep 23, 2022

Introduce a new GUI prompt for capturing basic credentials (username/password) on all platforms, using Avalonia UI on Mac & Linux, and WPF on Windows. Today we only have text-based support across all platforms, and a GUI prompt on Windows provided by the CredUIPromptForWindowsCredentials Windows API.

The Windows API has some shortcomings and behaviour that we cannot override, including that if the entered username matches a local Windows user account name, it'll be prefixed with the domain if the machine is joined (for example DOMAIN\LOCALUSER).

WPF/Windows (left: new, right: old)
image

AvaloniaUI (Mac/Linux)
image

Fixes #799 #319

For some reason on macOS windows that are activated are not appearing on
top, and get lost behind other application windows. The platform
implementation on macOS is seemingly correctly calling the
`makeKeyAndOrderFront` native windowing API, but it's not being made
"key and front".

Setting the "topmost" flag true (and then false again) brings our
windows to the front, which is what we want.
Include the images resource across all the Avalonia UI applications.
Copy link
Contributor

@ldennington ldennington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! Thanks for doing this.

src/osx/Installer.Mac/layout.sh Show resolved Hide resolved
@@ -37,6 +30,6 @@
<TextBlock HorizontalAlignment="Center"
Margin="0,10,0,0"
FontSize="11"
Text="Copyright © Microsoft Corporation"/>
Text="Copyright © GitHub"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

);

AddOption(
new Option("--no-logo", "Hide the Git Credential Manager logo and logotype.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is --no-logo rather than --logo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the default being 'show the logo'?

<ProjectReference Include="..\Core.UI.Windows\Core.UI.Windows.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(OSPlatform)' != 'windows'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this ever be the case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sadly.. opening the solution in some IDEs (*cough* VSMac *cough*) the projects are still built/restored even if the solution configuration isn't in WindowDebug/Release... :(

Add a generic credentials prompt view model and command for collecting
username/passwords.
Add an Avalonia-based UI prompt for the generic/basic credential prompt.
Add a WPF/Windows UI prompt for the generic/basic username and password
prompt.
Replace calls to the native system UI prompts with shelling out to the
generic helper UI.
@mjcheetham mjcheetham merged commit 00244fa into git-ecosystem:main Sep 28, 2022
@mjcheetham mjcheetham deleted the generic-ui branch September 28, 2022 15:23
@ldennington ldennington mentioned this pull request Nov 3, 2022
ldennington added a commit that referenced this pull request Nov 3, 2022
Changes:

- Check for broken links in documentation (#700)
- Support macOS `arm64` installs via Homebrew (#798) 
- Validate installers before publishing (#813)
- Auto-generate maintainer away notification issues (#842)
- Install dotnet via Jammy feeds on Ubuntu 22.04 and greater (#839)
- Access Azure storage account using service principle credentials
(#851)
- Update documentation to use reference-style links (#680)
- Unify documentation line length (#862)
- Add generic username/password UI (#871)
- Bitbucket DC OAuth support (#607)
- Distribute GCM as a dotnet tool (#886)
- Drop `-core` suffix from entry executable #551 
- Speed up build graph (#924)
@Favourjacobmudiaga

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants