From 3c8700155bdb171708f085d72e98e9f3dd43da0b Mon Sep 17 00:00:00 2001 From: "Davide R. Wiest" Date: Tue, 16 Apr 2024 22:03:30 +0200 Subject: [PATCH] reduce messaging through snackbar --- TimeWise/Pages/Scheduler.razor | 10 +++++++--- .../static/content/scheduleResultsDevelopment.json | 10 +++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/TimeWise/Pages/Scheduler.razor b/TimeWise/Pages/Scheduler.razor index 519296d..8df384c 100644 --- a/TimeWise/Pages/Scheduler.razor +++ b/TimeWise/Pages/Scheduler.razor @@ -120,6 +120,8 @@ private string Version = string.Empty; private bool ComparisonAlgorithmSuccessful = false; + private bool showedDbInfoMsg = false; + private string scheduleName = "Schedule"; private async Task FetchSolution() @@ -139,8 +141,11 @@ var result = await problemLoggingTask; - if (!result) - Snackbar.Add("No connection to the Database could be established. This does not affect the operability of the webapp.", Severity.Error); + if (!result & !showedDbInfoMsg) + { + Snackbar.Add("No connection to the Database could be established. This does not affect the operability of the webapp.", Severity.Info); + showedDbInfoMsg = true; + } solution = await solutionTask; showSolutionLoadingCircle = false; @@ -150,7 +155,6 @@ Snackbar.Add(@
Schedule could not be generated. Try completing and sanitizing your inputs. If the error persists, try again later or contact us.
, Severity.Error); } else { - Snackbar.Add("Your schedule was generated.", Severity.Success); await ResultsFileLoader.SaveIlpResults(solution.ObjectiveStrain, solution.ObjectiveCost); } } diff --git a/TimeWise/static/content/scheduleResultsDevelopment.json b/TimeWise/static/content/scheduleResultsDevelopment.json index 5a0011c..63595e7 100644 --- a/TimeWise/static/content/scheduleResultsDevelopment.json +++ b/TimeWise/static/content/scheduleResultsDevelopment.json @@ -1,10 +1,10 @@ { - "IlpCostAvg": 6000, - "IlpCostNum": 10, + "IlpCostAvg": 6112.941176470589, + "IlpCostNum": 18, "ComparisonCostAvg": 10000.0, "ComparisonCostNum": 10, - "IlpStrainAvg": 4, - "IlpStrainNum": 10, - "ComparisonStrainAvg": 6, + "IlpStrainAvg": 4.0, + "IlpStrainNum": 18, + "ComparisonStrainAvg": 6.0, "ComparisonStrainNum": 10 } \ No newline at end of file