Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "alukaszewski"

Nevermind my original assumption of doing something stupid was justified.

Hello,

I must be doing something stupid, or I have missed something but I was under the impression Angular components which reference a stylesUrlwould load the LESS or CSS when the component is rendered? None of my components (nor the base aspnetzero component) styles are being rendered from the included less files. I am trying to modify the login.component.less file, but the less/css file is never loaded by the dom.

What am I doing wrong?

Hi,

Thanks for replying.

Which file are you wanting to see? Is it the *CoreModule.cs class from the Core project?

I've just published base 8.9.2 to our staging appservice and it worked fine, so something in our code is causing the issue or I am messing something up in the merge. I'm not able to share the project as it has sensitive information in the codebase (keys). If there's nothing more obvious other than the dbcontext onmodelcreating call, I'll have to try and trace the issue in our code.

Thank you for replying

I've just upgraded to 8.9.2 and on my local build it works fine, but when I publish to Azure I am getting this exception:

WARN 2020-06-16 06:22:44,007 [45 ] Abp.BackgroundJobs.BackgroundJobManager - Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before. at Abp.Domain.Uow.UnitOfWorkBase.GetFilterIndex(String filterName) at Abp.Domain.Uow.UnitOfWorkBase.SetFilterParameter(String filterName, String parameterName, Object value) at Abp.Domain.Uow.UnitOfWorkBase.SetTenantId(Nullable1 tenantId, Boolean switchMustHaveTenantEnableDisable) at Abp.Domain.Uow.UnitOfWorkBase.Begin(UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkManager.Begin(UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.BackgroundJobStoreProxy.GetWaitingJobs(Int32 maxResultCount) at Abp.BackgroundJobs.BackgroundJobManager.DoWork() at Castle.Proxies.BackgroundJobManagerProxy.DoWork_callback() at Castle.Proxies.Invocations.BackgroundJobManager_DoWork.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.BackgroundJobManagerProxy.DoWork() at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e) Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before. at Abp.Domain.Uow.UnitOfWorkBase.GetFilterIndex(String filterName) at Abp.Domain.Uow.UnitOfWorkBase.SetFilterParameter(String filterName, String parameterName, Object value) at Abp.Domain.Uow.UnitOfWorkBase.SetTenantId(Nullable1 tenantId, Boolean switchMustHaveTenantEnableDisable) at Abp.Domain.Uow.UnitOfWorkBase.Begin(UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkManager.Begin(UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.BackgroundJobStoreProxy.GetWaitingJobs(Int32 maxResultCount) at Abp.BackgroundJobs.BackgroundJobManager.DoWork() at Castle.Proxies.BackgroundJobManagerProxy.DoWork_callback() at Castle.Proxies.Invocations.BackgroundJobManager_DoWork.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.BackgroundJobManagerProxy.DoWork() at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)

It's stating that MayHaveTenant filter is not being registered at startup. I still have in my DbContext base.OnModelCreating(modelBuilder); at the start so I am running out of ideas. Anything simple I could have missed?

I think I solved this, by adding myParams to new modalManager modal;

var _myCustomModal = new app.ModalManager({
        viewUrl: abp.appPath + 'Mpa/Modals/MyCustomModal',
        scriptUrl: abp.appPath + 'Areas/Mpa/Views/Common/Modals/_MyCustomModal.js',
        modalClass: 'MyCustomModal',
        myParams: { "param1": "16777328", "param2": "XX1XX1XX2" }
    });

I added some extra functionality to ModalManager.js;

I include myParams in ModalManager.js _normalizeOptions;

return function (options) {

            _normalizeOptions(options);

            var _$modal = null;
            var _modalId = options.modalId;
            var _modalSelector = '#' + _modalId;
            var _modalObject = null;
            var _myParams = options.myParams;

I then have an extra custom Api call which returns my parameters;

getMyParams: function () {
                    return _myParams
                },

Then in _MyCustomModal.js I can use;

var myParams = _modalManager.getMyParams();
            var myParam1 = myParams.param1;

before I run any other code such as DataTables or AmChart.

Bah, this does not appear to work with modals/modalManager. The parameters passed in the URL are not available when the modal loads. There must be a way to extend modal Manager - I can see an 'Args' I wonder what those are?

Ah, good idea thanks.

I had previously not been using the modalManager to show modals, instead including modal html and code on the page or loading from another controller - with that method I could throw a value into a field on the modal before modal.shown and then have the modal execute code based on the value in that field during modal.shown. With modalManager, the modal DOM elements are not available until modal Manager.open but I don't want modal code to execute until I have first established an id value.

In User.cs I already tried this;

public static User CreateTenantAdminUser(int tenantId, string emailAddress, string password)
        {
            return new User
                   {
                       TenantId = tenantId,
                       UserName = AdminUserName,
                       Name = AdminUserName,
                       Surname = AdminUserName,
                       EmailAddress = emailAddress,
                       Password = new PasswordHasher().HashPassword(password),
                       RefreshInterval = 300
                   };
        }

...but when new user accounts are created by LDAP or by admin user, the RefreshInterval is not set to 300. It is still 0 (zero).

As a temporary workaround in my _CreateOrEditModal.cshtml I have this;

<input id="EditUser_RefreshInterval" type="text" name="RefreshInterval" class="form-control edited" @Html.Raw(Model.User.RefreshInterval < 60 ? "value=\"300\"" : "value=\"" + Model.User.RefreshInterval + "\"") maxlength="5">

It's not ideal.

Is it possible to pass additional parameters using ModalManager, such as "myParam" below. I wish to pass an id so that the .js loaded as specified by the scriptURL can access this value.

var _MyCustomModal = new app.ModalManager({
    viewUrl: abp.appPath + 'Mpa/MyCustomModal',
    scriptUrl: abp.appPath + 'Areas/Mpa/Views/Common/Modals/_MyCustomModal.js',
    modalClass: 'MyCustomModal',
    myParam: '16777328'
});
Showing 1 to 10 of 65 entries