Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- 1.*
- MOSIP*
- tf_nira_dev
- digital_card

jobs:
build-admin-ui:
Expand Down
7 changes: 7 additions & 0 deletions admin-ui/src/app/core/services/data-storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ export class DataStorageService {
);
}

sentPacketToPerso(data: FormData) {
return this.http.post(
this.BASE_URL + 'admin' + '/packetstatusupdate/sentToPerso',
data
);
}

getCreateUpdateSteps(entity: string) {
return this.http.get(`./assets/create-update-steps/${entity}-steps.json`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<button mat-raised-button (click)="resume()" *ngIf="id && roles.includes('GLOBAL_ADMIN')" style="margin-left: 50px; background-color: #FF4081; color: white; height: 30px; width: 80px;">
{{ 'packet-status.resume' | translate }}
</button>
<button mat-raised-button (click)="sentToPerso()" *ngIf="id && showSendToPerso" style="margin-left: 50px; background-color: #FF4081; color: white; height: 30px; width: 120px;">
{{ 'packet-status.sentToPerso' | translate }}
</button>
<mat-error style="margin-left: 30px ;font-size: 9.5px" *ngIf="error">{{errorMessage | translate}}</mat-error>
</mat-card>
<mat-card *ngIf="showDetails" style="border-radius: 0;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class PacketStatusComponent implements OnInit {
// status: 'Completed'
// }
];
showSendToPerso: boolean = false;
roles: string[] = [];
showDetails = false;
showTimeline = false;
Expand Down Expand Up @@ -97,6 +98,9 @@ export class PacketStatusComponent implements OnInit {
this.error = false;
this.showDetails = true;
console.log("Final status is ", this.statusCheck)

this.showSendToPerso = this.data.some(item =>item.transactionTypeCode === 'PRINT_SERVICE' &&
item.statusCode === 'PROCESSED' || item.statusCode === 'COMPLETED');
}
});
}
Expand Down Expand Up @@ -131,6 +135,34 @@ export class PacketStatusComponent implements OnInit {
});
}

sentToPerso(){
if (!this.id) {
this.error = true;
this.errorMessage = 'Invalid packet id';
return;
}

const formData = new FormData();
formData.append('rid', this.id);
formData.append('langCode', this.headerService.getUserPreferredLanguage());

this.dataStorageService.sentPacketToPerso(formData).subscribe({
next: (response) => {
console.log('Sent Packet to Perso API Response:', response);
this.error = false;
const res: any = response;
if (res && res.response && res.response.message) {
const message = res.response.message;
if(message.startsWith('Card details sent')){
this.showPopup('Success', res.response.message, 'Close', 'success');
} else {
this.showPopup('Error', res.response.message, 'Close', 'error');
}
}
}
});
}

showPopup(title: string, message: string, buttonText: string, type: 'success' | 'error') {
this.popupTitle = title;
this.popupMessage = message;
Expand Down
1 change: 1 addition & 0 deletions admin-ui/src/assets/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@
"viewMore": "View More",
"viewLess": "View Less",
"resume": "Resume",
"sentToPerso": "Send to Perso",
"errorMessages": {
"title": "Error",
"message": "RID Not Found",
Expand Down
Loading