Activities of "jeflux"

I do want to add that the work around noted in my original post still works:

  1. Manually add the run-schematics.mjs file to .suite\schematics folder in Angular project
  2. Update the package.json file in .suite\schematics with the JSON provided above
  3. Runnpm install in the .suite\schematics folder
  4. Manually add the $ character as-needed to the schema.json files.
  5. Then run the code generation from ABP Suite

We updated our entire solution to 6.0.1 and still have the issue. Note that we are using "Module Template"

My current CLI and Suite versions are 6.0.2, We can do backend code generation without any issues. This week I scaffolded a new entity for the backend, but today I'm trying to generate the CRUID Angular UI and I get the same error:

Cannot find module 'C:\company\Solution.Main\Blurg\angular.suite\schematics\run-schematics.mjs'

I then fully deleted CLI/Suite, deleted .abp folder and reinstalled everything. Same result.

I then created a new solution with the "Module Template". This resulted in the download of supporting files:

However, when attempting to generate the CRUD Angular UI for this brand new 6.0.2 Module Template solution, same error.

Hello,

Can you modify your app.component.ts with following

import { DynamicLayoutComponent, eLayoutType, RouterEvents } from '@abp/ng.core'; 
import { AfterViewInit, Component, RendererFactory2, ViewChild } from '@angular/core'; 
 
@Component({ 
  selector: 'app-root', 
  template: ` 
    <abp-loader-bar></abp-loader-bar> 
    <abp-dynamic-layout></abp-dynamic-layout> 
  `, 
}) 
export class AppComponent implements AfterViewInit { 
  @ViewChild(DynamicLayoutComponent, { static: false }) dynamicLayout: DynamicLayoutComponent; 
 
  constructor(private rendererFactory: RendererFactory2, private routerEvents: RouterEvents) {} 
 
  ngAfterViewInit(): void { 
    const navigationEnd$ = this.routerEvents.getNavigationEvents('End'); 
    navigationEnd$.subscribe(() => { 
      if (this.dynamicLayout.layoutKey === eLayoutType.empty) { 
        this.rendererFactory 
          .createRenderer(document.body, null) 
          .addClass(document.body, 'empty-layout'); 
      } else { 
        this.rendererFactory 
          .createRenderer(document.body, null) 
          .removeClass(document.body, 'empty-layout'); 
      } 
    }); 
  } 
} 

And please add the following style to your style file

.empty-layout { 
  padding-top: 0; 
} 

Easy peasy! Thank you!

Firstly, which Theme are you currently using? Lepton, LeptonX, Basic

Which version are you currently using? 6.0.0, 5.3.5 etc.

Which UI type? Angular, MVC, Blazor Server, Blazor Wasm

5.3.4 Angular with Lepton them.

hi

There is the audit logic.

https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs#L39

I've read through the logic, but I still don't understand why the [DisableAuditing] attribute has no effect. The documentation leads me to believe that the attribute should exclude the controller/action from audting: https://docs.abp.io/en/abp/5.3/Audit-Logging#enable-disable-for-controllers-actions

By adding the path to the ignored URL collection, this does work. And I can see in the logic why that works.

When I don't have the path ignored (and IsEnabledForGetRequests is true), it appears to me that the ShouldWriteAuditLogAsync() method in the logic you reference should return false by checking for the [DisableAuditing] attribute, but it's returning true either from something in AuditingOptions.AlwaysLogSelectors or just getting the default true response of the method.

Is there an "AlwaysLogSelector" that overrides the DisableAuditing attribute?

AbpAspNetCoreAuditingOptions

This does work. Thank you!

However, was I misunderstanding how it should work? Should the [DisableAuditing] attribute work in the controller example I posted? Does IsEnabledForGetRequests=true ignore that attribute?

At this point, I've generated Angular UI for two of our microservices. There have been a number of challenges, but I'm confident we can make it work. I want to share what I've done to get this going in case someone comes along and tries to do something similar.

I started by creating a new Microservices solution in ABP Suite. I took the generated Angular folder from there and put it into the applications folder of our existing microservices solution. I was able to change the environment values to wire up to our existing oAuth endpoint. And I set the default endpoint to our gateway. I was able to start this angular app and login and got the Saas and Administration menus right out of the box. Very promising.

Next, I went back to ABP Suite and generated a new module. From this generated code, I took the angular folder and dropped it into the solution folder of the microservice I wanted to create an Angular UI for. I removed this microservice solution from ABP Suite, then re-added it to ABP Suite and it recognized it had an Angular folder and I was mostly ready to start generating UI.

In ABP Suite for our microservice I could choose an existing entity and generate UI. A lot of the generated code was good. We particularly wanted the CRUD UI and forms, and we got this! Though there were several caveats:

  • The ABP Solution name in ABP Suite had to match the module name in the response in the/api/abp/api-definitionresponse. For instance, we have what we call the "Company.InvitationService" project, but I had to rename it in ABP Suite to just "InvitationService".
  • There is a file that is generated in the /config/src/enums/route-names.ts directory. It exports an enum with the service name. This was generated as a weird value wouldn't even work out of the box. Easy to fix, but then every other entity I scaffolded UI code for would generate the same invalid name. So after every entity UI scaffold, I would have to go to the provider it made and make some tweaks.
  • Permissions strings for everything were off. This resulted in menu items not showing up. And in the form dropdowns for edit/delete, they show/hide based on a permissions string. I would just do a find/replace to change something from invitation-service. to InvitationService which matches the permissions strings in our microservice backend.
  • A ton of the models had broken references to other models. So I had to go through all the broken refs and just do a quick add import thing.

