diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/package.json b/sb-cb-ui-assessment/library/sunbird-cb/assessment/package.json index 2ff700072..2dc937995 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/package.json +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/package.json @@ -1,6 +1,6 @@ { "name": "@sunbird-cb/assessment", - "version": "0.0.6", + "version": "0.0.17", "main": "./src/public-api.ts", "peerDependencies": { "@angular/animations": "~8.2.1", diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.html b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.html index 3aa762beb..b3a0888c4 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.html +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.html @@ -1,22 +1,36 @@ -
+
-
-
- + +
+
+ +
-
- - - - + + + + + + + + +
\ No newline at end of file diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.scss b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.scss index d10bbead0..77c0668f8 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.scss +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.scss @@ -1,6 +1,11 @@ ::ng-deep .assessment-preview .mat-dialog-container { padding: 10px !important; - overflow: visible + overflow: visible; +} + +::ng-deep .assessment-preview-dialog-question-preview .mat-dialog-container { + padding: 10px !important; + overflow-y: auto; } ::ng-deep .assessment-preview-dialog { @@ -33,4 +38,40 @@ } } +} + +::ng-deep .assessment-preview-dialog-question-preview { + height: 98%; + overflow-y: auto; + overflow-x: hidden; + margin-top: 15px; + + .close-button { + border-radius: 50%; + border: 0.5px solid #6a6868; + width: 30px; + height: 30px; + position: absolute; + top: 19%; + right: 19.5%; + background-color: white; + + .close-icon { + font-size: 20px; + // margin-bottom: 12px; + // margin-left: 1px; + color: #7c7b7b; + } + + .mat-icon { + height: 16px; + width: 16px; + margin-top: 3px; + margin-left: -3px; + } + + .cursor-pointer { + cursor: pointer; + } + } } \ No newline at end of file diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.ts b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.ts index f71af2ead..7bfc93869 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.ts +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/common-assessment-viewer.component.ts @@ -19,8 +19,14 @@ export class CommonAssessmentViewerComponent implements OnInit { quizJson: any fromCreation = true collectionId = '' + questionPreview = false ngOnInit() { + // tslint:disable-next-line + console.log('this.data', this.data) if (this.data) { + // tslint:disable-next-line + console.log('this.data', this.data) + this.questionPreview = this.data.questionPreview this.isFetchingDataComplete = this.data.isFetchingDataComplete this.testData = this.data.testData this.isErrorOccured = this.data.isErrorOccured diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/fitb/fitb.component.html b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/fitb/fitb.component.html index 60281ccd1..e6ceb22a5 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/fitb/fitb.component.html +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/fitb/fitb.component.html @@ -1,16 +1,19 @@ - Instruction - {{ question?.instructions || 'Fill in the blank with the best - word'}} + + Instruction + {{ + question?.instructions || 'Fill in the blank with the best + word'}} +

-
+
- +
1) { + /* tslint:disable */ + for (let j = 0; j < totalBlank; j++) { + let selectBox = '' + } + } + this.localQuestion = this.localQuestion.replace('', 'idMarkerForReplacement') + } } if (iterationNumber === 0) { // replacing input tag forom richtext. new courses + const totalBlank = (this.localQuestion.match(/input style="border-style:none none solid none"/g) || []).length this.localQuestion = this.localQuestion.split('') .join('idMarkerForReplacement') + + if (this.question && this.question.choices && this.question.choices.options && this.question.choices.options.length > 1) { + for (let j = 0; j < totalBlank; j++) { + let selectBox = '' + } + } iterationNumber = (this.localQuestion.match(/idMarkerForReplacement/g) || []).length fromRichTextEditor = true } @@ -169,13 +239,40 @@ export class FillInTheBlankComponent implements OnInit, OnChanges, AfterViewInit this.unTouchedBlank.push(true) } } + let selectBox = '' for (let i = 0; i < iterationNumber; i += 1) { if (this.question.options.length > 0 || (fromRichTextEditor && iterationNumber > 0)) { + if (this.question && this.question.choices && this.question.choices.options && this.question.choices.options.length > 1) { + selectBox = `' + selectBox = selectBox.toString() + } // console.log('============>', i, this.question.options[i].text) if (value[i]) { this.localQuestion = this.localQuestion.replace( 'idMarkerForReplacement', - ``, ) @@ -184,7 +281,7 @@ export class FillInTheBlankComponent implements OnInit, OnChanges, AfterViewInit } else { this.localQuestion = this.localQuestion.replace( 'idMarkerForReplacement', - ``, ) @@ -193,7 +290,7 @@ export class FillInTheBlankComponent implements OnInit, OnChanges, AfterViewInit if (value[i]) { this.localQuestion = this.localQuestion.replace( 'idMarkerForReplacement', - ``, ) @@ -202,7 +299,7 @@ export class FillInTheBlankComponent implements OnInit, OnChanges, AfterViewInit } else { this.localQuestion = this.localQuestion.replace( 'idMarkerForReplacement', - ``, ) @@ -225,6 +322,8 @@ export class FillInTheBlankComponent implements OnInit, OnChanges, AfterViewInit iterationNumber = ((this.localQuestion.match(/_______________/g) || []).length) } else if (this.localQuestion.includes('input style="border-style:none none solid none"')) { iterationNumber = ((this.localQuestion.match(/input style="border-style:none none solid none"/g) || []).length) + } else if (this.localQuestion.includes('select"')) { + iterationNumber = ((this.localQuestion.match(/select"/g) || []).length) } for (let i = 0; i < iterationNumber; i += 1) { @@ -267,4 +366,4 @@ export class FillInTheBlankComponent implements OnInit, OnChanges, AfterViewInit this.shCorrectAnsSubscription.unsubscribe() } } -} +} \ No newline at end of file diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-mca/mcq-mca.component.scss b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-mca/mcq-mca.component.scss index ac5f44fd0..0aa14fa93 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-mca/mcq-mca.component.scss +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-mca/mcq-mca.component.scss @@ -126,4 +126,8 @@ height: auto !important; word-wrap: break-word; } +} + +video { + width: 360px !important; } \ No newline at end of file diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-sca/mcq-sca.component.scss b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-sca/mcq-sca.component.scss index 56e0a7bf0..0d4757897 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-sca/mcq-sca.component.scss +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mcq-sca/mcq-sca.component.scss @@ -169,4 +169,8 @@ .font-700 { font-weight: 700; +} + +video { + width: 360px !important; } \ No newline at end of file diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mtf/mtf.component.ts b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mtf/mtf.component.ts index 11549aeb5..168591283 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mtf/mtf.component.ts +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/mtf/mtf.component.ts @@ -71,6 +71,8 @@ export class MatchTheFollowingQuesComponent implements OnInit, OnChanges, AfterV } }) this.localQuestion = this.question.question + // tslint:disable-next-line + console.log('this.question', this.question) this.question.options.map(option => (option.matchForView = option.match)) // const array = this.question.options.map(elem => elem.match) // const arr = this.practiceSvc.shuffle(array) diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.html b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.html index 8876eb364..77babe93d 100755 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.html +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.html @@ -60,12 +60,13 @@
-

+

- +
@@ -182,34 +183,36 @@
-
-
-
- - - - -
-
-
-

+

- + {{ question?.instructions}} - + Drag and drop numbers on the left to the corresponding circles on the right
- +
+
+
+
+ + + + +
+
+
+
@@ -222,7 +225,6 @@

-
@@ -247,17 +249,19 @@

+

Read the paragraph and answer the question below

+

-

+

- +
- @@ -303,11 +307,14 @@

+
+

Read the paragraph and answer the question below

+

+
@@ -329,33 +336,35 @@

-
-
-
- - - -
-
-
-
+
-

+

- + {{ question?.instructions}} - + Drag and drop numbers on the left to the corresponding circles on the right
- +
+
+
+
+ + + +
+
+
+
diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.scss b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.scss index 5ae55d927..bb6ea466b 100755 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.scss +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.scss @@ -116,8 +116,13 @@ margin-top: -5px; } - // width:98%; - word-wrap: break-word; + width:98%; + word-break: break-word; +} + +.paragraph { + width: 98%; + word-break: break-word; } .mtf-flag { @@ -357,4 +362,14 @@ margin: 0 5px; } +} + +video { + width: 360px !important; +} + +@media only screen and (min-width : 240px) and (max-width: 767px) { + video { + width: 98% !important; + } } \ No newline at end of file diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.ts b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.ts index bd823729b..d458b316f 100755 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.ts +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/components/question/question.component.ts @@ -28,6 +28,7 @@ export class QuestionComponent implements OnInit, OnChanges, AfterViewInit { @Input() showAnswer: any @Input() currentQuestion: any @Input() selectedAssessmentCompatibilityLevel = 2 + @Input() questionParagraph ? = '' @Input() question: NSPractice.IQuestion = { multiSelection: false, section: '', @@ -44,6 +45,7 @@ export class QuestionComponent implements OnInit, OnChanges, AfterViewInit { isCorrect: false, }, ], + choices: { options: [] }, } @Input() itemSelectedList: string[] = [] @Input() markedQuestions: Set = new Set() @@ -66,6 +68,7 @@ export class QuestionComponent implements OnInit, OnChanges, AfterViewInit { @Input() showOnlyQuestion: any @Input() showMarkForReview: any = false @Input() assessmentType = '' + @Input() questionPreview = false expandedQuestionSetSubscription: any constructor( @@ -91,6 +94,8 @@ export class QuestionComponent implements OnInit, OnChanges, AfterViewInit { init() { this.matchHintDisplay = [] + // tslint:disable-next-line + console.log('this.question', this.question, this.showMarkForReview, this.questionNumber, this.showQuestionMarks, this.assessmentType) const res: string[] = this.question.question.match(/]+src="([^">]+)"/g) || [''] for (const oldImg of res) { if (oldImg) { @@ -106,6 +111,8 @@ export class QuestionComponent implements OnInit, OnChanges, AfterViewInit { } } + // tslint:disable-next-line + console.log('this.question', this.question, this.showMarkForReview, this.questionNumber, this.showQuestionMarks, this.assessmentType) this.practiceSvc.questionAnswerHash.subscribe(val => { this.itemSelectedList1 = val[this.question.questionId] }) diff --git a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/practice.component.html b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/practice.component.html index ad724eb40..7b05363ed 100644 --- a/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/practice.component.html +++ b/sb-cb-ui-assessment/library/sunbird-cb/assessment/src/lib/practice/practice.component.html @@ -1215,7 +1215,7 @@

