From db9195ee27928db96a6bf9dd203c27a056ad5656 Mon Sep 17 00:00:00 2001 From: Afzal84 Date: Mon, 8 Jul 2024 16:27:14 +0530 Subject: [PATCH 1/5] Fixed:- retired courses certificates for profile & learning strip in home page --- .../card-content-v2.component.html | 6 ++-- .../card-content-v2.component.scss | 4 +++ .../card-content-v2.component.ts | 14 +++++---- .../content-strip-with-tabs.component.ts | 31 ++++++++++++++++++- .../see-all-home/see-all-home.component.ts | 30 +++++++++++++++++- 5 files changed, 74 insertions(+), 11 deletions(-) diff --git a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html index 50c3a1f77..f30be0064 100644 --- a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html +++ b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html @@ -1099,8 +1099,8 @@

{{'cardcon - -
+ +
video_library {{'cardcon
-
+
diff --git a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.scss b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.scss index 9403ae5b8..1d6b7ad10 100644 --- a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.scss +++ b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.scss @@ -1753,4 +1753,8 @@ $title-line-count: 2; } .card-standard-container:hover { transform: scale(1.02); +} +.retiredCards { + opacity: 0.3; + cursor: default; } \ No newline at end of file diff --git a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts index 8d6b14cb1..e621a82a1 100644 --- a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts +++ b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts @@ -426,12 +426,14 @@ export class CardContentV2Component extends WidgetBaseComponent } }) } else { - let urlData = await this.contSvc.getResourseLink(content) - this.router.navigate( - [urlData.url], - { - queryParams: urlData.queryParams - }) + if (content && content.status !=='Retired') { + let urlData = await this.contSvc.getResourseLink(content) + this.router.navigate( + [urlData.url], + { + queryParams: urlData.queryParams + }) + } } diff --git a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts index 74919e417..05d70fbc8 100644 --- a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts +++ b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts @@ -324,9 +324,15 @@ export class ContentStripWithTabsComponent extends WidgetBaseComponent let contentNew: NsContent.IContent[] let tabResults: any[] = [] const queryParams = _.get(strip.request.enrollmentList, 'queryParams') + if (queryParams && queryParams.batchDetails) { + if (!queryParams.batchDetails.includes('&retiredCoursesEnabled=true')) { + queryParams.batchDetails += '&retiredCoursesEnabled=true' + } + } if (this.configSvc.userProfile) { userId = this.configSvc.userProfile.userId } + this.userSvc.resetTime('enrollmentService') // tslint:disable-next-line: deprecation this.userSvc.fetchUserBatchList(userId, queryParams).subscribe( (result: any) => { @@ -445,7 +451,30 @@ export class ContentStripWithTabsComponent extends WidgetBaseComponent strip: NsContentStripWithTabs.IContentStripUnit) { const inprogress: any[] = [] const completed: any[] = [] - array.forEach((e: any, idx: number, arr: any[]) => (customFilter(e, idx, arr) ? inprogress : completed).push(e)) + // array.forEach((e: any, idx: number, arr: any[]) => (customFilter(e, idx, arr) ? inprogress : completed).push(e)) + array.forEach((e, idx, arr) => { + if (customFilter(e, idx, arr)) { + if ((e.status as string) !== 'Retired') { + inprogress.push(e) + } + } else { + completed.push(e) + } + }) + // Sort the completed array with 'Live' status first and 'Retired' status second + completed.sort((a: any, b: any) => { + if (a.status === 'live' && b.status !== 'live') { + return 1 + } if (a.status !== 'live' && b.status === 'live') { + return -1 + } if (a.status === 'Retired' && b.status !== 'Retired') { + return 1 + } if (a.status !== 'Retired' && b.status === 'Retired') { + return -1 + } + return 0 + + }) return [ { value: 'inprogress', widgets: this.transformContentsToWidgets(inprogress, strip) }, { value: 'completed', widgets: this.transformContentsToWidgets(completed, strip) }] diff --git a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts index 2886b4f99..135c39ddb 100644 --- a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts +++ b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts @@ -157,7 +157,29 @@ export class SeeAllHomeComponent implements OnInit, OnDestroy { getInprogressAndCompleted(array: NsContent.IContent[], customFilter: any, strip: NsContentStripWithTabs.IContentStripUnit) { const inprogress: any[] = [] const completed: any[] = [] - array.forEach((e: any, idx: number, arr: any[]) => (customFilter(e, idx, arr) ? inprogress : completed).push(e)) + array.forEach((e, idx, arr) => { + if (customFilter(e, idx, arr)) { + if ((e.status as string) !== 'Retired') { + inprogress.push(e) + } + } else { + completed.push(e) + } + }) + // Sort the completed array with 'live' status first and 'Retired' status second + completed.sort((a: any, b: any) => { + if (a.status === 'live' && b.status !== 'live') { + return 1 + } if (a.status !== 'live' && b.status === 'live') { + return -1 + } if (a.status === 'Retired' && b.status !== 'Retired') { + return 1 + } if (a.status !== 'Retired' && b.status === 'Retired') { + return -1 + } + return 0 + + }) return [ { value: 'inprogress', widgets: this.transformContentsToWidgets(inprogress, strip) }, { value: 'completed', widgets: this.transformContentsToWidgets(completed, strip) }, @@ -231,10 +253,16 @@ export class SeeAllHomeComponent implements OnInit, OnDestroy { let contentNew: NsContent.IContent[] this.tabResults = [] const queryParams = _.get(strip.request.enrollmentList, 'queryParams') + if (queryParams && queryParams.batchDetails) { + if (!queryParams.batchDetails.includes('&retiredCoursesEnabled=true')) { + queryParams.batchDetails += '&retiredCoursesEnabled=true' + } + } if (this.configSvc.userProfile) { userId = this.configSvc.userProfile.userId } // tslint:disable-next-line: deprecation + this.userSvc.resetTime('enrollmentService') this.userSvc.fetchUserBatchList(userId, queryParams).subscribe( (result: any) => { const courses = result && result.courses From 0fa1bb60a101cf517653521524ae29ff130f4200 Mon Sep 17 00:00:00 2001 From: Afzal84 Date: Tue, 9 Jul 2024 13:03:48 +0530 Subject: [PATCH 2/5] Fixed:- retired courses certificates for profile & learning strip in home page --- .../card-content-v2.component.html | 4 ++-- .../card-content-v2.component.ts | 2 +- .../content-strip-with-tabs.component.ts | 21 ++++++++++++------- .../see-all-home/see-all-home.component.ts | 21 ++++++++++++------- src/app/app-routing.module.ts | 2 +- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html index f30be0064..121252173 100644 --- a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html +++ b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.html @@ -1100,7 +1100,7 @@

