Skip to content

Commit

Permalink
Merge pull request #2318 from vishnubansaltarento/nps-changes-for-build
Browse files Browse the repository at this point in the history
Nps changes for build
  • Loading branch information
vishnubansaltarento authored Jul 15, 2024
2 parents f0774ba + 73610d4 commit 2dc1a8b
Show file tree
Hide file tree
Showing 66 changed files with 1,846 additions and 368 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="tips-container" *ngIf="randomlearnAdvisoryObj">
<div class="circle-box">
<div class="background-circle">

</div>
</div>
<div class="tips-header">
<h3>Tips for Learners</h3>
<div class="ml-4 pl-2 view-more ws-mat-default-text ng-star-inserted">
<a class="flex ws-mat-default-text items-center justify-center mat-body-1 cursor-pointer"
(click)="showAllTips()">
<span class="ws-mat-default-text">{{ 'msg.showAll' | translate }}</span>
<mat-icon class="ws-mat-default-text" color="accent" role="img"
aria-hidden="true">navigate_next</mat-icon>
</a>
</div>
</div>
<div class="tip-content">
<div class="background">
<img class="book-icon" src="{{randomlearnAdvisoryObj?.contentImg}}"
alt="{{randomlearnAdvisoryObj?.content}}">
</div>
<div class="tip-data">
<p>{{randomlearnAdvisoryObj?.content}}</p>
</div>
<div class="tip-count">
{{randomlearnAdvisoryObj?.id}}/{{learnAdvisoryData?.length}}
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.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: 8px;
color: #000000;
font-family: Lato;
font-size: 14px;
z-index: 10;
padding: 0px 4px;
line-height: 16px;
}

.tip-count {
display: flex;
justify-content: center;
align-items: center;
color: #000000;
font-family: Montserrat !important;
font-size: 16px !important;
padding: 10px 3px;
z-index: 10;
font-weight: 600;
line-height: 19.5px;
width: 45px;
}

.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: 32px;
height: 32px;
padding: 5px;
}

