Skip to content

Commit

Permalink
fix(templates): resolve issues of dashboard page of Boilerplate #8927 (
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi authored Oct 16, 2024
1 parent 32a278d commit 0f7bfe5
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@
"src/Shared/Controllers/Categories/**",
"src/Shared/Controllers/Products/**",
"src/Shared/Controllers/Dashboard/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Categories/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Dashboard/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Products/**"
"src/Client/Boilerplate.Client.Core/Components/Pages/Main/Categories/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Main/Dashboard/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Main/Products/**"
]
},
{
Expand All @@ -402,14 +402,14 @@
"src/Server/Boilerplate.Server.Api/Mappers/TodoMapper.cs",
"src/Server/Boilerplate.Server.Api/Models/Todo/**",
"src/Shared/Controllers/Todo/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Todo/**"
"src/Client/Boilerplate.Client.Core/Components/Pages/Main/Todo/**"
]
},
{
"condition": "(offlineDb != true)",
"exclude": [
"src/Client/Boilerplate.Client.Core/Data/**",
"src/Client/Boilerplate.Client.Core/Components/Pages/Offline/**"
"src/Client/Boilerplate.Client.Core/Components/Pages/Main/Offline/**"
]
},
{
Expand Down Expand Up @@ -488,7 +488,9 @@
"src/Tests/PageTests/**",
"src/Tests/TestInitializer.cs",
"src/Tests/Services/CulturedStringLocalizer.cs",
"src/Tests/Services/FakeGoogleRecaptchaHttpClient.cs"
"src/Tests/Services/FakeGoogleRecaptchaHttpClient.cs",
"src/Tests/Services/EmailReaderService.cs",
"src/Tests/Services/UserService.cs"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@
@attribute [Route("{culture?}" + Urls.DashboardPage)]
@inherits AppPageBase

@if (isLoadingAssemblies)
{
<BitRingLoading />
}
else
{
<div class="page-container">
<OverallStatsWidget />

<div class="page-container">
<OverallStatsWidget />
@if (isLoadingAssemblies)
{
<BitRingLoading />
}
else
{
<div class="page-row">
<ProductsCountPerCategoryWidget />
<ProductsPercentageWidget />
</div>
}
</div>

<div class="page-row">
<ProductsSalesWidget />
</div>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ protected async override Task OnInitAsync()
if (AppPlatform.IsBrowser)
{
await lazyAssemblyLoader.LoadAssembliesAsync([
//#if (sample == "Admin" && offlineDb == false)
//#if (offlineDb == false)
"System.Private.Xml.wasm", "System.Data.Common.wasm",
//#endif
//#if (sample == "Admin")
"Newtonsoft.Json.wasm"]
//#endif
);
}
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@
"minify": { "enabled": false },
"options": { "sourceMap": false }
},
{
"outputFile": "Components/Pages/Main/Dashboard/ProductsSalesWidget.razor.css",
"inputFile": "Components/Pages/Main/Dashboard/ProductsSalesWidget.razor.scss",
"minify": { "enabled": false },
"options": { "sourceMap": false }
},
{
"outputFile": "Components/Pages/Main/Products/AddOrEditProductModal.razor.css",
"inputFile": "Components/Pages/Main/Products/AddOrEditProductModal.razor.scss",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ public IQueryable<ProductsCountPerCategoryResponseDto> GetProductsCountPerCatego
});
}

[HttpGet]
public IQueryable<ProductSaleStatResponseDto> GetProductsSalesStats()
{
Random rand = new Random();
return DbContext.Products.Include(p => p.Category)
.Select(p => new ProductSaleStatResponseDto()
{
ProductName = p.Name,
CategoryColor = p.Category!.Color,
SaleAmount = rand.Next(1, 10) * p.Price
});
}


[HttpGet]
public async Task<List<ProductPercentagePerCategoryResponseDto>> GetProductsPercentagePerCategoryStats(CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public interface IDashboardController : IAppController
[HttpGet]
Task<List<ProductsCountPerCategoryResponseDto>> GetProductsCountPerCategoryStats(CancellationToken cancellationToken) => default!;

[HttpGet]
Task<List<ProductSaleStatResponseDto>> GetProductsSalesStats(CancellationToken cancellationToken) => default!;

[HttpGet]
Task<List<ProductPercentagePerCategoryResponseDto>> GetProductsPercentagePerCategoryStats(CancellationToken cancellationToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ namespace Boilerplate.Shared.Dtos;
//#elif (sample == "Admin")
[JsonSerializable(typeof(List<ProductsCountPerCategoryResponseDto>))]
[JsonSerializable(typeof(OverallAnalyticsStatsDataResponseDto))]
[JsonSerializable(typeof(List<ProductSaleStatResponseDto>))]
[JsonSerializable(typeof(List<ProductPercentagePerCategoryResponseDto>))]
[JsonSerializable(typeof(ProductDto))]
[JsonSerializable(typeof(PagedResult<ProductDto>))]
Expand Down

This file was deleted.

0 comments on commit 0f7bfe5

Please sign in to comment.