diff --git a/library/ws-widget/utils/src/lib/services/configurations.model.ts b/library/ws-widget/utils/src/lib/services/configurations.model.ts index c9a6731e1..235160333 100644 --- a/library/ws-widget/utils/src/lib/services/configurations.model.ts +++ b/library/ws-widget/utils/src/lib/services/configurations.model.ts @@ -268,6 +268,7 @@ export namespace NsUser { competencies?: any systemTopics?: any desiredTopics?: any + desiredCompetencies?: any } export interface INodebbUserProfile { diff --git a/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.html b/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.html index 2d393bd49..28afe3d60 100644 --- a/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.html +++ b/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.html @@ -1,38 +1,47 @@ - - - -
-
-
-

{{ competency?.name}}

-

{{ competency?.competencyType}}

+
- diff --git a/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.scss b/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.scss index 25c091655..0c4ab367d 100644 --- a/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.scss +++ b/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.scss @@ -112,8 +112,6 @@ } .learn-card { - // padding: 24px !important; - overflow: hidden; width: 100%; box-sizing: border-box; @@ -126,9 +124,7 @@ } .card_inner_title_box { - // display: column; width: 220px; - // padding: 24px; box-sizing: border-box; @media (max-width: 768px) { @@ -194,3 +190,13 @@ a.level_item_active .mat-icon { } +[wsCompTooltipDirective] { + position: relative; +} + +.tooltip { + position: absolute; + opacity: 1; + z-index: 999; + padding: 5px; +} diff --git a/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.ts b/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.ts index a5071237a..9df9f5ee5 100644 --- a/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.ts +++ b/project/ws/app/src/lib/routes/profile-v3/components/competency-card/competency-card.component.ts @@ -38,4 +38,8 @@ export class CompetencyCardComponent implements OnInit { this.selectedCompetency.emit(this.selectedCompList) } } + + newselectedCompetency(event: any) { + this.selectedCompetency.emit(event) + } } diff --git a/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.html b/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.html new file mode 100644 index 000000000..e1392c9cc --- /dev/null +++ b/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.html @@ -0,0 +1,11 @@ + + {{competencyLevelData.level}} + info_outlined + + +
+ +
+
+
diff --git a/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.scss b/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.scss new file mode 100644 index 000000000..7c3fc8227 --- /dev/null +++ b/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.scss @@ -0,0 +1,209 @@ +@import 'ws-common'; +@import 'ws-vars'; +@import 'ws-mixins'; + +.competency-card { + flex: 1; + height: auto; + // min-width: 346px; + min-height: 190px; + + // width: max-content; + @include breakpoint-xs { + // min-width: 100%; + width: auto; + } +} + +.competency_main { + width:100%; + + @media (max-width:1024px) { + width: 100%; + } +} + +.font-medium { + font-weight: 500 !important; +} + +.dot:before { + content: '•'; + margin: 1rem; +} + +.mobile { + @include breakpoint-xs { + flex: 1; + } + + @include breakpoint-s { + flex: 1; + } +} + +.mobile2 { + @include breakpoint-xs { + margin-top: $size-s; + } + + // @include breakpoint-s { + // margin-top: $size-s; + // } +} + +.tag { + display: flex; + margin: 0 10px; + padding: 3px 15px; + font-size: 12px; + min-width: 50px; + justify-content: center; + border-radius: 20px 5px 5px 20px; +} + +.noocoments { + flex: 1; + text-align: right; + margin-right: $size-m; +} + +.custom { + flex-direction: column; + + @include breakpoint-xs { + flex-direction: column; + } +} + +.custom-reverse { + flex-direction: column; + + @include breakpoint-xs { + flex-direction: column; + } +} + +.add-comp { + right: 0; + display: flex; + position: absolute; + top: 0; + height: 48px; + width: 48px; + background: rgb(29, 137, 35) !important; +} + +.margin-0 { + margin: 0; +} + +.pad-4 { + padding: 4px; +} + +.example-header-image { + // background-image: url('https://material.angular.io/assets/img/examples/shiba1.jpg'); + background-size: cover; +} + +.mat-copmetence a:hover { + color: #ffffff !important ; +} + +.learn-card { + // padding: 24px !important; + // overflow: hidden; + width: 100%; + box-sizing: border-box; + + .mat-card-content { + margin-bottom: 0; + } + + .card_inner_content { + overflow: hidden; + } + + .card_inner_title_box { + // display: column; + width: 220px; + // padding: 24px; + box-sizing: border-box; + + @media (max-width: 768px) { + width: 40%; + // padding: 12px 12px; + } + + h4.mat-h4 { + margin-bottom: 5px; + } + + .text_icon_box { + margin-top: 45px; + .mat-icon1 { + vertical-align: middle; + margin-right: 10px; + } + .icon_text { + margin-bottom: 0; + + } + } + + } + .card_right_txtbox { + float: right; + // padding: 24px; + box-sizing: border-box; + width: calc(100% - 230px); + border-left:1px solid rgba(0, 0, 0, 0.08); + + @media (max-width: 768px) { + width: 60%; + padding: 12px 12px; + } + + } +} + +a.level_item { + height: 40px; + line-height: 26px; + padding:6px 12px; + border-radius: 18px 18px; + text-align: center; + border:1px solid rgba(0, 0, 0, 0.08); + background-color: #fff; + box-sizing: border-box; + width: auto; +} +a.level_item_active { + background-color: #0074b6; + color: #fff; + border:1px solid #0074b6; +} +a.level_item_active .mat-icon { + color: #fff!important; +} +.material-icons.info_icon { + font-size: 18px; + width: 18px; + height: 18px; + line-height: 27px; + +} + +[wsCompTooltipDirective] { + position: relative; +} + +.tooltip { + position: absolute; + opacity: 1; + z-index: 999; + padding: 5px; + top: 35px; + left: -10px; +} diff --git a/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.ts b/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.ts new file mode 100644 index 000000000..7137aa4e0 --- /dev/null +++ b/project/ws/app/src/lib/routes/profile-v3/components/level-card/level-card.component.ts @@ -0,0 +1,43 @@ +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core' + +@Component({ + selector: 'ws-app-level-card', + templateUrl: './level-card.component.html', + styleUrls: ['./level-card.component.scss'], +}) +export class LevelCardComponent implements OnInit { + selectedLevelId: any + selectedCompId: any + selectedCompList: any = [] + @Input() competencyLevelData!: any + @Input() competency!: any + @Output() selectedCompetency = new EventEmitter() + + constructor() { } + + ngOnInit() { + } + + selectLevel(complevel: any, competency: any) { + this.selectedLevelId = complevel.id + this.selectedCompId = competency.id + + if (this.selectedCompList.indexOf(competency.id) === -1) { + const compobj = { + type: competency.type, + id: competency.id, + name: competency.name, + description: competency.description, + status: competency.status, + source: competency.source, + competencyType: competency.additionalProperties.competencyType, + competencySelfAttestedLevel: complevel.id, + competencySelfAttestedLevelValue: complevel.name, + osid: competency.osid, + } + this.selectedCompList.push(compobj) + this.selectedCompetency.emit(this.selectedCompList) + } + } + +} diff --git a/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.html b/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.html new file mode 100644 index 000000000..d54263a8c --- /dev/null +++ b/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.html @@ -0,0 +1,8 @@ + + +
{{complevel.level}}
+
{{complevel.name}}
+
{{complevel.description}}
+
+
+ diff --git a/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.scss b/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.scss new file mode 100644 index 000000000..d5e3b941a --- /dev/null +++ b/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.scss @@ -0,0 +1,68 @@ +@import 'ws-common'; +@import 'ws-vars'; +@import 'ws-mixins'; + +.card-container { + // height: 338px; + width: 320px; + // border: 1px solid rgba(0, 0, 0, 8%); + border-radius: calc(#{$size-s}-#{$size-xs}); + padding: 0; + min-height: 200px; + min-width: 320px; + text-align: center; +} + +.m-t-fix { + margin-top: calc(2* #{$size-m} + #{$size-xs}); +} + +.fixd { + position: absolute; + position: absolute; + display: flex; + left: 24px; + top: 31px; +} + +.photo-container { + background: #F8F4F9; + padding: $size-m 0; + min-height: 60px; +} + +.name-container { + padding: $size-m $size-l; + box-sizing: border-box; +} + +.name { + text-transform: capitalize; +} + +.designation { + line-height: 21px; +} + +.action-container { + padding: $size-m 0; +} + +.m-margin { + margin-top: $size-xs; + // margin-bottom: $size-xs; +} + +.p-inherit { + position: inherit !important; +} + +.title_text, .desc_text { + word-break: break-word; + white-space: initial; + text-overflow: ellipsis; + display: -webkit-box; +} +.title_text { + color: rgba($color: #000000, $alpha: 0.4); +} diff --git a/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.ts b/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.ts new file mode 100644 index 000000000..fdace5c83 --- /dev/null +++ b/project/ws/app/src/lib/routes/profile-v3/components/level-info/level-info.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit, Input } from '@angular/core' + +@Component({ + selector: 'ws-app-level-info', + templateUrl: './level-info.component.html', + styleUrls: ['./level-info.component.scss'], +}) +export class LevelInfoComponent implements OnInit { + @Input() complevel!: any + + constructor() { } + + ngOnInit() { + } + +} diff --git a/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.scss b/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.scss index 0fb869e55..5af6a381b 100644 --- a/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.scss +++ b/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.scss @@ -3,7 +3,7 @@ padding: 8px 12px; box-sizing: border-box; border: 1px solid; - min-width: 200px; + min-width: 90px; cursor: pointer; } // .topic_tag_link.tag_link_active { diff --git a/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.ts b/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.ts index b7a9cad37..ac90e5673 100644 --- a/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.ts +++ b/project/ws/app/src/lib/routes/profile-v3/components/topic-card/topic-card.component.ts @@ -21,37 +21,37 @@ export class TopicCardComponent implements OnInit { clicked(top: NSProfileDataV3.ITopic | string) { this.topicService.autoSave.next(true) if (typeof (top) === 'object') { - const index = _.findIndex(this.topicService.getCurrentSelectedTopics, { identifier: top.identifier }) + const index = _.findIndex(this.topicService.getCurrentSelectedSysTopics, { identifier: top.identifier }) if (index !== -1) { /// remove from store - this.topicService.removeTopics(top) + this.topicService.removeSystemTopics(top) } else { /// add to store - this.topicService.addTopics(top) + this.topicService.addSystemTopics(top) } } else { - const index = _.findIndex(this.topicService.getCurrentSelectedTopics, { name: 'Added by you' }) - const cIndex = _.indexOf(this.topicService.getCurrentSelectedTopics[index].children, top) - if (cIndex !== -1) { + const index = _.indexOf(this.topicService.getCurrentSelectedDesTopics, top) + // const cIndex = _.indexOf(this.topicService.getCurrentSelectedTopics[index].children, top) + if (index !== -1) { /// remove from store - this.topicService.removeTopicsAddedByYou(top) + this.topicService.removeDesiredTopics(top) } else { /// add to store - this.topicService.addTopicsAddedByYou(top) + this.topicService.addDesiredTopics(top) } } } - isSelected(top: NSProfileDataV3.ITopic): boolean { + isSelected(top: NSProfileDataV3.ITopic | string): boolean { if (top) { - if (!top.identifier) { - const index = _.indexOf(this.topicService.getCurrentSelectedTopics, top) + if (typeof (top) !== 'object') { + const index = _.indexOf(this.topicService.getCurrentSelectedDesTopics, top) if (index === -1) { return false } return true } - const index1 = _.findIndex(this.topicService.getCurrentSelectedTopics, { identifier: top.identifier }) + const index1 = _.findIndex(this.topicService.getCurrentSelectedSysTopics, { identifier: top.identifier }) if (index1 === -1) { return false } diff --git a/project/ws/app/src/lib/routes/profile-v3/directives/tooltip.directive.ts b/project/ws/app/src/lib/routes/profile-v3/directives/tooltip.directive.ts new file mode 100644 index 000000000..32960c89b --- /dev/null +++ b/project/ws/app/src/lib/routes/profile-v3/directives/tooltip.directive.ts @@ -0,0 +1,67 @@ +import { + Input, + Renderer2, HostListener, + Directive, ElementRef, + TemplateRef, ViewContainerRef, + ContentChild, +} from '@angular/core' + +@Directive({ selector: '[wsCompTooltipDirective]' }) +export class CompTooltipDirective { + // private tooltipId!: string + constructor( + private renderer: Renderer2, + private elementRef: ElementRef, + private viewContainerRef: ViewContainerRef) { } + + @Input() parametroPlantilla!: TemplateRef + @Input() placement = 'top' + // @Input() close + @ContentChild('tooltipTemplate', { static: false }) + private tooltipTemplateRef!: TemplateRef + offset = 10 + @HostListener('mouseenter') onMouseEnter(): void { + const view = this.viewContainerRef.createEmbeddedView(this.tooltipTemplateRef) + view.rootNodes.forEach(node => + this.renderer.appendChild(this.elementRef.nativeElement, node)) + } + + @HostListener('mouseleave') onMouseLeave(): void { + if (this.viewContainerRef) { + this.viewContainerRef.clear() + } + } + + setPosition() { + const hostPos = this.elementRef.nativeElement.getBoundingClientRect() + const tooltipPos = this.tooltipTemplateRef.elementRef.nativeElement.getBoundingClientRect() + const scrollPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0 + + let top + let left + + if (this.placement === 'top') { + top = hostPos.top - tooltipPos.height - this.offset + left = hostPos.left + (hostPos.width - tooltipPos.width) / 2 + } + + if (this.placement === 'bottom') { + top = hostPos.bottom + this.offset + left = hostPos.left + (hostPos.width - tooltipPos.width) / 2 + } + + if (this.placement === 'left') { + top = hostPos.top + (hostPos.height - tooltipPos.height) / 2 + left = hostPos.left - tooltipPos.width - this.offset + } + + if (this.placement === 'right') { + top = hostPos.top + (hostPos.height - tooltipPos.height) / 2 + left = hostPos.right + this.offset + } + + // 스크롤이 발생한 경우, tooltip 요소의 top에 세로 스크롤 좌표값을 반영하여야 한다. + this.renderer.setStyle(this.tooltipTemplateRef, 'top', `${top + scrollPos}px`) + this.renderer.setStyle(this.tooltipTemplateRef, 'left', `${left}px`) + } +} diff --git a/project/ws/app/src/lib/routes/profile-v3/profile-v3.module.ts b/project/ws/app/src/lib/routes/profile-v3/profile-v3.module.ts index 2ef0c03e3..fc6c61d7f 100644 --- a/project/ws/app/src/lib/routes/profile-v3/profile-v3.module.ts +++ b/project/ws/app/src/lib/routes/profile-v3/profile-v3.module.ts @@ -23,6 +23,9 @@ import { PlatformWalkthroughComponent } from './routes/platform-walkthrough/plat import { AddTopicDialogComponent } from './components/add-topic/add-topic.component' import { RolesAndActivitiesComponent } from './routes/roles-and-activities/roles-and-activities.component' import { RolesAndActivityService } from './services/rolesandActivities.service' +import { LevelCardComponent } from './components/level-card/level-card.component' +import { LevelInfoComponent } from './components/level-info/level-info.component' +import { CompTooltipDirective } from './directives/tooltip.directive' @NgModule({ declarations: [ @@ -37,6 +40,9 @@ import { RolesAndActivityService } from './services/rolesandActivities.service' // VideoWrapperComponent, AddTopicDialogComponent, RolesAndActivitiesComponent, + LevelCardComponent, + LevelInfoComponent, + CompTooltipDirective, ], imports: [ CommonModule, diff --git a/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.html b/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.html index ac148d383..aed7bb1e0 100644 --- a/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.html +++ b/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.html @@ -1,13 +1,6 @@ -

Self-Attested Competencies

+
- +

Self-Attested Competencies

+
diff --git a/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.scss b/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.scss index d54d284d9..36ecc7119 100644 --- a/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.scss +++ b/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.scss @@ -1,10 +1,25 @@ +@import 'ws-common'; +@import 'ws-vars'; +@import 'ws-mixins'; +::ng-deep .comptency_main_div { + width: 100%; +} + +.main_title_text { + @include breakpoint-xs { + margin-top: 0.5rem; + } + @include breakpoint-s { + margin-top: 0.5rem; + } +} .left_card_box { // width: 890px; width: 75%; float: left; - @media (max-width:992px) { + @include breakpoint-m { width:100%; } diff --git a/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.ts b/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.ts index 770d60409..7acead07b 100644 --- a/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.ts +++ b/project/ws/app/src/lib/routes/profile-v3/routes/current-competencies/current-competencies.component.ts @@ -2,18 +2,23 @@ import { Component, OnInit } from '@angular/core' import { ProfileV3Service } from '../../services/profile_v3.service' import { NSProfileDataV3 } from '../../models/profile-v3.models' import { ConfigurationsService } from '@sunbird-cb/utils/src/public-api' -import * as _ from 'lodash' +// tslint:disable-next-line +import _ from 'lodash' + @Component({ selector: 'ws-app-current-competencies', templateUrl: './current-competencies.component.html', styleUrls: ['./current-competencies.component.scss'], + /* tslint:disable */ + host: { class: 'flex flex-1 comptency_main_div' }, + /* tslint:enable */ }) export class CurrentCompetenciesComponent implements OnInit { searchJson!: NSProfileDataV3.ISearch[] allCompetencies: any = [] overallCompetencies!: NSProfileDataV3.ICompetencie[] changedProperties: any = {} - userDetails: any + // userDetails: any updatecompList: any = [] competenciesList: any = [] @@ -24,13 +29,23 @@ export class CurrentCompetenciesComponent implements OnInit { } getUserDetails() { - if (this.configService.unMappedUser && this.configService.unMappedUser.id) { - this.competencySvc.getUserdetailsFromRegistry(this.configService.unMappedUser.id).subscribe( - (data: any) => { - this.userDetails = data - this.competenciesList = data.profileDetails.competencies - this.getCompetencies() - }) + // if (this.configService.unMappedUser && this.configService.unMappedUser.id) { + // this.competencySvc.getUserdetailsFromRegistry(this.configService.unMappedUser.id).subscribe( + // (data: any) => { + // this.userDetails = data + // this.competenciesList = data.profileDetails.competencies + // if (this.overallCompetencies && this.overallCompetencies.length > 0) { + // this.getCompLsit() + // } else { + // this.getCompetencies() + // } + // }) + // } + this.competenciesList = _.get(this.configService.unMappedUser, 'profileDetails.desiredCompetencies') || [] + if (this.overallCompetencies && this.overallCompetencies.length > 0) { + this.getCompLsit() + } else { + this.getCompetencies() } } diff --git a/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.html b/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.html index 5f5188173..fbe6e4146 100644 --- a/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.html +++ b/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.html @@ -1,3 +1,5 @@ -

Desired competencies

+
+

Desired competencies

+
diff --git a/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.scss b/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.scss index e69de29bb..a80836aa6 100644 --- a/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.scss +++ b/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.scss @@ -0,0 +1,8 @@ + +@import 'ws-common'; +@import 'ws-vars'; +@import 'ws-mixins'; + +::ng-deep .comptency_main_div { + width: 100%; +} diff --git a/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.ts b/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.ts index f2a80c658..34bd4ebb9 100644 --- a/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.ts +++ b/project/ws/app/src/lib/routes/profile-v3/routes/desired-competencies/desired-competencies.component.ts @@ -2,17 +2,22 @@ import { Component, OnInit } from '@angular/core' import { ProfileV3Service } from '../../services/profile_v3.service' import { NSProfileDataV3 } from '../../models/profile-v3.models' import { ConfigurationsService } from '@sunbird-cb/utils/src/public-api' +// tslint:disable-next-line +import _ from 'lodash' @Component({ selector: 'ws-app-desired-competencies', templateUrl: './desired-competencies.component.html', styleUrls: ['./desired-competencies.component.scss'], + /* tslint:disable */ + host: { class: 'flex flex-1 comptency_main_div' }, + /* tslint:enable */ }) export class DesiredCompetenciesComponent implements OnInit { searchJson!: NSProfileDataV3.ISearch[] allCompetencies: any = [] changedProperties: any = {} - userDetails: any + // userDetails: any updatecompList: any = [] overallCompetencies!: NSProfileDataV3.ICompetencie[] desiredcompList: any = [] @@ -24,13 +29,19 @@ export class DesiredCompetenciesComponent implements OnInit { } getUserDetails() { - if (this.configService.unMappedUser && this.configService.unMappedUser.id) { - this.competencySvc.getUserdetailsFromRegistry(this.configService.unMappedUser.id).subscribe( - (data: any) => { - this.userDetails = data - this.desiredcompList = data.profileDetails.desiredCompetencies - this.getCompetencies() - }) + // if (this.configService.unMappedUser && this.configService.unMappedUser.id) { + // this.competencySvc.getUserdetailsFromRegistry(this.configService.unMappedUser.id).subscribe( + // (data: any) => { + // this.userDetails = data + // this.desiredcompList = data.profileDetails.desiredCompetencies + // this.getCompetencies() + // }) + // } + this.desiredcompList = _.get(this.configService.unMappedUser, 'profileDetails.desiredCompetencies') || [] + if (this.overallCompetencies && this.overallCompetencies.length > 0) { + this.getCompLsit() + } else { + this.getCompetencies() } } diff --git a/project/ws/app/src/lib/routes/profile-v3/routes/platform-walkthrough/platform-walkthrough.component.html b/project/ws/app/src/lib/routes/profile-v3/routes/platform-walkthrough/platform-walkthrough.component.html index 45c8a8584..6cfcacd9f 100644 --- a/project/ws/app/src/lib/routes/profile-v3/routes/platform-walkthrough/platform-walkthrough.component.html +++ b/project/ws/app/src/lib/routes/profile-v3/routes/platform-walkthrough/platform-walkthrough.component.html @@ -1,3 +1,5 @@ -