abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.92k stars 3.45k forks source link

UserManagement with Syncfusion #12964

Closed BogdanJak closed 2 years ago

BogdanJak commented 2 years ago

ABP Framework version - 5.2.2 User Interface - Blazor Server Database provider - EF Core / SQL Server

Is it possible to replace the native Blazorise controls in a component, e.g. UserManagement, with controls such as Syncfusion?

I am able to do the frontend without any problems. But I already have a problem with the backend - eg in the "OpenCreateModalAsync" function, which uses the AbpCrudPageBase class - the procedure for opening the Modal component from Blazorise is permanently entered. Could it be changed in a simpler way without rewriting the whole code from scratch?

enisn commented 2 years ago

Did you try this one? https://community.abp.io/posts/using-syncfusion-components-with-the-abp-framework-5ccvi8kc

BogdanJak commented 2 years ago

I use Syncfusion in new pages but I have a problem with rewriting the code for pages with e.g. UserManagement.

Procedure

protected override Task OpenCreateModalAsync()
    {

        CreateModalSelectedTab = DefaultSelectedTab;

        NewUserRoles = Roles.Select(x => new AssignedRoleViewModel
        {
            Name = x.Name,
            IsAssigned = x.IsDefault
        }).ToArray();

        return base.OpenCreateModalAsync();     
    }

refers to AbpCrudPageBase.cs from Volo.Abp.BlazoriseUI There is procedure in this class

protected Modal CreateModal;

and from the level of AbpCrudPageBase the Modal component from Blazorise is opened

Procedure

protected virtual async Task OpenCreateModalAsync()
    {
        try
        {
            if (CreateValidationsRef != null)
            {
                await CreateValidationsRef.ClearAll();
            }

            await CheckCreatePolicyAsync();

            NewEntity = new TCreateViewModel();

            // Mapper will not notify Blazor that binded values are changed
            // so we need to notify it manually by calling StateHasChanged
            await InvokeAsync(async () =>
            {
                StateHasChanged();
                if (CreateModal != null)
                {
                    await CreateModal.Show();
                }

            });
        }
        catch (Exception ex)
        {
            await HandleErrorAsync(ex);
        }
    }
BogdanJak commented 2 years ago

?

enisn commented 2 years ago

Unfortunately, there is no option for replacing entire components from a single point. If you really want to do it, you have to replace all components with your chosen component one by one.

I'm not sure but Blazorise might have some adapters.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.