Browse Source

Delete Volo.Abp.AspNetCore.Mvc.UI.Dashboards package

pull/1545/head
Halil İbrahim Kalkan 7 years ago
parent
commit
c0c106b1b4
  1. 11
      framework/Volo.Abp.sln
  2. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Pages/Components/Dashboard/Default.js
  3. 27
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Properties/launchSettings.json
  4. 38
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo.Abp.AspNetCore.Mvc.UI.Dashboards.csproj
  5. 20
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/AbpAspNetCoreMvcUiDashboardsModule.cs
  6. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/AbpBasicDashboardScriptContributor.cs
  7. 8
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/AbpBasicDashboardStyleContributor.cs
  8. 31
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/DashboardViewComponent.cshtml.cs
  9. 48
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/DashboardViewModel.cs
  10. 53
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/Default.cshtml
  11. 62
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardDefinition.cs
  12. 15
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardGlobalFilterConfiguration.cs
  13. 14
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardOptions.cs
  14. 15
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardRenderer.cs
  15. 28
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardWidgetConfiguration.cs
  16. 39
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/GlobalFilterDefinition.cs
  17. 14
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/GlobalFilterOptions.cs
  18. 25
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/GlobalFilterRenderer.cs
  19. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/IDashboardRenderer.cs
  20. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/IGlobalFilterRenderer.cs
  21. 15
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/WidgetLocation.cs
  22. 3
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/_ViewImports.cshtml
  23. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetAttribute.cs
  24. 14
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetDefinition.cs

11
framework/Volo.Abp.sln

@ -236,8 +236,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Cli.Core.Tests", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.Widgets", "src\Volo.Abp.AspNetCore.Mvc.UI.Widgets\Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj", "{EE1AAB08-3FBD-487F-B0B4-BEBA4B69528A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.Dashboards", "src\Volo.Abp.AspNetCore.Mvc.UI.Dashboards\Volo.Abp.AspNetCore.Mvc.UI.Dashboards.csproj", "{054D766D-5992-460E-A4D8-936D80BE2C1A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap", "src\Volo.Abp.Ldap\Volo.Abp.Ldap.csproj", "{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap.Tests", "test\Volo.Abp.Ldap.Tests\Volo.Abp.Ldap.Tests.csproj", "{38FB8F75-426E-4265-8D0E-E121837B6FCC}"
@ -246,9 +244,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Dapper", "src\Volo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Dapper.Tests", "test\Volo.Abp.Dapper.Tests\Volo.Abp.Dapper.Tests.csproj", "{E026A085-D881-4AE0-9F08-422AC3903BD7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.MailKit", "src\Volo.Abp.MailKit\Volo.Abp.MailKit.csproj", "{0CAED4CC-1CFD-4092-A326-AFE4DB3A9AB4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MailKit", "src\Volo.Abp.MailKit\Volo.Abp.MailKit.csproj", "{0CAED4CC-1CFD-4092-A326-AFE4DB3A9AB4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.MailKit.Tests", "test\Volo.Abp.MailKit.Tests\Volo.Abp.MailKit.Tests.csproj", "{70DD6E17-B98B-4B00-8F38-C489E291BB53}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MailKit.Tests", "test\Volo.Abp.MailKit.Tests\Volo.Abp.MailKit.Tests.csproj", "{70DD6E17-B98B-4B00-8F38-C489E291BB53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -716,10 +714,6 @@ Global
{EE1AAB08-3FBD-487F-B0B4-BEBA4B69528A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE1AAB08-3FBD-487F-B0B4-BEBA4B69528A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE1AAB08-3FBD-487F-B0B4-BEBA4B69528A}.Release|Any CPU.Build.0 = Release|Any CPU
{054D766D-5992-460E-A4D8-936D80BE2C1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{054D766D-5992-460E-A4D8-936D80BE2C1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{054D766D-5992-460E-A4D8-936D80BE2C1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{054D766D-5992-460E-A4D8-936D80BE2C1A}.Release|Any CPU.Build.0 = Release|Any CPU
{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -864,7 +858,6 @@ Global
{D078553A-C70C-4F56-B3E2-9C5BA6384C72} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{F006B0B4-F25D-4511-9FB3-F17AA44BDCEA} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{EE1AAB08-3FBD-487F-B0B4-BEBA4B69528A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{054D766D-5992-460E-A4D8-936D80BE2C1A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{38FB8F75-426E-4265-8D0E-E121837B6FCC} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Pages/Components/Dashboard/Default.js

@ -1,6 +0,0 @@
(function ($) {
$('#GlobalRefreshButton').on('click',
function () {
$(document).trigger('RefreshWidgets', $('#DashboardGlobalFiltersForm').serializeFormToObject());
});
})(jQuery);

27
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Properties/launchSettings.json

@ -1,27 +0,0 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:57333/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Volo.Abp.AspNetCore.Mvc.UI.Dashboards": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:57343/"
}
}
}

38
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo.Abp.AspNetCore.Mvc.UI.Dashboards.csproj

@ -1,38 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Volo.Abp.AspNetCore.Mvc.UI.Dashboards</AssemblyName>
<PackageId>Volo.Abp.AspNetCore.Mvc.UI.Dashboards</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\Components\**\*.cshtml" />
<Content Remove="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\Components\**\*.cshtml" />
<EmbeddedResource Include="Pages\Components\Dashboard\*.js" />
<Content Remove="Pages\Components\Dashboard\*.js" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\_ViewImports.cshtml" />
<Content Remove="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\_ViewImports.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\Components\Dashboard\Default.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Widgets\Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bundling\Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj" />
</ItemGroup>
</Project>

20
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/AbpAspNetCoreMvcUiDashboardsModule.cs

@ -1,20 +0,0 @@
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
[DependsOn(
typeof(AbpAspNetCoreMvcUiWidgetsModule)
)]
public class AbpAspNetCoreMvcUiDashboardsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAspNetCoreMvcUiDashboardsModule>();
});
}
}
}

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/AbpBasicDashboardScriptContributor.cs

@ -1,12 +0,0 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class AbpBasicDashboardScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.Add("/Pages/Components/Dashboard/Default.js");
}
}
}

