Skip to content

Commit

Permalink
Merge pull request #441 from Madhuravas/develop
Browse files Browse the repository at this point in the history
MOSIP-29033 resolved to refresh track service details
  • Loading branch information
aranaravi authored Aug 23, 2023
2 parents 42ea749 + 53e6cd6 commit 00ca19b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<span class="breadcrumb">
<a (click)="onItemSelected('uinservices/dashboard')">{{'dashboard.uinservices' | translate}} &nbsp;&nbsp;</a> >
&nbsp;&nbsp;<a (click)="onItemSelected('uinservices/viewhistory')" *ngIf="source">{{"trackservicerequest.source" | translate}}&nbsp;&nbsp;></a>
&nbsp;<a (click)="onItemSelected('uinservices/viewhistory')" *ngIf="source">{{"trackservicerequest.source" | translate}}&nbsp;&nbsp;></a>
&nbsp;&nbsp;<span class="active">{{'trackservicerequest.title' | translate}}</span>
</span>

Expand Down Expand Up @@ -30,7 +30,7 @@
(input)="captureValue($event)"
placeholder="{{'trackservicerequest.searchPlaceholder' | translate}}" />&nbsp;&nbsp;&nbsp;&nbsp;
<button [disabled]="disableTrackBtn" id="getEIDStatusbtn" mat-raised-button class="track-btn"
(click)="getEIDStatus()">{{'trackservicerequest.searchButton' | translate}}</button>
(click)="getEIDStatusByInput()">{{'trackservicerequest.searchButton' | translate}}</button>
<p *ngIf="showWarningMessage" class="warning-message">{{'trackservicerequest.warningMsg' | translate}}</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export class TrackservicerequestComponent implements OnInit, OnDestroy {
this.eventIdValidation =this.appConfigService.getConfig()["resident.validation.event-id.regex"];
this.route.queryParams
.subscribe(params => {
this.source = params.source
if(params.source){
this.source = params.source
}
this.eidVal = params.eid;
this.getEIDStatus();
}
Expand Down Expand Up @@ -93,8 +95,11 @@ export class TrackservicerequestComponent implements OnInit, OnDestroy {
}
}

getEIDStatusByInput(){
this.router.navigateByUrl(`uinservices/trackservicerequest?eid=` + this.eidVal);
}

getEIDStatus(){
this.isLoading = true;
this.auditService.audit('RP-026', 'Track Service Request', 'RP-Track Service Request', 'Track Service Request', 'User clicks on "search" button');
if(this.eidVal){
this.dataStorageService
Expand All @@ -106,6 +111,7 @@ export class TrackservicerequestComponent implements OnInit, OnDestroy {
}else if(response["errors"]){
this.isLoading = false;
this.showErrorPopup(response["errors"])
this.eidStatus = ""
}

});
Expand Down Expand Up @@ -149,27 +155,29 @@ export class TrackservicerequestComponent implements OnInit, OnDestroy {
}

showErrorPopup(message: string) {
console.log("Hello")
this.errorCode = message[0]["errorCode"]
if(this.errorCode === "RES-SER-410"){
let errorMessageType = message[0]["message"].split("-")[1].trim()
this.message = this.popupMessages.serverErrors[this.errorCode][errorMessageType]
}else{
this.message = this.popupMessages.serverErrors[this.errorCode]
}

this.dialog
.open(DialogComponent, {
width: '550px',
data: {
case: 'MESSAGE',
title: this.popupMessages.genericmessage.errorLabel,
message: this.message,
btnTxt: this.popupMessages.genericmessage.successButton,
isOk:"OK"
},
disableClose: true
});
setTimeout(() =>{
if(this.errorCode === "RES-SER-410"){
let errorMessageType = message[0]["message"].split("-")[1].trim()
this.message = this.popupMessages.serverErrors[this.errorCode][errorMessageType]
}else{
this.message = this.popupMessages.serverErrors[this.errorCode]
}

this.dialog
.open(DialogComponent, {
width: '550px',
data: {
case: 'MESSAGE',
title: this.popupMessages.genericmessage.errorLabel,
message: this.message,
btnTxt: this.popupMessages.genericmessage.successButton,
isOk:"OK"
},
disableClose: true
});
},1000)

}

downloadVIDCard(eventId:any){
Expand Down

0 comments on commit 00ca19b

Please sign in to comment.