diff --git a/src/iRLeagueManager.Web/ViewModels/ResultFilterViewModel.cs b/src/iRLeagueManager.Web/ViewModels/ResultFilterViewModel.cs index 2a7cb1e8..57bb532a 100644 --- a/src/iRLeagueManager.Web/ViewModels/ResultFilterViewModel.cs +++ b/src/iRLeagueManager.Web/ViewModels/ResultFilterViewModel.cs @@ -37,7 +37,7 @@ public string ColumnPropertyName public string Value { get => ConvertFromValue(model.FilterValues.FirstOrDefault() ?? string.Empty, ColumnPropertyName); - set => SetP(model.FilterValues.FirstOrDefault() ?? string.Empty, value => model.FilterValues = new[] { ConvertToValue(value, ColumnPropertyName) }.ToList(), value); } + set => SetP(model.FilterValues.FirstOrDefault() ?? string.Empty, value => model.FilterValues = new[] { value }.ToList(), ConvertToValue(value, ColumnPropertyName)); } public MatchedValueAction Action { get => model.Action; set => SetP(model.Action, value => model.Action = value, value); } public override void SetModel(ResultFilterModel model) @@ -56,15 +56,29 @@ private void UpdateFilterType() }; } - private static string ConvertFromValue(string filterValue, string? columnProperty) => columnProperty switch + private static string ConvertFromValue(string filterValue, string? columnProperty) { - nameof(ResultRowModel.CompletedPct) => ((double)Convert.ChangeType(filterValue, typeof(double), CultureInfo.InvariantCulture) * 100).ToString(), - _ => filterValue - }; + if (string.IsNullOrWhiteSpace(filterValue)) + { + return filterValue; + } + return columnProperty switch + { + nameof(ResultRowModel.CompletedPct) => ((double)Convert.ChangeType(filterValue, typeof(double), CultureInfo.InvariantCulture) * 100).ToString(CultureInfo.InvariantCulture), + _ => filterValue + }; + } - private static string ConvertToValue(string value, string? columnProperty) => columnProperty switch + private static string ConvertToValue(string value, string? columnProperty) { - nameof(ResultRowModel.CompletedPct) => ((double)Convert.ChangeType(value, typeof(double), CultureInfo.InvariantCulture) / 100).ToString(), - _ => value - }; + if (string.IsNullOrWhiteSpace(value)) + { + return value; + } + return columnProperty switch + { + nameof(ResultRowModel.CompletedPct) => ((double)Convert.ChangeType(value, typeof(double), CultureInfo.InvariantCulture) / 100).ToString(CultureInfo.InvariantCulture), + _ => value + }; + } } diff --git a/src/iRLeagueManager.Web/appsettings.json b/src/iRLeagueManager.Web/appsettings.json index 8813a99e..bc04f2c2 100644 --- a/src/iRLeagueManager.Web/appsettings.json +++ b/src/iRLeagueManager.Web/appsettings.json @@ -9,8 +9,8 @@ } }, "AllowedHosts": "*", - "APIServer": "http://localhost:5000", - //"APIServer": "https://irleaguemanager.net/api/", + //"APIServer": "http://localhost:5000", + "APIServer": "https://irleaguemanager.net/api/", "DefaultUser": "testuser", "DefaultPassword": "TestPass123!" } diff --git a/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj b/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj index 288b5239..b13f856b 100644 --- a/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj +++ b/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj @@ -2,7 +2,7 @@ net7.0 - 0.8.1 + 0.8.2 enable enable aspnet-iRLeagueManager.Web-2B05F9DC-55A3-49D1-BD64-31507000EDF3