8
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/AbpBasicDashboardStyleContributor.cs

@ -1,8 +0,0 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class AbpBasicDashboardStyleContributor : BundleContributor
{
}
}

31
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/DashboardViewComponent.cshtml.cs

@ -1,31 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard
{
public class DashboardViewComponent : AbpViewComponent
{
private readonly DashboardOptions _dashboardOptions;
private readonly WidgetOptions _widgetOptions;
private readonly GlobalFilterOptions _globalFilterOptions;
public DashboardViewComponent(IOptions<DashboardOptions> dashboardOptions, IOptions<WidgetOptions> widgetOptions, IOptions<GlobalFilterOptions> globalFilterOptions)
{
_dashboardOptions = dashboardOptions.Value;
_widgetOptions = widgetOptions.Value;
_globalFilterOptions = globalFilterOptions.Value;
}
public IViewComponentResult Invoke(string dashboardName)
{
var dashboard = _dashboardOptions.Dashboards.Single(d => d.Name.Equals(dashboardName));
var model = new DashboardViewModel(dashboard, _widgetOptions.Widgets.GetAll().ToList(), _globalFilterOptions.GlobalFilters);
return View("~/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/Default.cshtml", model);
}
}
}

48
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/DashboardViewModel.cs

@ -1,48 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard
{
public class DashboardViewModel
{
public DashboardDefinition Dashboard { get; set; }
public List<WidgetDefinition> Widgets { get; set; }
public List<GlobalFilterDefinition> GlobalFilters { get; set; }
public DashboardViewModel(DashboardDefinition dashboard, List<WidgetDefinition> widgets, List<GlobalFilterDefinition> globalFilters)
{
Dashboard = dashboard;
Widgets = widgets;
GlobalFilters = globalFilters;
}
public WidgetDefinition GetWidget(string name)
{
return Widgets.Single(d => d.Name.Equals(name));
}
public GlobalFilterDefinition GetGlobalFilter(string name)
{
return GlobalFilters.Single(d => d.Name.Equals(name));
}
public async Task<bool> CheckPermissionsAsync(IAuthorizationService authorizationService, WidgetDefinition widget)
{
foreach (var permission in widget.RequiredPolicies)
{
if (!await authorizationService.IsGrantedAsync(permission))
{
return false;
}
}
return true;
}
}
}

53
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/Default.cshtml

