src/app/authenticate-request/authenticate-request.component.ts
selector | app-authenticate-request |
styleUrls | authenticate-request.component.css |
templateUrl | ./authenticate-request.component.html |
Properties |
Methods |
Outputs |
constructor(multiFactorService: MultiFactorService, app: AppState, router: Router, errorService: ErrorStore)
|
|||||||||||||||
Parameters :
|
closeAuthRequest
|
$event type: EventEmitter
|
openAuthMethod
|
$event type: EventEmitter
|
openAuthRepeat
|
$event type: EventEmitter
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
stopPropagation | ||||||
stopPropagation(event: Event)
|
||||||
Parameters :
Returns :
void
|
toggleAuthMethod | ||||||
toggleAuthMethod(event: Event)
|
||||||
Parameters :
Returns :
void
|
toggleAuthRepeat | ||||||
toggleAuthRepeat(event: Event)
|
||||||
Parameters :
Returns :
void
|
toggleAuthRequest | ||||||
toggleAuthRequest(event: Event)
|
||||||
Parameters :
Returns :
void
|
isLoading |
isLoading:
|
Default value : false
|
loadingHeader |
loadingHeader:
|
Type : string
|
Default value : 'Processing'
|
loadingMessage |
loadingMessage:
|
Type : string
|
Default value : 'Please wait a moment.'
|
import { Location, DatePipe } from '@angular/common';
import {
Component,
ElementRef,
OnInit,
ViewChild,
Output,
EventEmitter
} from '@angular/core';
import { Router } from '@angular/router';
import { LOCALE } from '../app.constants';
import { SelectedMultiFactorMethod } from '../models';
import { TemplateUpdate } from '../models';
import {
PaymentService,
TemplateService,
MultiFactorService
} from '../services';
import { ErrorStore } from '../stores';
import { AppState } from '../stores/app-state.store';
@Component({
selector: 'app-authenticate-request',
templateUrl: './authenticate-request.component.html',
styleUrls: ['./authenticate-request.component.css']
})
export class AuthenticateRequestComponent implements OnInit {
@Output() closeAuthRequest = new EventEmitter();
@Output() openAuthMethod = new EventEmitter();
@Output() openAuthRepeat = new EventEmitter();
loadingHeader = 'Processing';
loadingMessage = 'Please wait a moment.';
isLoading = false;
constructor(
private multiFactorService: MultiFactorService,
private app: AppState,
private router: Router,
private errorService: ErrorStore
) {}
ngOnInit() {}
toggleAuthRequest(event: Event) {
this.closeAuthRequest.emit();
this.app.useMfaModal = false;
}
toggleAuthMethod(event: Event) {
this.closeAuthRequest.emit();
this.openAuthMethod.emit();
}
toggleAuthRepeat(event: Event) {
this.closeAuthRequest.emit();
this.openAuthRepeat.emit();
}
stopPropagation(event: Event) {
event.stopPropagation();
}
}
<div class="overlay scroller" (click)="toggleAuthRequest($event)">
<div class="pop-up-ctn" id="authenticateUserMethod" (click)="stopPropagation($event)">
<div class="close-ctn">
<a id="closeButton" (click)="toggleAuthRequest($event)"><i class="material-icons">close</i></a>
</div>
<div class="pop-up-ctn-header">
<h1 id="authUserHeader" class="header-text">Authenticate User</h1>
</div>
<div class="pop-up-ctn-body">
<div id="authRequest" *ngIf="!isLoading">
<p>For security reasons we require a two-factor authentication per transaction as an extra layer of security.</p>
<div class="auth-request-container">
<!-- Already Has An Authentication Code -->
<div id="haveAuth" class="auth-request-method first" (click)="toggleAuthRepeat()">
<p>I already have an authentication code</p>
</div>
<!-- Requesting An Authentication Code -->
<div id="needAuth" class="auth-request-method last" (click)="toggleAuthMethod()">
<p>I need a new authentication code</p>
</div>
</div>
</div>
<div *ngIf="isLoading">
<app-loader [header]="loadingHeader" [message]="loadingMessage"></app-loader>
</div>
</div>
</div>
</div>