.background {
background-color: white;
width: 56px;
height: 42px;
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;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { TipsForLearnerCardComponent } from './tips-for-learner-card.component';

describe('TipsForLearnerCardComponent', () => {
let component: TipsForLearnerCardComponent;
let fixture: ComponentFixture<TipsForLearnerCardComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TipsForLearnerCardComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(TipsForLearnerCardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Component, Input, OnInit } from '@angular/core'
import { Router } from '@angular/router'

@Component({
selector: 'ws-widget-tips-for-learner-card',
templateUrl: './tips-for-learner-card.component.html',
styleUrls: ['./tips-for-learner-card.component.scss'],
})
export class TipsForLearnerCardComponent implements OnInit {
randomlearnAdvisoryObj: any
learnAdvisoryDataLength: any
@Input() learnAdvisoryData: any
constructor(private router: Router) { }

ngOnInit() {
this.displayRandomlearnAdvisoryData()
}

displayRandomlearnAdvisoryData(): void {
if (this.learnAdvisoryData && this.learnAdvisoryData.length) {
const randomIndex = Math.floor(Math.random() * this.learnAdvisoryData.length)
this.randomlearnAdvisoryObj = this.learnAdvisoryData[randomIndex]
}

}

showAllTips() {
this.router.navigate(['/learner-advisory'])
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { TipsForLearnerCardComponent } from './tips-for-learner-card/tips-for-learner-card.component'
import { MatIconModule } from '@angular/material'
import { TranslateModule } from '@ngx-translate/core'

@NgModule({
declarations: [TipsForLearnerCardComponent],
imports: [
CommonModule,
MatIconModule,
TranslateModule,
],
exports: [
TipsForLearnerCardComponent,
],
})
export class TipsForLearnerModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -462,21 +462,22 @@ export class WidgetContentService {
async getResourseLink(content: any) {
const enrolledCourseData: any = this.getEnrolledData(content.identifier)
if (enrolledCourseData) {
if (enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.BLENDED_PROGRAM ||
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.INVITE_ONLY_PROGRAM ||
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.MODERATED_PROGRAM ||
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.BLENDED_PROGRAM ||
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM) {
if (!this.isBatchInProgress(enrolledCourseData.batch)) {
return this.gotoTocPage(content)
}
if (enrolledCourseData && enrolledCourseData.content && enrolledCourseData.content.status &&
enrolledCourseData.content.status.toLowerCase() !== 'retired') {
if (enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.BLENDED_PROGRAM ||
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.INVITE_ONLY_PROGRAM ||
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.MODERATED_PROGRAM ||
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.BLENDED_PROGRAM ||
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM) {
if (!this.isBatchInProgress(enrolledCourseData.batch)) {
return this.gotoTocPage(content)
}
} else {
const data = await this.checkForDataToFormUrl(content, enrolledCourseData)
return data
} {
const data = await this.checkForDataToFormUrl(content, enrolledCourseData)
return data
}
}

return ''
}
return this.gotoTocPage(content)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@
<span class="m-t-b mat-body-2 font-bold-imp {{title?.textClass}}" *ngIf="title?.disableTranslate"> {{ title?.title }}</span>
</a>
</div>
<div class="flex" role="menuitem">
<mat-icon class="m-auto mr-2">keyboard_arrow_right</mat-icon>
<a class="flex m-auto ws-mat-default-text" [routerLink]="['/tips-for-learners']" role="menuitem">
<span class="m-t-b mat-body-2 font-bold-imp">{{ 'btnpageback.tipsForLearners' | translate }}</span>
</a>
</div>

</ng-container>
</div>
<div class="flex flex-col" *ngIf="visible" [@enterAnimation]="visible">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export class BtnProfileComponent extends WidgetBaseComponent
}
redirectToLearnersPage() {
this.raiseTelemetry('Tips For Learners')
this.router.navigate(['/public/learner-advisory'])
this.router.navigate(['/learner-advisory'])
}

// rasieProfileMenuTelemetry(tabname: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,8 @@ <h2 class="mat-subheading-2 flex-1 min-w-0 margin-remove-bottom" i18n>{{'cardcon
</ng-template>

<ng-template #cardPortrait>
<mat-card class="card-portrait cursor-pointer" [ngClass]="widgetData.cardCustomeClass ? widgetData.cardCustomeClass : ''" (click)="raiseTelemetry();getRedirectUrlData(widgetData?.content); $event.stopPropagation()" >
<div class="course_widget portrait_widget flex margin-bottom-xs">
<mat-card class="card-portrait cursor-pointer" [ngClass]="widgetData.cardCustomeClass ? widgetData.cardCustomeClass : ''" (click)="raiseTelemetry();getRedirectUrlData(widgetData?.content); $event.stopPropagation()" >
<div class="course_widget portrait_widget flex margin-bottom-xs" [ngClass]="{'retiredCards': widgetData?.content?.status === 'Retired' && widgetData?.content?.completionPercentage === 100}">
<div class="flex flex-end flex-middle course_port">
<mat-icon class="mat-icon main_icon ws-mat-default-text margin-right-xs">video_library</mat-icon>
<ws-widget-display-content-type i18n-title title="Content Type" *ngIf="widgetData.content?.primaryCategory"
Expand All @@ -1110,7 +1110,7 @@ <h2 class="mat-subheading-2 flex-1 min-w-0 margin-remove-bottom" i18n>{{'cardcon
</ws-widget-display-content-type>
</div>
</div>
<div class="flex">
<div class="flex" [ngClass]="{'retiredCards': widgetData?.content?.status === 'Retired' && widgetData?.content?.completionPercentage === 100}">
<div class="margin-right-s">
<ng-container *ngIf="widgetData.content.posterImage">
<div class=" img-block-portrait position-relative">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1753,4 +1753,8 @@ $title-line-count: 2;
}
.card-standard-container:hover {
transform: scale(1.02);
}
.retiredCards {
opacity: 0.5;
cursor: default;
}
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ export class CardContentV2Component extends WidgetBaseComponent
}
}
async getRedirectUrlData(content: any,contentType?:any){
const contentCategory = content && content.primaryCategory ? content.primaryCategory : 'Content'
if(contentType) {
this.router.navigate([`/app/gyaan-karmayogi/player/${VIEWER_ROUTE_FROM_MIME(content.mimeType)}/${content.identifier}`],{
queryParams : {
Expand All @@ -426,14 +427,19 @@ export class CardContentV2Component extends WidgetBaseComponent
}
})
} else {
let urlData = await this.contSvc.getResourseLink(content)
this.router.navigate(
[urlData.url],
{
queryParams: urlData.queryParams
})
// if (content && content.status && content.status.toLowerCase() !== 'retired') {
let urlData = await this.contSvc.getResourseLink(content)
if (urlData && urlData.url ) {
this.router.navigate(
[urlData.url],
{
queryParams: urlData.queryParams
})
} else {
// const contentType = urlData;
this.snackBar.open(`This ${contentCategory} has been archived and is no longer available.`, 'X', { duration: 2000 });
}
}


}

Expand Down
Loading

0 comments on commit 2dc1a8b

Please sign in to comment.