Leonardo.Willrich的活动

  • ABP Framework version: v4.2.1
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

I have two DBContext in my application and I want to know how to use DBMigrator to apply migration for both DBContext? To create (add-migration) and to update the database (update-database) I am using the argument -context <dbcontext>. But, how it will be possible using DBMigrator? I want to seed my database using DBMigrator.

  • ABP Framework version: v4.2.1
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi, I have created a simple CRUD in the Blazor Commercial ABP.IO framework. I am trying to deploy to a IIS server and I am getting issue when clicking in Login link, it is returning Error 500. In the logs files, I could see:

2021-03-07 05:43:17.967 +00:00 [ERR] Invalid redirect_uri: https://avalancheocp.tvdinc.com/authentication/login-callback {"ClientId":"AvalancheOCP_Blazor","ClientName":"AvalancheOCP_Blazor","RedirectUri":null,"AllowedRedirectUris":["https://localhost:44307/authentication/login-callback"],"SubjectId":"anonymous","ResponseType":null,"ResponseMode":null,"GrantType":null,"RequestedScopes":"","State":null,"UiLocales":null,"Nonce":null,"AuthenticationContextReferenceClasses":null,"DisplayMode":null,"PromptMode":"","MaxAge":null,"LoginHint":null,"SessionId":null,"Raw":{"client_id":"AvalancheOCP_Blazor","redirect_uri":"https://avalancheocp.tvdinc.com/authentication/login-callback","response_type":"code","scope":"openid profile AvalancheOCP role email phone","state":"cf815de5d3414edc8f74d53c799f1a30","code_challenge":"krQ1k5KNh9_QFBaWHwRW-JR4wXFJMUTuzpgUYcSApHA","code_challenge_method":"S256","response_mode":"query"},"$type":"AuthorizeRequestValidationLog"}

I have already changed the appsettings.json as below, but, even restarting all IIS, it keeps showing https://localhost:44307. It seems to be hardcoded in some point.

appsettings.json:

"App": {
    "SelfUrl": "https://avalancheocp.host.tvdinc.com",
    "CorsOrigins": "https://*.tvdinc.com",
		"RedirectAllowedUrls": "https://avalancheocp.tvdinc.com"
  },

What would be wrong?

  • ABP Framework version: v4.2.1
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

When I try to run DbMigrator.exe on deployed environment it says that the solution folder was not found. In the "...DbMigrationService.cs" I've found a method that gets the solution path. If not found, it raises an exception. See below:

private string GetDbMigrationsProjectFolderPath()
        {
            var slnDirectoryPath = GetSolutionDirectoryPath();

            if (slnDirectoryPath == null)
            {
                throw new Exception("Solution folder not found!");
            }

            var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src");

            return Directory.GetDirectories(srcDirectoryPath)
                .FirstOrDefault(d => d.EndsWith(".DbMigrations"));
        }

        private string GetSolutionDirectoryPath()
        {
            var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());

            while (Directory.GetParent(currentDirectory.FullName) != null)
            {
                currentDirectory = Directory.GetParent(currentDirectory.FullName);

                if (Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null)
                {
                    return currentDirectory.FullName;
                }
            }

            return null;
        }

Is that correct? Is DbMigrator suppose to be executed in deployment environement? I don't have my source code there, only the binary files generated by "Publish to Folder" option.

  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

I wonder if there is an option for confirmation popups for Blazor template such as in ABP Framework?

For example: https://docs.abp.io/en/abp/latest/UI/Angular/Confirmation-Service https://aspnetboilerplate.com/Pages/Documents/Javascript-API/Message

To create a confirmation poup I create a Modal in my razor page. But, I don't want to do that always, it would be awesome if there was some to do that easily.

My code:

<Modal @ref="ActiveConfirmationModal">
    <ModalContent Centered="true">
        <ModalHeader>
            <ModalTitle>@L["SupplyNetwork:DesactiveTitle"]</ModalTitle>
            <CloseButton />
        </ModalHeader>
        <ModalBody>
            @L["SupplyNetwork:DesactiveMessage"]
        </ModalBody>
        <ModalFooter>
            <Button Color="Color.Primary" Clicked="@(() => ActiveConfirmationModal.Hide())">@L["Button:Yes"]</Button>
            <Button Color="Color.Secondary" Clicked="CancelActiveCheck">@L["Button:No"]</Button>
        </ModalFooter>
    </ModalContent>
</Modal>
  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

I have a modal with some fields SELECT. The first item is just a generic item to message the user to select an option. Those fields are required, I don't want leave the user save the modal with some not selected field. How can I do that? I've tried play with Validation component, but it doesn't work.

Here one of my SELECT code:

<Select TValue="int" @bind-SelectedValue="@NewEntity.NetworkTypeId">
    <SelectItem TValue="int" Value="0">@L["SupplyNetwork:SelectNetworkType"]</SelectItem>
    @foreach (var network in networkTypeList)
    {
        <SelectItem TValue="int" Value="@network.Id">
            @network.Name
        </SelectItem>
    }
</Select>
  • ABP Framework version: v4.2.2
  • UI type:Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

Im a modal form, I want to disable/enable the "Save" button based on the field validations. If there is no invalid field, then the button save should be enabled, otherwise, it should be disabled.

In my other native Blazor applicaiton, I am using the context from <EditForm>. But, using Blazorise it seems that there is no property like that available.

That is what I excepct to do: <button class="btn btn-primary" type="submit" disabled="@(!context.Validate())">Send</button> source: https://stackoverflow.com/questions/63770011/disable-enable-button-in-blazor-depending-on-what-is-in-the-form

