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

Activities of "BobIngham"

Any thoughts, @ismcagdas - this is becoming important for me. I tried removing jquery blockUI but that made things even worse! Here is the answer from Telerik:

In general, the error '$.blockUI is not a function' indicates that this might be related to jQuery library that is not imported as required.

We have previously had this problem with Angular applications. The following steps helped resolving the issue :

  1. Install jQuery with the script : npm install --save jquery

  2. Import jQuery globally for the application : //in app.module.ts import * as $ from 'jquery';

Hopefully, the approach would work also for you.

I believe the Zero implementation iof jquery differs from this and I don't want to run "npm install --save jquery" because i believe we already have it in the system. I have tried the "import * as $ from 'jquery';" in both my app.module and my lazy-loaded, nuagecare.module but the same error persists. This is down at a level where I confess I'm not particularly good with. Any suggestions for me to try next?

Hi @ismcagdas, Yes I do. "node_modules/block-ui/jquery.blockUI.js" What is your thinking here?

any ideas, @aaron?

This is probably not a Zero problem but perhaps someone can suggest a way i can configure something to get rid of the errors I am getting... In a fresh angular install I have successfully implemented Telerik reporting with no problems. Using the same methods used in the test project I simply add Telerik reporting:

npm install @progress/telerik-angular-report-viewer

As soon as i import the module into my app.module:

import { TelerikReportingModule } from '@progress/telerik-angular-report-viewer';

and apply it to my imports array the Zero system throws the following error in the console of the login page and the page remains blocked to the user:

ERROR TypeError: $.unblockUI is not a function at Object.abp.ui.unblock (abp.blockUI.js:28)

I then took the import away from the app.module and imported it into my project.module which is lazy-loaded. Now I can login but when I select a menu item invoking my lazy-loaded module the same error is thrown.

Does anyone have any idea as to why a third party component should play havoc with Abp? btw - I will post a similar entry on the Telerik forum.

dotnet-core, angular, 5.4.1 - One for Aaron. I think. Hi Aaron, If you remember I implemented my own EntityHistoryStore inheriting from IEntityHistoryStore to write entity change history to Mongodb. This works well but the other day Azure reconfigured my outgoing Ip's for some reason and the new IP's were not configured in my Mongodb Atlas whitelist. I fixed this issue but realised that I would need a fallback should, for any reason, my Mongodb data store become unavailable. I implemented the following fallback code in my implementation of EntityHistoryStore:

try
{
    //standard timeout for Mpongodb is 30 seconds, here we need to the system to return to the client as quickly as possible
    using (var timeoutCancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(2000)))
    {
        await collection.InsertOneAsync(document);
    }
}
catch (Exception ex)
{
    logger.Error("Mongodb: " + ex.GetType(), ex);
    //fallback and save to SQL Server until Mongodb is back up and running
    await _fallbackEntityHistoryStore.SaveAsync(changeSet);
}

If I cannot write to Mongodb the system will fallback to my FallbackEntityHistoryStore which is simple in implementation:

public class FallbackEntityHistoryStore : IFallbackEntityHistoryStore, ITransientDependency
{
    private readonly IRepository<EntityChangeSet, long> _changeSetRepository;
    private readonly IUnitOfWorkManager _unitOfWorkManager;

    public FallbackEntityHistoryStore(
        IRepository<EntityChangeSet, long> changeSetRepository,
        IUnitOfWorkManager unitOfWorkManager
        )
    {
        _changeSetRepository = changeSetRepository;
        _unitOfWorkManager = unitOfWorkManager;
    }

    public async Task SaveAsync(EntityChangeSet changeSet)
    {
        using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
        {
            await _changeSetRepository.InsertAsync(changeSet);
            await uow.CompleteAsync();
        }
    }
}

This works well on the first call but then fails on subsequent calls with the message:

Cannot insert explicit value for identity column in table '[dbo].[AbpEntityChangeSets]' when IDENTITY_INSERT is set to OFF.

I can reset the identity_insert value in the database directly with SET IDENTITY_INSERT dbo.AbpEntityChangeSets ON and the next iteration will work again but it sets the identity_insert value of the table back to OFF.

Is there some piece of magic which you use in your solution that I can implement in my solution? I have searched your source code on github but I can see nothing you are doing different. Googling the issue suggests I should change data annotations on the models but I don't remember changing any of your models, I built new ones to support Mongdb Bson documents.

Any pointers what to do next? Cheers, Bob

Hi @maliming. Thanks for all the help. The documentation is a little unclear in that it does not specifically mention that appconfig.json should be changed in angular:

{
  "remoteServiceBaseUrl": "https://{TENANCY_NAME}.projectname.api",
  "appBaseUrl": "https://{TENANCY_NAME}.projectname.ui"
}

and appsettings.production.json in .NET core:

"App": {
        "ServerRootAddress": "https://{TENANCY_NAME}.projectname.api/",
        "ClientRootAddress": "https://{TENANCY_NAME}.projectname.ui/",
        "CorsOrigins": "https://{TENANCY_NAME}.projectname.ui/"
    },

I will leave this here on the off-chance that it may help someone else. Thanks again, @maliming.

@maliming, Brilliant, I feel we're going in the right direction. In Nuagecare.Web.Host\Startup\NuagecareWebHostModule.cs, method PreInitialize() I have:

public override void PreInitialize()
{
    Configuration.Modules.AbpWebCommon().MultiTenancy.DomainFormat = _appConfiguration["App:ServerRootAddress"] ?? "http://localhost:22742/";
    Configuration.Modules.AspNetZero().LicenseCode = _appConfiguration["AbpZeroLicenseCode"];
}

In my appsettings.production.json:

"App": {
    "ServerRootAddress": "https://projectname.api/",
    "ClientRootAddress": "https://projectname.ui/",
    "CorsOrigins": "https://projectname.ui/"
},

I just know I'm going to feel really stupid when you tell me to change these values to:

"App": {
    "ServerRootAddress": "https://{TENANCY_NAME}.projectname.api/",
    "ClientRootAddress": "https://{TENANCY_NAME}.projectname.ui/",
    "CorsOrigins": "https://{TENANCY_NAME}.projectname.ui/"
},

Is that where the problem lies?

@maliming, if my understanding is correct the user navigates to the sub-domain and the first thing the browser does is to request the page from the server. Where in the .net code does it read the url to ascertain the tenant and set the session?

Angular cli 6.0.8, Node 8.11.4, OS Win32, Angular 6.0.0 @angular-devkit/architect 0.6.0 @angular-devkit/build-angular 0.6.0 @angular-devkit/build-optimizer 0.6.0 @angular-devkit/core 0.6.8 @angular-devkit/schematics 0.6.8 @angular/cdk 6.4.7 @angular/cli 6.0.8 @angular/compiler-cli 6.0.4 @ngtools/webpack 6.0.0 @schematics/angular 0.6.8 @schematics/update 0.6.8 rxjs 6.1.0 typescript 2.7.2 webpack 4.6.0 The .net core soluition is gramework 4.6.1 but the Mongo and BlobStorage projects and .NET standard 2.0 Does that help? Thanks for your help.

Hi @maliming, I reached a dead-end and I have sent you a copy of my project by email. I'm hoping you can help me in this because I'm fairly much at my wits end! Cheers, Bob

Showing 411 to 420 of 619 entries