Skip to content

Commit

Permalink
Merge pull request #2265 from sunbird-cb/new-enhancement-ui-fix
Browse files Browse the repository at this point in the history
lint error fixed
  • Loading branch information
vishnubansaltarento authored Jul 3, 2024
2 parents 6da8291 + ecc20d3 commit d43a01f
Show file tree
Hide file tree
Showing 36 changed files with 782 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
<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
@@ -1,7 +1,7 @@
import { animate, style, transition, trigger } from '@angular/animations'
import { Component, HostBinding, Input, OnInit } from '@angular/core'
import { Router } from '@angular/router'

// import { environment } from './../../../environments/environment'
import { NsWidgetResolver, WidgetBaseComponent } from '@sunbird-cb/resolver'
import { ConfigurationsService, MultilingualTranslationsService, NsInstanceConfig } from '@sunbird-cb/utils-v2'

Expand All @@ -12,8 +12,8 @@ import { environment } from 'src/environments/environment'
import _ from 'lodash'
import { TranslateService } from '@ngx-translate/core'
// tslint:enable
type TUrl = undefined | 'none' | 'back' | string

type TUrl = undefined | 'none' | 'back' | string
@Component({
selector: 'ws-widget-btn-page-back',
templateUrl: './btn-page-back.component.html',
Expand All @@ -33,12 +33,9 @@ type TUrl = undefined | 'none' | 'back' | string
),
],
})

export class BtnPageBackComponent extends WidgetBaseComponent
implements OnInit, NsWidgetResolver.IWidgetData<{ url: TUrl }> {

@Input() widgetData: { url: TUrl, titles?: NsWidgetResolver.ITitle[],
disableTranslate?: boolean, textClass: any } = { url: 'none', titles: [], disableTranslate: false, textClass: '' }
@Input() widgetData: { url: TUrl, titles?: NsWidgetResolver.ITitle[] } = { url: 'none', titles: [] }
presentUrl = ''
@HostBinding('id')
public id = 'nav-back'
Expand Down Expand Up @@ -76,19 +73,17 @@ export class BtnPageBackComponent extends WidgetBaseComponent
this.loggedinUser = false
}
}

get isUserLoggegIn(): boolean {
return this.loggedinUser
}

get backUrl(): { fragment?: string; routeUrl: string; queryParams: any } {

if (this.presentUrl === '/page/explore') {
return {
queryParams: undefined,
routeUrl: '/page/home',
}
}

if (this.widgetData.url === 'home') {
return {
queryParams: undefined,
Expand All @@ -102,18 +97,17 @@ export class BtnPageBackComponent extends WidgetBaseComponent
queryParams: this.btnBackSvc.getLastUrl(2).queryParams,
routeUrl: this.btnBackSvc.getLastUrl(2).route,
}
}

if (this.widgetData.url === 'back') {
} if (this.widgetData.url === 'back') {
return {
fragment: this.btnBackSvc.getLastUrl().fragment,
queryParams: this.btnBackSvc.getLastUrl().queryParams,
routeUrl: this.btnBackSvc.getLastUrl().route,
}
}

if (this.widgetData.url !== 'back' && this.widgetData.url !== 'doubleBack') {

this.btnBackSvc.checkUrl(this.widgetData.url)

}

return {
Expand Down Expand Up @@ -160,6 +154,12 @@ export class BtnPageBackComponent extends WidgetBaseComponent
this.router.navigate(['/app/discussion-forum'], { queryParams: { page: 'home' }, queryParamsHandling: 'merge' })
}

// get titleUrl(): { fragment?: string; routeUrl: string; queryParams: any } {
// return {
// queryParams: undefined,
// routeUrl: this.widgetData.url ? this.widgetData.url : '/app/home',
// }
// }
toggleVisibility() {
this.visible = !this.visible
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ <h2 class="mat-title margin-bottom-xs" i18n>Pinned</h2>
<!-- <mat-icon>settings</mat-icon> -->
<span i18n>{{'profileDropdown.getStarted' | translate }}</span>
</a>
<a mat-menu-item role="link" (click)="redirectToLearnersPage()" class="app-tour flex items-center">
<!-- <mat-icon>settings</mat-icon> -->
<span i18n>{{'profileDropdown.tipsLearners' | translate }}</span>
</a>
<a mat-menu-item role="link" (click)="redirectToMyLearning()" class="app-features flex items-center">
<!-- <mat-icon>settings</mat-icon> -->
<span i18n>{{'profileDropdown.myLearning' | translate }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export class BtnProfileComponent extends WidgetBaseComponent
super()
this.btnAppsConfig = { ...this.basicBtnAppsConfig }
this.btnSettingsConfig = { ... this.settingBtnConfig }
if (this.configSvc.unMappedUser && this.configSvc.unMappedUser.profileDetails.profileStatus === 'VERIFIED') {
if (this.configSvc.unMappedUser && this.configSvc.unMappedUser.profileDetails &&
this.configSvc.unMappedUser.profileDetails.profileStatus === 'VERIFIED') {
this.verifiedBadge = true
}
this.updateUserInfo()
Expand Down Expand Up @@ -226,6 +227,10 @@ export class BtnProfileComponent extends WidgetBaseComponent
}
)
}
redirectToLearnersPage() {
this.raiseTelemetry('Tips For Learners')
this.router.navigate(['/public/learner-advisory'])
}

// rasieProfileMenuTelemetry(tabname: string) {
// tabname = tabname.toLowerCase().split(' ').join('-')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class ContentStripMultipleComponent extends WidgetBaseComponent
private userSvc: WidgetUserService,
private http: HttpClient,
private searchApiService: SearchApiService,
private langtranslations: MultilingualTranslationsService
private langtranslations: MultilingualTranslationsService,
) {
super()
}
Expand Down Expand Up @@ -1180,6 +1180,7 @@ export class ContentStripMultipleComponent extends WidgetBaseComponent
...stripInfo,
visibilityMode: stripInfo.visibilityMode === 'hidden' ? 'visible' : 'hidden',
}

}
}
}
Expand Down
19 changes: 19 additions & 0 deletions library/ws-widget/collection/src/lib/sliders/banner.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';


