Skip to content

Commit

Permalink
MOSIP-37782 created error component
Browse files Browse the repository at this point in the history
Signed-off-by: MadhuMosip <[email protected]>
  • Loading branch information
MadhuMosip committed Nov 25, 2024
1 parent 74df13a commit be1425e
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 0 deletions.
13 changes: 13 additions & 0 deletions resident-ui/src/app/feature/error/error-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {ErrorComponent} from './error/error.component'

const routes: Routes = [
{path:'', component:ErrorComponent}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ErrorRoutingModule { }
14 changes: 14 additions & 0 deletions resident-ui/src/app/feature/error/error.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { ErrorRoutingModule } from './error-routing.module';
import { ErrorComponent } from './error/error.component';

@NgModule({
declarations: [ErrorComponent],
imports: [
CommonModule,
ErrorRoutingModule
]
})
export class ErrorModule { }
12 changes: 12 additions & 0 deletions resident-ui/src/app/feature/error/error/error.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.main-container{
height: 85%;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.text{
background-color: rgb(254 226 226);
color: rgb(185 28 28);
padding: 1rem;
}
3 changes: 3 additions & 0 deletions resident-ui/src/app/feature/error/error/error.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="main-container" *ngIf="longJson">
<p class="text">{{longJson.sessionExpired}}, {{longJson.clickHere2}} <span class="navigate-link" (click)="login()">{{longJson.clickHere}}</span> {{longJson.login}}</p>
</div>
31 changes: 31 additions & 0 deletions resident-ui/src/app/feature/error/error/error.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { LoginRedirectService } from 'src/app/core/services/loginredirect.service';
import { TranslateService } from '@ngx-translate/core';

@Component({
selector: 'app-error',
templateUrl: './error.component.html',
styleUrls: ['./error.component.css']
})
export class ErrorComponent implements OnInit {
redirectUrl:string;
longJson:any;
constructor(
private redirectService: LoginRedirectService,
private translateService: TranslateService
) { }

ngOnInit() {
this.translateService
.getTranslation(localStorage.getItem("langCode"))
.subscribe(response => {
this.longJson = response.genericmessage;
console.log(this.longJson)
});
let urlData = window.location.href.split('#', )
this.redirectUrl = urlData[0] + "/#/" + "uinservices/dashboard"
}
login(){
this.redirectService.redirect(this.redirectUrl);
}
}

0 comments on commit be1425e

Please sign in to comment.