From d2031fdd329801a21b0b35a540465cb3411f8a43 Mon Sep 17 00:00:00 2001 From: Tiago-Salles Date: Tue, 9 Sep 2025 16:40:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(course-runs):=20refactor=20s?= =?UTF-8?q?elf=20paced=20course=20availability=20presentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed self paced course availability presentation - Remove the entire run component if other runs list is empty --- .../components/SyllabusAsideList/index.tsx | 24 ++++------- .../SyllabusCourseRunCompacted/index.tsx | 43 +++++++++++++------ 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx b/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx index 95ed09e1b2..1d9dcce55a 100644 --- a/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx +++ b/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx @@ -108,28 +108,20 @@ export const SyllabusAsideList = ({ const showLanguages = CourseRunHelper.IsAllCourseRunsWithSameLanguages(courseRuns); + // If there are no runs to display at all, don't render anything + if (openedRuns.length <= 1 && otherRuns.length === 0) { + return null; + } + return ( <>

- {openedRuns.length === 1 ? ( - - ) : ( + {openedRuns.length > 1 ? ( + ) : ( + )}

- {openedRuns.length <= 1 && otherRuns.length === 0 && ( -
- {openedRuns.length === 0 ? ( -

- -

- ) : ( -

- -

- )} -
- )} {openedRuns.length > 1 && (
{courseRun.title &&

{StringHelper.capitalizeFirst(courseRun.title)}

}
- {!showLanguages && ( -
- -
- )}
{hasEndDate ? ( - + <> +
+ +
+
+ +
+
+ +
+
+ +
+ ) : ( )}