From 80384e8650d918ad83920279f79b2f4710810e85 Mon Sep 17 00:00:00 2001 From: Bryan Jonker Date: Wed, 10 Jun 2026 08:35:08 -0500 Subject: [PATCH] Cleanup --- .../CourseraImport/CourseraImportManager.cs | 4 ++-- ProgramInformationV2.Search/Models/Section.cs | 6 +++--- ProgramInformationV2/Components/Pages/Section/General.razor | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ProgramInformationV2.Data/CourseraImport/CourseraImportManager.cs b/ProgramInformationV2.Data/CourseraImport/CourseraImportManager.cs index d4cd29b..35c5926 100644 --- a/ProgramInformationV2.Data/CourseraImport/CourseraImportManager.cs +++ b/ProgramInformationV2.Data/CourseraImport/CourseraImportManager.cs @@ -22,17 +22,17 @@ public async Task GetCourse(string source, string id) { CourseTitle = courseraCourse.Title, Sections = [ new Section { - Title = "Coursera Information", BeginDate = DateTime.MinValue, EndDate = DateTime.MaxValue, IsActive = true, Term = Terms.Ongoing, FormatType = FormatType.Online, - SectionCode = courseraCourse.Id + SectionCode = "Coursera Information" } ] }; course.CleanHtmlFields(); + course.SetId(); return course; } diff --git a/ProgramInformationV2.Search/Models/Section.cs b/ProgramInformationV2.Search/Models/Section.cs index 3114219..4210e67 100644 --- a/ProgramInformationV2.Search/Models/Section.cs +++ b/ProgramInformationV2.Search/Models/Section.cs @@ -90,9 +90,9 @@ public void ManageFacultyList(string name, string netid, string url, bool isAdde public override void SetId() { base.SetId(); - Title = string.IsNullOrWhiteSpace(Title) ? Title : - string.IsNullOrWhiteSpace(DateString) || string.IsNullOrWhiteSpace(SectionCode) ? AlternateTitle : - (string.IsNullOrWhiteSpace(AlternateTitle) ? $"{DateString}: {SectionCode}" : $"{AlternateTitle} ({DateString}: {SectionCode})"); + var datestring = string.IsNullOrWhiteSpace(DateString) ? "Ongoing" : DateString; + Title = string.IsNullOrWhiteSpace(SectionCode) ? AlternateTitle : + (string.IsNullOrWhiteSpace(AlternateTitle) ? $"{datestring}: {SectionCode}" : $"{AlternateTitle} ({datestring}: {SectionCode})"); } public override string ToString() => JsonSerializer.Serialize(this); diff --git a/ProgramInformationV2/Components/Pages/Section/General.razor b/ProgramInformationV2/Components/Pages/Section/General.razor index 212e89f..31edafd 100644 --- a/ProgramInformationV2/Components/Pages/Section/General.razor +++ b/ProgramInformationV2/Components/Pages/Section/General.razor @@ -8,7 +8,7 @@ @if (SectionItem != null && FieldItems != null) { - +

Title: @SectionItem.Title