Skip to content

Commit d1eb69a

Browse files
committed
Add ability to side-panel preview course materials
Implement rtibblesbot cleanup fixes
1 parent 1333ee2 commit d1eb69a

8 files changed

Lines changed: 612 additions & 0 deletions

File tree

kolibri/plugins/coach/frontend/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ class CoachToolsModule extends KolibriApp {
104104
PageNames.COURSES_ASSIGN,
105105
PageNames.COURSES_ASSIGN_INDEX,
106106
PageNames.COURSES_ASSIGN_COURSE_DETAILS,
107+
PageNames.COURSES_ASSIGN_COURSE_PREVIEW,
107108
PageNames.COURSES_ASSIGN_SELECT_RECIPIENTS,
108109
PageNames.COURSE_SUMMARY_ASSIGN,
109110
PageNames.COURSE_SUMMARY_ASSIGN_COURSE_DETAILS,
111+
PageNames.COURSE_SUMMARY_ASSIGN_COURSE_PREVIEW,
110112
PageNames.COURSE_SUMMARY_ASSIGN_SELECT_RECIPIENTS,
111113
PageNames.UNIT_DETAIL,
112114
PageNames.UNIT_DETAIL_LESSONS,
@@ -180,9 +182,11 @@ class CoachToolsModule extends KolibriApp {
180182
PageNames.COURSES_ASSIGN,
181183
PageNames.COURSES_ASSIGN_INDEX,
182184
PageNames.COURSES_ASSIGN_COURSE_DETAILS,
185+
PageNames.COURSES_ASSIGN_COURSE_PREVIEW,
183186
PageNames.COURSES_ASSIGN_SELECT_RECIPIENTS,
184187
PageNames.COURSE_SUMMARY_ASSIGN,
185188
PageNames.COURSE_SUMMARY_ASSIGN_COURSE_DETAILS,
189+
PageNames.COURSE_SUMMARY_ASSIGN_COURSE_PREVIEW,
186190
PageNames.COURSE_SUMMARY_ASSIGN_SELECT_RECIPIENTS,
187191
HomeActivityPage.name,
188192
].includes(to.name)

kolibri/plugins/coach/frontend/constants/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,14 @@ export const PageNames = {
8383
COURSES_ASSIGN: 'COURSES_ASSIGN',
8484
COURSES_ASSIGN_INDEX: 'COURSES_ASSIGN_INDEX',
8585
COURSES_ASSIGN_COURSE_DETAILS: 'COURSES_ASSIGN_COURSE_DETAILS',
86+
COURSES_ASSIGN_COURSE_PREVIEW: 'COURSES_ASSIGN_COURSE_PREVIEW',
8687
COURSES_ASSIGN_SELECT_RECIPIENTS: 'COURSES_ASSIGN_SELECT_RECIPIENTS',
8788
UNIT_DETAIL_LESSONS: 'UNIT_DETAIL_LESSONS',
8889
UNIT_DETAIL_OBJECTIVES: 'UNIT_DETAIL_OBJECTIVES',
8990
// Side panel routes accessible from the course summary page
9091
COURSE_SUMMARY_ASSIGN: 'COURSE_SUMMARY_ASSIGN',
9192
COURSE_SUMMARY_ASSIGN_COURSE_DETAILS: 'COURSE_SUMMARY_ASSIGN_COURSE_DETAILS',
93+
COURSE_SUMMARY_ASSIGN_COURSE_PREVIEW: 'COURSE_SUMMARY_ASSIGN_COURSE_PREVIEW',
9294
COURSE_SUMMARY_ASSIGN_SELECT_RECIPIENTS: 'COURSE_SUMMARY_ASSIGN_SELECT_RECIPIENTS',
9395

9496
/* Attendance */

kolibri/plugins/coach/frontend/routes/coursesRoutes.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import AssignCourseSidePanel from '../views/courses/sidePanels/AssignCourse/inde
77
import CourseDetailsSubpage from '../views/courses/sidePanels/AssignCourse/subpages/CourseDetails.vue';
88
import SelectRecipientsSubpage from '../views/courses/sidePanels/AssignCourse/subpages/SelectRecipients.vue';
99
import AssignCourseIndexSubpage from '../views/courses/sidePanels/AssignCourse/subpages/AssignCourseIndex.vue';
10+
import CoursePreviewSidePanel from '../views/courses/sidePanels/AssignCourse/subpages/CoursePreviewSidePanel.vue';
1011
import { classIdParamRequiredGuard, RouteSegments, COMPACT_UUID_PATTERN } from './utils';
1112

1213
const { OPTIONAL_CLASS, ALL_COURSES, CLASS, COURSE_SESSION } = RouteSegments;
@@ -76,6 +77,11 @@ export default [
7677
path: ':courseId/course-details',
7778
component: CourseDetailsSubpage,
7879
},
80+
{
81+
name: PageNames.COURSE_SUMMARY_ASSIGN_COURSE_PREVIEW,
82+
path: ':courseId/preview',
83+
component: CoursePreviewSidePanel,
84+
},
7985
{
8086
name: PageNames.COURSE_SUMMARY_ASSIGN_SELECT_RECIPIENTS,
8187
path: 'select-recipients',
@@ -144,6 +150,11 @@ export default [
144150
path: ':courseId/course-details',
145151
component: CourseDetailsSubpage,
146152
},
153+
{
154+
name: PageNames.COURSES_ASSIGN_COURSE_PREVIEW,
155+
path: ':courseId/preview',
156+
component: CoursePreviewSidePanel,
157+
},
147158
{
148159
name: PageNames.COURSES_ASSIGN_SELECT_RECIPIENTS,
149160
path: 'select-recipients',

kolibri/plugins/coach/frontend/views/courses/sidePanels/AssignCourse/subpages/CourseDetails.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@
2929
{{ course.description }}
3030
</div>
3131
</section>
32+
<KButton
33+
:primary="false"
34+
appearance="raised-button"
35+
:text="previewAction$()"
36+
:disabled="loading || !course"
37+
class="preview-button"
38+
data-testid="preview-button"
39+
@click="openPreview"
40+
/>
41+
3242
<KButton
3343
v-if="descOverflowing"
3444
class="view-more"
@@ -202,6 +212,7 @@
202212
selectRecipientsLabel$,
203213
preTestLabel$,
204214
postTestLabel$,
215+
previewAction$,
205216
} = coursesStrings;
206217
207218
const { expandAll$, collapseAll$ } = enhancedQuizManagementStrings;
@@ -266,6 +277,13 @@
266277
return message;
267278
});
268279
280+
function openPreview() {
281+
const previewRouteName = route.params.courseSessionId
282+
? PageNames.COURSE_SUMMARY_ASSIGN_COURSE_PREVIEW
283+
: PageNames.COURSES_ASSIGN_COURSE_PREVIEW;
284+
router.push(overrideRoute(route, { name: previewRouteName }));
285+
}
286+
269287
// Description expansion
270288
const descExpanded = ref(false);
271289
const courseDescriptionRef = templateRef('courseDescriptionRef');
@@ -282,6 +300,8 @@
282300
selectRecipients,
283301
numTestQuestions,
284302
isPreviewMode,
303+
openPreview,
304+
previewAction$,
285305
286306
courseSubtitle,
287307
backAction$,
@@ -373,4 +393,8 @@
373393
text-align: right;
374394
}
375395
396+
.preview-button {
397+
margin-bottom: 16px;
398+
}
399+
376400
</style>

0 commit comments

Comments
 (0)