I have the same problem. @kpmg's answer did not solve the problem for me.
Thank you @ismcagdas!
Feature request can be found here: feature request: implement refresh tokens in Angular client
7.0.0, Angular, .NET Framework
Some of our customers complain about having to login each day they use our product although there is a "remember me" checkbox. The previous version of our product (which was a prototype) was based on plain Asp.NET using cookie authentication and sliding expiration, so they almost never had to login for quite some time. We want to achieve that same user experience they had before again.
So, I was reading a bit about authentication using JWT tokens and refresh tokens and also looking through the source code of ASPNETZERO to see whether refreshing tokens is implemented, which seems it is ... partially!? It seems the Core project fully implements refreshing tokens, but the Angular project does not!? Are there any plans to complete implementation for Angular? Or am I missunderstanding something important here?
I was able to solve it myself - anyway, thank you @maliming!
Styles for pricing pages can be found in src\assets\metronic\themes\default\css\pages\general\pricing\pricing-*.css
. Just copy its content to select-edition.component.less
(replacing all kt-pricing-1
styles).
Note: CSS class names have changed from m-pricing-table-*
to kt-pricing-*
(so, no table
anymore).
7.0.0, Angular, .NET Framework
I'm using metronic's pricing tables 4 but now that I'm upgrading to ASPNETZERO 7.0.0 my select-edition page is broken ... It seems to me the styles are missing - how do I add them back again?
You are right @maliming! Didn't see it myself, not even in code (overlooked many times...) - how were you able to tell from log message? Experience? Thanks a lot!
7.0.0, Angular, .NET Framework
I'm having troubles with one of my multi-lingual entities - see log:
ERROR 2019-07-08 15:55:00,824 [13 ] Mvc.ExceptionHandling.AbpExceptionFilter -
Unmapped members were found. Review the types and members below.
Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
AutoMapper created this type map for you, but your types cannot be mapped using the current configuration.
Task`1 -> List`1 (Destination member list)
System.Threading.Tasks.Task`1[[System.Collections.Generic.List`1[[CompanyName.ProjectName.EntityFeatures.EntityFeatureTranslation, CompanyName.ProjectName.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] -> System.Collections.Generic.List`1[[CompanyName.ProjectName.Backend.EntityFeatures.Dto.EntityFeatureTranslationBackendDto, CompanyName.ProjectName.Application.Shared, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null]] (Destination member list)
Unmapped properties:
Capacity
AutoMapper.AutoMapperConfigurationException:
Unmapped members were found. Review the types and members below.
Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
AutoMapper created this type map for you, but your types cannot be mapped using the current configuration.
Task`1 -> List`1 (Destination member list)
System.Threading.Tasks.Task`1[[System.Collections.Generic.List`1[[CompanyName.ProjectName.EntityFeatures.EntityFeatureTranslation, CompanyName.ProjectName.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] -> System.Collections.Generic.List`1[[CompanyName.ProjectName.Backend.EntityFeatures.Dto.EntityFeatureTranslationBackendDto, CompanyName.ProjectName.Application.Shared, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null]] (Destination member list)
Unmapped properties:
Capacity
bei AutoMapper.ConfigurationValidator.AssertConfigurationIsValid(IEnumerable`1 typeMaps)
bei lambda_method(Closure , Task`1 , List`1 , ResolutionContext )
bei lambda_method(Closure , Object , Object , ResolutionContext )
bei AutoMapper.Mapper.AutoMapper.IMapper.Map[TDestination](Object source)
bei CompanyName.ProjectName.Backend.EntityFeatures.EntityFeatureBackendAppService.<GetTranslationsForEntityFeaturePagedAndSortedAsync>d__14.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei lambda_method(Closure , Object )
bei Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.<Execute>d__0.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
bei Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
bei Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()
Here are the involved classes:
public class EntityFeature : FullAuditedEntity, IMultiLingualEntity<EntityFeatureTranslation>, IPassivable
{
[Required]
[MaxLength(EntityConsts.EntityFeature.MaxLengthLabelCssClasses)]
public virtual string LabelCssClasses { get; set; }
[Required]
[MaxLength(EntityConsts.EntityFeature.MaxLengthIconCssClasses)]
public virtual string IconCssClasses { get; set; }
public virtual bool IsActive { get; set; }
public virtual ICollection<EntityFeatureTranslation> Translations { get; set; }
}
public class EntityFeatureTranslation : AuditedEntity, IEntityTranslation<EntityFeature>
{
[Required]
[MaxLength(EntityConsts.EntityFeature.MaxLengthName)]
public virtual string Name { get; set; }
[Required]
[MaxLength(EntityConsts.EntityFeature.MaxLengthTitleHtmlTag)]
public virtual string TitleHtmlTag { get; set; }
public virtual EntityFeature Core { get; set; }
public virtual int CoreId { get; set; }
[Required]
[MaxLength(EntityConsts.Translation.MaxLengthLanguage)]
public virtual string Language { get; set; }
}
public class EntityFeatureBackendDto : FullAuditedEntityDto, IPassivable
{
public string Name { get; set; }
public string TitleHtmlTag { get; set; }
public string LabelCssClasses { get; set; }
public string IconCssClasses { get; set; }
public bool IsActive { get; set; }
public ICollection<EntityFeatureTranslationBackendDto> Translations { get; set; }
}
public class EntityFeatureTranslationBackendDto : AuditedEntityDto
{
public string Name { get; set; }
public string TitleHtmlTag { get; set; }
public string Language { get; set; }
}
There are other multi-lingual entities as well, all of them working as expected. Any ideas what's wrong with this one?
Thank you for your reply @alper!
I chose to do it by making use of UserManager:
[UnitOfWork]
private async Task<UserIdentifier[]> GetHostUserIds()
{
using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant))
{
var hostUsers = await _userManager.Users.Where(e => e.TenantId == null).ToListAsync();
var hostUserIds = new UserIdentifier[hostUsers.Count];
for (var i = 0; i < hostUsers.Count; i++)
{
hostUserIds[i] = hostUsers[i].ToUserIdentifier();
}
return hostUserIds;
}
}
Works nicely!
I'm reopening this because I now know why my custom notifications don't work - and the reason is similar to what I explained in my comment above.
The situation is the following:
If a tenant user creates or edits an entity, a notification will be sent to host users and the entity will be temporarely locked to be reviewed by a host user with a sepecific permission. Since I want any host user (given the specific permission) to be able to receive the notification, I don't pass any tenantIds
or userIds
to NotificationPublisher.PublishAsync(...)
. But this doesn't lead to the correct result because if no tenantIds
and no userIds
are passed on, then the tenantIds
will be set to an array containing AbpSession.TenantId
which is the current tenant as we can see here. This means I cannot trigger a notification by a tenant user and send it to all host users. At least not this way.
Is there any easy solution to what I want to achieve? Right now I can only think of retrieving all host users and add them to userIds
- any better ideas?
Hi @ismcagdas! Yes, notification settings are correct.
I think I found what was causing the problem with not receiving further notifications for NewTenantRegisteredAsync(...)
:
After registering a new tenant I used the browser's back-button to go back to registering the next new tenant - in this case no further notification is sent (note that the newly registered tenant is selected automatically after registration). But if I just delete the /account/register-tenant-result
-part from the browser's address-bar to get back to login page and start a fresh registration from there (first switch from new tenant back to host) everything works as expected. So, I think the fact that after a successful registration, the new tenant was selected automatically for login was causing the problem (as AbpSession.TenantId
for sure was something other than null
). I guess, this is not something that would happen in reality - so, there is no issue here (and sorry for stealing your time).
Next, I will try to make my custom notifications work - but I might start a new questions if I still face problems!