I'll finish up the remaining microservices we want to generate Angular UI code for, but I think now that I know what to expect, it will go pretty fast. The only remaining item that is unknown is how to merge all of the individual Angular microservice apps into the main Angular app. I have an open ticket on that (https://support.abp.io/QA/Questions/3118/Guidance-on-developing-new-Microservice-Modules-for-Angular).

Of course our life would've been a lot easier if we started with Angular to begin with, but if you are looking to make the change, just know that it is possible.

Actually, ABP Suite searches for some specific directories in your solution.
It generates UI for all the UI types if it finds the folder.
But you can overwrite these paths in the appsettings.json files.
some users change their Angular path, if it's being updated also in the appsettings.json file it'll create the necessary code.

did you try to set paths for your Angular or MVC projects

I did change the path and framework from MVC to angular. The project then shows up in ABP suite as angular. However, when I attempt to generate code, it still generates MVC UI code.

I deleted the web project path. When I click generate, it would re-add the path to the appsettings.json file. So I removed the web project from the solution, but it did the same thing. Then I went a step further and deleted the web project files and set the web project path in the appsettings to null again. When I do this, ABP suite generates no UI code, and the console shows "no command"

At this point, with no MVC project or files, if I re-add the solution to AVP suite, it's still detects it as an MVC solution.

While trying a bunch of things, I did get it to generate angular code for this project. I had miscellaneous junk files from trying a bunch of things, so I reset my git repo to clean up, then I was going to start generating angular code for real. However, I cannot repeat my success. I know I'm close, I suspect it's that I need a folder named "angular" in a specific location.

So it appears if I put an "angular" folder with an "angular.json" file in the solution directory, ABP Suite will recognize it as using Angular UI Framework. I can then change the angular path in appsettings and...it WILL generate Angular UI code!

However, the generated code is quite a mess, probably due to this solution being a module for a microservices template. My guess is that we've strayed too far from the default template for code generation to be useful. I'll leave this ticket open for the time being as I continue to experiment.

Actually, ABP Suite searches for some specific directories in your solution. It generates UI for all the UI types if it finds the folder. But you can overwrite these paths in the appsettings.json files. some users change their Angular path, if it's being updated also in the appsettings.json file it'll create the necessary code.

did you try to set paths for your Angular or MVC projects

I did change the path and framework from MVC to angular. The project then shows up in ABP suite as angular. However, when I attempt to generate code, it still generates MVC UI code.

I deleted the web project path. When I click generate, it would re-add the path to the appsettings.json file. So I removed the web project from the solution, but it did the same thing. Then I went a step further and deleted the web project files and set the web project path in the appsettings to null again. When I do this, ABP suite generates no UI code, and the console shows "no command"

At this point, with no MVC project or files, if I re-add the solution to AVP suite, it's still detects it as an MVC solution.

While trying a bunch of things, I did get it to generate angular code for this project. I had miscellaneous junk files from trying a bunch of things, so I reset my git repo to clean up, then I was going to start generating angular code for real. However, I cannot repeat my success. I know I'm close, I suspect it's that I need a folder named "angular" in a specific location.

there's no automatic way to switch a project's UI Framework to another.

ABP Suite settings are stored in the following file

%UserProfile%\.abp\suite\appsettings.json  

You can find the UI Framework settings in the following fields:

  • UiFrameworkName , update it from Mvc to Angular
  • UiFramework update it from 2 to 3

I didn't test if this works because it's hacky way :)

Ah. This I wanted to try, but wasn't sure where to make the changes. When I make those changes and regenerate UI, ABP Suite is still only generating the MVC code.

When I load an existing solution into ABP Suite, how does it know the UI Framework? Do I need to change it there also? For example, I made the changes you suggested. When it didn't work, I tried to remove solution from ABP Suite, and when I re-added it, the values in appsettings.json had the MVC configuration (the manual changes I made were not persisted)

I've generated a new solution using Angular for UI and compared to one of my existing solutions I want to migrate from MVC to Angular. As you suggested, I made these changes:

  • UiFrameworkName , update it from Mvc to Angular
  • UiFramework update it from 2 to 3

I also noted that my appsettings file has an entry for "WebProjectDirectory." In the newly-generated Angular solution, this value is null. So, I changed it to null for the solution I'm attempting to migrate.

When I then attempt to generate some UI elements using ABP suite, it still generates MVC UI code. Also, the "WebProjectDirectly" value get's changed from null back to it's path to the web project (even if I remove the web project from the VS Solution).

When I generate a new entity in the Angular app, I see in ABP Suite logs "AngularUiGenerateWithSchematicsCommand started", But with MVC you see instead: "MvcUiGenerateCommand started..."

Do you know how ABP Suite is determining whether to call Angular generate or MVC generate? Is there something in the Solution that tells ABP Suite to use MVC?

Showing 11 to 20 of 21 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11