Open Closed

After Upgrading to Abp Commercial V5.2, ChartjsStyleContributor is not recognized #2923


User avatar
0
piseth created
  • ABP Framework version: v5.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

5 Answer(s)
  • User Avatar
    0
    piseth created

    Within my lower version < 5.2, ChartjsStyleContributor is recognized and working fine. it is from Volo.Abp.AspNetCore.Mvc.UI.Packages.ChartJs.ChartjsStyleContributor I use it in my class MyChartViewComponent.cs under MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget

    ****Now it is not recognized

    namespace MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget
    {
    [Widget(
        StyleTypes = new[] { typeof(ChartjsStyleContributor) },
        ScriptTypes = new[] { typeof(MyChartWidgetWidgetScriptContributor) }
        )]
    public class MyChartViewComponent : AbpViewComponent
    {
        public virtual IViewComponentResult Invoke()
        {
            return View("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.cshtml");
        }
    }
    
    [DependsOn(typeof(ChartjsScriptContributor))]
    public class MyChartWidgetWidgetScriptContributor : BundleContributor
    {
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.Add("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.js");
        }
    }
    }
    
  • User Avatar
    0
    piseth created

    any update plz?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    HI,

    We have upgrade Chartjs to version 3.7.0, no longer needs style.

    See: https://github.com/abpframework/abp/pull/11861

  • User Avatar
    0
    piseth created

    https://github.com/abpframework/abp/pull/11861

    So how my code should look like?

    it works like the following?

    namespace MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget
    {
    [Widget(
      
        ScriptTypes = new[] { typeof(MyChartWidgetWidgetScriptContributor) }
        )]
    public class MyChartViewComponent : AbpViewComponent
    {
        public virtual IViewComponentResult Invoke()
        {
            return View("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.cshtml");
        }
    }
    
    
    public class MyChartWidgetWidgetScriptContributor : BundleContributor
    {
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.Add("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.js");
        }
    }
    }
    
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Just remove ChartjsStyleContributor, it should be work.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19