@mdframe sure thing - here's the complete HTML of my modal component:
<div bsModal #modalCategoryCreateOrEdit="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="modal" aria-hidden="true" [config]="{backdrop: 'static'}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form *ngIf="active" role="form" #formCategoryCreateOrEdit="ngForm" novalidate (ngSubmit)="save()">
<div class="modal-header">
<h4 class="modal-title">
<span>{{modalTitle}}</span>
</h4>
<button type="button" class="close" style="cursor: pointer; line-height: normal;" (click)="close()">
<span class="fas fa-times" aria-hidden="true"></span>
<span class="sr-only">{{l('Shared.Action.Close')}}</span>
</button>
</div>
<div class="modal-body">
<!-- Add new Translation -->
<div class="form-group">
<button type="button" class="btn btn-default" (click)="createTranslation()">
<span class="fas fa-plus" aria-hidden="true"></span>
{{l("Shared.Action.Add")}}
</button>
</div>
<!-- Translations -->
<!--<Primeng-TurboTable-Start>-->
<div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
<p-table #tableCategoryTranslations (onLazyLoad)="getTranslations($event)" [value]="primengTableHelper.records"
rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
[responsive]="primengTableHelper.isResponsive">
<ng-template pTemplate="header">
<tr>
<th style="width: 135px">
{{l('Shared.Actions')}}
</th>
<th>
{{l('Translation.Name')}}
</th>
<th>
{{l('Translation.Language')}}
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-record="$implicit">
<tr>
<td style="width: 135px">
<div class="btn-group dropdown" dropdown container="body">
<a dropdownToggle href="javascript:;" class="dropdown-toggle btn btn-sm btn-primary">
<span class="fas fa-cog" aria-hidden="true"></span>
{{l("Shared.Actions")}}
</a>
<ul style="z-index: 2000" class="dropdown-menu" *dropdownMenu>
<li>
<a *ngIf="editTranslationCanExecute()" href="javascript:;" (click)="editTranslation(record)">
<span class="fas fa-edit" aria-hidden="true"></span>
{{l("Shared.Action.Edit")}}
</a>
</li>
<li>
<a *ngIf="deleteTranslationCanExecute()" href="javascript:;"
(click)="deleteTranslation(record)">
<span class="fas fa-trash" aria-hidden="true"></span>
{{l("Shared.Action.Delete")}}
</a>
</li>
</ul>
</div>
</td>
<td>
{{record.name}}
</td>
<td>
{{record.language | languageByISO: cultures}}
</td>
</tr>
</ng-template>
</p-table>
<div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
{{l('NoData')}}
</div>
<div class="primeng-paging-container">
<p-paginator rows="{{primengTableHelper.defaultRecordsCountPerPage}}"
#paginatorCategoryTranslations (onPageChange)="getTranslations($event)" [totalRecords]="primengTableHelper.totalRecordsCount"
[rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
</p-paginator>
<span class="total-records-count">
{{l('TotalRecordsCount', primengTableHelper.totalRecordsCount)}}
</span>
</div>
</div>
<!--<Primeng-TurboTable-End>-->
</div>
<div class="modal-footer">
<button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">
{{l("Shared.Action.Cancel")}}
</button>
<button type="submit" class="btn btn-primary blue" [disabled]="!formCategoryCreateOrEdit.form.valid"
[buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
<span class="fas fa-save" aria-hidden="true"></span>
{{l("Shared.Action.Save")}}
</button>
</div>
</form>
</div>
</div>
<modal-category-translation-create-or-edit #modalCategoryTranslationCreateOrEdit>
</modal-category-translation-create-or-edit>
</div>
Hope it's useful somehow!
@mdframe good find : )
I managed to get what I wanted by simply adding an inline-style to the <ul>:
<ul style="z-index:2000" class="dropdown-menu" *dropdownMenu>
I'm not a big fan of inline-styles but as they can be found in some other places in ASPNETZERO as well, it will do.
Thanks for your help @mdframe : )
Hi @ismcagdas
I replaced the <button> for the dropdownToggle with an <a> but that didn't work either ... It doesn't trigger submit anymore, but the menu still does not show.
My guess is that is has something to do with the dropdown being part of a modal, which is not beeing displayed right from the beginning.
I will post an update here, as soon as I found a solution.
I'm having troubles implementing the 'action-menu' for table-items in a modal window. The action-menu should allow me to select actions such as editing and deleting translations for the selected entity. But instead of showing the dropdown with its menu-item, it just saves changes (I get a toast stating changes have been saved) and closes the modal window. Also there are warnings related to sweetalert2 shown in console.
I implemented the action-menu the same way it's done everywhere else ASPNETZERO. Already checked that for errors - unable to find any issues there. Also, I tried to implement it exactly as documented by ngx-bootstrap - doesn't help either.
For now, I switched to use separate buttons instead of the dropdown-menu. But I'd like to have the dropdown because of consistency.
Please, see if you can reproduce the problem (there is no such implementation in ASPNETZERO of a modal that implements a data-table with an action-menu for each data-item).
Hi @sduffy
Until a few weeks ago I had a similar setup as you, only less RAM (8 GB). Currently I'm on a Intel Xeon E3-1225 V2 and 32 GB.
Never had any issues running ASPNETZERO (Core + Angular).
Executing 'npm run hmr' is still pretty slow (the '92% after chunk asset optimization'-part), but that's the only 'problem' there is so far.
I was able to figure out the problem and solve it. It was due to a change I falsely made to QueryStringTokenResolver(…) in AuthConfigurer.cs. All is working fine now!
Unmodified ASPNETZERO works as expected. So, there is something wrong with my project … Okay, that's all I wanted to make sure.
@ismcagdas I just checked demo.aspnetzero.com with different browsers and it works as expected in current version of Firefox and Chrome. In Edge it got error notifications when I tried to send messages. Now it kind of works as long as the user I want to chat with is logged in. But the messages do not get displayed in chat window - I need to refresh the page to see latest messages. Anyway, this looks like there is an issue with Edge and not with ASPNETZERO.
In dev-environment it still doesn't work in any of the browsers. Here are the log-entries from Logs.txt (opened chat and tried to send a single message):
INFO 2018-09-10 10:11:21,605 [22 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS http://localhost:22742/api/services/app/Chat/GetUserChatMessages?UserId=1
INFO 2018-09-10 10:11:21,605 [22 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution successful.
INFO 2018-09-10 10:11:21,605 [22 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 0.2934ms 204
INFO 2018-09-10 10:11:21,619 [23 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:22742/api/services/app/Chat/GetUserChatMessages?UserId=1 application/json
INFO 2018-09-10 10:11:21,619 [23 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution successful.
INFO 2018-09-10 10:11:21,619 [23 ] uthentication.JwtBearer.JwtBearerHandler - Successfully validated the token.
WARN 2018-09-10 10:11:21,619 [23 ] calization.RequestLocalizationMiddleware - AbpUserRequestCultureProvider returned the following unsupported cultures 'null'.
WARN 2018-09-10 10:11:21,619 [23 ] calization.RequestLocalizationMiddleware - AbpUserRequestCultureProvider returned the following unsupported UI Cultures 'null'.
INFO 2018-09-10 10:11:21,627 [23 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "app", action = "GetUserChatMessages", controller = "Chat"}. Executing action CompanyName.ProjectName.Chat.ChatAppService.GetUserChatMessages (CompanyName.ProjectName.Application)
INFO 2018-09-10 10:11:21,627 [23 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution successful.
INFO 2018-09-10 10:11:21,635 [23 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method CompanyName.ProjectName.Chat.ChatAppService.GetUserChatMessages (CompanyName.ProjectName.Application) with arguments (CompanyName.ProjectName.Chat.Dto.GetUserChatMessagesInput) - Validation state: Valid
INFO 2018-09-10 10:11:21,685 [4 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method CompanyName.ProjectName.Chat.ChatAppService.GetUserChatMessages (CompanyName.ProjectName.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 49.1124ms.
INFO 2018-09-10 10:11:21,685 [4 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'.
INFO 2018-09-10 10:11:21,687 [4 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action CompanyName.ProjectName.Chat.ChatAppService.GetUserChatMessages (CompanyName.ProjectName.Application) in 60.0389ms
INFO 2018-09-10 10:11:21,688 [4 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 68.9666ms 200 application/json; charset=utf-8
WARN 2018-09-10 10:11:32,698 [23 ] CompanyName.ProjectName.Web.Chat.SignalR.ChatHub - Could not send chat message to user: 1
WARN 2018-09-10 10:11:32,704 [23 ] CompanyName.ProjectName.Web.Chat.SignalR.ChatHub - Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<CheckPermissions>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
at Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type)
at Abp.Authorization.AuthorizationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.ChatMessageManagerProxy.SendMessageAsync(UserIdentifier sender, UserIdentifier receiver, String message, String senderTenancyName, String senderUserName, Nullable`1 senderProfilePictureId)
at CompanyName.ProjectName.Web.Chat.SignalR.ChatHub.<SendMessage>d__5.MoveNext()
Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<CheckPermissions>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
at Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type)
at Abp.Authorization.AuthorizationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.ChatMessageManagerProxy.SendMessageAsync(UserIdentifier sender, UserIdentifier receiver, String message, String senderTenancyName, String senderUserName, Nullable`1 senderProfilePictureId)
at CompanyName.ProjectName.Web.Chat.SignalR.ChatHub.<SendMessage>d__5.MoveNext()
Additional Information:
I was working on a feature using SignalR. Hub was working as expected, only when i switched to use the Hub through IHubContext<MyHubName> (just like in SignalRChatCommunicator.cs) I realized that it didn't work at all - the client never received any messages. After trying to debug without success, I checked if chat was working properly (as it also uses IHubContext) - which doesn't seem to be the case ...
I'm currently receiving error-notification when trying to send a message in chat (both on my dev environment as well as on demo.apsnetzero.com; both ASP.NET Core & Angular; ASPNETZERO 5.5.0):
[attachment=0:3evupvak]aspnetzero-chat-send_message-error-20180908.png[/attachment:3evupvak]
AppService method does not get called. There are no errors logged to browser console.
Please, confirm whether there is a problem in ASPNETZERO 5.5.0? If not, why do I encounter this error on demo.aspnetzero.com as well?