@Injectable({
providedIn: 'root'
})
export class BannerService {
constructor(private http: HttpClient) { }

getBanners(): Observable<any> {
return this.http.get<any>('api/course/v2/explore');
}

getContentDetails(identifier: string): Observable<any> {
return this.http.get<any>(`api/content/v1/read/${identifier}`);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@project-sunbird/sb-styles": "0.0.7",
"@project-sunbird/sunbird-quml-player": "0.0.6",
"@project-sunbird/telemetry-sdk": "0.0.26",
"@sunbird-cb/consumption": "0.0.43",
"@sunbird-cb/consumption": "0.0.45",
"@sunbird-cb/design-system": "0.0.2",
"@sunbird-cb/discussions-ui-v8": "2.1.3",
"@sunbird-cb/micro-surveys": "^2.0.17",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
</div>
</div>

<div class="right-container">
<div class="right-container" >
<div class="right-content" #rightContainer>
<ng-container *ngIf="skeletonLoader">
<ws-widget-skeleton-loader [width]="'384px'" [height]="'224px'"
Expand Down Expand Up @@ -620,9 +620,31 @@
</ng-container>
</div>
</div>

<div class="tips-container" >
<div class="circle-box">
<div class="background-circle">
<!-- circle -->
</div>
</div>
<div class="tips-header">
<h3>Tips for Learners</h3>
<button (click)="showAllTips()">Show all ></button>
</div>
<div class="tip-content">
<div class =" background">
<img class="book-icon" src="assets/icons/learner-advisory/use-gyaan-karmayogi.png"
alt="Use the new section Gyaan Karmayogi regularly, to go over case studies and other learning material.">
</div>
<p>{{'learnerAdvisory.useGyaanKarmayogi' | translate}}</p>
<div class="tip-count">
1/13
</div>
</div>
</div>

</div>
</div>

<div class="mobile-enroll-div" [ngClass]="{'bg-white': content?.primaryCategory === primaryCategory.BLENDED_PROGRAM }">
<ng-container *ngIf="content && content?.primaryCategory === primaryCategory.BLENDED_PROGRAM ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
top: 132px;
width: 384px;
margin-bottom: 2rem;
box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.5), 0 -4px 4px -2px rgba(0, 0, 0, 0.5)
box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.5), 0 -4px 4px -2px rgba(0, 0, 0, 0.5);
}

.border-bottom {
Expand Down Expand Up @@ -218,6 +218,7 @@
height: 20px;
}
}

}

.batch-info {
Expand All @@ -233,6 +234,109 @@
line-height: 1rem;
}
}
.tips-container {
background-color: #F9CB97;
padding: 16px;
padding-bottom: 0px;
border-radius: 8px;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-bottom: 20px;
overflow: hidden;
position: fixed;
top: 560px;
left: 1166px;
width: 358px;
}

.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;
align-items: center;
z-index: 10;
}

.tip-content p {
margin-left: 10px;
color: #000000;
font-family: Lato;
font-size: 14px;
z-index: 10;
padding: 5px;
line-height: 16.8px;
}

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

.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;
}

.button {
border-radius: 64px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1830,4 +1830,7 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked,
programEnrollCall(batchData: any) {
this.autoEnrollCuratedProgram(NsContent.ECourseCategory.MODERATED_PROGRAM, batchData)
}
showAllTips() {
this.router.navigate(['public/learner-advisory']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
</ws-widget-btn-page-back>

<div class="container-balanced main_content_box">
<div class="top_card_container">
<div class="top_card_container" *ngIf="featuredProviders?.length">
<h2 class="mat-h1 margin-bottom-m inline-block "> {{ 'allproviderscomponent.popularProviders' | translate }}</h2>
<div class="top_card_inner_box flex">
<ng-container *ngFor="let p of featuredProviders | slice:0:8; let i=index">
Expand All @@ -24,7 +24,7 @@ <h2 class="mat-h1 margin-bottom-m inline-block "> {{ 'allproviderscomponent.allP
<!-- search box and dropdown-->
<form [formGroup]="searchForm">
<div class="flex top_search_box">
<div class="search_box_inner flex-1">
<div class="search_box_inner mb-4 flex-1">
<div class="flex flex-1 flex-column margin-fix search search_box_main">
<!-- <mat-form-field appearance="outline" class="autocomplete-form search_form margin-right-s"
color="primary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ resolve(
'orderBy': 'createdOn',
'orderDirection': 'ASC',
'facets': ['category', 'orgId'],
'query': '',
}
return this.http.post(requestUrl, requestData).pipe(
map((rData: any) => ({ data: rData, error: null })),
Expand Down
Loading

0 comments on commit d43a01f

Please sign in to comment.