Skip to content

Commit

Permalink
courses: smoother progress navigation (fixes #7911)(fixes #7936) (#7938)
Browse files Browse the repository at this point in the history
Co-authored-by: mutugiii <[email protected]>
Co-authored-by: dogi <[email protected]>
  • Loading branch information
3 people authored Dec 17, 2024
1 parent 7f741bd commit 555417c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.16.6",
"version": "0.16.7",
"myplanet": {
"latest": "v0.21.42",
"min": "v0.20.42"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
<div class="errors" *ngFor="let set of sets">
<div>{{set.total}}</div>
<planet-avatar *ngIf="showAvatar" class="cursor-pointer" (click)="labelClick(set)" [username]="set.label" [planetCode]="set.planetCode" imgClass="profile-image-large"></planet-avatar>
<div class="wrap-content cursor-pointer" (click)="labelClick(set)" i18n-matTooltip [matTooltip]="set.label?.length > 3 ? set.label : null "><p>{{set.label}}</p></div>
<div class="wrap-content cursor-pointer" (click)="labelClick(set)" i18n-matTooltip [matTooltip]="set.label && set.label.length > 3 ? (set.label.length > 180 ? (set.label | slice:0:180) + '...' : set.label) : null"><p>{{set.label}}</p></div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span i18n>Courses: myProgress</span>
</mat-toolbar>
<div class="view-container view-full-height">
<planet-courses-progress-chart *ngIf="chartData?.length; else noProgress" [inputs]="chartData" [height]="yAxisLength" [showTotals]="false" (changeData)="changeData($event)">
<planet-courses-progress-chart *ngIf="chartData?.length; else noProgress" [inputs]="chartData" [height]="yAxisLength" [showTotals]="false" (clickAction)="handleCourseClick($event)" (changeData)="changeData($event)">
</planet-courses-progress-chart>
<ng-template #noProgress i18n>No Progress record available</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class CoursesProgressLearnerComponent implements OnInit, OnDestroy {
createChartData(courses = [], submissions) {
return courses.map((course: any) => ({
label: course.doc.courseTitle,
courseId: course._id,
items: this.courseBySteps(
course,
submissions.filter(submission => submission.parentId.indexOf(course._id) > -1)
Expand Down Expand Up @@ -106,4 +107,10 @@ export class CoursesProgressLearnerComponent implements OnInit, OnDestroy {

changeData(event) {}

handleCourseClick(event: any) {
if (event.courseId) {
this.router.navigate([ '/courses', 'view', event.courseId ]);
}
}

}

0 comments on commit 555417c

Please sign in to comment.