@ -1,53 +0,0 @@
@using Localization.Resources.AbpUi
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Dashboards
@using Volo.Abp.AspNetCore.Mvc.UI.Widgets
@inject IAuthorizationService AuthorizationService
@inject IGlobalFilterRenderer GlobalFilteRenderer
@inject IHtmlLocalizer<AbpUiResource> L
@model Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard.DashboardViewModel
@{
}
<abp-row class="mb-4 align-items-center justify-content-between">
@if (Model.Dashboard.AvailableGlobalFilters.Any())
{
<abp-column size="_10">
<form id="DashboardGlobalFiltersForm">
<abp-row>
@foreach (var globalFilterConfiguration in Model.Dashboard.AvailableGlobalFilters)
{
var globalFilter = Model.GetGlobalFilter(globalFilterConfiguration.GlobalFilterName);
@await GlobalFilteRenderer.RenderAsync(Component, globalFilter.Name)
}
</abp-row>
</form>
</abp-column>
<abp-column size="_2">
<div class="float-right">
<abp-button button-type="Success" text="@L["Refresh"].Value" icon="refresh" id="GlobalRefreshButton" />
</div>
</abp-column>
}
</abp-row>
<abp-row>
@foreach (var widgetConfiguration in Model.Dashboard.AvailableWidgets)
{
var widgetDefinition = Model.GetWidget(widgetConfiguration.WidgetName);
if (await Model.CheckPermissionsAsync(AuthorizationService, widgetDefinition))
{
widgetDefinition.DefaultDimensions = widgetConfiguration.Dimensions ?? widgetDefinition.DefaultDimensions ?? new WidgetDimensions(6, 4);
<abp-column class="col-@(widgetDefinition.DefaultDimensions.Width) p-2"
style="height: @(widgetDefinition.DefaultDimensions.Height * 100)px">
@await Component.InvokeAsync(widgetDefinition.Name)
</abp-column>
}
}
</abp-row>

62
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardDefinition.cs

@ -1,62 +0,0 @@
using System.Collections.Generic;
using JetBrains.Annotations;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
using Volo.Abp.Localization;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class DashboardDefinition
{
/// <summary>
/// Unique name of the dashboard.
/// </summary>
[NotNull]
public string Name { get; }
/// <summary>
/// A list of Widgets available for this dashboard.
/// </summary>
public List<DashboardWidgetConfiguration> AvailableWidgets { get; }
/// <summary>
/// A list of Global Filters available for this dashboard.
/// </summary>
public List<DashboardGlobalFilterConfiguration> AvailableGlobalFilters { get; }
/// <summary>
/// Display name of the dashboard.
/// </summary>
[NotNull]
public ILocalizableString DisplayName
{
get => _displayName;
set => _displayName = Check.NotNull(value, nameof(value));
}
private ILocalizableString _displayName;
public DashboardDefinition(
[NotNull] string name,
[CanBeNull] ILocalizableString displayName)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name));
DisplayName = displayName ?? new FixedLocalizableString(name);
AvailableWidgets = new List<DashboardWidgetConfiguration>();
AvailableGlobalFilters = new List<DashboardGlobalFilterConfiguration>();
}
public DashboardDefinition WithWidget(string widgetName, WidgetLocation location = null, WidgetDimensions dimensions = null)
{
AvailableWidgets.Add( new DashboardWidgetConfiguration(widgetName, dimensions, location));
return this;
}
public DashboardDefinition WithGlobalFilter(string globalFilterName)
{
AvailableGlobalFilters.Add( new DashboardGlobalFilterConfiguration(globalFilterName));
return this;
}
}
}

15
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardGlobalFilterConfiguration.cs

@ -1,15 +0,0 @@
using JetBrains.Annotations;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class DashboardGlobalFilterConfiguration
{
[NotNull]
public string GlobalFilterName { get; }
public DashboardGlobalFilterConfiguration([NotNull] string globalFilterName)
{
GlobalFilterName = Check.NotNullOrWhiteSpace(globalFilterName, nameof(globalFilterName));
}
}
}

14
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardOptions.cs

@ -1,14 +0,0 @@
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class DashboardOptions
{
public List<DashboardDefinition> Dashboards { get; }
public DashboardOptions()
{
Dashboards = new List<DashboardDefinition>();
}
}
}

15
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardRenderer.cs

@ -1,15 +0,0 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class DashboardRenderer : IDashboardRenderer
{
public async Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, object args = null)
{
return await componentHelper.InvokeAsync(typeof(DashboardViewComponent), args ?? new object());
}
}
}

28
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/DashboardWidgetConfiguration.cs

