diff --git a/dist/404.html b/dist/404.html new file mode 100644 index 0000000000..7caaa0c96e --- /dev/null +++ b/dist/404.html @@ -0,0 +1,351 @@ + + + + + + iGot + + + + + + + +
+
+ + +
+
+
+ karmayogiLogo +
+
+
+
+
+
+
+

404

+

Page Not Found

+
+
+
+
+
+ + + diff --git a/dist/package.json b/dist/package.json index 91c4131d4e..8998b3f2b4 100644 --- a/dist/package.json +++ b/dist/package.json @@ -14,6 +14,7 @@ "license": "ISC", "dependencies": { "connect-timeout": "^1.9.0", + "ejs": "^3.1.10", "express": "^4.16.4", "express-static-gzip": "2.0.3", "helmet": "^3.15.0", diff --git a/dist/server.js b/dist/server.js index 8f50910bb7..9dc968adaf 100644 --- a/dist/server.js +++ b/dist/server.js @@ -26,6 +26,8 @@ app.use('/healthcheck', healthcheck({ }, })) +app.engine('html', require('ejs').renderFile); + // Add required helmet configurations app.use( helmet({ @@ -82,6 +84,11 @@ uiHostCreator('/ja', 'ja') uiHostCreator('', 'en') app.use(haltOnTimedOut) +app.use((err, req, res, next) => { + //check what error happened here ... + res.status(404).render(path.join(__dirname, `404.html`)) +}) + const port = CONSTANTS.PORTAL_PORT app.listen(port, '0.0.0.0', err => { console.error(err || 'No Error', `Server started at ${port}`) diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.html b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.html index 487742179a..346c9786c3 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.html +++ b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.html @@ -19,9 +19,10 @@ - - + arrow_downward + @@ -31,8 +32,9 @@ [height]="'148px'"> -
- No certificate image +
+ No certificate image + No certificate image
{{'apptochome.certificationTakesTime' | translate }}
@@ -41,12 +43,32 @@
- + +
+ + certificate image + certificate image + +
+ +
+
+
+
@@ -77,7 +99,7 @@
- +
@@ -145,8 +167,26 @@
+ +
+
+
{{ selectedBatchData?.content[0]?.batchAttributes?.currentBatchSize || '0' }} +
+
{{ 'apptoc.batchSize' | translate }}
+
+
+
{{ selectedBatchData?.userCount?.totalApplied || '0' }}
+
{{ 'apptoc.totalApplied' | translate }}
+
+
+
{{ selectedBatchData?.userCount?.enrolled || '0' }}
+
{{ 'apptoc.totalEnrolled' | translate }}
+
+
+
+ -
+
@@ -182,24 +222,6 @@
- -
-
-
{{ selectedBatchData?.content[0]?.batchAttributes?.currentBatchSize || '0' }} -
-
{{ 'apptoc.batchSize' | translate }}
-
-
-
{{ selectedBatchData?.userCount?.totalApplied || '0' }}
-
{{ 'apptoc.totalApplied' | translate }}
-
-
-
{{ selectedBatchData?.userCount?.enrolled || '0' }}
-
{{ 'apptoc.totalEnrolled' | translate }}
-
-
-
-
@@ -229,7 +251,7 @@
{{ 'apptocsinglepage.summary' | translate }}
- +
 {{ 'apptocsinglepage.viewLess' | translate }}