{{'cardcon -
+
video_library {{'cardcon
-
+
diff --git a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts index e621a82a1..7e7a6c29c 100644 --- a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts +++ b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts @@ -426,7 +426,7 @@ export class CardContentV2Component extends WidgetBaseComponent } }) } else { - if (content && content.status !=='Retired') { + if (content && content.status.toLowerCase() === 'retired') { let urlData = await this.contSvc.getResourseLink(content) this.router.navigate( [urlData.url], diff --git a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts index 05d70fbc8..6bd9f33a2 100644 --- a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts +++ b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts @@ -453,8 +453,9 @@ export class ContentStripWithTabsComponent extends WidgetBaseComponent const completed: any[] = [] // array.forEach((e: any, idx: number, arr: any[]) => (customFilter(e, idx, arr) ? inprogress : completed).push(e)) array.forEach((e, idx, arr) => { + const statusRetired = (e.status as string).toLowerCase() if (customFilter(e, idx, arr)) { - if ((e.status as string) !== 'Retired') { + if (statusRetired !== 'retired') { inprogress.push(e) } } else { @@ -463,17 +464,21 @@ export class ContentStripWithTabsComponent extends WidgetBaseComponent }) // Sort the completed array with 'Live' status first and 'Retired' status second completed.sort((a: any, b: any) => { - if (a.status === 'live' && b.status !== 'live') { - return 1 - } if (a.status !== 'live' && b.status === 'live') { + const statusA = a.status.toLowerCase() + const statusB = b.status.toLowerCase() + if (statusA === 'live' && statusB !== 'live') { return -1 - } if (a.status === 'Retired' && b.status !== 'Retired') { + } + if (statusA !== 'live' && statusB === 'live') { + return 1 + } + if (statusA === 'retired' && statusB !== 'retired') { return 1 - } if (a.status !== 'Retired' && b.status === 'Retired') { + } + if (statusA !== 'retired' && statusB === 'retired') { return -1 } - return 0 - + return 0 }) return [ { value: 'inprogress', widgets: this.transformContentsToWidgets(inprogress, strip) }, diff --git a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts index 314bd6a71..0948ffb8c 100644 --- a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts +++ b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts @@ -177,8 +177,9 @@ export class SeeAllHomeComponent implements OnInit, OnDestroy { const inprogress: any[] = [] const completed: any[] = [] array.forEach((e, idx, arr) => { + const statusRetired = (e.status as string).toLowerCase() if (customFilter(e, idx, arr)) { - if ((e.status as string) !== 'Retired') { + if (statusRetired !== 'retired') { inprogress.push(e) } } else { @@ -187,17 +188,21 @@ export class SeeAllHomeComponent implements OnInit, OnDestroy { }) // Sort the completed array with 'live' status first and 'Retired' status second completed.sort((a: any, b: any) => { - if (a.status === 'live' && b.status !== 'live') { - return 1 - } if (a.status !== 'live' && b.status === 'live') { + const statusA = a.status.toLowerCase() + const statusB = b.status.toLowerCase() + if (statusA === 'live' && statusB !== 'live') { return -1 - } if (a.status === 'Retired' && b.status !== 'Retired') { + } + if (statusA !== 'live' && statusB === 'live') { + return 1 + } + if (statusA === 'retired' && statusB !== 'retired') { return 1 - } if (a.status !== 'Retired' && b.status === 'Retired') { + } + if (statusA !== 'retired' && statusB === 'retired') { return -1 } - return 0 - + return 0 }) return [ { value: 'inprogress', widgets: this.transformContentsToWidgets(inprogress, strip) }, diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1e3af3537..35c85feed 100755 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -962,7 +962,7 @@ const routes: Routes = [ pageId: 'public/privacy-policy', }, }, - + { path: 'public/google/sso', component: PublicLoginWGComponent, From 70b25ebd5f39775cf03188e257916620c5dcb04d Mon Sep 17 00:00:00 2001 From: Afzal84 Date: Tue, 9 Jul 2024 15:11:26 +0530 Subject: [PATCH 3/5] Fixed:- retired courses certificates for profile & learning strip in home page --- .../card-content-v2.component.ts | 2 +- .../content-strip-with-tabs.component.ts | 21 ++++++++++--------- .../see-all-home/see-all-home.component.ts | 19 +++++++++-------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts index 7e7a6c29c..b56a7b5a6 100644 --- a/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts +++ b/library/ws-widget/collection/src/lib/card-content-v2/card-content-v2.component.ts @@ -426,7 +426,7 @@ export class CardContentV2Component extends WidgetBaseComponent } }) } else { - if (content && content.status.toLowerCase() === 'retired') { + if (content && content.status && content.status.toLowerCase() !== 'retired') { let urlData = await this.contSvc.getResourseLink(content) this.router.navigate( [urlData.url], diff --git a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts index 6bd9f33a2..f97a8e8d5 100644 --- a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts +++ b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts @@ -453,19 +453,20 @@ export class ContentStripWithTabsComponent extends WidgetBaseComponent const completed: any[] = [] // array.forEach((e: any, idx: number, arr: any[]) => (customFilter(e, idx, arr) ? inprogress : completed).push(e)) array.forEach((e, idx, arr) => { - const statusRetired = (e.status as string).toLowerCase() - if (customFilter(e, idx, arr)) { - if (statusRetired !== 'retired') { - inprogress.push(e) - } - } else { - completed.push(e) - } + const status = e.status ? (e.status as string).toLowerCase() : '' + const statusRetired = status === 'retired' + if (customFilter(e, idx, arr)) { + if (!statusRetired) { + inprogress.push(e) + } + } else { + completed.push(e) + } }) // Sort the completed array with 'Live' status first and 'Retired' status second completed.sort((a: any, b: any) => { - const statusA = a.status.toLowerCase() - const statusB = b.status.toLowerCase() + const statusA = a.status ? a.status.toLowerCase() : '' + const statusB = b.status ? b.status.toLowerCase() : '' if (statusA === 'live' && statusB !== 'live') { return -1 } diff --git a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts index 0948ffb8c..e4ddf0836 100644 --- a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts +++ b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts @@ -177,19 +177,20 @@ export class SeeAllHomeComponent implements OnInit, OnDestroy { const inprogress: any[] = [] const completed: any[] = [] array.forEach((e, idx, arr) => { - const statusRetired = (e.status as string).toLowerCase() + const status = e.status ? (e.status as string).toLowerCase() : '' + const statusRetired = status === 'retired' if (customFilter(e, idx, arr)) { - if (statusRetired !== 'retired') { - inprogress.push(e) - } - } else { - completed.push(e) + if (!statusRetired) { + inprogress.push(e) } - }) + } else { + completed.push(e) + } + }) // Sort the completed array with 'live' status first and 'Retired' status second completed.sort((a: any, b: any) => { - const statusA = a.status.toLowerCase() - const statusB = b.status.toLowerCase() + const statusA = a.status ? a.status.toLowerCase() : '' + const statusB = b.status ? b.status.toLowerCase() : '' if (statusA === 'live' && statusB !== 'live') { return -1 } From 17880f02095199e9a36a55059f0cb933283bf197 Mon Sep 17 00:00:00 2001 From: Afzal84 Date: Tue, 9 Jul 2024 16:54:27 +0530 Subject: [PATCH 4/5] Fixed:- retired courses certificates for profile & learning strip in home page --- .../content-strip-with-tabs.component.ts | 12 ++++++------ .../see-all-home/see-all-home.component.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts index f97a8e8d5..005008bbe 100644 --- a/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts +++ b/library/ws-widget/collection/src/lib/content-strip-with-tabs/content-strip-with-tabs.component.ts @@ -324,15 +324,15 @@ export class ContentStripWithTabsComponent extends WidgetBaseComponent let contentNew: NsContent.IContent[] let tabResults: any[] = [] const queryParams = _.get(strip.request.enrollmentList, 'queryParams') - if (queryParams && queryParams.batchDetails) { - if (!queryParams.batchDetails.includes('&retiredCoursesEnabled=true')) { - queryParams.batchDetails += '&retiredCoursesEnabled=true' - } - } + // if (queryParams && queryParams.batchDetails) { + // if (!queryParams.batchDetails.includes('&retiredCoursesEnabled=true')) { + // queryParams.batchDetails += '&retiredCoursesEnabled=true' + // } + // } if (this.configSvc.userProfile) { userId = this.configSvc.userProfile.userId } - this.userSvc.resetTime('enrollmentService') + // this.userSvc.resetTime('enrollmentService') // tslint:disable-next-line: deprecation this.userSvc.fetchUserBatchList(userId, queryParams).subscribe( (result: any) => { diff --git a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts index e4ddf0836..d6b742b1e 100644 --- a/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts +++ b/project/ws/app/src/lib/routes/see-all/components/see-all-home/see-all-home.component.ts @@ -275,16 +275,16 @@ export class SeeAllHomeComponent implements OnInit, OnDestroy { let contentNew: NsContent.IContent[] this.tabResults = [] const queryParams = _.get(strip.request.enrollmentList, 'queryParams') - if (queryParams && queryParams.batchDetails) { - if (!queryParams.batchDetails.includes('&retiredCoursesEnabled=true')) { - queryParams.batchDetails += '&retiredCoursesEnabled=true' - } - } + // if (queryParams && queryParams.batchDetails) { + // if (!queryParams.batchDetails.includes('&retiredCoursesEnabled=true')) { + // queryParams.batchDetails += '&retiredCoursesEnabled=true' + // } + // } if (this.configSvc.userProfile) { userId = this.configSvc.userProfile.userId } // tslint:disable-next-line: deprecation - this.userSvc.resetTime('enrollmentService') + // this.userSvc.resetTime('enrollmentService') this.userSvc.fetchUserBatchList(userId, queryParams).subscribe( (result: any) => { const courses = result && result.courses From 64e70d2c48ca5f162458ee2e8b8593b223ad9560 Mon Sep 17 00:00:00 2001 From: Afzal84 Date: Tue, 9 Jul 2024 19:46:44 +0530 Subject: [PATCH 5/5] Fixed:- retired courses certificates for profile & learning strip in home page --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65414a5af..9eb8e959c 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@project-sunbird/sb-styles": "0.0.7", "@project-sunbird/sunbird-quml-player": "0.0.6", "@project-sunbird/telemetry-sdk": "0.0.26", - "@sunbird-cb/consumption": "0.0.47", + "@sunbird-cb/consumption": "0.0.48", "@sunbird-cb/design-system": "0.0.2", "@sunbird-cb/discussions-ui-v8": "2.1.3", "@sunbird-cb/micro-surveys": "^2.0.17",