File

src/app/modules/public/module/sign-in/sso/components/auth-failed/auth-failed.component.ts

Implements

OnInit OnDestroy

Metadata

Index

Properties
Methods

Constructor

constructor(activatedRoute: ActivatedRoute, resourceService: ResourceService, tenantService: TenantService)
Parameters :
Name Type Optional
activatedRoute ActivatedRoute No
resourceService ResourceService No
tenantService TenantService No

Methods

createNewUser
createNewUser()
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

Public activatedRoute
Type : ActivatedRoute
instance
Type : string
logo
Type : string
queryParam
Type : any
Public resourceService
Type : ResourceService
tenantDataSubscription
Type : Subscription
tenantName
Type : string
Public tenantService
Type : TenantService
import {Component, OnInit, OnDestroy} from '@angular/core';
import {ResourceService} from '@sunbird/shared';
import {ActivatedRoute} from '@angular/router';
import {Subscription} from 'rxjs';
import {TenantService} from '@sunbird/core';

@Component({
  selector: 'app-auth-failed',
  templateUrl: './auth-failed.component.html',
  styleUrls: ['./auth-failed.component.scss']
})
export class AuthFailedComponent implements OnInit, OnDestroy {
  instance: string;
  logo: string;
  tenantName: string;
  tenantDataSubscription: Subscription;

  constructor(public activatedRoute: ActivatedRoute, public resourceService: ResourceService,
              public tenantService: TenantService) {
    this.instance = (<HTMLInputElement>document.getElementById('instance'))
      ? (<HTMLInputElement>document.getElementById('instance')).value.toUpperCase() : 'SUNBIRD';
  }

  queryParam: any;

  ngOnInit() {
    this.activatedRoute.queryParams.subscribe((queryParams) => {
      this.queryParam = {...queryParams};
    });
    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.queryParam.identifierType + '&identifierValue=' +
      this.queryParam.identifierValue + '&freeUser=true' + '&tncAccepted=' + this.queryParam.tncAccepted;
    queryParams = queryParams + '&tncVersion=' + this.queryParam.tncVersion;
    window.location.href = 'v1/sso/create/user?userId=' + this.queryParam.userId + queryParams;
  }

  ngOnDestroy() {
    if (this.tenantDataSubscription) {
      this.tenantDataSubscription.unsubscribe();
    }
  }

}
<app-modal-wrapper #modal [config]="{disableClose: true, size: 'large'}" (dismiss)="modal.deny()">
  <ng-template sbModalContent>
    <div class="sb-modal">
      <div class="transition ui dimmer page modals active visible">
        <div class="ui modal transition active visible large">
          <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>
                  <p class="py-8 m-0 failed-message font-weight-bold">{{resourceService.messages?.imsg?.m0072}}
                    {{resourceService.messages?.imsg?.m0073 | interpolate:'{instance}': instance }}</p>
                </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)="createNewUser()">{{resourceService.frmelmnts?.btn?.createNew}}
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </ng-template>
</app-modal-wrapper>

./auth-failed.component.scss

@use "@project-sunbird/sb-styles/assets/mixins/mixins" as *;
@use "pages/sign_in_up" as *;

.failed-message{
    color: var(--tertiary-400);
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""