diff --git a/WSIST/WSIST.Web/Components/Pages/Home.razor b/WSIST/WSIST.Web/Components/Pages/Home.razor index 9fc518b..82f540e 100644 --- a/WSIST/WSIST.Web/Components/Pages/Home.razor +++ b/WSIST/WSIST.Web/Components/Pages/Home.razor @@ -78,6 +78,9 @@

đź“‹

@localizer["Home_NoUpcomingTitle"]

@localizer["Home_NoUpcomingSub"]

+ } else @@ -207,7 +210,11 @@
- + + @if (titleError is not null) + { + @titleError + }
@@ -262,6 +269,7 @@
diff --git a/WSIST/WSIST.Web/Components/Pages/Home.razor.cs b/WSIST/WSIST.Web/Components/Pages/Home.razor.cs index 2adf9d7..948f1bc 100644 --- a/WSIST/WSIST.Web/Components/Pages/Home.razor.cs +++ b/WSIST/WSIST.Web/Components/Pages/Home.razor.cs @@ -90,6 +90,7 @@ public enum Modes private bool addingSubject; private string newSubjectName = string.Empty; private string? subjectError; + private string? titleError; private int lastSubjectId; private void OpenEditTestModal(Test test) @@ -107,19 +108,21 @@ private void OpenEditTestModal(Test test) Grade = test.Grade, }; lastSubjectId = test.Subject; + titleError = null; ResetInlineSubject(); showModal = true; } public void OpenAddTestModal() { - temporaryTest = new Test { Title = "Some Test" }; + temporaryTest = new Test { Title = string.Empty }; Mode = Modes.AddTest; temporaryTest.DueDate = DateOnly.FromDateTime(DateTime.Today); // Default to a real subject rather than the int default (0), which is // the "+ Add new subject" sentinel, not a valid subject id. temporaryTest.Subject = subjects.FirstOrDefault()?.Id ?? AddNewSubjectValue; lastSubjectId = temporaryTest.Subject; + titleError = null; ResetInlineSubject(); showModal = true; } @@ -196,6 +199,16 @@ private void ModalSubmit() // submit the whole form with the sentinel subject id; ignore it. if (addingSubject) return; + // The browser's `required` only rejects truly empty input; a + // whitespace-only title would still reach the engine and throw. + var title = temporaryTest.Title.Trim(); + if (title.Length == 0) + { + titleError = localizer["Modal_TitleEmptyError"]; + return; + } + titleError = null; + temporaryTest.Title = title; switch (Mode) { case Modes.AddTest: diff --git a/WSIST/WSIST.Web/Components/Pages/Login.razor b/WSIST/WSIST.Web/Components/Pages/Login.razor index a60c334..c0a6815 100644 --- a/WSIST/WSIST.Web/Components/Pages/Login.razor +++ b/WSIST/WSIST.Web/Components/Pages/Login.razor @@ -2,7 +2,22 @@ @layout EmptyLayout @using WSIST.Web.Components.Layout @inject IStringLocalizer Localizer -WSIST — @Localizer["Landing_HeroLine1"] @Localizer["Landing_HeroLine2Pre"]@Localizer["Landing_HeroLine2Em"] +WSIST — What Should I Study Today? + + + + + + + + + + + + + + +
diff --git a/WSIST/WSIST.Web/Components/Pages/Privacy.razor b/WSIST/WSIST.Web/Components/Pages/Privacy.razor index a3b0c99..51ba581 100644 --- a/WSIST/WSIST.Web/Components/Pages/Privacy.razor +++ b/WSIST/WSIST.Web/Components/Pages/Privacy.razor @@ -2,7 +2,7 @@ @layout EmptyLayout @using WSIST.Web.Components.Layout @inject IStringLocalizer Localizer -@Localizer["Privacy_Title"] – WSIST +Privacy Policy – WSIST