File
Implements
Methods
ngOnDestroy
|
ngOnDestroy()
|
|
|
Public
activatedRoute
|
Type : ActivatedRoute
|
|
isMergeSuccess
|
Type : any
|
Default value : {}
|
|
modal
|
Decorators :
@ViewChild('modal')
|
|
tenantDataSubscription
|
Type : Subscription
|
|
import {Component, OnInit, ViewChild, OnDestroy} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ResourceService} from '@sunbird/shared';
import {Subscription} from 'rxjs';
import {TenantService} from '@sunbird/core';
@Component({
selector: 'app-merge-account-status',
templateUrl: './merge-account-status.component.html',
styleUrls: ['./merge-account-status.component.scss']
})
export class MergeAccountStatusComponent implements OnInit, OnDestroy {
@ViewChild('modal') modal;
isMergeSuccess: any = {};
error_type: string;
redirectUri: string;
mergeType: string;
logo: string;
tenantName: string;
tenantDataSubscription: Subscription;
constructor(public activatedRoute: ActivatedRoute, public resourceService: ResourceService,
public tenantService: TenantService) {
}
ngOnInit() {
this.activatedRoute.queryParams.subscribe((queryParams) => {
const queryParam = {...queryParams};
this.isMergeSuccess = queryParam.status === 'success';
this.mergeType = queryParam.merge_type;
this.redirectUri = queryParam.redirect_uri || '/resources';
this.error_type = queryParam.error_type;
});
this.tenantDataSubscription = this.tenantService.tenantData$.subscribe(data => {
if (data && !data.err && data.tenantData) {
this.logo = data.tenantData.logo;
this.tenantName = data.tenantData.titleName;
}
});
}
closeModal() {
window.location.href = this.redirectUri;
this.modal.deny();
}
ngOnDestroy() {
if (this.tenantDataSubscription) {
this.tenantDataSubscription.unsubscribe();
}
}
}
<app-modal-wrapper [config]="{disableClose: false, size: 'large', panelClass: ['overflow-visible', 'material-modal']}" (dismiss)="modal.deny()" #modal>
<ng-template sbModalContent>
<div class="sb-mat__modal sb-mat__modal--fullscreen">
<div class="signup-background">
<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 *ngIf="mergeType === 'manual'">
<p *ngIf="isMergeSuccess"
class="sb-merged-account-body-para sb-color-success font-weight-bold py-8">
{{resourceService.messages?.imsg?.m0065}}. {{resourceService.messages?.imsg?.m0066}}</p>
<p *ngIf="!isMergeSuccess && error_type !== 'account_not_found'"
class="sb-merged-account-body-para sb-color-error font-weight-bold py-8">
{{resourceService.messages?.imsg?.m0067}} </p>
<p *ngIf="!isMergeSuccess && error_type === 'account_not_found'"
class="sb-merged-account-body-para sb-color-error font-weight-bold py-8">
{{resourceService.messages?.imsg?.m0087}}</p>
</div>
<div *ngIf="mergeType === 'auto'">
<p *ngIf="isMergeSuccess"
class="sb-merged-account-body-para sb-color-success font-weight-bold py-8">
{{resourceService.messages?.imsg?.m0081}}</p>
<p *ngIf="!isMergeSuccess" class="sb-merged-account-body-para sb-color-error font-weight-bold py-8">
{{resourceService.messages?.imsg?.m0080}} </p>
</div>
</div>
<div class="d-flex flex-jc-center mt-40">
<button class="sb-btn sb-btn-primary sb-btn-md w-100" tabindex="0"
(click)="closeModal()">{{resourceService.frmelmnts?.btn?.ok}}
</button>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</app-modal-wrapper>
@use "@project-sunbird/sb-styles/assets/mixins/mixins" as *;
@use "pages/sign_in_up" as *;
.sb-merged-account-body-para.sb-color-success{
color:var(--success-color);
}
Legend
Html element with directive