Base solution for your next web application

Activities of "andmattia"

How can we set a forword directly to openIdConnect on login page?

Is it possible to add an externla SignalR into a Angular application?

Example a chat sistem not embedded on ANZ

I worked to update our solution, I used the approch describe on ANZ giude Version Updating.

Following this apporch (it's very powefull) I'm able to upgrade my solution but I think it still remain an open point about migration.

On EF pre NetCore you can applied migration created in the past but now EFCore create a file to take a snapshot of db schema so is not possibile to add previous migration. We found 2 solution:

  1. remove all migrations from EF snapshot, add ANZ migration and after that re add custom migration
  2. create a new migration an manully check (index, nameing, etc)
  3. ...

Is it possibile to use different approch to update db?

  • What is your product version? 9.2
  • What is your product type (Angular or MVC)? angular
  • What is product framework type (.net framework or .net core)? .NetCore

If issue related with ABP Framework

  • What is ABP Framework version? 5.13

I migrate from ABP 4.8.1 -> 5.13 and I found an issue on Swagger

 if (WebConsts.SwaggerUiEnabled)
            {
                //Swagger - Enable this line and the related lines in Configure method to enable swagger UI
                services.AddSwaggerGen(options =>
                {
                    options.SwaggerDoc("v1", new OpenApiInfo() { Title = " API", Version = "v1" });
                    options.DocInclusionPredicate((docName, description) => true);
                    options.ParameterFilter<SwaggerEnumParameterFilter>();
                    options.SchemaFilter<SwaggerEnumSchemaFilter>();
                    options.OperationFilter<SwaggerOperationIdFilter>();
                    //options.OperationFilter<SwaggerOperationFilter>();
                    options.CustomDefaultSchemaIdSelector();
                    options.CustomSchemaIds(o => o.FullName);
                    options.OrderActionsBy(o => o.RelativePath);
                }).AddSwaggerGenNewtonsoftSupport();
            }

my DTO class is

public class InputDto: ...
    {
        public string FilterText { get; set; }
        public long? Id { get; set; }
        ...
        public OrderStatus? Status { get; set; }
        ...
        public OrderStatus[] StatusList { get; set; }
        ...
    }

The only way to fix is add a try catch

private static void AddEnumSpec(Type type, ParameterFilterContext context)
        {
            var schema = context.SchemaRepository.Schemas.GetOrAdd($"#/definitions/{type.Name}", () =>
                context.SchemaGenerator.GenerateSchema(type, context.SchemaRepository)
            );

            if (schema.Reference == null || !type.IsEnum)
            {
                return;
            }

            var enumNames = new OpenApiArray();
            enumNames.AddRange(Enum.GetNames(type).Select(_ => new OpenApiString(_)));
            try
            {
                schema.Extensions.Add("x-enumNames", enumNames);
            }
            catch (Exception ex)
            {
                Console.Write("Ingore this error");
            }
        }
Question

Prerequisites

  • What is your product version? 4.8.1 -> 5.11
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? NetCore 3.1

If issue related with ABP Framework

  • What is ABP Framework version? 5.11

I move my app to 5.11 and I find this migration In the same bulk of migration I see a second migration I think is so dangerous. In my case table is empty and no data lost but if I move from different version I can potential lost all data in this table. I see that this migratio is only for raname colum why you decide to release this script and not a Add temp column copy data and remove column?

ANZ 7.1.0 & ANZ 10.5

I try to use multi tenancy routing by name and customize my base url to default tenant and host.mydomain.io to host but somenthing not work on main call from angular.

I follow this suggestion Access host side with hostdomaincom

I set up my local pc where i put some rule on hosts file to ruote traffic for

api.mydomain.com app.mydomain.com deafult.app.mydomain.com deafult.api.mydomain.com

I set on API side my config file in this way

"ServerRootAddress": "http://{TENANCY_NAME}.api.mydomain.com:5000/", 
"ClientRootAddress": "http://{TENANCY_NAME}.mydomain.com:4200/", 
"CorsOrigins": "http://*.mydomain.com:4200,http://localhost:4200,http://localhost:49152,http://localhost:5000,http://localhost:9876,http://localhost:9877",

and if I try to open http://api.mydomain.com:5000 or http://default.api.mydomain.com:5000 the web reply and I'm able to connect. I need to add this row to Program.cs on web.Host to allow IIS to replay on my real IP and not only to localhost

                .UseIISIntegration()
                .UseUrls("http://192.168.1.21:5000") //-->>>TO DEBUG ON Local
                .UseStartup<Startup>();

<br> From angular side I get this error

On 10.5 angular call first time and get an error so it retry on 7.1 no call 1 time and broken it. Is it normal that getall not replay first time?

Question

Hi

I look to ABP.IO Commercial for next upgrade on our solition based on ANZ because we need some options based on MongoDb. Our solution is not very simple to move in one single step to ABP.IO for this reason I need to invastigate if it's possibile to start some service on ABP.IO and step by step move other.

I check if we can share the same database but I think is not possibile beacuse now the defualt id is GUID and on ANZ is int. So I read the documentation on ABP.IO and, if I correct undestand, I can use ANZ site for autentication and use ABP.IO like a separate service in that way I can share DB or not it's not blocking (my idea / goal could be some microservice that use ANZ solution for autentication)

I terms of license can we have some support during this transition phase (I work on ANZ since ver 0.7)

Any idea o support is appreciated.

Regards

Abp 4.8.1

Hi I've a console application that works on ABP + HangFire.

on Program.cs I've

 var host = Host.CreateDefaultBuilder(args);
            host.ConfigureAppConfiguration(
                (hostContext, config) =>
                {
                    config.SetBasePath(Directory.GetCurrentDirectory());
                    config.AddJsonFile("appsettings.json", false, true);
                }
            );

            host.ConfigureLogging(
                loggingBuilder =>
                {
                    loggingBuilder.ClearProviders();

                    var configuration = new ConfigurationBuilder()
                        .AddJsonFile("appsettings.json", false, true)
                        .AddEnvironmentVariables()
                        .Build();
                    var loggerConfig = new LoggerConfiguration()
                        .ReadFrom.Configuration(configuration);


                    var logger = loggerConfig.CreateLogger();
                    loggingBuilder.AddSerilog(logger, dispose: true);
                }
            );

So I see that HangFire logs work beacuse HF internlly search the logger provider how can I tell to ABP to use my log model?

Question

Hi

I try to find a best way to implement this pattern. User Role + Data Segregation.

Suppose to have an entity invoice with IMustHaveCompany and Company entity.

My Goal is to create an access level for user to have specific function on single company

USER_A -> Admin Company 1 USER_B -> User Company 1

USER_A -> User Company_2 USER_B -> Admin Company_2

but if you ad another level like sales organization

| Company A |--| Sales Org 1 |--| Sales Org 2 | Company B |--| Sales Org 3 |--| Sales Org 4

we have more complex situation

  1. User 1 -> Admin Company A, implicty is Admin on Sales Org 1 and 2
  2. User 2 -> Admin Sales Org 1 and User In Sales Org 2
  3. User 3 -> Admin Sales Org 2 and User In Sales Org 1
  4. ....

How is the best way to implement this pattern?

The actual sales organization implementation is not able to do that. If I set my entity with OuOrganizationId (0001.0001 and roles) I cann't assinge a user role in organization unit....

Angular + .NET Core + Zero (7.2 abp 4.8.1)

We want to autenticate user from external app without passing user & password but a token.

In first option we use and encripetd token with user data and login this user, after login complete we use impersonate to move to real user. It works but we have an open issue. If user click on impersonate back it return to user used to login.

Is it possibile impersonate user directly without a password?

Showing 1 to 10 of 64 entries