diff --git a/WotBlitzStatisticsPro.Blazor/Helpers/ScaleHelper.cs b/WotBlitzStatisticsPro.Blazor/Helpers/ScaleHelper.cs index fcef425..813eae5 100644 --- a/WotBlitzStatisticsPro.Blazor/Helpers/ScaleHelper.cs +++ b/WotBlitzStatisticsPro.Blazor/Helpers/ScaleHelper.cs @@ -1,7 +1,14 @@ -namespace WotBlitzStatisticsPro.Blazor.Helpers +using System; + +namespace WotBlitzStatisticsPro.Blazor.Helpers { public static class ScaleHelper { + public static string ScaleColor(this decimal winRate) + { + var intWinRate = Convert.ToInt32(winRate); + return intWinRate.ScaleColor(); + } public static string ScaleColor(this int winRate) { return winRate switch @@ -17,5 +24,23 @@ _ => Constants.ScaleSuperUnicumColor }; } + + public static string Wn7ScaleColor(this double wn7) + { + return wn7 switch + { + ( > 0 ) and ( < 500) => Constants.ScaleVeryBadColor, + ( >= 500) and ( < 700) => Constants.ScaleBadColor, + ( >= 700) and ( < 900) => Constants.ScaleBelowAverageColor, + ( >= 900) and ( < 1100) => Constants.ScaleAverageColor, + ( >= 1100) and ( < 1350) => Constants.ScaleGoodColor, + ( >= 1350) and ( < 1550) => Constants.ScaleVeryGoodColor, + ( >= 1550) and ( < 1850) => Constants.ScaleGreatColor, + ( >= 1850) and ( < 2050) => Constants.ScaleUnicumColor, + _ => Constants.ScaleSuperUnicumColor + }; + } + + } } \ No newline at end of file diff --git a/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoTanksList.razor b/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoTanksList.razor index d12a8de..eefdf29 100644 --- a/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoTanksList.razor +++ b/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoTanksList.razor @@ -13,22 +13,22 @@ ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.Or"> - + - + - + - + @@ -40,22 +40,31 @@ - - + + + + + + + FormatString="{0:d}" + SortOrder="SortOrder.Descending"/> @@ -104,4 +114,12 @@ public IEnumerable TanksList { get; set; } void ShowTooltip(ElementReference elementReference, string message, TooltipOptions options = null) => TooltipService.Open(elementReference, message, options); + + void OnChange() + { + // Filter - dropdown with multiselect + // https://blazor.radzen.com/datagrid-filter-template + // TanksList = TanksList.Where(e => currentTOC >= 0 ? e.TitleOfCourtesy == currentTOC : true); + } + } diff --git a/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs b/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs index 01b20fe..302f439 100644 --- a/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs +++ b/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs @@ -118,7 +118,7 @@ namespace WotBlitzStatisticsPro.Blazor.Services.Mock faker.Name.LastName(), nation.nation, nation.nationName, - faker.Random.Number(10), + faker.Random.Number(1, 10), vehicleType.vehicleType, vehicleType.vehicleTypeName, faker.Random.Bool(),