What is the best way to do that using ABP.IO Blazor template with Blazorise?

  • ABP Framework version: v4.2.2
  • UI type: Angular / MVC / Blazor
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi, I am implemeting my first CRUD using AbpCrudPageBase class. I have two questions about that:

  1. Is it allways required having two MODAL markup and repeat the fields? If the Create and Edit modal are exactly the same, do I need to repeat that?

  2. In events onChange, I have two variables, NewEntity and EditingEntity. How I know if I am editing or creating a new record? The only way that I've found to resolve that was creating two different events and then duplicating code or creating a third method and pass the EntityDto as parameter.

For example, to load an image in the event <FileEdit Changed="">, I did the code below. Is there a better way to do that?

protected async Task OnChangedLogoNew(FileChangedEventArgs e)
{
    await ChangedLogo(e, NewEntity);
}

protected async Task OnChangedLogoEditing(FileChangedEventArgs e)
{
    await ChangedLogo(e, EditingEntity);
}

protected async Task ChangedLogo(FileChangedEventArgs e, CreateUpdateSupplyNetworkDto currentDto)
{
    try
    {
        foreach (var file in e.Files)
        {
            // A stream is going to be the destination stream we're writing to.
            using (var stream = new MemoryStream())
            {
                await file.WriteToStreamAsync(stream);
                stream.Seek(0, SeekOrigin.Begin);
                currentDto.Logo = stream.ToArray();
            }
        }
    }
    catch (Exception exc)
    {
        Console.WriteLine(exc.Message);
    }
    finally
    {
        this.StateHasChanged();
    }
}
  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi, I have added two menus that should be visible only in the Tenant Side. I don't want then on the Host side. How can I do that?

I tried to inject CurrentTenant and check the property IsAvailable, but, the class is instanced manually and dependency injection doesn't work. See my code below:

public class AvalancheOCPMenuContributor : IMenuContributor
    {
        private readonly IConfiguration _configuration;

        public AvalancheOCPMenuContributor(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public async Task ConfigureMenuAsync(MenuConfigurationContext context)
        {
            if (context.Menu.Name == StandardMenus.Main)
            {
                await ConfigureMainMenuAsync(context);
            }
            else if (context.Menu.Name == StandardMenus.User)
            {
                await ConfigureUserMenuAsync(context);
            }
        }

        //This method was intentionally "async" because ABP Suite will generate asnyc method calls here.
        private static async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
        {
            var l = context.GetLocalizer<AvalancheOCPResource>();

            context.Menu.AddItem(new ApplicationMenuItem(
                AvalancheOCPMenus.Home,
                l["Menu:Home"],
                "/",
                icon: "fas fa-home",
                order: 1
            ));

            // Tenant Side
            **//if (_currentTenant.IsAvailable) // How to do it? Or what is the best way to do that?**
            { 
                var settings = new ApplicationMenuItem(
                    "Settings",
                    l["Menu:AvalancheOCPSettings"],
                    icon: "fa fa-sliders",
                    order: 2
                );
                context.Menu.AddItem(settings);

                if (await context.IsGrantedAsync(AvalancheOCPPermissions.Causes.Default))
                {
                    settings.AddItem(new ApplicationMenuItem(
                        "Settings.Causes",
                        l["Menu:Causes"],
                        url: "/causes"
                    ));
                }

                if (await context.IsGrantedAsync(AvalancheOCPPermissions.SupplyNetworks.Default))
                {
                    settings.AddItem(new ApplicationMenuItem(
                        "Settings.SupplyNetworks",
                        l["Menu:SupplyNetworks"],
                        url: "/supplynetworks"
                    ));
                }
            }
  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

I'd like to know how to perform orderby passing a string as parameter when I have two tables connect by join in the method GetListAsync in a CrudAppService class.

In the Tutorial, Item 10. Book and Author Relation, in the method GetListAsync we have this comment:

orderby input.Sorting //TODO: Can not sort like that!

In AspNetZero project I have an extension for OrderBy and PageBy that make life easy. But, I haven't found those extensions for Abp.IO Blazor UI project.

Here is my code:

public override async Task<PagedResultDto<SupplyNetworkDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{
    //Set a default sorting, if not provided
    if (input.Sorting.IsNullOrEmpty())
    {
        input.Sorting = nameof(SupplyNetworkDto.Name);
    }

    //Get the IQueryable<Book> from the repository
    var queryable = await Repository.GetQueryableAsync();

    //Prepare a query to join books and authors
    var query = from supplyNetwork in queryable
                join networkType in _networkTypeRepository on supplyNetwork.NetworkTypeId equals networkType.Id
                orderby input.Sorting // It is not working as per example in ABP.IO Documentation Example
                select new { supplyNetwork, networkType };

    query = query
        .Skip(input.SkipCount)
        .Take(input.MaxResultCount);

    //Execute the query and get a list
    var queryResult = await AsyncExecuter.ToListAsync(query);

    //Convert the query result to a list of BookDto objects
    var dtos = queryResult.Select(x =>
    {
        var dto = ObjectMapper.Map<SupplyNetwork, SupplyNetworkDto>(x.supplyNetwork);
        dto.NetworkTypeName = x.networkType.Name;
        return dto;
    }).ToList();

    //Get the total count with another query
    var totalCount = await Repository.GetCountAsync();

    return new PagedResultDto<SupplyNetworkDto>(
        totalCount,
        dtos
    );
}
  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

In my local machine all CRUD operations work fine. But, when I deploy to IIS Server the Update and Delete don't work.

I've tried to remove WebDAV in the Web.Config, but still getting errors. My Web.Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
				<remove name="WebDAV" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\TVD_Holdings_Ltd.AvalancheOCP.HttpApi.Host.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 96e5259e-59a3-4faf-bcd1-5bf8e74ef82c-->

In the console I am getting these messages:

What should I change in my config to make it work?

显示 47 个条目中的 1 到 10 个.
Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11