Hi,
I'm sorry, but I don't understand how those links show localisation in dtos. I don't want to change our validation component - we are using a third party component which uses this validation type. The validation itself is working. What I'm unsure of is if I can inject our Localisation resource into a dto to reference that for the error message which currently is a hard-coded string. The links above also use a hard-coded error message string. Is there anything I can do?
We are using a data grid component which requires validation to be performed within the dto class. The validation works, but we are unable to use a localized error message within the class. Is there a way to refer to the localization resource from within the dto?
For eg:
public class ApplicationValidationActionFlatDto
{
public Guid Id { get; set; }
public string TaskDescription { get; set; }
public string Result { get; set; }
[CustomValidationResultDate]
public DateTime ResultDate { get; set; }
public Guid? ResultedById { get; set; }
public string Comments { get; set; }
public int Order { get; set; }
public Guid ApplicationProcessId { get; set; }
public Guid LicenceTypeValidationId { get; set; }
}
public class CustomValidationResultDate : ValidationAttribute
{
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
if (value != null)
{
var d = Convert.ToDateTime(value);
if (d.Year.ToString().Length < 4)
{
return new ValidationResult("ValidationMessageResultDate");
}
else if (d < DateTime.Now)
{
return new ValidationResult("ValidationMessageResultDateLessThanCurrentDate");
}
}
return ValidationResult.Success;
}
}
In CustomValidationResultDate Class, the parameter of ValidationResult Class is not able to be set to a localized string.
We are pretty much just using the built-in logout action. The only change we made was to alter the Microsoft endpoints to support business Microsoft accounts instead of personal ones. Everything seems to work except this less than complete logout.
private void ConfigureExternalProviders(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAuthentication()
.AddGoogle(GoogleDefaults.AuthenticationScheme, _ => { })
.WithDynamicOptions<GoogleOptions, GoogleHandler>(
GoogleDefaults.AuthenticationScheme,
options =>
{
options.WithProperty(x => x.ClientId);
options.WithProperty(x => x.ClientSecret, isSecret: true);
}
)
.AddMicrosoftAccount(MicrosoftAccountDefaults.AuthenticationScheme, options =>
{
//Personal Microsoft accounts as an example.
var tenantId = configuration["ExternalProviders:Microsoft:TenantId"];
options.AuthorizationEndpoint = string.Format("https://login.microsoftonline.com/{0}/oauth2/v2.0/authorize", tenantId);
options.TokenEndpoint = string.Format("https://login.microsoftonline.com/{0}/oauth2/v2.0/token", tenantId);
})
.WithDynamicOptions<MicrosoftAccountOptions, MicrosoftAccountHandler>(
MicrosoftAccountDefaults.AuthenticationScheme,
options =>
{
options.WithProperty(x => x.ClientId);
options.WithProperty(x => x.ClientSecret, isSecret: true);
}
)
.AddTwitter(TwitterDefaults.AuthenticationScheme, options => options.RetrieveUserDetails = true)
.WithDynamicOptions<TwitterOptions, TwitterHandler>(
TwitterDefaults.AuthenticationScheme,
options =>
{
options.WithProperty(x => x.ConsumerKey);
options.WithProperty(x => x.ConsumerSecret, isSecret: true);
}
);
}
We have a system with both local account and External Provider (Microsoft) login types enabled. When a user logs in to Blazor with a Microsoft account, and then logs out again, if they log in with the same browser then the Microsoft account is assumed and logged in automatically. There is no way to log in with a different Microsoft account without also entering a Microsoft app and logging out. We need the blazor logout to also log the Microsoft account out of the browser.
Is this a configuration issue?
@alper - Those kind of variable usages do work in plain CSS. I have them working for the majority of the project now - the colours in my screenshot on the content on the right all uses variables for colour substitution.
My issue is not that that variables aren't working, it's that I cannot override the CSS in the sidebar. I've done kind of a work-around for the moment where I changed the background colour of the underlying element, so as the sidebar divs all have transparent background colours, the underlying one shows through. But I am unable to actively override any of the actual sidebar classes. This means I can't change the icon colours, which is my main issue at the moment, but I also can't override the font style or apply more depth in the menu backgrounds.
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
I am trying to style a site with specific customer branding. We have a Team level support, so can't download the Lepton source code, but I don't really want the source code anyway. All I wanted to do was to override the colours in the lepton theme using custom .css. I have created the .css and applied it to a file which is added with an IBundleContributor implementation. This has worked, but only on the content pages. For some reason, the style changes don't apply to the menu and toolbar. I have checked the implementation, and that section of the page appears to exclude my css file, and just use the Lepton theme.
I had seen https://support.abp.io/QA/Questions/8/Theme-customization-Angular and tried to use a similar strategy, but in Blazor. The screenshots in that discussion show exactly what I want to happen which is the sidebar being skinned.
Here is a screenshot of a test page using Lepton6:
I do have overriding .css calls for the sidebar and menu classes, but my file seems to be ignored completely. Is this action possible from .css?
Here is one class update from my custom .css. I am using variables for the colors (not sure if this would impact it being used within the sidebar or not).
.navbar-toggler {
color: var(--sidebar-text) !important;}
Thanks, Kirsty