Browse Source
Merge pull request #4736 from abpframework/maliming/hideCancelButton
The Cancel button is only displayed in Identity Server.
pull/4783/head
Halil İbrahim Kalkan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
14 additions and
4 deletions
modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs
@ -50,6 +50,8 @@ namespace Volo.Abp.Account.Web.Pages.Account
if ( context ! = null )
if ( context ! = null )
{
{
ShowCancelButton = true ;
LoginInput . UserNameOrEmailAddress = context . LoginHint ;
LoginInput . UserNameOrEmailAddress = context . LoginHint ;
//TODO: Reference AspNetCore MultiTenancy module and use options to get the tenant key!
//TODO: Reference AspNetCore MultiTenancy module and use options to get the tenant key!
@ -41,9 +41,12 @@
</form>
</form>
</div>
</div>
<div class="card-footer text-center border-0">
@if (Model.ShowCancelButton)
<abp-button type="button" button-type="Link" name="Action" value="Cancel" class="px-2 py-0">@L["Cancel"]</abp-button> @* TODO: Only show if identity server is used *@
{
</div>
<div class="card-footer text-center border-0">
<abp-button type="button" button-type="Link" name="Action" value="Cancel" class="px-2 py-0">@L["Cancel"]</abp-button>
</div>
}
</div>
</div>
}
}
@ -51,6 +51,11 @@ namespace Volo.Abp.Account.Web.Pages.Account
protected IAuthenticationSchemeProvider SchemeProvider { get ; }
protected IAuthenticationSchemeProvider SchemeProvider { get ; }
protected AbpAccountOptions AccountOptions { get ; }
protected AbpAccountOptions AccountOptions { get ; }
/// <summary>
/// TODO: Find a better way to implement it. Only show if identity server is used.
/// </summary>
public bool ShowCancelButton { get ; set ; }
public LoginModel (
public LoginModel (
IAuthenticationSchemeProvider schemeProvider ,
IAuthenticationSchemeProvider schemeProvider ,
IOptions < AbpAccountOptions > accountOptions )
IOptions < AbpAccountOptions > accountOptions )
@ -83,7 +88,7 @@ namespace Volo.Abp.Account.Web.Pages.Account
ValidateModel ( ) ;
ValidateModel ( ) ;
ExternalProviders = await GetExternalProviders ( ) ;
ExternalProviders = await GetExternalProviders ( ) ;
EnableLocalLogin = await SettingProvider . IsTrueAsync ( AccountSettingNames . EnableLocalLogin ) ;
EnableLocalLogin = await SettingProvider . IsTrueAsync ( AccountSettingNames . EnableLocalLogin ) ;
await ReplaceEmailToUsernameOfInputIfNeeds ( ) ;
await ReplaceEmailToUsernameOfInputIfNeeds ( ) ;