Skip to content

Commit

Permalink
Merge pull request #331 from chaitrali-r/main
Browse files Browse the repository at this point in the history
Abha Changes
  • Loading branch information
Pratikshakhandagale authored Jul 12, 2023
2 parents 9b1c531 + 0a69a6e commit c848ae8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 30 deletions.
54 changes: 27 additions & 27 deletions donor-registry/src/app/forms/types/verify-identity-no.type.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h3 class="fw-bold mb-3">Thank you for your enthusiasm. </h3>
</div>
</div>
</div>
<div *ngIf="isGotErr && !err401 && canRegister" class="modal-dialog" role="document">
<div *ngIf="isGotErr && !err401 && canRegister && !err409" class="modal-dialog" role="document">
<div class="p-4 modal-content">
<div class="modal-body text-center">
<div class="d-flex flex-column justify-content-center align-items-center">
Expand Down Expand Up @@ -77,6 +77,31 @@ <h3 class="fw-bold mb-3">Thank you for your enthusiasm. </h3>
</div>
</div>

<div *ngIf="isGotErr && err409" class="modal-dialog" role="document">
<div class="p-4 modal-content">
<div class="modal-body text-center">
<div class="d-flex flex-column justify-content-center align-items-center">

<div>
<span class="p24 mb-2 mt-2 mb-2 fw-bold">Already Registered</span>

<br>

<br>
<span *ngIf="errorMessage" class="p16 mb-2 mt-2 mb-2 fw-bold">{{errorMessage}}</span>
<br />
<br />

</div>
<div class="container-fluid mt-3">
<button type="button" class="btn btn-primary-notto btn-style w-100 submit-button mb-2"
data-toggle="modal" data-dismiss="modal" aria-label="Close">OK</button>
</div>
</div>
</div>
</div>
</div>

<div *ngIf="(!isGotErr || err401) && showConfirmPopup" class="modal-dialog" role="document">
<div class="p-4 modal-content">
<div class="close float-end" data-dismiss="modal" aria-label="Close">
Expand Down Expand Up @@ -127,30 +152,5 @@ <h5 class="modal-title">Modal title</h5>
</div>
</div>

<!-- Error message handled -->
<div class="modal fade hide" id="errorMessagePop" tabindex="-1" role="dialog"
aria-labelledby="errorMessagePop" aria-hidden="true" data-keyboard="false" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="p-4 modal-content text-center">
<div class="modal-body">
<!-- ------------------------ -->
<span class="p24 mb-2 mt-2 mb-2 fw-bold">{{errHeading}}</span>
<br /><br />
<span class="p12 lh-32">{{errorMessage}}</span> <br /><br />
<div class="d-flex justify-content-center">
<button [hidden]="err409" type="button" data-dismiss="modal"
class="btn btn-primary-notto btn-style w-50 submit-button mb-2">
{{'OK' | translate}}
</button>
<a [hidden]="!err409" href="/login"> <button type="button"
class="btn btn-primary-notto btn-style w-100 submit-button mb-2">
{{'LOGIN' | translate}}
</button></a>
</div>
</div>
</div>
</div>
</div>

</div>


17 changes: 14 additions & 3 deletions donor-registry/src/app/forms/types/verify-identity-no.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ export class VerifyIndentityCode extends FieldType {
showConfirmPopup:boolean = false;
err409: boolean;
errHeading: string;
errorCode: any;


constructor(private http: HttpClient, public generalService: GeneralService,public router: Router,) {
super();
}

ngOnInit(): void {
if(this.router.url == "/form/signup"){
if(this.router.url == "/form/signup"){
this.signupForm = true;
}
localStorage.removeItem('form_value');
Expand Down Expand Up @@ -71,6 +73,7 @@ export class VerifyIndentityCode extends FieldType {
this.isIdentityNo = true;
this.isConfirmPopup = true;
this.showConfirmPopup = true;
console.log(data);
this.transactionId = data.txnId;
},
error: (error) => {
Expand All @@ -81,6 +84,7 @@ export class VerifyIndentityCode extends FieldType {
localStorage.getItem('formtype') != 'recipient' &&
localStorage.getItem('formtype') != 'livedonor'
) {
// alert(this.errorMessage);
}
this.isGotErr = true;
this.isAbhaNoErr = true;
Expand Down Expand Up @@ -179,6 +183,7 @@ export class VerifyIndentityCode extends FieldType {
},
error: (error) => {
this.errorMessage = error?.error['message'];
this.closeAllModal();
this.customErrCode = (error?.error['status'])? error?.error['status'] : "";
if( error?.error['status'] == '401')
{
Expand All @@ -188,6 +193,7 @@ export class VerifyIndentityCode extends FieldType {
this.err401 = true;
this.err429 = false;
this.optVal = "";
this.err409 = false;
}
if( error?.error['status'] == '429')
{
Expand All @@ -196,14 +202,17 @@ export class VerifyIndentityCode extends FieldType {
this.isIdentityNo = true;
this.err401 = false;
this.err429 = true;
this.err409 = false;

}
if (error?.error['status'] == '409') {
this.isGotErr = true;
console.log(error);
this.errorCode = error?.error['code'];
this.err409 = true;
this.errHeading = 'Already Pledged';
this.errorMessage = error?.error['message'];
this.closeAllModal();
this.openPopup('errorMessagePop');

}

console.error('There was an error!', error);
Expand All @@ -212,6 +221,7 @@ export class VerifyIndentityCode extends FieldType {
}
}
openPopup(id) {
console.log(id);
var button = document.createElement("button");
button.setAttribute('data-toggle', 'modal');
button.setAttribute('data-target', `#${id}`);
Expand All @@ -235,6 +245,7 @@ export class VerifyIndentityCode extends FieldType {
}

}

closePops(id) {
$(id).modal('hide');
Array.from(document.querySelectorAll('.modal-backdrop')).forEach((el) => el.classList.remove('modal-backdrop'));
Expand Down

0 comments on commit c848ae8

Please sign in to comment.