Skip to content

Commit 4118f44

Browse files
authored
Remove UI settings (#16064)
1 parent 7b46d44 commit 4118f44

File tree

5 files changed

+1
-149
lines changed

5 files changed

+1
-149
lines changed
Lines changed: 1 addition & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,22 @@
1-
using Umbraco.Cms.Core.Models;
2-
31
namespace Umbraco.Cms.Api.Management.Security;
42

53
/// <summary>
64
/// Options used to configure back office external login providers
75
/// </summary>
86
public class BackOfficeExternalLoginProviderOptions
97
{
10-
private string _buttonStyle = string.Empty;
11-
128
public BackOfficeExternalLoginProviderOptions(
13-
string buttonStyle,
14-
string icon,
159
ExternalSignInAutoLinkOptions? autoLinkOptions = null,
16-
bool denyLocalLogin = false,
17-
bool autoRedirectLoginToExternalProvider = false,
18-
string? customBackOfficeView = null)
10+
bool denyLocalLogin = false)
1911
{
20-
ButtonStyle = buttonStyle;
21-
Icon = icon;
2212
AutoLinkOptions = autoLinkOptions ?? new ExternalSignInAutoLinkOptions();
2313
DenyLocalLogin = denyLocalLogin;
24-
AutoRedirectLoginToExternalProvider = autoRedirectLoginToExternalProvider;
25-
CustomBackOfficeView = customBackOfficeView;
2614
}
2715

2816
public BackOfficeExternalLoginProviderOptions()
2917
{
3018
}
3119

32-
/// <summary>
33-
/// Gets or sets the style of the login button.
34-
/// </summary>
35-
/// <remarks>
36-
/// The default look is an outlined button, which has been optimized for the login screen.
37-
/// </remarks>
38-
[Obsolete("This is no longer used and will be removed in V15. Please set the ButtonLook and ButtonColor properties instead.")]
39-
public string ButtonStyle
40-
{
41-
get => _buttonStyle;
42-
set
43-
{
44-
_buttonStyle = value;
45-
46-
// Map cases from buttons.less
47-
switch (value.ToLowerInvariant())
48-
{
49-
case "btn-primary":
50-
ButtonColor = UuiButtonColor.Default;
51-
ButtonLook = UuiButtonLook.Primary;
52-
break;
53-
case "btn-warning":
54-
ButtonColor = UuiButtonColor.Warning;
55-
ButtonLook = UuiButtonLook.Primary;
56-
break;
57-
case "btn-danger":
58-
ButtonColor = UuiButtonColor.Danger;
59-
ButtonLook = UuiButtonLook.Primary;
60-
break;
61-
case "btn-success":
62-
ButtonColor = UuiButtonColor.Positive;
63-
ButtonLook = UuiButtonLook.Primary;
64-
break;
65-
default:
66-
ButtonColor = UuiButtonColor.Default;
67-
ButtonLook = UuiButtonLook.Outline;
68-
break;
69-
}
70-
}
71-
}
72-
73-
/// <summary>
74-
/// Gets or sets the look to use for the login button.
75-
/// See the UUI documentation for more details: https://uui.umbraco.com/?path=/story/uui-button--looks-and-colors.
76-
/// </summary>
77-
/// <remarks>
78-
/// The default value is <see cref="UuiButtonLook.Outline" />, which has been optimized for the login screen.
79-
/// </remarks>
80-
public UuiButtonLook ButtonLook { get; set; } = UuiButtonLook.Outline;
81-
82-
/// <summary>
83-
/// Gets or sets the color to use for the login button.
84-
/// See the UUI documentation for more details: https://uui.umbraco.com/?path=/story/uui-button--looks-and-colors.
85-
/// </summary>
86-
/// <remarks>
87-
/// The default value is <see cref="UuiButtonColor.Default" />, which has been optimized for the login screen.
88-
/// </remarks>
89-
public UuiButtonColor ButtonColor { get; set; } = UuiButtonColor.Default;
90-
91-
/// <summary>
92-
/// Gets or sets the icon to use for the login button.
93-
/// The standard icons of the Backoffice is available.
94-
/// </summary>
95-
/// <remarks>
96-
/// It is possible to add custom icons to your provider by adding the icons to the
97-
/// <c>~/App_Plugins/{providerAlias}/icons</c> folder as SVG files. The icon name should be the same as the file name.
98-
/// </remarks>
99-
public string Icon { get; set; } = "icon-user";
100-
10120
/// <summary>
10221
/// Gets or sets options used to control how users can be auto-linked/created/updated based on the external login provider
10322
/// </summary>
@@ -108,26 +27,4 @@ public string ButtonStyle
10827
/// This is useful if you want to force users to login with an external provider.
10928
/// </summary>
11029
public bool DenyLocalLogin { get; set; }
111-
112-
/// <summary>
113-
/// Gets or sets a value indicating whether when specified this will automatically redirect to the OAuth login provider instead of prompting the user to click
114-
/// on the OAuth button first.
115-
/// </summary>
116-
/// <remarks>
117-
/// This is generally used in conjunction with <see cref="DenyLocalLogin" />. If more than one OAuth provider specifies
118-
/// this, the last registered
119-
/// provider's redirect settings will win.
120-
/// </remarks>
121-
public bool AutoRedirectLoginToExternalProvider { get; set; }
122-
123-
/// <summary>
124-
/// Gets or sets a virtual path to a custom JavaScript module that will be rendered in place of the default OAuth login buttons.
125-
/// The view can optionally replace the entire login screen if the <see cref="DenyLocalLogin"/> option is set to true.
126-
/// </summary>
127-
/// <remarks>
128-
/// If this view is specified it is 100% up to the user to render the html responsible for rendering the link/un-link
129-
/// buttons along with showing any errors that occur.
130-
/// This overrides what Umbraco normally does by default.
131-
/// </remarks>
132-
public string? CustomBackOfficeView { get; set; }
13330
}

src/Umbraco.Cms.Api.Management/Security/BackOfficeExternalLoginProviders.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ public BackOfficeExternalLoginProviders(
3838
return new BackOfficeExternaLoginProviderScheme(provider, associatedScheme);
3939
}
4040

41-
/// <inheritdoc />
42-
public string? GetAutoLoginProvider()
43-
{
44-
var found = _externalLogins.Values.Where(x => x.Options.AutoRedirectLoginToExternalProvider).ToList();
45-
return found.Count > 0 ? found[0].AuthenticationType : null;
46-
}
47-
4841
/// <inheritdoc />
4942
public async Task<IEnumerable<BackOfficeExternaLoginProviderScheme>> GetBackOfficeProvidersAsync()
5043
{

src/Umbraco.Cms.Api.Management/Security/IBackOfficeExternalLoginProviders.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ public interface IBackOfficeExternalLoginProviders
1818
/// <returns></returns>
1919
Task<IEnumerable<BackOfficeExternaLoginProviderScheme>> GetBackOfficeProvidersAsync();
2020

21-
/// <summary>
22-
/// Returns the authentication type for the last registered external login (oauth) provider that specifies an
23-
/// auto-login redirect option
24-
/// </summary>
25-
/// <returns></returns>
26-
string? GetAutoLoginProvider();
27-
2821
/// <summary>
2922
/// Returns true if there is any external provider that has the Deny Local Login option configured
3023
/// </summary>

src/Umbraco.Core/Models/UuiButtonColor.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Umbraco.Core/Models/UuiButtonLook.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)