Skip to content

Commit

Permalink
Update LessonsRootPage table to include progress from reports, mainta…
Browse files Browse the repository at this point in the history
…ining the same empty states for unavailable data
  • Loading branch information
LianaHarris360 committed Oct 9, 2024
1 parent 604986b commit 22795e1
Showing 1 changed file with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
:tabsId="PLAN_TABS_ID"
:activeTabId="PlanTabs.LESSONS"
>
<p v-if="lessons.length && lessons.length > 0">
<p
v-if="calcTotalSizeOfVisibleLessons !== null"
class="total-size"
>
{{ coachString('totalLessonsSize', { size: calcTotalSizeOfVisibleLessons }) }}
</p>
<div class="filter-and-button">
Expand All @@ -32,6 +35,7 @@
>
<template #headers>
<th>{{ coachString('titleLabel') }}</th>
<th>{{ coreString('progressLabel') }}</th>
<th>{{ $tr('size') }}</th>
<th>{{ coachString('recipientsLabel') }}</th>
<th>{{ coachString('lessonVisibleLabel') }}</th>
Expand All @@ -53,6 +57,12 @@
icon="lesson"
/>
</td>
<td>
<StatusSummary
:tally="lesson.tally"
:verbose="true"
/>
</td>
<td>
{{
coachString('resourcesAndSize', {
Expand Down Expand Up @@ -222,7 +232,19 @@
...mapState('classSummary', { classId: 'id' }),
...mapState('lessonsRoot', ['lessons', 'learnerGroups']),
sortedLessons() {
return this._.orderBy(this.lessons, ['date_created'], ['desc']);
const sorted = this._.orderBy(this.lessons, ['date_created'], ['desc']);
return sorted.map(lesson => {
const learners = this.getLearnersForLesson(lesson);
const sortedLesson = {
totalLearners: learners.length,
tally: this.getLessonStatusTally(lesson.id, learners),
groupNames: this.getGroupNames(lesson.assignments),
recipientNames: this.getRecipientNamesForLesson(lesson),
hasAssignments: learners.length > 0,
};
Object.assign(sortedLesson, lesson);
return sortedLesson;
});
},
userHasDismissedModal() {
return Lockr.get(LESSON_VISIBILITY_MODAL_DISMISSED);
Expand Down Expand Up @@ -426,4 +448,8 @@
}
}
.total-size {
padding: 16px 0;
}
</style>

0 comments on commit 22795e1

Please sign in to comment.