Base solution for your next web application

Activities of "rickwheeler"

You may also like to add a unique index to the table on Name + EditionId + TenantId

Hi,

Thanks for your help. I can confirm that both of these issues are resolved.

#2 was because the database was refreshed and I forgot to set my time-zone again.

Regards, Sean

Hi,

I haven't been able to figure out how to fix this yet. I tried to find a solution for you but couldn't so perhaps you can help.

The "active" state on the administration menu seems a little buggy. Here are the steps to replicate with a fresh install of ABP Zero.

I'm using the SPA/Angular version of Zero.

  • Log in as admin, the tenants screen is shown. Notice on the left there is a solid blue border showing.

  • Click "Administration", the admin menu drops down.

  • Click "Organization Units". Notice how the administration is now collapsed (It shouldn't be collapsed), there are no menu items highlighed and nothing with a solid blue border on the left.

  • Click "Administration" again

  • Click "Roles". Notice that Administration menu is now highlighed with a solid blue border on the left.

  • Click "Users". The menu continues to stay as highlighted.

  • Click "Tenants". Notice how there are now TWO menu items highlighted!

  • Click "Editions". The admin menu collapses and only one menu item is highlighed now.

  • An item under the admin menu needs to be clicked twice in order for it to be highlighted

  • The admin menu should not collapse after clicking the first item

  • The admin menu should not stay highlighted after click back to tenants/editions

The issue appears to have something to do with angular ui router and $state as well as the ui-sref-active directive. I'd say it has something to do with the nested nature of the menu but unfortunately I haven't been able to figure out what is causing this.

Can you please investigate this problem?

Okay great. Thanks for the quick reply!

Hi,

I'm trying to write some code to create a new tenant from a console application.

  • Download ASP.NET Zero template
  • Add a new console application to the solution
  • Make it a module just like the Migrator tool using the same code for bootstrapper etc
  • Call TenantManager.CreateWithAdminUserAsync

When I do this, I receive the error "There is no permission with name: Pages.Tenants"

I have both data and core modules added as dependencies to my console application module. Are you able to replicate this problem?

Any help appreciated.

Cheers, Sean

Hi,

In Abp.Configuration.Setting.Value the string length is set to 2000.

I need the field to be NVARCHAR(MAX)

How would you suggest to accomplish this in an ABPZero template?

Regards, Sean

Hi,

If I define a route like the following underneath all routes in in the RouteConfig.cs, calls from the angular app to the dynamic API no longer work. Instead, they are passed to my CatchAllController as shown in the image.

routes.MapRoute(
                "CatchAll",
                "{*urlString}",
                new { controller = "CatchAllController", action = "Index" }
            );

This is a fairly major issue for us at the moment so any help on how to resolve the problem would be appreciated.

Perhaps it has to do with moving the order of precedence for dynamic api routes above my catch all route? The catch all route should be the very last option if no other routes were found.

Regards, Sean

<cite>exlnt: </cite> That file is already there. I updated the bundle reference to use "Darkblue" so that resolved the color issue. The menu still does not work. It will not expand when you click on it. Can you help me with that?

To fix this issue you need to edit YourApplication.Web>App>common>views>layout>sidebar.cshtml

You need to change this

<a href="javascript:;" class="auto" ng-if="childMenuItem.items.length">

To this

<a href="javascript:;" class="auto nav-link nav-toggle" ng-if="menuItem.items.length">

Hi,

It is related.

It is to do with the way you are registering the routes and the order that they are registered in.

The problem is that by adding a catch all route inside of the RouteConfig.cs of the web project. It gets registered BEFORE the dynamic API routes.

Here is how I resolved the issue.

Step 1: Add a catch all route in the PostInitialize method. This will ensure that it is registered AFTER all others.

public override void PostInitialize()
        {
            var server = HttpContext.Current.Server;
            var appFolders = IocManager.Resolve<AppFolders>();

            appFolders.SampleProfileImagesFolder = server.MapPath("~/Common/Images/SampleProfilePics");
            appFolders.TempFileDownloadFolder = server.MapPath("~/Temp/Downloads");
            appFolders.WebLogsFolder = server.MapPath("~/App_Data/Logs");
            
            try { DirectoryHelper.CreateIfNotExists(appFolders.TempFileDownloadFolder); } catch { }

            // Register catch all here
            RouteTable.Routes.MapRoute(
                "CatchAll",
                "{*urlString}",
                new { controller = "CatchAll", action = "Index" }
            );
        }

Step 2: Update RouteConfig.cs with the following. We need to comment out the default route, map attribute routes and add explicit routes for scripts and views controllers

public static class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // Map attribute routes
            routes.MapMvcAttributeRoutes();

            //ASP.NET Web API Route Config
            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            routes.MapRoute(
                "Home",
                "",
                new { controller = "Page", action = "Home" }
            );

            // Add explicit routes for some ABP controllers that were being handled by the now commented out default route
            routes.MapRoute(
                "AbpScripts",
                "AbpScripts/{action}",
                defaults: new { controller = "AbpScripts" },
                namespaces: new [] { "Abp.Web.Mvc.Controllers" }
            );

            routes.MapRoute(
                "AbpAppView",
                "AbpAppView/{action}",
                defaults: new { controller = "AbpAppView" },
                namespaces: new[] { "Abp.Web.Mvc.Controllers" }
            );

            // Comment out old default route in order to define explicit attribute routes
            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            //    namespaces: new[] { "ProductsOnline.Web.Controllers" }
            //);
            
        }
    }

Step 3: Go through all Controllers and define explicit attribute routes as follows

[AbpMvcAuthorize]
    // Add explicit attribute routing
    [Route("profile/{action}/{id?}")]
    public class ProfileController : ProductsOnlineControllerBase
    {
Question

Hi,

Just wondering if it is safe to disable Entity Framework Lazy Loading?

public MyDbContext()  : base("Default")
{
    this.Configuration.LazyLoadingEnabled = false;
}

I want to disable it in my DbContext but want to make sure it isn't going to cause any issues with ABP.

Thanks, Sean

Showing 11 to 20 of 24 entries