File
Implements
Index
Properties
|
|
Methods
|
|
Inputs
|
|
identifierType
|
Type : any
|
|
identifierValue
|
Type : any
|
|
tncVersionAccepted
|
Type : string
|
|
Methods
createNewUser
|
createNewUser()
|
|
|
migrateUser
|
migrateUser()
|
|
|
ngOnDestroy
|
ngOnDestroy()
|
|
|
telemetryCdata
|
Type : []
|
Default value : [{
id: 'user:account:migrate',
type: 'Feature'
}, {
id: 'SB-13773',
type: 'Task'
}]
|
|
tenantDataSubscription
|
Type : Subscription
|
|
import {Component, Input, OnInit, OnDestroy} from '@angular/core';
import {ResourceService} from '@sunbird/shared';
import {Subscription} from 'rxjs';
import {TenantService} from '@sunbird/core';
@Component({
selector: 'app-sso-merge-confirmation',
templateUrl: './sso-merge-confirmation.component.html',
styleUrls: ['./sso-merge-confirmation.component.scss']
})
export class SsoMergeConfirmationComponent implements OnInit, OnDestroy {
@Input() userDetails: any;
@Input() identifierType: any;
@Input() identifierValue: any;
@Input() tncVersionAccepted: string;
@Input() isTncAccepted: boolean;
instance: string;
logo: string;
tenantName: string;
tenantDataSubscription: Subscription;
telemetryCdata = [{
id: 'user:account:migrate',
type: 'Feature'
}, {
id: 'SB-13773',
type: 'Task'
}];
constructor(public resourceService: ResourceService, public tenantService: TenantService) {
this.instance = (<HTMLInputElement>document.getElementById('instance'))
? (<HTMLInputElement>document.getElementById('instance')).value.toUpperCase() : 'SUNBIRD';
}
ngOnInit() {
this.tenantDataSubscription = this.tenantService.tenantData$.subscribe(data => {
if (data && !data.err && data.tenantData) {
this.logo = data.tenantData.logo;
this.tenantName = data.tenantData.titleName;
}
});
}
createNewUser() {
let queryParams = '&identifier=' + this.identifierType + '&identifierValue=' + this.identifierValue + '&freeUser=true';
queryParams = queryParams + '&tncAccepted=' + this.isTncAccepted + '&tncVersion=' + this.tncVersionAccepted;
window.location.href = 'v1/sso/create/user?userId=' + this.userDetails.id + queryParams;
}
closeModal() {
}
migrateUser() {
let queryParams = '&identifier=' + this.identifierType + '&identifierValue=' + this.identifierValue + '&freeUser=true';
queryParams = queryParams + '&tncAccepted=' + this.isTncAccepted + '&tncVersion=' + this.tncVersionAccepted;
window.location.href = '/v1/sso/migrate/account/initiate?userId=' + this.userDetails.id + queryParams;
}
ngOnDestroy() {
if (this.tenantDataSubscription) {
this.tenantDataSubscription.unsubscribe();
}
}
}
<div class="signup-background signup-background--sso">
<div class="fullpage-background-image">
<div class="container-wrapper">
<div class="sb-merged-account-content text-center">
<img alt="{{tenantName}}" src="{{logo}}" class="sb-certificatePage-logo"/>
<div class="title text-center my-24">
{{resourceService.frmelmnts?.lbl?.mergeAccount}}</div>
</div>
<div class="text-left">
<p
class="py-8 m-0">{{resourceService.messages?.imsg?.m0070 | interpolate:'{instance}': instance | interpolate:'{identifierValue}':identifierValue }}:
</p>
<ul class="m-0 sb-list-items">
<li class="mb-8">
{{resourceService.messages?.imsg?.m0063}}
</li>
<li class="mb-8">
{{resourceService.messages?.imsg?.m0064}}
</li>
</ul>
<p class="">{{resourceService.messages?.imsg?.m0062}} {{resourceService.messages?.imsg?.m0141 | interpolate:'{instance}': instance}}</p>
</div>
<div class="d-flex mt-40">
<button class="sb-btn sb-btn-outline-primary sb-btn-md width-100 mr-8 mb-auto"
appTelemetryInteract [telemetryInteractCdata]="telemetryCdata"
[telemetryInteractEdata]="{id: 'sso-create-user', type: 'click', pageid: 'user-migrate'}"
tabindex="0" (click)="createNewUser()">{{resourceService.frmelmnts?.btn?.createNew}}
</button>
<button class="sb-btn sb-btn-primary sb-btn-md width-100 ml-8 mb-auto"
appTelemetryInteract [telemetryInteractCdata]="telemetryCdata"
[telemetryInteractEdata]="{id: 'sso-user-migrate', type: 'click', pageid: 'user-migrate'}"
tabindex="0" (click)="migrateUser()">{{resourceService.frmelmnts?.btn?.merge}}
</button>
</div>
</div>
</div>
</div>
@use "@project-sunbird/sb-styles/assets/mixins/mixins" as *;
@use "pages/sign_in_up" as *;
.sb-list-items{
text-align: left;
list-style-type: initial;
padding-left: calculateRem(16px);
line-height: normal;
}
.signup-background.signup-background--sso {
position: fixed;
z-index: 9999;
}
Legend
Html element with directive