Base solution for your next web application
Open Closed

Possible problem with abp.features.isEnabled in Angular with 10.1-rc1 release #9958


User avatar
0
murphymj5209 created

I am on the current release 10.1.0-rc1 and am trying to get the menu to work for my solution; I am trying to add a menu item that will display if the Tenant has a feature. When I implment the feature in the menu, the solution just keeps running and does not come back. I am supplying the code i used and various screen shots with the last 20 rows of the log file.

I am logged onto non-host tenant and in a user account. It happens in the Tenant Admin account also.

I was expecting the Menu item to go from being displayed to disappear or to stay on the left hand sidebar, assuming the Tenant had the feature. I looked at various problem reports and the documents and this looks OK.

Please let me know what is the problem and its resolution. thanks.


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murphymj5209

    Could you also check browser console ? It seems like there is a JavaScript error.

    Thanks,

  • User Avatar
    0
    murphymj5209 created

    Here is the error. plz let me know how to handle.

    To be brief: the 1st line works, the 2nd one does not. :) new AppMenuItem('MorthoApp', '', 'flaticon-interface-8', '/app/admin/demo-ui-components'), //new AppMenuItem('MorthoApp', '', 'flaticon-interface-8', '/app/admin/demo-ui-components', [], [], null, null, (abp.features.isEnabled("App.WebFeatue.Arthroplasty.TotalKnee"))),

    I also tried (abp.features.isEnabled('App.WebFeatue.Arthroplasty.TotalKnee')); i thought the double quote vs single quote.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You need to check featureDependency on the Angular side as explained in this post https://github.com/aspnetzero/aspnet-zero-core/issues/1632#issuecomment-428900148. Could you try that ?

  • User Avatar
    0
    murphymj5209 created

    I have tried your solution to my problem and it did not work; the eror is shown below.

    I tried the following code, Chat feature unchecked, on the admin account for Tenant #2 the content stays on the menu screen.

    new AppMenuItem('MorthoApp', '', 'flaticon-interface-8', '/app/admin/demo-ui-components', [], [], null, abp.features.isEnabled('App.ChatFeature.')),

  • User Avatar
    0
    musa.demir created

    Did you add that?

  • User Avatar
    0
    murphymj5209 created

    No I did not add the statement; I am sure it will work OK.