@@ -254,7 +276,8 @@
{{ 'apptocsinglepage.description' | translate }}
- + +
 {{ 'apptocsinglepage.viewLess' | translate }}
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 867216d900..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 @@ -19,13 +19,13 @@ font-size: 16px; } -.desc { - ::ng-deep span { - p { - margin: 0px !important; - } - } -} +// .desc { + +// ::ng-deep .mob-text p { +// margin: 0px !important; + +// } +// } .themes-button { border-radius: 20px; @@ -78,12 +78,20 @@ } } -.mob-text { +.mob-text{ word-break: break-word; white-space: normal; // word-wrap: break-word; overflow-wrap: break-word; text-align: left; +} +::ng-deep .mob-text p { + word-break: break-word!important; + white-space: normal!important; + word-wrap: break-word!important; + overflow-wrap: break-word!important; + text-align: left; + // margin: 0px !important; // hyphens: auto; } @@ -170,6 +178,14 @@ $title-line-count: 3; word-break: break-word; } +.desc { + word-break: break-word; + white-space: normal; + // word-wrap: break-word; + overflow-wrap: break-word; + text-align: left; +} + .desc-ellipsis { @extend .text-ellipsis; min-height: $title-line-count * 24px; @@ -429,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; @@ -493,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 cfeb92d8ce..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' @@ -82,7 +82,8 @@ export class AppTocAboutComponent implements OnInit, OnChanges, AfterViewInit, O public router: Router, private reviewDataService: ReviewComponentDataService, private handleClaimService: HandleClaimService, - private resetRatingsService: ResetRatingsService + 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/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.html b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.html index e4b3408c53..e007d6a680 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.html +++ b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.html @@ -72,7 +72,7 @@

- {{ content?.name | truncate:8 }} + {{ content?.name | truncate:40 }}

{{ 'playerbrief.optional' | translate | titlecase}} @@ -234,7 +234,7 @@

- {{index}}. {{ content?.name | truncate:8 }} + {{index}}. {{ content?.name | truncate:40 }}