@ -1,28 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class DashboardWidgetConfiguration
{
[NotNull]
public string WidgetName { get; }
[CanBeNull]
public WidgetDimensions Dimensions { get; set; }
[CanBeNull]
public WidgetLocation Location { get; set; }
public DashboardWidgetConfiguration(
[NotNull] string widgetName,
[CanBeNull] WidgetDimensions dimensions = null,
[CanBeNull] WidgetLocation location = null
)
{
WidgetName = Check.NotNullOrWhiteSpace(widgetName, nameof(widgetName));
Dimensions = dimensions;
Location = location;
}
}
}

39
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/GlobalFilterDefinition.cs

@ -1,39 +0,0 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.Localization;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class GlobalFilterDefinition
{
/// <summary>
/// Unique name of the Global Filter.
/// </summary>
[NotNull]
public string Name { get; }
/// <summary>
/// Display name of the Global Filter.
/// </summary>
[NotNull]
public ILocalizableString DisplayName
{
get => _displayName;
set => _displayName = Check.NotNull(value, nameof(value));
}
private ILocalizableString _displayName;
[NotNull]
public Type ViewComponentType { get; }
public GlobalFilterDefinition(
[NotNull] string name,
[CanBeNull] ILocalizableString displayName,
[NotNull] Type viewComponentType)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name));
DisplayName = displayName ?? new FixedLocalizableString(name);
ViewComponentType = Check.NotNull(viewComponentType, nameof(viewComponentType));
}
}
}

14
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/GlobalFilterOptions.cs

@ -1,14 +0,0 @@
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class GlobalFilterOptions
{
public List<GlobalFilterDefinition> GlobalFilters { get; }
public GlobalFilterOptions()
{
GlobalFilters = new List<GlobalFilterDefinition>();
}
}
}

25
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/GlobalFilterRenderer.cs

@ -1,25 +0,0 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class GlobalFilterRenderer : IGlobalFilterRenderer
{
private readonly GlobalFilterOptions _globalFilterOptions;
public GlobalFilterRenderer(IOptions<GlobalFilterOptions> widgetOptions)
{
_globalFilterOptions = widgetOptions.Value;
}
public async Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, string globalFilterName, object args = null)
{
var globalFilter = _globalFilterOptions.GlobalFilters.Single(w => w.Name.Equals(globalFilterName));
return await componentHelper.InvokeAsync(globalFilter.ViewComponentType, args ?? new object());
}
}
}

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/IDashboardRenderer.cs

@ -1,12 +0,0 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public interface IDashboardRenderer : ITransientDependency
{
Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, object args = null);
}
}

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/IGlobalFilterRenderer.cs

@ -1,12 +0,0 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public interface IGlobalFilterRenderer : ITransientDependency
{
Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, string globalFilterName, object args = null);
}
}

15
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/WidgetLocation.cs

@ -1,15 +0,0 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class WidgetLocation
{
public int X { get; set; }
public int Y { get; set; }
public WidgetLocation(int x, int y)
{
X = x;
Y = y;
}
}
}

3
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Dashboards/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/_ViewImports.cshtml

@ -1,3 +0,0 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetAttribute.cs

@ -31,10 +31,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
public bool RequiresAuthentication { get; set; }
public int? DefaultWidth { get; set; }
public int? DefaultHeight { get; set; }
public string RefreshUrl { get; set; }
public static bool IsWidget(Type type)

14
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetDefinition.cs

@ -47,9 +47,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
[NotNull]
public List<WidgetResourceItem> Scripts { get; }
[CanBeNull]
public WidgetDimensions DefaultDimensions { get; set; }
[CanBeNull]
public string RefreshUrl { get; set; }
@ -67,11 +64,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
Styles = GetStyles(WidgetAttribute);
Scripts = GetScripts(WidgetAttribute);
RefreshUrl = WidgetAttribute.RefreshUrl;
if (WidgetAttribute.DefaultWidth.HasValue && WidgetAttribute.DefaultHeight.HasValue)
{
DefaultDimensions = new WidgetDimensions(WidgetAttribute.DefaultWidth.Value, WidgetAttribute.DefaultHeight.Value);
}
}
private static List<WidgetResourceItem> GetStyles(WidgetAttribute widgetAttribute)
@ -169,12 +161,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets
return this;
}
public WidgetDefinition WithDefaultDimensions(int width, int height)
{
DefaultDimensions = new WidgetDimensions(width, height);
return this;
}
public WidgetDefinition WithStyles(params string[] files)
{
return WithResources(Styles, files);

Loading…
Cancel
Save