[currentQuestion]="current_Question" [coursePrimaryCategory]="coursePrimaryCategory" [showOnlyQuestion]="false" [selectedAssessmentCompatibilityLevel]="selectedAssessmentCompatibilityLevel" [questionAnswerHash]="questionAnswerHash" [showQuestionMarks]="showQuestionMarks" - [assessmentType]="assessmentType"> + [assessmentType]="assessmentType" [questionParagraph]="questionParagraph">
@@ -1953,7 +1953,8 @@

[coursePrimaryCategory]="coursePrimaryCategory" [mobileQuestionSetExpand]="!expandFalse" [questionAnswerHash]="questionAnswerHash" [assessmentType]="assessmentType" [showQuestionMarks]="showQuestionMarks" - [selectedAssessmentCompatibilityLevel]="selectedAssessmentCompatibilityLevel"> + [selectedAssessmentCompatibilityLevel]="selectedAssessmentCompatibilityLevel" + [questionParagraph]="questionParagraph"> @@ -31,8 +31,8 @@
-
- {{ child.name }} +
+ {{ child?.displayName }}
{ + this.competencySvc.getCompetencyListv_V2().subscribe((response: any) => { this.allcompetencyTheme = {} - if(response && response.result && response.result.competency) { - this.originalCompetencyArray = response.result.competency + if(response && response.result && response.result.content) { + this.originalCompetencyArray = response.result.content this.getMdoCompetencies() // this.getCompetencyArea() - response.result.competency.forEach(element => { + response.result.content.forEach(element => { element.children.forEach((childEle) => { let name = childEle.name.toLowerCase() this.allcompetencyTheme[name] = childEle @@ -80,10 +88,10 @@ export class CompetencyPassbookMdoComponent implements OnInit { if(response.results.result.facets && response.results.result.facets.length){ let facetData = response.results.result.facets facetData.forEach((facet: any) => { - if(facet.name === 'competencies_v5.competencyArea') { + if(facet.name === `${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyArea}`) { this.competencyArea = facet.values this.selectedValue = facet.values[0].name - } else if(facet.name === 'competencies_v5.competencyTheme') { + } else if(facet.name === `${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyTheme}`) { this.competencyThemeData = facet.values this.getCompetencyTheme() } @@ -146,7 +154,6 @@ export class CompetencyPassbookMdoComponent implements OnInit { } this.temeletryResponse.emit(e.name) - this.selectedValue = e.name this.getCompetencyTheme() } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook-mdo/competency-passbook-mdo.service.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook-mdo/competency-passbook-mdo.service.ts index 2de63cd08..8555c88e8 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook-mdo/competency-passbook-mdo.service.ts +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook-mdo/competency-passbook-mdo.service.ts @@ -5,6 +5,7 @@ import { Observable } from 'rxjs' const API_POINTS = { COMPETENCY_LIST: `apis/proxies/v8/competency/v4/search`, competency_URL: `apis/proxies/v8/v1/search/competenciesByOrg/`, + COMPETENCY_LIST_V2: `apis/proxies/v8/searchBy/v2/competency`, } @Injectable({ providedIn: 'root' }) @@ -15,7 +16,9 @@ export class CompetencyPassbookMdoService { getCompetencyList(payload: any): Observable { return this.http.post(API_POINTS.COMPETENCY_LIST, payload) } - + getCompetencyListv_V2(): Observable { + return this.http.get(API_POINTS.COMPETENCY_LIST_V2) + } mdoCompetency(providerId: string): Observable { return this.http.get(API_POINTS.competency_URL + providerId) } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.component.html index 7c1bf9f9b..fcbfd8d7e 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.component.html +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.component.html @@ -15,25 +15,25 @@
-
{{allcompetencyTheme[obj?.name]?.name}}
+
{{allcompetencyTheme[obj?.name]?.displayName}}
- {{ allcompetencyTheme[obj.name]?.description }} + {{ allcompetencyTheme[obj.name]?.description }}
-
+
-
- {{ child.name }} +
+ {{ child?.displayName }}
partialSum + data.count, 0) + response.results.result.facets.forEach((fact: any) => { + + if(fact.name === `${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyArea}`) { + this.competencyArea = fact.values + } + }); this.selectedValue = this.competencyArea[0].name.toLowerCase() - let addFilter = { - "createdFor": [ - this.providerId - ] - } - this.getcompetencyTheme(this.competencyArea[0].name, addFilter) + this.competencyArea.forEach(async (area: any, indexValue: any)=> { + let addFilter = { + "createdFor": [ + this.providerId + ] + } + let data = await this.getcompetencyThemeCount(area, addFilter) + area['themeData'] = data + area['count'] = data.length + + this.competencyStrength = this.competencyStrength + data.length + if(indexValue === 0) { + + this.getThemeDataByArea(area) + } + }) this.loadCompetencyArea = false } } @@ -140,19 +162,17 @@ export class CompetencyPassbookComponent implements OnInit { this.temeletryResponse.emit(e.name) - this.getcompetencyTheme(e.name, addfilter) + this.getThemeDataByArea(e) this.selectedValue = e.name } getAllCompetencies(){ this.loadCometency = true - let request = {"search":{"type":"Competency Area"},"filter":{"isDetail":true}} - this.competencySvc.getCompetencyList(request).subscribe((response: any) => { + this.competencySvc.getCompetencyListv_V2().subscribe((response: any) => { this.allcompetencyTheme = {} - if(response && response.result && response.result.competency) { - this.originalCompetencyArray = response.result.competency - + if(response && response.result && response.result.content) { + this.originalCompetencyArray = response.result.content this.getCompetencyArea() - response.result.competency.forEach(element => { + response.result.content.forEach(element => { element.children.forEach((childEle) => { let name = childEle.name.toLowerCase() this.allcompetencyTheme[name] = childEle @@ -171,7 +191,7 @@ export class CompetencyPassbookComponent implements OnInit { "filters": { "contentType":"Course", ...addFilter, - "competencies_v5.competencyArea" : value, + [`${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyArea}`] : value, "status": [ "Live" ] @@ -180,7 +200,7 @@ export class CompetencyPassbookComponent implements OnInit { "lastUpdatedOn": "desc" }, "facets": [ - "competencies_v5.competencyTheme" + `${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyTheme}` ], "limit": 0, "offset": 0, @@ -214,6 +234,79 @@ export class CompetencyPassbookComponent implements OnInit { } } + getThemeDataByArea(areaData: any){ + let competencyThemeData : any = areaData.themeData + this.originalCompetencyArray.forEach((element: any) => { + if(element.name.toLowerCase() === areaData.name) { + this.competencyTheme = competencyThemeData.filter((ele1: any) => { + return element.children.find((ele2: any) => ele2.name.toLowerCase() === ele1.name.toLowerCase()) + }) + this.showAllTheme = [{name:'Show all', showAll: false}] + this.competencyThemeLength = 6 + } + }); + let addfilter: any = {} + if(this.providerId) { + addfilter = { + "createdFor": [ + this.providerId + ], + } + } + this.getcompetencySubTheme(areaData,addfilter) + } + + async getcompetencyThemeCount(area: any,addFilter?: any) { + let request = { + "request": { + "query": "", + "filters": { + "contentType":"Course", + ...addFilter, + [`${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyArea}`] : area.name, + "status": [ + "Live" + ] + }, + "sort_by": { + "lastUpdatedOn": "desc" + }, + "facets": [ + `${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyTheme}` + ], + "limit": 0, + "offset": 0, + "fields": [ + ] + } + } + + try { + let returnedData : any = + this.loadCometency = true + const response = await this.callCompetencySearch(request); + if (response && response.results) { + if(response.results.result.facets){ + let competencyThemeData : any = response.results.result.facets[0].values + this.originalCompetencyArray.forEach((element: any) => { + if(element.name.toLowerCase() === area.name) { + returnedData = competencyThemeData.filter((ele1: any) => { + return element.children.find((ele2: any) => ele2.name.toLowerCase() === ele1.name.toLowerCase()) + }) + this.showAllTheme = [{name:'Show all', showAll: false}] + this.competencyThemeLength = 6 + } + }); + } + this.loadCometency = false + return returnedData + } + } catch (error) { + // Handle errors + // console.error('Error:', error); + } + } + resetViewMore(){ Object.keys(this.allcompetencyTheme).forEach((comp: any) => { this.allcompetencyTheme[comp]['viewMore'] = false @@ -231,6 +324,65 @@ export class CompetencyPassbookComponent implements OnInit { } navigateToCompetency(compData: any){ - this.router.navigateByUrl(`app/learn/browse-by/competency/${compData.name}`) + this.router.navigateByUrl(`/app/learn/browse-by/competency/${compData.name}`) + } + + + async getcompetencySubTheme(compArea: any,addFilter?: any) { + let request = { + "request": { + "query": "", + "filters": { + "contentType":"Course", + ...addFilter, + [`${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencyArea}`] : compArea.name, + "status": [ + "Live" + ] + }, + "sort_by": { + "lastUpdatedOn": "desc" + }, + "facets": [ + `${this.environment.compentencyVersionKey}.${this.comeptencyKeys.vCompetencySubTheme}` + ], + "limit": 0, + "offset": 0, + "fields": [ + ] + } + } + + try { + this.loadCometency = true + const response = await this.callCompetencySearch(request); + if (response && response.results) { + if(response.results.result.facets){ + let competencySubThemeData : any = response.results.result.facets[0].values + this.competencyArea.forEach((areaEle: any) => { + if(areaEle.name === compArea.name) { + areaEle.themeData.forEach((themeEle) => { + if(this.allcompetencyTheme[themeEle.name.toLowerCase()] && + this.allcompetencyTheme[themeEle.name.toLowerCase()].children && + this.allcompetencyTheme[themeEle.name.toLowerCase()].children.length) { + let data = this.allcompetencyTheme[themeEle.name.toLowerCase()].children.filter(obj1 => + competencySubThemeData.some(obj2 => + Object.keys(obj1).every(key => obj1['name'] === (obj2['name'])) + ) + ); + + this.allcompetencyTheme[themeEle.name.toLowerCase()]['children'] = data + } + }); + } + }) + } + + this.loadCometency = false + } + } catch (error) { + // Handle errors + // console.error('Error:', error); + } } } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.service.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.service.ts index 28ecd8eb2..f33cac0e3 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.service.ts +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/competency-passbook/competency-passbook.service.ts @@ -4,6 +4,7 @@ import { Observable } from 'rxjs' const API_POINTS = { COMPETENCY_LIST: `apis/proxies/v8/competency/v4/search`, + COMPETENCY_LIST_V2: `apis/proxies/v8/searchBy/v2/competency`, CERTIFICATE_URL: `apis/protected/v8/cohorts/course/batch/cert/download/`, } @@ -15,6 +16,9 @@ export class CompetencyPassbookService { getCompetencyList(payload: any): Observable { return this.http.post(API_POINTS.COMPETENCY_LIST, payload) } + getCompetencyListv_V2(): Observable { + return this.http.get(API_POINTS.COMPETENCY_LIST_V2) + } fetchCertificate(certId: string): Observable { return this.http.get(API_POINTS.CERTIFICATE_URL + certId) diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.html index ab3b5ca85..fac7e6dd0 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.html +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.html @@ -83,7 +83,8 @@ (selectedTabChange)="tabClicked($event, stripsResultDataMap[key], key)"> - {{ translateLabels(tab?.label, 'home') }}   + {{ translateLabels(tab?.label, 'home') }} + {{tab?.label}}   ({{tab?.widgets?.length}})
diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.ts index c37c18faa..42f56e66a 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.ts +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, Input, OnDestroy, HostBinding, Inject, EventEmitter, import { NsWidgetResolver, WidgetBaseComponent } from '@sunbird-cb/resolver-v2'; import { NsContentStripWithTabs } from './content-strip-with-tabs-lib.model'; // import { HttpClient } from '@angular/common/http' -import { WidgetContentService } from '../../_services/widget-content.service'; +import { WidgetContentLibService } from '../../_services/widget-content-lib.service'; import { NsContent } from '../../_models/widget-content.model'; import { MultilingualTranslationsService } from '../../_services/multilingual-translations.service'; import { @@ -15,7 +15,7 @@ import { } from '@sunbird-cb/utils-v2'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { WidgetUserService } from '../../_services/widget-user.service'; +import { WidgetUserServiceLib } from '../../_services/widget-user-lib.service'; // import { environment } from 'src/environments/environment' // tslint:disable-next-line import * as _ from 'lodash' @@ -100,14 +100,12 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent environment!: any; changeEventSubscription: Subscription | null = null; defaultMaxWidgets = 12; - enrollInterval: any; todaysEvents: any = []; - enrollmentMapData: any constructor( // private contentStripSvc: ContentStripNewMultipleService, @Inject('environment') environment: any, - private contentSvc: WidgetContentService, + private contentSvc: WidgetContentLibService, private loggerSvc: LoggerService, private eventSvc: EventService, private configSvc: ConfigurationsService, @@ -115,7 +113,7 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent // private http: HttpClient, // private searchServSvc: SearchServService, public router: Router, - private userSvc: WidgetUserService, + private userSvc: WidgetUserServiceLib, private translate: TranslateService, private langtranslations: MultilingualTranslationsService ) { @@ -345,9 +343,6 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent this.fetchPlaylistReadData(strip, calculateParentStatus); this.fetchCiosContentData(strip, calculateParentStatus); - // this.enrollInterval = setInterval(() => { - // this.fetchAllCbpPlans(strip, calculateParentStatus) - // }, 1000) } fetchFromEnrollmentList(strip: NsContentStripWithTabs.IContentStripUnit, calculateParentStatus = true) { @@ -561,11 +556,22 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent // console.log('calling after-- ') if (response.results.result.content) { if (strip.key === 'scheduledAssessment') { - this.enrollInterval = setInterval(() => { - this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl) - - // tslint:disable-next-line - }, 1000) + + let result = response.results.result.content.map(a => a.identifier); + const responseData = await this.userSvc.fetchEnrollmentDataByContentId(this.configSvc.userProfile.userId,result.join(',')).toPromise().then(async (res: any) => { + const enrollData: any = {} + if (res && res.courses && res.courses.length) { + res.courses.forEach((data: any) => { + enrollData[data.collectionId] = data + }) + return enrollData + } else { + return {} + } + }).catch((_err: any) => { + return {} + }); + this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl, responseData) } else { @@ -601,21 +607,21 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent } } - checkInvitOnlyAssessments(content: any, strip: any, calculateParentStatus: any, viewMoreUrl: any) { - if (localStorage.getItem('enrollmentMapData')) { - this.enrollmentMapData = JSON.parse(localStorage.getItem('enrollmentMapData') || '{}') + checkInvitOnlyAssessments(content: any, strip: any, calculateParentStatus: any, viewMoreUrl: any, enrollmentData:any) { + if (Object.keys(enrollmentData).length) { + enrollmentData = enrollmentData let filteredArray: any = [] let now = new Date().getTime() content.forEach((data: any) => { - if (this.enrollmentMapData[data.identifier]) { - if(this.enrollmentMapData[data.identifier].status !== 2 && this.enrollmentMapData[data.identifier].batch) { - const enrollData = this.enrollmentMapData[data.identifier].batch + if (enrollmentData[data.identifier]) { + if(enrollmentData[data.identifier].status !== 2 && enrollmentData[data.identifier].batch) { + const enrollData = enrollmentData[data.identifier].batch let endDate:any = new Date(enrollData.endDate).getTime() // let endDate:any = '2024-07-7T00:00:00.000Z' let timeDuration = endDate - now if(timeDuration > 0 ) { - data['batch'] = this.enrollmentMapData[data.identifier].batch - data['completionPercentage'] = this.enrollmentMapData[data.identifier].completionPercentage + data['batch'] = enrollmentData[data.identifier].batch + data['completionPercentage'] = enrollmentData[data.identifier].completionPercentage filteredArray.push(data) } } @@ -634,7 +640,14 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent calculateParentStatus, viewMoreUrl, ); - clearInterval(this.enrollInterval) + } else { + this.processStrip( + strip, + [], + 'done', + calculateParentStatus, + viewMoreUrl, + ); } } @@ -1174,7 +1187,8 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent let courses: NsContent.IContent[]; let tabResults: any[] = []; - const response = await this.userSvc.fetchCbpPlanList().toPromise(); + let userId = this.configSvc.userProfile.userId + const response = await this.userSvc.fetchCbpPlanList(userId).toPromise(); if (response) { courses = response; if (strip.tabs && strip.tabs.length) { @@ -1197,35 +1211,7 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent ); } } - // this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => { - // if (res) { - // console.log(res,'===============================>') - // courses = res - // if (strip.tabs && strip.tabs.length) { - // tabResults = this.splitCbpTabsData(courses, strip) - // await this.processStrip( - // strip, - // this.transformContentsToWidgets(courses, strip), - // 'done', - // calculateParentStatus, - // '', - // tabResults - // ) - // } else { - // this.processStrip( - // strip, - // this.transformContentsToWidgets(courses, strip), - // 'done', - // calculateParentStatus, - // 'viewMoreUrl', - // ) - // } - // } - // }, (_err: any) => { - // }) - - clearInterval(this.enrollInterval); } } splitCbpTabsData(contentNew: NsContent.IContent[], strip: NsContentStripWithTabs.IContentStripUnit) { @@ -1814,30 +1800,7 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent } try { const response = await this.getRequestMethod(strip, currentTab.request.playlistRead, currentTab.request.apiUrl, calculateParentStatus); - // if (response && response.results.result.content) { - // let content = response.results.result.content - // if(strip.key === 'providers'){ - // let featuredProviders : any = JSON.parse(content.featuredProviders|| '[]') - // this.processStrip( - // strip, - // this.transformAllContentsToWidgets(featuredProviders, strip), - // 'done', - // calculateParentStatus, - // response, - // ); - // } else { - // this.processStrip( - // strip, - // this.transformAllContentsToWidgets(content, strip), - // 'done', - // calculateParentStatus, - // response, - // ); - // } - // } else { - // this.processStrip(strip, [], 'error', calculateParentStatus, null); - // this.emptyResponse.emit(true) - // } + if (response.results && response.results.result) { let content = response.results.result.content let widgets = [] @@ -1845,6 +1808,9 @@ export class ContentStripWithTabsLibComponent extends WidgetBaseComponent let featuredProviders : any = JSON.parse(content.featuredProviders|| '[]') widgets = this.transformAllTabContentsToWidgets(featuredProviders, currentTab) } else { + if(currentTab && currentTab.contentShuffel){ + content = content.sort( () => Math.random() - 0.5); + } widgets = this.transformAllTabContentsToWidgets(content, currentTab) } let tabResults: any[] = []; diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.model.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.model.ts index dae0ed345..5111367a3 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.model.ts +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.model.ts @@ -151,5 +151,7 @@ export namespace NsContentStripWithTabs { tabLoading?: boolean; stripConfig?: IStripConfig; customeClass?: string; + disableTranslate?: boolean; + contentShuffel?: boolean } } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.css b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.css index fe32d6e7d..a67278d77 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.css +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.css @@ -4,6 +4,52 @@ src: url('https://cdn.jsdelivr.net/fontsource/fonts/poppins@latest/latin-400-normal.woff2') format('woff2'), url('https://cdn.jsdelivr.net/fontsource/fonts/poppins@latest/latin-400-normal.woff') format('woff'); } + .stats-header { + display: flex; + align-items: center; + justify-content: center; + } + .stats-title { + background-color: #F3962F; + padding: 12px 16px; + color: white; + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 16.8px; + border-radius: 35px; + margin-top: -20px; + z-index: 90; + } + .my-arrow { + font-size: 12px; + } + .less-opacity1 { + opacity: 0.75; + } + .less-opacity2 { + opacity: 0.5; + } + .nlw-status { + background: linear-gradient(173.01deg, #266EEB -5.09%, #133F8B 133.16%); + margin-top: -22px; + } + .nlw-status-mob { + background: linear-gradient(173.01deg, #266EEB -5.09%, #133F8B 133.16%); + margin-top: -22px; + padding-top: 32px; + } + + .nlw-div { + padding: 0 16px; + margin: 10px 0 16px 0; + } + .divider { + border-left: 1.6px solid #a6a4a4; + } + .mob-image-container-v2 { height: 28px; width: 28px; diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.html index cdfe2df58..da823d963 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.html +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.html @@ -17,7 +17,7 @@
-
+
@@ -137,6 +137,58 @@
+
+
+
+ + + + {{title}} + + + +
+
+
+
+
+
+
+
+ +
+
+
0
+
+ {{converToIndianSystem(obj?.value)}} +
+
{{obj?.label}}
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
0
+
+ {{converToIndianSystem(obj?.value)}} +
+
{{obj?.label}}
+
+
+
+
+
+
+ diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.ts index 90a4a8889..3db92465a 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.ts +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/data-points/data-points.component.ts @@ -12,8 +12,10 @@ export class DataPointsComponent implements OnInit { @Input() fetchDataFromApi: boolean = false @Input() providerId : any = '' @Input() pageLayout: any = '' + @Input() title: any customArray: any[][] = [] isDataLoading: boolean = false + apiResults: any constructor(public insightSvc: InsiteDataService) { } @@ -23,7 +25,11 @@ export class DataPointsComponent implements OnInit { } if(this.fetchDataFromApi) { this.isDataLoading = true - this.getInsiteData() + if (this.pageLayout === 'nlw') { + this.getStats() + } else { + this.getInsiteData() + } } } @@ -71,6 +77,18 @@ export class DataPointsComponent implements OnInit { } + getStats() { + this.insightSvc.fetchNwlStats().subscribe((res: any) => { + if(res && res.result && res.result.data) { + this.objectData = res.result.data + } + this.isDataLoading = false + }, error => { + console.log(error) + this.isDataLoading = false + }) + } + converToIndianSystem(value: any) { if (value) { let numStr = value.toString() diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.html new file mode 100644 index 000000000..54b0c8836 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.html @@ -0,0 +1,48 @@ +
+
+
+ +
+
+
+
{{eventDetails?.resourceType}}
+
+
+ {{eventDetails?.owner}} +
+
+ {{eventDetails?.name | slice:0:descriptionMaxLength}} + ... +
+
{{getEventDate(eventDetails)}}
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
\ No newline at end of file diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.scss b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.scss new file mode 100644 index 000000000..659f33a71 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.scss @@ -0,0 +1,59 @@ +.events-card { + padding: 16px; + border-radius: 12px; + border: 1px solid #c3c3c3; + .poster { + width: 180px; + height: 107px; + border-radius: 12px; + } + .event-label { + border: 1px solid #ef951e; + background: rgba(239, 149, 30, 0.05); + border-radius: 45px; + /* stylelint-disable */ + font: 400 12px / 16px Lato; + font-family: Lato; + /* stylelint-enable */ + padding: 8px 12px; + font-size: 14px; + font-weight: 400; + line-height: 16.8px; + } + .orgName { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 12px; + font-weight: 400; + line-height: 14.4px; + text-align: left; + opacity: 0.6; + } + .event-title { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 16.8px; + text-align: left; + } + .event-date { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 12px; + font-weight: 400; + line-height: 14.4px; + text-align: left; + color: #1B4CA1; + } + + @media screen and (min-width: 320px) and (max-width: 769px) { + .poster { + width: 80px; + height: 69px; + } + } +} \ No newline at end of file diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.spec.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.spec.ts new file mode 100644 index 000000000..e4a491c8c --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EventCardComponent } from './event-card.component'; + +describe('EventCardComponent', () => { + let component: EventCardComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EventCardComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EventCardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.ts new file mode 100644 index 000000000..cf09d2cbc --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/event-card/event-card.component.ts @@ -0,0 +1,37 @@ +import { Component, Inject, Input } from '@angular/core' +import { Router } from '@angular/router' +import * as moment_ from 'moment' +const moment = moment_ + +@Component({ + selector: 'sb-uic-event-card', + templateUrl: './event-card.component.html', + styleUrls: ['./event-card.component.scss'] +}) +export class EventCardComponent { + + @Input() objectData: any + @Input() eventDetails: any + environment!: any + @Input() loader: any + descriptionMaxLength: number = 50 + constructor(@Inject('environment') environment: any, private router: Router) { + this.environment = environment + } + + getEventDate(event: any) { + let timeString = event.startTime.split(":") + let dataString = `${moment(event.startDate).format('MMM DD, YYYY')} ${timeString[0]}:${timeString[1]}` + return dataString + } + + getPublicUrl(url: string): string { + const mainUrl = url.split('/content').pop() || '' + return `${this.environment.contentHost}/${this.environment.contentBucket}/content${mainUrl}` + } + + redirectTo(event: any) { + this.router.navigate(["/app/event-hub/home/", event.identifier]); + } + +} diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.html new file mode 100644 index 000000000..72029f3e2 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.html @@ -0,0 +1,36 @@ +
+
+ {{object?.title}} +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+
+ No events exist. +
+
+
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.scss b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.scss new file mode 100644 index 000000000..9ab2952fc --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.scss @@ -0,0 +1,49 @@ +.e-header { + justify-content: space-between; +} +.event-title { + /* stylelint-disable */ + font-family: Montserrat; + /* stylelint-enable */ + font-size: 20px; + font-weight: 600; + line-height: 24.38px; + text-align: left; +} + +.events-select { + position: relative; + display: inline-block; + width: 150px; + } + + .events-select select { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 25px; + padding: 10px 30px 10px 10px; + font-size: 16px; + font-family: Arial, sans-serif; + width: 100%; + height: 100%; + cursor: pointer; + } + .events-select:after { + content: '\25BC'; + position: absolute; + top: 50%; + right: 10px; + transform: translateY(-50%); + pointer-events: none; + font-size: 14px; + color: #555; + } + + .no-events { + border: 1px solid #c3c3c3; + border-radius: 12px; + } + diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.spec.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.spec.ts new file mode 100644 index 000000000..a69136cea --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EventsComponent } from './events.component'; + +describe('EventsComponent', () => { + let component: EventsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EventsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EventsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.ts new file mode 100644 index 000000000..9e762c8ca --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.component.ts @@ -0,0 +1,116 @@ +import { Component, Input, OnInit } from '@angular/core' +import { InsiteDataService } from '../../_services/insite-data.service' +import * as moment_ from 'moment'; +const moment = moment_; + +@Component({ + selector: 'sb-uic-events', + templateUrl: './events.component.html', + styleUrls: ['./events.component.scss'] +}) +export class EventsComponent implements OnInit { + + @Input() object: any + @Input() nwlEventsConfig: any + daysBetween: any = [] + events: any = [] + requestBody: any + currentDay: any + loader: boolean = false + constructor(public insightSvc: InsiteDataService) { } + + ngOnInit() { + this.requestBody = { + locale: [ + 'en', + ], + query: '', + request: { + query: '', + filters: { + status: ['Live'], + contentType: 'Event', + category: 'Event', + startDate : { + ">=": '', + "<": '' + } + }, + sort_by: { + startDate: 'desc', + }, + }, + } + this.getEventsList() + } + getDaysBetweenDates() { + let currentDate = moment(this.nwlEventsConfig.startDate, 'DD-MM-YYYY') + const endDate = moment(this.nwlEventsConfig.endDate, 'DD-MM-YYYY') + while (currentDate.isSameOrBefore(endDate)) { + let localObj = {} + localObj['startDate'] = currentDate.format('YYYY-MM-DD') + localObj['diplayFormat'] = currentDate.format('MMM DD, YYYY') + if(currentDate.isSame(moment(), 'day')){ + this.currentDay = currentDate.format('YYYY-MM-DD') + } + currentDate.add(1, 'days').format('YYYY-MM-DD') + this.daysBetween.push(localObj) + } + console.log("currentDay ", this.currentDay) + } + + getEvents(slectedDate: any) { + this.currentDay = slectedDate.target.value + let nextDay = moment(slectedDate.target.value, 'YYYY-MM-DD') + nextDay.add(1, 'days') + this.requestBody.request.filters.startDate[">="] = this.currentDay + this.requestBody.request.filters.startDate["<"] = nextDay.format('YYYY-MM-DD') + this.loader = true + this.insightSvc.fetchTrainingDetails(this.requestBody).subscribe((res: any)=> { + this.events = [] + if (res && res.result && res.result.count > 0) { + + this.events = this.sortItemByTime(res.result.Event) + this.loader = false + } else { + this.loader = false + } + }, error => { + this.loader = false + }) + } + + getEventsList() { + this.getDaysBetweenDates() + let nextDay = moment(this.currentDay, 'YYYY-MM-DD') + nextDay.add(1, 'days') + this.requestBody.request.filters.startDate[">="] = this.currentDay + this.requestBody.request.filters.startDate["<"] = nextDay.format('YYYY-MM-DD') + this.loader = true + this.insightSvc.fetchTrainingDetails(this.requestBody).subscribe((res: any)=> { + this.events = [] + if (res && res.result && res.result.count > 0) { + this.events = this.sortItemByTime(res.result.Event) + this.loader = false + } else { + this.loader = false + } + }, error => { + this.loader = false + }) + } + + sortItemByTime(eventsdata: any) { + return eventsdata.sort((a:any, b:any)=> { + return (a.startTime === b.startTime)? 0 : b.startTime? -1 : 1; + }); + } + + customDateFormat(date: any, time: any) { + const stime = time.split('+')[0] + const hour = stime.substr(0, 2) + const min = stime.substr(2, 3) + return `${date} ${hour}${min}` + } + +} diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.module.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.module.ts new file mode 100644 index 000000000..2a10ee0cf --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/events/events.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { EventsComponent } from './events.component'; +import { EventCardComponent } from './event-card/event-card.component'; +import { RouterModule } from '@angular/router'; +import { SkeletonLoaderLibModule } from '../skeleton-loader-lib/skeleton-loader-lib.module'; +import { MatIconModule } from '@angular/material'; + + + +@NgModule({ + declarations: [EventsComponent, EventCardComponent], + imports: [ + CommonModule, + RouterModule, + SkeletonLoaderLibModule, + MatIconModule + ], + exports: [EventsComponent, EventCardComponent] +}) +export class EventsModule { } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.html new file mode 100644 index 000000000..4b89b8b9c --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.html @@ -0,0 +1,43 @@ +
+ +
+
+ {{objectData?.title}} +
+ +
+
+
+ expand_more +
+
+
+ +
+
+
+
+ +
+
+ {{item?.title}} +
+
+ {{item?.description}} +
+
+
+
+
+
+
+
+ diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.scss b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.scss new file mode 100644 index 000000000..e0a5d674c --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.scss @@ -0,0 +1,79 @@ +.highlights-of-the-week-container { + ::ng-deep.banner-title { + display: none; + } + ::ng-deep.banner-meta { + bottom: -37px; + } + ::ng-deep.prev { + margin-left: 11px; + } + ::ng-deep.next { + margin-right: 16px; + } + @media screen and (min-width: 320px) and (max-width: 769px) { + ::ng-deep.prev { + display: none !important; + } + ::ng-deep.next { + display: none !important; + } + } +} +.title { + /* stylelint-disable */ + font-family: Montserrat; + /* stylelint-enable */ + font-size: 20px; + font-weight: 600; + line-height: 24.38px; + text-align: left; + background-color: #D1DBEC; + padding: 16px; + border-top-left-radius: 12px; + border-top-right-radius: 12px; +} +.wh-wrapper { + background-color: #D1DBEC; + padding: 0 16px 16px 16px; + border-bottom-left-radius: 12px; + border-bottom-right-radius: 12px; + .player { + height: 420px; + } + .player-title { + /* stylelint-disable */ + font-family: Montserrat; + /* stylelint-disable */ + font-size: 16px; + font-weight: 600; + line-height: 19.5px; + text-align: left; + } + .player-body { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-disable */ + line-clamp: 2; + -webkit-line-clamp: 2; + font-size: 14px; + font-weight: 400; + line-height: 16.8px; + text-align: left; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + } + @media screen and (min-width: 320px) and (max-width: 769px) { + .player { + height: 215px; + } + } +} + +@media screen and (min-width: 320px) and (max-width: 769px) { + .no-radius { + border-radius: 0px; + } +} diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.spec.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.spec.ts new file mode 100644 index 000000000..30a61ac4d --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HighlightsOfWeekComponent } from './highlights-of-week.component'; + +describe('HighlightsOfWeekComponent', () => { + let component: HighlightsOfWeekComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HighlightsOfWeekComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HighlightsOfWeekComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.ts new file mode 100644 index 000000000..d142ed7d0 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.component.ts @@ -0,0 +1,43 @@ +import { Component, Input, OnInit, QueryList, ViewChildren } from '@angular/core'; +import { ScrollableItemDirective } from '../../_directives/scrollable-item/scrollable-item.directive'; + +@Component({ + selector: 'sb-uic-highlights-of-week', + templateUrl: './highlights-of-week.component.html', + styleUrls: ['./highlights-of-week.component.scss'] +}) +export class HighlightsOfWeekComponent implements OnInit { + + @Input() objectData: any + currentIndex = 0 + contentdata: any = [] + styleData: any = {} + expand: boolean = true + + @ViewChildren(ScrollableItemDirective) scrollableItems: QueryList + constructor() { } + + ngOnInit() { + this.styleData = this.objectData && this.objectData.sliderData && this.objectData.sliderData.styleData + if (this.objectData && this.objectData.list) { + this.objectData.list.forEach((contentEle: any) => { + let localData = {} + localData['title'] = contentEle.title + localData['videoUrl'] = contentEle.videoUrl + localData['cardSubType'] = "card-wide-lib" + localData['description'] = contentEle.description + this.contentdata.push(localData) + }) + } + } + + toggleWeekHightlits() { + this.expand = !this.expand + } + + getCurrentIndex(indexValue: any) { + this.currentIndex = indexValue + } + + +} diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.module.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.module.ts new file mode 100644 index 000000000..78f9f5ace --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/highlights-of-week/highlights-of-week.module.ts @@ -0,0 +1,23 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MatIconModule, MatTooltipModule } from '@angular/material'; +import { HighlightsOfWeekComponent } from './highlights-of-week.component'; +import { ScrollableItemModule } from '../../_directives/scrollable-item/scrollable-item.module'; +import { SlidersNgContentLibModule } from '../sliders-ng-content/sliders-ng-content.module'; + + + +@NgModule({ + declarations: [HighlightsOfWeekComponent], + imports: [ + CommonModule, + MatIconModule, + MatTooltipModule, + ScrollableItemModule, + SlidersNgContentLibModule + ], + exports: [ + HighlightsOfWeekComponent + ] +}) +export class HighlightsOfWeekModule { } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.html new file mode 100644 index 000000000..bcd52de01 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.html @@ -0,0 +1,49 @@ + +
+ +
+
+
+
+ {{content?.title | slice:0:titleMaxLength}} + ... +
+
+
+
+
+
+
+ + +
+
+ +
+
+
+
+ {{content?.title | slice:0:titleMaxLength }} + ... +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.scss b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.scss new file mode 100644 index 000000000..a5e7c720c --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.scss @@ -0,0 +1,33 @@ +.kh-description { + /* stylelint-disable */ + font-family: Montserrat; + /* stylelint-enable */ + font-size: 16px; + font-weight: 600; + line-height: 19.5px; + text-align: center; + padding: 0 10px; +} + +.key-wrapper { + background-color: #EAF1F8; + padding: 25px 16px; + border-radius: 50px; +} +.mkey-wrapper { + background-color: #EAF1F8; + padding: 16px; + border-radius: 50px; +} + +.mkh-description{ + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 16.8px; + text-align: center; + padding: 0 30px; + +} \ No newline at end of file diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.spec.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.spec.ts new file mode 100644 index 000000000..81904c54f --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { KeyHighlightsComponent } from './key-highlights.component'; + +describe('KeyHighlightsComponent', () => { + let component: KeyHighlightsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ KeyHighlightsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(KeyHighlightsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.ts new file mode 100644 index 000000000..481bbd21f --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.component.ts @@ -0,0 +1,30 @@ +import { Component, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren } from '@angular/core'; +import { ScrollableItemDirective } from '../../_directives/scrollable-item/scrollable-item.directive'; + +@Component({ + selector: 'sb-uic-key-highlights', + templateUrl: './key-highlights.component.html', + styleUrls: ['./key-highlights.component.scss'] +}) +export class KeyHighlightsComponent implements OnInit { + currentIndex: any = 0 + @Input() providerId : any = '' + @Input() formData : any = '' + @Input() mode: any + @Output() emptyResponse = new EventEmitter() + titleMaxLength = 100 + + styleData: any = {} + contentdata: any = [] + @ViewChildren(ScrollableItemDirective) scrollableItems: QueryList + constructor() { } + + ngOnInit() { + this.styleData = this.formData && this.formData.sliderData && this.formData.sliderData.styleData + this.contentdata = this.formData && this.formData.content ? this.formData.content : [] + } + + getCurrentIndex(indexValue: any) { + this.currentIndex = indexValue + } +} diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.module.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.module.ts new file mode 100644 index 000000000..95ad018e9 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/key-highlights/key-highlights.module.ts @@ -0,0 +1,23 @@ +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { KeyHighlightsComponent } from './key-highlights.component'; +import { MatIconModule } from '@angular/material'; +import { SlidersNgContentLibModule } from '../sliders-ng-content/sliders-ng-content.module'; +import { ScrollableItemModule } from '../../_directives/scrollable-item/scrollable-item.module'; + + + +@NgModule({ + declarations: [KeyHighlightsComponent], + imports: [ + CommonModule, + MatIconModule, + SlidersNgContentLibModule, + ScrollableItemModule + ], + exports: [ + KeyHighlightsComponent + ], + schemas:[CUSTOM_ELEMENTS_SCHEMA] +}) +export class KeyHighlightsModule { } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.html new file mode 100644 index 000000000..a8893584b --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.html @@ -0,0 +1,60 @@ +
+
+
+ {{object?.title}}
+
+
+ expand_more +
+
+
+
+
+ +
+
+
+
+
+
+ Greater than 50K + 10K-50K + 1K-10K + 500-1K + Less than 500 +
+
+
+ search + + +
+
+
+
+
+
{{user.row_num}}
+
+
+
+
{{user.org_name}}
+
+ +
{{user.total_points || 0 }} points
+
+
+
+ +
+
+
+
+
+
+ No data found! +
+
+
+
diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.scss b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.scss new file mode 100644 index 000000000..9239c870a --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.scss @@ -0,0 +1,198 @@ +.l-title { + /* stylelint-disable */ + font-family: Montserrat; + /* stylelint-enable */ + font-size: 20px; + font-weight: 600; + line-height: 24.38px; + text-align: left; + +} + +.l-content { + background-color: #E9EEF6; + border-radius: 16px; + padding: 16px; +} + +.horizontal-scroll-container { + overflow-x: auto; + white-space: nowrap; + -ms-overflow-style: none; + scrollbar-width: none; + height: 32px; +} + .horizontal-scroll-container::-webkit-scrollbar { + display: none; + } + + .scroll-content { + display: inline-block; + } + .tab-title { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + line-height: 16.8px; + text-align: left; + cursor: pointer; + padding: 0 15px; + border-bottom: 2px solid #c3c3c3; + padding-bottom: 8px; +} +.active { + font-weight: 700; + border-bottom: 2px solid #1b4ca1; +} + +.search-field { + height: 34px; + padding: 0px 16px 0px 40px; + border-radius: 52px; + background: #fff; + border: 2px solid #00000014; + width: 100%; +} + +.icon-search { + top: 10px; + left: 15px; + height: 15px; + width: 17px; +} + +.item { + border-radius: 12px; + background-color: white; + padding: 16px; + align-items: flex-start; +} +.rank1 { + background: #ffca28; + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 9px; + text-align: center; + border-radius: 50%; + padding: 10px; +} +.rank2 { + background: #1B4CA1; + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 9px; + text-align: center; + border-radius: 50%; + padding: 10px; + color: white; +} + +.rank3{ + background: #FF8228; + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 9px; + text-align: center; + border-radius: 50%; + padding: 10px; +} + +.rank0 { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 9px; + text-align: center; + border-radius: 50%; + padding: 10px; + border: 1px solid #c3c3c3; +} + +.rank-name { + /* stylelint-disable */ + font-family: Montserrat; + line-height: 1.5em; + /* stylelint-enable */ + font-size: 16px; + font-weight: 600; + text-align: left; + align-items: center; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 2; + line-clamp: 2; +} + +.rank-points { + align-items: center; +} + +.nlw-kb { + height: 24px; + width: 24px; +} + +.points { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 600; + line-height: 16.8px; + text-align: right; +} + +.crown { + left: 10px; + top: 0px; + width: 36px; + height: 36px; +} + +.l-tab-data { + height: 520px; + overflow: auto; + padding-bottom: 16px; +} + +.l-tab-data::-webkit-scrollbar { + display: none; +} + +.pointer { + margin-bottom: -59px; + border-radius: 41px; + background: #c3c3c3; + border: 35px solid #e9eef6; +} + +.dot-dot { + width: 7px; + display: flex; + height: 7px; + background: #c3c3c3; + margin-top: -25px; + border-radius: 10px; +} + + +@media screen and (min-width: 320px) and (max-width: 769px) { + .mdo-leaderboard-container { + background-color: #d1dbec; + } +} + diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.spec.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.spec.ts new file mode 100644 index 000000000..3211c62d7 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MdoLeaderboardComponent } from './mdo-leaderboard.component'; + +describe('MdoLeaderboardComponent', () => { + let component: MdoLeaderboardComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MdoLeaderboardComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MdoLeaderboardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.ts new file mode 100644 index 000000000..91a956d7a --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.component.ts @@ -0,0 +1,97 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { InsiteDataService } from '../../_services/insite-data.service'; + +@Component({ + selector: 'sb-uic-mdo-leaderboard', + templateUrl: './mdo-leaderboard.component.html', + styleUrls: ['./mdo-leaderboard.component.scss'] +}) +export class MdoLeaderboardComponent implements OnInit { + + currentTab: any = 'XL' + result: any = [] + filteredData: any + searchTerm: string = '' + expand: boolean = true + + @Input() object: any + @Output() tabClicked = new EventEmitter() + constructor(private insiteDataService: InsiteDataService) { } + + ngOnInit() { + this.getData() + } + + getData() { + this.insiteDataService.fetchLeaderboard().subscribe((res: any) => { + if (res && res.result) { + this.result = res.result + this.filteredData = this.result.mdoLeaderBoard + .filter(user => user.size === this.currentTab) + .map(user => ({ ...user, children: [], selected: false })).slice(0, 5) + } + + }, error => { + console.log(error) + }) + } + + getTabData(name: any) { + this.currentTab = name + this.searchTerm = '' + this.filteredData = this.result.mdoLeaderBoard + .filter(user => user.size === this.currentTab) + .map(user => ({ ...user, children: [], selected: false })).slice(0, 5) + let nameStr: any = '' + switch (name) { + case 'XL': + nameStr = 'greater-than-50K' + break + case 'L': + nameStr = '10K-50K' + break + case 'M': + nameStr = '1K-10K' + break + case 'S': + nameStr = '500-1K' + break + default: + nameStr = 'less-than-500' + break + } + this.tabClicked.emit(nameStr) + } + + getRank(rank: number) { + return [1,2,3].includes(rank) ? `rank${rank}` : 'rank0' + } + + getMedal(rank: number) { + if (rank === 1) { + return 'assets/images/national-learning/Medal1.svg' + } else if(rank === 2) { + return 'assets/images/national-learning/Medal2.svg' + } else { + return 'assets/images/national-learning/Medal3.svg' + } + } + + handleSearchQuery(e: any) { + if (e.target.value && e.target.value.length > 0) { + this.searchTerm = e.target.value + this.filteredData = this.result.mdoLeaderBoard + .filter(user => user.size === this.currentTab && user.org_name.toLowerCase().includes(e.target.value)) + .map(user => ({ ...user, children: []})).slice(0, 5) + } else { + this.filteredData = this.result.mdoLeaderBoard + .filter(user => user.size === this.currentTab) + .map(user => ({ ...user, children: []})).slice(0, 5) + } + } + + toggleWeekHightlits() { + this.expand = !this.expand + } + +} diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.module.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.module.ts new file mode 100644 index 000000000..4f99c3f3b --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/mdo-leaderboard/mdo-leaderboard.module.ts @@ -0,0 +1,25 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MdoLeaderboardComponent } from './mdo-leaderboard.component'; +import { MatIconModule, MatTooltipModule } from '@angular/material'; +import { SkeletonLoaderLibModule } from '../skeleton-loader-lib/skeleton-loader-lib.module'; +import { InsiteDataService } from '../../_services/insite-data.service'; +import { FormsModule } from '@angular/forms'; + + + +@NgModule({ + declarations: [MdoLeaderboardComponent], + imports: [ + CommonModule, + MatIconModule, + SkeletonLoaderLibModule, + FormsModule, + MatTooltipModule + ], + exports: [ + MdoLeaderboardComponent + ], + providers: [InsiteDataService] +}) +export class MdoLeaderboardModule { } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.html index 28aa177e7..0ce66c23c 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.html +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.html @@ -235,14 +235,22 @@

{{'learnsearch.noResults' | tra - - - - + + + +

@@ -275,18 +283,17 @@

{{'learnsearch.noResults' | tra

- - - + +
diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.ts index 38607f785..e10b21726 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.ts +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/mdo-channels/mdo-channel-v2/mdo-channel-v2.component.ts @@ -81,9 +81,9 @@ export class MdoChannelV2Component implements OnInit { public tabClicked(tabEvent: MatTabChangeEvent) { this.raiseTelemetry(`${tabEvent.tab.textLabel} tab`) } - hideContentStrip(event: any, contentStripData: any) { + hideContentStrip(event: any, colData: any) { if (event) { - contentStripData['hideSection'] = true + colData.contentStripData['hideSection'] = true this.contentTabEmptyResponseCount = this.contentTabEmptyResponseCount + 1 // if(this.contentTabEmptyResponseCount === 4 ) { // this.selectedIndex = 1 @@ -153,18 +153,13 @@ export class MdoChannelV2Component implements OnInit { } } - showAllContent(_stripData: any, contentStrip: any) { - if (contentStrip && contentStrip.strips && contentStrip.strips.length) { - const stripData: any = contentStrip.strips[0] - if (stripData && stripData.request) { - delete(stripData['loaderWidgets']) + showAllContent(_stripData: any, columnData: any) { + if (columnData && columnData.contentStrip && columnData.contentStrip.strips && columnData.contentStrip.strips.length) { + const stripData: any = _stripData + let tabSelected = stripData.viewMoreUrl && stripData.viewMoreUrl.queryParams && stripData.viewMoreUrl.queryParams.tabSelected && stripData.viewMoreUrl.queryParams.tabSelected || '' this.router.navigate( [`/app/learn/mdo-channels/${this.channnelName}/${this.orgId}/all-content`], - { queryParams: { stripData: JSON.stringify(stripData) } }) - } - } else { - this.router.navigate( - [`/app/learn/browse-by/provider/${this.channnelName}/${this.orgId}/all-CBP`]) + { queryParams: { tabSelected, key: columnData.sectionKey } }) } } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning.module.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning.module.ts new file mode 100644 index 000000000..e5c4737f2 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning.module.ts @@ -0,0 +1,47 @@ +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MatChipsModule, MatIconModule, MatTabsModule } from '@angular/material'; +import { SkeletonLoaderLibModule } from '../../skeleton-loader-lib/skeleton-loader-lib.module'; +import { NationalLearningComponent } from './national-learning/national-learning.component'; +import { CommonMethodsService } from '../../../_services/common-methods.service'; +import { SlidersLibModule } from '../../sliders/sliders.module'; +import { KeyHighlightsModule } from '../../key-highlights/key-highlights.module'; +import { ContentStripWithTabsLibModule } from '../../content-strip-with-tabs-lib/content-strip-with-tabs-lib.module'; +import { EventsModule } from '../../events/events.module'; +import { MdoLeaderboardModule } from '../../mdo-leaderboard/mdo-leaderboard.module'; +import { DataPointsModule } from '../../data-points/data-points.module'; +import { HighlightsOfWeekModule } from '../../highlights-of-week/highlights-of-week.module'; +import { SpeakersModule } from '../../speakers/speakers.module'; +import { UserProgressModule } from '../../user-progress/user-progress.module'; +import { ContentStripFacetFilterModule } from '../../strips/content-strip-facet-filter/content-strip-facet-filter.module'; + + + +@NgModule({ + declarations: [NationalLearningComponent], + imports: [ + CommonModule, + MatIconModule, + MatChipsModule, + SkeletonLoaderLibModule, + SlidersLibModule, + MatTabsModule, + KeyHighlightsModule, + ContentStripWithTabsLibModule, + DataPointsModule, + EventsModule, + MdoLeaderboardModule, + HighlightsOfWeekModule, + SpeakersModule, + UserProgressModule, + ContentStripFacetFilterModule + ], + exports: [ + NationalLearningComponent, + ], + providers:[ + CommonMethodsService + ], + schemas:[CUSTOM_ELEMENTS_SCHEMA] +}) +export class NationalLearningModule { } diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.html new file mode 100644 index 000000000..84d2bb67b --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.html @@ -0,0 +1,205 @@ +
+
+ + + +
+ +
+ + + + +
+
+
+
+
+
+
+
+ + + +
+
+ +
+
+
+ + +
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+ Application Logo +
+
+
+
{{data?.title}}
+
{{data?.description | slice:0:descriptionMaxLength}} + ... +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ + + + +
+
+
+
+
+ + +
+ + + + +
+
+
+ + +
+
+ + +
+
+ +
+ +
+
+
+ + +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ + diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.scss b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.scss new file mode 100644 index 000000000..43c80cc30 --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.scss @@ -0,0 +1,169 @@ +@import '~@sunbird-cb/design-system/src/styles/ws-common'; +@import '~@sunbird-cb/design-system/src/styles/ws-vars'; +@import '~@sunbird-cb/design-system/src/styles/ws-mixins'; + +.white-bg { + background: white !important; +} + +.nlw-mandatoryCourse { + ::ng-deep.capitalize { + font-size: 20px; + line-height: 24.38px; + } +} + +.nlm-micro-sites { + ::ng-deep.container { + max-width: 1200px!important; + } + ::ng-deep.banner-container { + padding-bottom: 0!important; + } +} +.topSection { + ::ng-deep.prev { + margin-left: 15px!important; + } + ::ng-deep.next { + margin-right: 15px!important; + } + .stats-header { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + left: 43.5%; + top: -20px; + text-transform: capitalize; + } + .stats-title { + display: flex; + align-items: center; + justify-content: center; + background-color: #F3962F; + padding: 12px 16px; + color: white; + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 700; + line-height: 16.8px; + border-radius: 35px; + + } + .my-arrow { + font-size: 12px; + } + .less-opacity1 { + opacity: 0.75; + } + .less-opacity2 { + opacity: 0.5; + } + .details-wrapper { + padding: 16px; + display: flex; + gap: 50px; + } + + .logo-box-container { + width: 180px; + position: relative; + @include breakpoint-xs { + width: 112px; + height: 72px; + } + } + .logo-box-rounded { + height: 180px; + width: 180px; + background: #fff; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.06); + @include breakpoint-xs { + width: 112px; + height:112px; + } + .logo-img{ + max-width: 122px; + @include breakpoint-xs { + max-width: 84px; + } + } + } + .mlogo-box-rounded { + height: 180px; + width: 180px; + background: #fff; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 1px 1px 8px 3px rgba(0, 0, 0, 0.06); + @include breakpoint-xs { + width: 112px; + height:112px; + } + .logo-img{ + max-width: 122px; + @include breakpoint-xs { + max-width: 84px; + } + } + } + + .txt-ellipsis-2 { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .description-title { + /* stylelint-disable */ + font-family: Montserrat; + /* stylelint-enable */ + font-size: 16px; + font-weight: 600; + line-height: 19.5px; + text-align: left; + padding-bottom: 16px; + } + .description { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 16px; + font-weight: 400; + line-height: 24px; + text-align: left; + } + .mdescription { + /* stylelint-disable */ + font-family: Lato; + /* stylelint-enable */ + font-size: 14px; + font-weight: 400; + line-height: 16.8px; + text-align: left; + } + + + @media screen and (min-width: 320px) and (max-width: 769px) { + ::ng-deep.prev { + margin-left: 15px!important; + } + ::ng-deep.next { + margin-right: 15px!important; + } + ::ng-deep.banner-container { + min-height: 212px !important; + } + } +} + diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.spec.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.spec.ts new file mode 100644 index 000000000..0af334cdd --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NationalLearningComponent } from './national-learning.component'; + +describe('NationalLearningComponent', () => { + let component: NationalLearningComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NationalLearningComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NationalLearningComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.ts b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.ts new file mode 100644 index 000000000..517ad11cb --- /dev/null +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.ts @@ -0,0 +1,94 @@ +import { Component, Inject, Input, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { EventService, WsEvents } from '@sunbird-cb/utils-v2'; +import * as _ from 'lodash' + +@Component({ + selector: 'sb-uic-national-learning', + templateUrl: './national-learning.component.html', + styleUrls: ['./national-learning.component.scss'] +}) +export class NationalLearningComponent implements OnInit { + @Input() sectionList:any = [] + @Input() configDetails: any + @Input() nwlConfiguration: any + providerId: string = '123456789' + providerName: '' + descriptionMaxLength = 500 + environment: any + constructor(@Inject('environment') environment: any,public router: Router, private events: EventService) { + this.environment = environment + } + + ngOnInit(): void { + } + + + hideKeyHightlight(event: any, learnerReview: any) { + if (event) { + learnerReview['hideSection'] = true + } + } + + showAllContent(_stripData: any, columnData: any) { + if (columnData && columnData.contentStrip && columnData.contentStrip.strips && columnData.contentStrip.strips.length) { + const stripData: any = _stripData + let tabSelected = stripData.viewMoreUrl && stripData.viewMoreUrl.queryParams && stripData.viewMoreUrl.queryParams.tabSelected && stripData.viewMoreUrl.queryParams.tabSelected || '' + this.router.navigate( + [`app/learn/karmayogi-saptah/see-all`], + { queryParams: { pageDetails: true, tabSelected, key: columnData.sectionKey } }) + + } else { + this.router.navigate( + [`/app/learn/browse-by/provider/${this.providerName}/${this.providerId}/all-CBP`], + { queryParams: { pageDetails: true } }) + } + } + + hideContentStrip(event: any, contentStripData: any) { + if (event) { + contentStripData.contentStrip['hideSection'] = true + } + } + + raiseTabClick(event) { + this.events.raiseInteractTelemetry( + { + type: 'click', + subType: 'mdo-leaderboard', + id: `${event}-tab`, + }, + { + }, + { + module: 'National Learning Week', + } + ) + } + + + raiseTelemetryInteratEvent(event: any) { + let _subType = 'mandatory-courses' + let _id = 'mandatory-courses-card' + if (event.typeOfTelemetry === 'learningContent') { + _subType = 'explore-learning-content' + _id = 'explore-learning-content-card' + } + this.events.raiseInteractTelemetry( + { + type: 'click', + subType: _subType, + id: _id, + }, + { + id: event.identifier, + type: event.primaryCategory, + }, + { + pageIdExt: _id, + module: 'National Learning Week', + } + ) + } + +} diff --git a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/providers/providers-v2/providers-v2.component.html b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/providers/providers-v2/providers-v2.component.html index ef6ad0f6c..b3d253286 100644 --- a/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/providers/providers-v2/providers-v2.component.html +++ b/sb-cb-ui-consumption/library/sunbird-cb/consumption/src/lib/_common/microsites/providers/providers-v2/providers-v2.component.html @@ -17,10 +17,14 @@ [ngTemplateOutletContext]="{data: column?.data}"> - - + +
-
-