diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.scss b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.scss
index d5a8ca4c31..afa265b372 100644
--- a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.scss
+++ b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.scss
@@ -445,7 +445,7 @@ $mob-title-line-count: 2;
.ceritificate-image {
display: flex;
- max-width: 248px;
+ // max-width: 248px;
margin: auto;
width: 100%;
border-radius: 8px;
@@ -509,3 +509,82 @@ $mob-title-line-count: 2;
-webkit-box-orient: vertical;
word-wrap: break-word;
}
+.img-container {
+ position: relative;
+
+ .view-cert {
+ visibility: hidden;
+ display: none;
+ }
+
+ &:hover {
+ display: block;
+ z-index: 99999;
+ .view-cert {
+ visibility: visible;
+ position: absolute;
+ left: 0;
+ top: 0;
+ text-align: center;
+ opacity: 1;
+ transition: opacity 0.35s ease;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 100%;
+ background-color: #000000b5;
+ border-radius: 8px;
+ button {
+ color: white;
+ border: 1px solid white;
+ padding: 8px;
+ background: transparent;
+ border-radius: 12px;
+ cursor: pointer;
+ z-index: 999999;
+ }
+ }
+ }
+}
+.view-certificate {
+ visibility: visible !important;
+ display: block;
+ position: absolute;
+ /* width: 500px; */
+ left: 0;
+ top: 0;
+ text-align: center;
+ opacity: 1;
+ background-color: #000000b5;
+ border-radius: 8px;
+ transition: opacity 0.35s ease;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 100%;
+
+ button {
+ color: white;
+ border: 1px solid white;
+ padding: 8px;
+ background: transparent;
+ border-radius: 12px;
+ cursor: pointer;
+ z-index: 999999;
+ width: 150px;
+ }
+}
+
+.uploader-status ::ng-deep .mat-progress-spinner circle, .mat-spinner circle {
+ stroke: #ffffff;
+}
+.uploader-status ::ng-deep .mat-progress-spinner svg {
+ width: 24px !important;
+ height: 24px !important;
+}
+.uploader-status ::ng-deep .mat-progress-spinner {
+ width: 24px !important;
+ height: 24px !important;
+}
diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts
index 8aa582d0bc..c3e01148df 100644
--- a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts
+++ b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts
@@ -18,7 +18,7 @@ import { NsContentStripWithTabs } from '../../../content-strip-with-tabs/content
import { AppTocService } from '@ws/app/src/lib/routes/app-toc/services/app-toc.service'
import { NsContent, RatingService } from '@sunbird-cb/collection/src/public-api'
-import { LoggerService, ConfigurationsService } from '@sunbird-cb/utils-v2'
+import { LoggerService, ConfigurationsService, WidgetContentService } from '@sunbird-cb/utils-v2'
import { TimerService } from '@ws/app/src/lib/routes/app-toc/services/timer.service'
import { HandleClaimService } from '../content-services/handle-claim.service'
import { LoadCheckService } from '@ws/app/src/lib/routes/app-toc/services/load-check.service'
@@ -83,6 +83,7 @@ export class AppTocAboutComponent implements OnInit, OnChanges, AfterViewInit, O
private reviewDataService: ReviewComponentDataService,
private handleClaimService: HandleClaimService,
private resetRatingsService: ResetRatingsService,
+ private contentSvc: WidgetContentService
) {
this.resetRatingsService.resetRatings$.subscribe((_res: any) => {
this.fetchRatingSummary()
@@ -150,6 +151,7 @@ export class AppTocAboutComponent implements OnInit, OnChanges, AfterViewInit, O
private destroySubject$ = new Subject
()
viewMoreTags = false
timerUnsubscribe: any
+ downloadCertificateBool = false
strip: NsContentStripWithTabs.IContentStripUnit = {
key: 'blendedPrograms',
@@ -695,11 +697,30 @@ export class AppTocAboutComponent implements OnInit, OnChanges, AfterViewInit, O
}
handleOpenCertificateDialog() {
- const cet = this.content && this.content.certificateObj.certData
- this.dialog.open(CertificateDialogComponent, {
- width: '1200px',
- data: { cet, certId: this.content && this.content.certificateObj.certId },
- })
+ this.downloadCertificateBool = true
+ const certId = this.content && this.content.certificateObj.certId
+ if (this.content && this.content.certificateObj && !this.content.certificateObj.certData) {
+ this.contentSvc.downloadCert(certId).subscribe(response => {
+ if (this.content) {
+ this.downloadCertificateBool = false
+ this.content['certificateObj']['certData'] = response.result.printUri
+ this.dialog.open(CertificateDialogComponent, {
+ width: '1200px',
+ data: { cet: response.result.printUri, certId: this.content && this.content.certificateObj.certId },
+ })
+ }
+ }, (error: any) => {
+ this.downloadCertificateBool = false
+ this.loggerService.error('CERTIFICATE FETCH ERROR >', error)
+ this.matSnackBar.open('Unable to View Certificate, due to some error!')
+ })
+ } else {
+ this.downloadCertificateBool = false
+ this.dialog.open(CertificateDialogComponent, {
+ width: '1200px',
+ data: { cet: this.content && this.content.certificateObj.certData, certId: this.content && this.content.certificateObj.certId },
+ })
+ }
}
checkValidJSON(str: any) {
diff --git a/package.json b/package.json
index 5efb6a4b81..23539649ad 100644
--- a/package.json
+++ b/package.json
@@ -47,13 +47,13 @@
"@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.72",
+ "@sunbird-cb/consumption": "0.0.73",
"@sunbird-cb/design-system": "0.0.2",
"@sunbird-cb/discussions-ui-v8": "2.1.3",
"@sunbird-cb/micro-surveys": "^2.0.17",
"@sunbird-cb/rain-dashboards": "0.4.33",
"@sunbird-cb/resolver-v2": "0.0.7",
- "@sunbird-cb/utils-v2": "0.0.8",
+ "@sunbird-cb/utils-v2": "0.0.10",
"@types/file-saver": "^2.0.1",
"@types/uuid": "^8.3.1",
"bootstrap": "5.1.2",
diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts
index 31c52f1856..00e599fcca 100755
--- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts
+++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts
@@ -979,8 +979,20 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked,
this.tocSvc.checkModuleWiseData(this.content)
this.enrolledCourseData = enrolledCourse
this.currentCourseBatchId = enrolledCourse.batchId
- this.downloadCert(enrolledCourse.issuedCertificates)
-
+ // this.downloadCert(enrolledCourse.issuedCertificates)
+ if (enrolledCourse && enrolledCourse.issuedCertificates &&
+ enrolledCourse.issuedCertificates.length) {
+ const certificate: any = enrolledCourse.issuedCertificates.sort((a: any, b: any) =>
+ new Date(b.lastIssuedOn).getTime() - new Date(a.lastIssuedOn).getTime())
+ const certId = certificate[0].identifier
+ this.certId = certId
+ if (this.content) {
+ this.content['certificateObj'] = {
+ certId,
+ certData: '',
+ }
+ }
+ }
this.content.completionPercentage = enrolledCourse.completionPercentage || 0
this.content.completionStatus = enrolledCourse.status || 0
if (this.contentReadData && this.contentReadData.cumulativeTracking) {
@@ -1098,22 +1110,22 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked,
return batchId
}
- downloadCert(certIdArr: any) {
- if (certIdArr && certIdArr.length && certIdArr.length > 0) {
- certIdArr.sort((a: any, b: any) => new Date(b.lastIssuedOn).getTime() - new Date(a.lastIssuedOn).getTime())
- const certId = certIdArr[0].identifier
- this.certId = certId
+ // downloadCert(certIdArr: any) {
+ // if (certIdArr && certIdArr.length && certIdArr.length > 0) {
+ // certIdArr.sort((a: any, b: any) => new Date(b.lastIssuedOn).getTime() - new Date(a.lastIssuedOn).getTime())
+ // const certId = certIdArr[0].identifier
+ // this.certId = certId
- this.contentSvc.downloadCert(certId).subscribe(response => {
- if (this.content) {
- this.content['certificateObj'] = {
- certData: response.result.printUri,
- certId: this.certId,
- }
- }
- })
- }
- }
+ // this.contentSvc.downloadCert(certId).subscribe(response => {
+ // if (this.content) {
+ // this.content['certificateObj'] = {
+ // certData: response.result.printUri,
+ // certId: this.certId,
+ // }
+ // }
+ // })
+ // }
+ // }
public handleAutoBatchAssign() {
if (this.forPreview) {
diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts
index 2dc1760289..7ea143c309 100644
--- a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts
+++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts
@@ -69,7 +69,7 @@ export class KarmaProgramsMicrositeV2Component implements OnInit {
}
}
-
+
richTextContent(content: any) {
return this.sanitizer.bypassSecurityTrustHtml(content)
}
diff --git a/src/app/competency-passbook/competency-card-details/competency-card-details.component.html b/src/app/competency-passbook/competency-card-details/competency-card-details.component.html
index ab3eb25cb6..541ed4af98 100644
--- a/src/app/competency-passbook/competency-card-details/competency-card-details.component.html
+++ b/src/app/competency-passbook/competency-card-details/competency-card-details.component.html
@@ -69,19 +69,33 @@
- arrow_downward
- share
+ arrow_downward
+ share