Skip to content

Commit

Permalink
reduce messaging through snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideWiest committed Apr 16, 2024
1 parent 2666106 commit 3c87001
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 7 additions & 3 deletions TimeWise/Pages/Scheduler.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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;
Expand All @@ -150,7 +155,6 @@
Snackbar.Add(@<div>Schedule could not be generated. Try completing and sanitizing your inputs. If the error persists, try again later or <a href="/contact">contact us</a>.</div>, Severity.Error);
} else
{
Snackbar.Add("Your schedule was generated.", Severity.Success);
await ResultsFileLoader.SaveIlpResults(solution.ObjectiveStrain, solution.ObjectiveCost);
}
}
Expand Down
10 changes: 5 additions & 5 deletions TimeWise/static/content/scheduleResultsDevelopment.json
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 3c87001

Please sign in to comment.