diff --git a/library/ws-widget/collection/src/lib/card-content/card-content.component.html b/library/ws-widget/collection/src/lib/card-content/card-content.component.html index cb338f47a..096a8a0be 100644 --- a/library/ws-widget/collection/src/lib/card-content/card-content.component.html +++ b/library/ws-widget/collection/src/lib/card-content/card-content.component.html @@ -1062,7 +1062,7 @@

Reason

-
+

Deadline - {{widgetData.content.batch?.endDate | date: "d MMM yyyy"}}

diff --git a/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts b/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts index d3ae19de0..8adf600a0 100644 --- a/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts +++ b/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts @@ -601,7 +601,7 @@ export class ContentStripMultipleComponent extends WidgetBaseComponent // To sort in descending order of the enrolled date if (content && content.length) { - contentNew = content.sort((a: any, b: any) => { + contentNew = (content || []).sort((a: any, b: any) => { const dateA: any = new Date(a.enrolledDate || 0) const dateB: any = new Date(b.enrolledDate || 0) return dateB - dateA diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts b/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts index 040bf8741..1d0555b5e 100755 --- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts +++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts @@ -211,7 +211,12 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { this.getLearningUrls() } if (this.resumeData && this.content) { - const resumeDataV2 = this.getResumeDataFromList() + let resumeDataV2: any + if (this.content.completionPercentage === 100) { + resumeDataV2 = this.getResumeDataFromList('start') + } else { + resumeDataV2 = this.getResumeDataFromList() + } if (!resumeDataV2.mimeType) { resumeDataV2.mimeType = this.getMimeType(this.content, resumeDataV2.identifier) } @@ -370,12 +375,19 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { } } - private getResumeDataFromList() { - const lastItem = this.resumeData && this.resumeData.pop() + private getResumeDataFromList(type?: string) { + if (!type) { + console.log('getResumeDataFromList: type', type) + const lastItem = this.resumeData && this.resumeData.pop() + return { + identifier: lastItem.contentId, + mimeType: lastItem.progressdetails && lastItem.progressdetails.mimeType, + } + } + const firstItem = this.resumeData && this.resumeData.length && this.resumeData[0] return { - identifier: lastItem.contentId, - mimeType: lastItem.progressdetails && lastItem.progressdetails.mimeType, - + identifier: firstItem.contentId, + mimeType: firstItem.progressdetails && firstItem.progressdetails.mimeType, } } private modifySensibleContentRating() { diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html index 5e9a1f10e..3a76a7b87 100755 --- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html +++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html @@ -114,8 +114,13 @@ [routerLink]="resumeData ? resumeDataLink?.url : firstResourceLink?.url" [queryParams]="resumeData ? generateQuery('RESUME') : generateQuery('START')" class="mat-button mat-button-base resumeButton custom-button width-1-1 text-white"> - - {{resumeData? "Resume" : "Start"}} + + + {{resumeData? "Resume" : "Start"}} + + + + {{resumeData? "Start again" : "Start"}} - + + + + {{resumeData? "Resume" : "Start"}} + + + + {{resumeData? "Start again" : "Start"}} { + contentNew = (content || []).sort((a: any, b: any) => { const dateA: any = new Date(a.enrolledDate || 0) const dateB: any = new Date(b.enrolledDate || 0) return dateB - dateA