call_to_action diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts index f7e50e4d11..3cd099a184 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts +++ b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts @@ -374,11 +374,14 @@ export class AppTocContentCardV2Component implements OnInit { if(localContentData.primaryCategory === NsContent.EPrimaryCategory.MODULE) { this.hierarchyMapData[identifier]['duration'] = this.hierarchyMapData[identifier].leafNodes.reduce( (sum: any, childID: any) => { - return sum + Number(this.hierarchyMapData[childID].duration || this.hierarchyMapData[childID].expectedDuration || 0) + if(this.hierarchyMapData && this.hierarchyMapData[childID]) { + return sum + Number(this.hierarchyMapData[childID].duration || this.hierarchyMapData[childID].expectedDuration || 0) + } + }, 0) } // tslint:disable - const completedItems = _.filter(this.hierarchyMapData[identifier].leafNodes, r => this.hierarchyMapData[r].completionStatus === 2 || this.hierarchyMapData[r].completionPercentage === 100) + const completedItems = _.filter(this.hierarchyMapData[identifier].leafNodes, r => (this.hierarchyMapData[r] && (this.hierarchyMapData[r].completionStatus === 2 || this.hierarchyMapData[r].completionPercentage === 100))) const totalCount = _.toInteger(_.get(this.hierarchyMapData[identifier], 'leafNodesCount')) || 1 this.hierarchyMapData[identifier]['completionPercentage'] = Number(((completedItems.length / totalCount) * 100).toFixed()) this.hierarchyMapData[identifier]['completionStatus'] = (this.hierarchyMapData[identifier].completionPercentage >= 100) ? 2 : 1 diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.html b/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.html index 263d95bedb..743690ee16 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.html +++ b/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.html @@ -1,4 +1,4 @@ - + @@ -9,4 +9,4 @@ [resumeData]="resumeData" [batchData]="batchData" [skeletonLoader]="skeletonLoader" [hierarchyMapData]="hierarchyMapData"> - \ No newline at end of file + diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.scss b/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.scss index 955a349738..799a343e24 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.scss +++ b/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.component.scss @@ -33,4 +33,11 @@ box-shadow: 0px -2px 9px rgba(0, 0, 0, 0.08); background-color: rgba(255, 255, 255, 1); } +} + + +::ng-deep .contentSticky { + .mat-tab-header { + top: 0px !important; + } } \ No newline at end of file diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.module.ts b/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.module.ts index fd801b30e8..e8d72ef3f8 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.module.ts +++ b/library/ws-widget/collection/src/lib/_common/content-toc/content-toc.module.ts @@ -39,6 +39,7 @@ import { AppTocSessionCardNewComponent } from './app-toc-session-card-new/app-to import { AppTocSessionsNewComponent } from './app-toc-sessions-new/app-toc-sessions-new.component' import { AppTocContentCardV2SkeletonComponent } from './app-toc-content-card-v2-skeleton/app-toc-content-card-v2-skeleton.component' import { TruncatePipe } from './pipes/truncate.pipe' +import { ReplaceNbspPipe } from './pipes/replace-nbsp.pipe' @NgModule({ declarations: [ @@ -51,6 +52,7 @@ import { TruncatePipe } from './pipes/truncate.pipe' AppTocSessionsNewComponent, AppTocContentCardV2SkeletonComponent, TruncatePipe, + ReplaceNbspPipe, ], imports: [ CommonModule, diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/karma-points/karma-points.component.ts b/library/ws-widget/collection/src/lib/_common/content-toc/karma-points/karma-points.component.ts index 9540b57028..9b33b9130a 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/karma-points/karma-points.component.ts +++ b/library/ws-widget/collection/src/lib/_common/content-toc/karma-points/karma-points.component.ts @@ -36,7 +36,7 @@ export class KarmaPointsComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - this.condition = changes.condition.currentValue + this.condition = changes.condition && changes.condition.currentValue || null if (!this.condition) { return } if (!this.condition.isPostAssessment && (this.condition.content && this.condition.content.hasOwnProperty('completionPercentage') diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/pipes/replace-nbsp.pipe.spec.ts b/library/ws-widget/collection/src/lib/_common/content-toc/pipes/replace-nbsp.pipe.spec.ts new file mode 100644 index 0000000000..37634c1a3f --- /dev/null +++ b/library/ws-widget/collection/src/lib/_common/content-toc/pipes/replace-nbsp.pipe.spec.ts @@ -0,0 +1,8 @@ +import { ReplaceNbspPipe } from './replace-nbsp.pipe'; + +describe('ReplaceNbspPipe', () => { + it('create an instance', () => { + const pipe = new ReplaceNbspPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/pipes/replace-nbsp.pipe.ts b/library/ws-widget/collection/src/lib/_common/content-toc/pipes/replace-nbsp.pipe.ts new file mode 100644 index 0000000000..2c2dc301e1 --- /dev/null +++ b/library/ws-widget/collection/src/lib/_common/content-toc/pipes/replace-nbsp.pipe.ts @@ -0,0 +1,14 @@ +import { Pipe, PipeTransform } from '@angular/core' + +@Pipe({ + name: 'replaceNbsp', +}) +export class ReplaceNbspPipe implements PipeTransform { + + transform(value: any): any { + if (value.includes(' ')) { + return value.replace(/ /g, ' ') + } + return value + } +} diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/pipes/truncate.pipe.ts b/library/ws-widget/collection/src/lib/_common/content-toc/pipes/truncate.pipe.ts index c91ff9eae4..39063f54f8 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/pipes/truncate.pipe.ts +++ b/library/ws-widget/collection/src/lib/_common/content-toc/pipes/truncate.pipe.ts @@ -8,8 +8,10 @@ export class TruncatePipe implements PipeTransform { if (!value) { return '' } - const words = value.split(' ') - const newWord = words.slice(0, limit).join(' ') - return words.length > limit ? (`${newWord}...`) : value + // const words = value.split(' ') + // const newWord = words.slice(0, limit).join(' ') + const charLen = value.trim() + const newWord = value.substring(0, limit) + return charLen.length > limit ? (`${newWord}...`) : value } } diff --git a/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.html b/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.html index 19d2c1f05b..6d0c77d090 100644 --- a/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.html +++ b/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.html @@ -1,7 +1,7 @@
- -
+
diff --git a/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.scss b/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.scss index 7bbb5a822b..d5c9442f01 100644 --- a/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.scss +++ b/library/ws-widget/collection/src/lib/_common/profile-card-stats/profile-card-stats.component.scss @@ -94,6 +94,7 @@ } .profile-wrapper { margin-top: 32px; + position: relative; z-index: 10; @include breakpoint-xs { @@ -104,6 +105,11 @@ } } +.profile-loading-wrapper { + background-color: #fff; + box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12); + border-radius: 12px 12px; +} .stats-container { border-radius: 12px; border: 1px solid rgba(0,0,0, 0.08); @@ -251,17 +257,19 @@ .expand-icon { width: 32px; height: 32px; - position: absolute; - background: black; - color: white; + position: relative; + background: #000; + color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; left: 50%; right: 50%; - top: -16px; + top: 13px; cursor: pointer; + z-index: 9999; + margin-left: -16px; } .republic-wrapper .collapse-expand-icon { diff --git a/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.html b/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.html index 6593168f21..699ef582c2 100644 --- a/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.html +++ b/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.html @@ -32,7 +32,7 @@
users icon img
{{ 'home.networkBuildConn' | translate }}
-
diff --git a/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.scss b/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.scss index ff9758d8af..5e09acfab1 100644 --- a/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.scss +++ b/library/ws-widget/collection/src/lib/_common/recent-requests/recent-requests.component.scss @@ -3,6 +3,9 @@ width: 100%; height: 100%; } +.network-btn { + background-color: #1b4ca1; +} .recent-div { border-bottom: 1px solid rgba(0, 0, 0, 0.16); diff --git a/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.html b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.html new file mode 100644 index 0000000000..6644ba46e4 --- /dev/null +++ b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.html @@ -0,0 +1,30 @@ +
+ +
+ {{data.title}} + + close + +
+
+
+
+
+ +
+
+
+ {{data?.ImageUrl}} +
+
+

{{data?.content}}

+
+
+ + +
+
+
\ No newline at end of file diff --git a/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.scss b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.scss new file mode 100644 index 0000000000..54c4be067b --- /dev/null +++ b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.scss @@ -0,0 +1,157 @@ +.tips-container { + background-color: #F9CB97; + padding: 16px; + padding-bottom: 0px; + border-radius: 8px; + display: flex; + flex-direction: column; + justify-content: space-between; + margin-bottom: 1rem; + overflow: hidden; + width: 385px; + box-sizing: border-box; + + + } + + @media screen and (max-width: 1000px) { + .tips-container { + width: 100%; + + } + } + + .tips-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 8px; + z-index: 10; + } + + .tips-header h3 { + margin: 0; + font-size: 1.2em; + color: #000000; + font-family: Montserrat; + font-size: 16px; + z-index: 10; + } + + .tips-header button { + background: none; + border: none; + color: #01468f; + cursor: pointer; + font-family: Lato; + font-size: 14px; + z-index: 10; + } + + .tip-content { + display: flex; + // justify-content: space-between; + z-index: 10; + padding-top: 6px; + margin-bottom: 8px; + } + + .tip-content p { + margin-left: 12px; + margin-bottom: 4px; + color: #000000; + font-family: Lato; + font-size: 14px; + z-index: 10; + line-height: 16.8px; + } + + .tip-count { + display: flex; + justify-content: end; + align-items: center; + font-family: Lato !important; + font-size: 14px !important; + z-index: 10; + font-weight: 600; + line-height: 19.5px; + } + + // .tip-data { + // width: calc(100% - 110px); + // } + + + .background-circle { + position: absolute; + z-index: 1; + right: -6.5em; + top: 2.8em; + width: 178px; + height: 178px; + border-radius: 100%; + background-color: #fcd2a3; + } + + .circle-box { + position: relative; + width: 100%; + height: 0px; + } + + .book-icon { + width: 50px; + height: 50px; + padding: 6px; + box-sizing: border-box; + } + + .background { + background-color: white; + justify-content: center; + width: 100px; + height: 51px; + border-radius: 5px; + text-align: center; + } + .view-more { + display: flex; + align-items: center; + text-align: center; + height: 40px; + justify-content: center; + } + + .view-more:hover { + background-color: #DCDFE5; + } + .card-header { + display: flex; + justify-content: space-between; + } + + .card-title { + font-weight: 600; + width: 85%; + font-family: 'Montserrat'; + font-size: 16px; + line-height: 19.5px; + } + + .close-button { + cursor: pointer; + vertical-align: top; + color: #1b4ca1; + } + .btn-title { + color: #fff !important; + background-color: #1b4ca1; + border-radius: 16px; + padding: 8px 16px; + font-weight: 700; + font-size: 14px; + width: 102px; + text-align: center; + margin-bottom: 7px; + + } \ No newline at end of file diff --git a/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.spec.ts b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.spec.ts new file mode 100644 index 0000000000..0c1f203f07 --- /dev/null +++ b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SurveyFormSectionComponent } from './survey-form-section.component'; + +describe('SurveyFormSectionComponent', () => { + let component: SurveyFormSectionComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SurveyFormSectionComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SurveyFormSectionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.ts b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.ts new file mode 100644 index 0000000000..1393771b8e --- /dev/null +++ b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form-section/survey-form-section.component.ts @@ -0,0 +1,22 @@ +import { Component, Input, OnInit } from '@angular/core' + +@Component({ + selector: 'ws-widget-survey-form-section', + templateUrl: './survey-form-section.component.html', + styleUrls: ['./survey-form-section.component.scss'], +}) +export class SurveyFormSectionComponent implements OnInit { + isVisible = true + @Input() surveyFormData: any + surveyData: any + + constructor() { } + + ngOnInit() { + // this.surveyData = this.surveyFormData + } + + closeCard() { + this.isVisible = false + } +} diff --git a/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form.module.ts b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form.module.ts new file mode 100644 index 0000000000..a656d8a494 --- /dev/null +++ b/library/ws-widget/collection/src/lib/_common/survey-form-left-section/survey-form/survey-form.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core' +import { CommonModule } from '@angular/common' +import { SurveyFormSectionComponent } from './survey-form-section/survey-form-section.component' +import { MatIconModule } from '@angular/material' +import { TranslateModule } from '@ngx-translate/core' + +@NgModule({ + declarations: [SurveyFormSectionComponent], + imports: [ + CommonModule, + MatIconModule, + TranslateModule, + ], + exports: [SurveyFormSectionComponent], +}) +export class SurveyFormModule { } diff --git a/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.html b/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.html index 0aa38d7eca..2c267339fe 100644 --- a/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.html +++ b/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.html @@ -1,11 +1,12 @@
-
+
-

Tips for Learners

+ +

Tips for Learners

diff --git a/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.scss b/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.scss index 3e6cfed921..5dc1149989 100644 --- a/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.scss +++ b/library/ws-widget/collection/src/lib/_common/tips-for-learner/tips-for-learner-card/tips-for-learner-card.component.scss @@ -29,14 +29,14 @@ z-index: 10; } - .tips-header h3 { - margin: 0; - font-size: 1.2em; - color: #000000; - font-family: Montserrat; - font-size: 16px; - z-index: 10; - } + // .tips-header h3 { + // margin: 0; + // font-size: 1.2em; + // color: #000000; + // font-family: Montserrat; + // font-size: 16px; + // z-index: 10; + // } .tips-header button { background: none; @@ -53,16 +53,18 @@ // justify-content: space-between; z-index: 10; padding-top: 6px; - margin-bottom: 8px; + // margin-bottom: 8px; + margin-bottom: 16px; + box-sizing: border-box; } .tip-content p { - margin-left: 8px; + // margin-left: 8px; color: #000000; font-family: Lato; font-size: 14px; z-index: 10; - padding: 0px 4px; + // padding: 0px 4px; line-height: 20px; } @@ -83,6 +85,9 @@ // .tip-data { // width: calc(100% - 110px); // } + .tip-data { + margin-left: 12px; + } .background-circle { @@ -125,4 +130,7 @@ .view-more:hover { background-color: #DCDFE5; + } + .margin-bottom-none { + margin-bottom: 0!important; } \ No newline at end of file diff --git a/library/ws-widget/collection/src/lib/_common/user-leaderboard/user-leaderboard.component.ts b/library/ws-widget/collection/src/lib/_common/user-leaderboard/user-leaderboard.component.ts index bf21a5091e..b6f6ca6d40 100644 --- a/library/ws-widget/collection/src/lib/_common/user-leaderboard/user-leaderboard.component.ts +++ b/library/ws-widget/collection/src/lib/_common/user-leaderboard/user-leaderboard.component.ts @@ -60,6 +60,8 @@ export class UserLeaderboardComponent implements OnInit { this.maxLength = Math.max(...this.rankLengthsArray) if (this.currentUserRank) { this.monthName = moment().month(Number(this.currentUserRank.month) - 1).format('MMMM') + } else if (!this.currentUserRank) { + this.monthName = moment().month(Number(this.rank1.month) - 1).format('MMMM') } if (this.currentUserRank && this.currentUserRank.rank < this.currentUserRank.previous_rank) { const rankDiff = this.currentUserRank.previous_rank - this.currentUserRank.rank diff --git a/library/ws-widget/collection/src/lib/_services/widget-content.service.ts b/library/ws-widget/collection/src/lib/_services/widget-content.service.ts index ee8da5c24b..0e23a31c7d 100644 --- a/library/ws-widget/collection/src/lib/_services/widget-content.service.ts +++ b/library/ws-widget/collection/src/lib/_services/widget-content.service.ts @@ -114,7 +114,11 @@ export class WidgetContentService { if (!forPreview) { url = `/apis/proxies/v8/action/content/v3/read/${contentId}` } else { - url = `/api/content/v1/read/${contentId}` + if (window.location.href.includes('editMode=true') && window.location.href.includes('_rc')) { + url = `/apis/proxies/v8/action/content/v3/read/${contentId}` + } else { + url = `/api/content/v1/read/${contentId}` + } } } else { if (!forPreview) { @@ -435,7 +439,11 @@ export class WidgetContentService { API_END_POINTS.CONTENT_READ(contentId), ) } - url = `/api/content/v1/read/${contentId}` + if (window.location.href.includes('editMode=true')) { + url = `/apis/proxies/v8/action/content/v3/read/${contentId}` + } else { + url = `/api/content/v1/read/${contentId}` + } return this.http.get(url) // return this.http.get(API_END_POINTS.CONTENT_READ(contentId)) } @@ -482,15 +490,15 @@ export class WidgetContentService { if (!this.isBatchInProgress(enrolledCourseData.batch)) { return this.gotoTocPage(content) } - } else { - const data = await this.checkForDataToFormUrl(content, enrolledCourseData) - return data + const returnData = await this.checkForDataToFormUrl(content, enrolledCourseData) + return returnData } + const data = await this.checkForDataToFormUrl(content, enrolledCourseData) + return data } return '' } return this.gotoTocPage(content) - } async checkForDataToFormUrl(content: any, enrollData: any) { let urlData: any 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 1212521732..db17101cf7 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 @@ -627,19 +627,7 @@

{{ widgetData.content.name

- +
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 366730f4d6..258604d6a8 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 @@ -436,10 +436,10 @@ export class CardContentV2Component extends WidgetBaseComponent { queryParams: urlData.queryParams }) - } else { - // const contentType = urlData; - this.snackBar.open(`This ${contentCategory} has been archived and is no longer available.`, 'X', { duration: 2000 }); - } + } else { + // const contentType = urlData; + this.snackBar.open(`This ${contentCategory} has been archived and is no longer available.`, 'X', { duration: 2000 }); + } } } 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 c0d5e2f6a6..3dcb1c9868 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 @@ -737,19 +737,7 @@

{{ widgetData.content.name

-
- -
-
- Law -
-
-
+ +
+ -