Date: Mon, 4 Dec 2023 07:32:08 +0530
Subject: [PATCH 06/10] transfer drop down issue fix
---
src/app/closure/closure.component.html | 2 +-
src/app/closure/closure.component.ts | 55 ++++++++++++++++++++
src/app/innerpage/innerpage.component.ts | 2 +
src/app/services/dataService/data.service.ts | 9 ++++
4 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/src/app/closure/closure.component.html b/src/app/closure/closure.component.html
index f2d2694..de773f1 100644
--- a/src/app/closure/closure.component.html
+++ b/src/app/closure/closure.component.html
@@ -109,7 +109,7 @@ {{currentLanguageSet?.closure}}
Select none
- {{availableService.subServiceName}}
+ {{availableService.subServiceName}}
diff --git a/src/app/closure/closure.component.ts b/src/app/closure/closure.component.ts
index 2ff1d12..a239187 100644
--- a/src/app/closure/closure.component.ts
+++ b/src/app/closure/closure.component.ts
@@ -139,6 +139,8 @@ export class ClosureComponent implements OnInit {
enableInstitute: boolean = false;
varRefral : any;
appointmnetSuccessFlag : boolean;
+ benDetailsSelectedData: any;
+ transferCallArr: Array = [];
constructor(
public dialog: MdDialog,
@@ -205,6 +207,14 @@ export class ClosureComponent implements OnInit {
(err) => {}
);
+ this._availableServices.getServices(requestObject).subscribe(
+ (response) => {
+ // this.callTypeObj = response;
+ this.populateTransferDropDown(response);
+ },
+ (err) => { }
+ );
+
this.saved_data.serviceAvailed.subscribe((data) => {
this.serviceAvailed = true;
});
@@ -1516,4 +1526,49 @@ export class ClosureComponent implements OnInit {
}
})
}
+
+ populateTransferDropDown(response: any) {
+ // this.benDetailsSelectedData = this.saved_data.benDetailsSelected;
+ this.saved_data.isBenDetails$.subscribe((value) => {
+ this.benDetailsSelectedData = value;
+
+ if ((this.current_role.toUpperCase() === "RO") && (this.benDetailsSelectedData === null || this.benDetailsSelectedData === undefined || this.benDetailsSelectedData === "")) {
+ if (response !== null || response !== undefined || response.length > 0) {
+ this.transferCallArr = response.filter(function (item) {
+ return item.subServiceName === 'Health Advisory Service';
+ });
+ }
+
+ }
+
+ else {
+ if (response !== null || response !== undefined || response.length > 0) {
+ this.transferCallArr = response;
+ // transferCallArr = response;
+ }
+ }
+ // transferDropdown();
+
+ });
+
+ // let transferCallArr : Array = [];
+
+ // if ((this.current_role.toUpperCase() === "RO") && (this.benDetailsSelectedData === null || this.benDetailsSelectedData === undefined || this.benDetailsSelectedData === "")) {
+ // if (response !== null || response !== undefined || response.length > 0) {
+ // this.transferCallArr = response.filter(function (item) {
+ // return item.subServiceName === 'Health Advisory Service';
+ // });
+ // }
+
+ // }
+
+ // else {
+ // if (response !== null || response !== undefined || response.length > 0) {
+ // this.transferCallArr = response;
+ // // transferCallArr = response;
+ // }
+ // }
+
+ }
+
}
diff --git a/src/app/innerpage/innerpage.component.ts b/src/app/innerpage/innerpage.component.ts
index 0888526..b229dbb 100644
--- a/src/app/innerpage/innerpage.component.ts
+++ b/src/app/innerpage/innerpage.component.ts
@@ -496,6 +496,8 @@ export class InnerpageComponent implements OnInit, OnDestroy {
this.selectedBenData.caste = res[0].i_bendemographics.communityName
? res[0].i_bendemographics.communityName
: undefined;
+
+ this.getCommonData.getBenDetailsOfCall(this.selectedBenData);
}
}
diff --git a/src/app/services/dataService/data.service.ts b/src/app/services/dataService/data.service.ts
index 99b6265..d8cbfb8 100644
--- a/src/app/services/dataService/data.service.ts
+++ b/src/app/services/dataService/data.service.ts
@@ -24,6 +24,7 @@
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
+import { BehaviorSubject } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import 'rxjs/add/operator/catch';
@@ -69,6 +70,9 @@ export class dataService {
outboundBloodReqtID: any;
avoidingEvent: boolean = false;
transactionId:any;
+ isBenDetails: any="";
+ isBenDetailsData = new BehaviorSubject(this.isBenDetails);
+ isBenDetails$ = this.isBenDetailsData.asObservable();
// bpQuestionTypeId = 18;
// diabeticQuestionTypeId = 19;
@@ -116,5 +120,10 @@ export class dataService {
benDataInRO: any;
apiCalledForInbound=false;
appLanguage:any="English";
+
+ getBenDetailsOfCall(value : any){
+ this.isBenDetails = value;
+ this.isBenDetailsData.next(this.isBenDetails);
+ }
};
From 4fa22706a969c1bf35f46d100f6f8f292ac5e4db Mon Sep 17 00:00:00 2001
From: Parth Kothari
Date: Wed, 20 Dec 2023 21:03:28 +0530
Subject: [PATCH 07/10] Change in logic for transfer dropdown for call type
valid
---
src/app/closure/closure.component.ts | 62 ++++++++++++++++----
src/app/services/dataService/data.service.ts | 4 ++
2 files changed, 53 insertions(+), 13 deletions(-)
diff --git a/src/app/closure/closure.component.ts b/src/app/closure/closure.component.ts
index a239187..a1aa098 100644
--- a/src/app/closure/closure.component.ts
+++ b/src/app/closure/closure.component.ts
@@ -36,7 +36,7 @@ import { dataService } from "../services/dataService/data.service";
import { CallServices } from "../services/callservices/callservice.service";
import { FeedbackResponseModel } from "../sio-grievience-service/sio-grievience-service.component";
import { MdDialog } from "@angular/material";
-import { Observable } from "rxjs/Rx";
+import { Observable, Subscription } from "rxjs/Rx";
//import { Router } from '@angular/router';
import { Router } from "@angular/router";
import { ConfirmationDialogsService } from "./../services/dialog/confirmation.service";
@@ -141,6 +141,8 @@ export class ClosureComponent implements OnInit {
appointmnetSuccessFlag : boolean;
benDetailsSelectedData: any;
transferCallArr: Array = [];
+ private benDetailSubscription: Subscription;
+
constructor(
public dialog: MdDialog,
@@ -174,6 +176,7 @@ export class ClosureComponent implements OnInit {
ngOnInit() {
console.log("@@@@@@@@@@@@@@@@@@@@");
+ this.saved_data.clearBenData();
this.currentLanguageSetValue();
let today = new Date();
this.followupOn = today;
@@ -296,6 +299,10 @@ export class ClosureComponent implements OnInit {
})
.subscribe((response) => this.IDsuccessHandeler(response));
}
+
+ ngOnDestroy(){
+ this.benDetailSubscription.unsubscribe();
+ }
IDsuccessHandeler(res) {
this.commonData = res;
if (this.saved_data.caste) {
@@ -437,10 +444,31 @@ export class ClosureComponent implements OnInit {
// if(this.current_role=="Supervisor"){
// this.roleFlag=false;
- if (callType == "Valid" || callType == "Transfer" || callType == "Referral") {
- this.validTrans = true;
- this.nuisanceBLock = false;
- } else {
+ if (callType.toLowerCase() === "valid" || callType.toLowerCase() === "transfer" || callType.toLowerCase() === "referral") {
+ // this.validTrans = true;
+ this.nuisanceBLock = false;
+ this.benDetailSubscription = this.saved_data.isBenDetails$.subscribe((value) => {
+ this.benDetailsSelectedData = value;
+ if(this.benDetailsSelectedData === null || this.benDetailsSelectedData === undefined || this.benDetailsSelectedData === ""){
+ if(callType.toLowerCase() === "transfer"){
+ this.validTrans = true;
+ }
+ else{
+ this.validTrans = false;
+ }
+ }
+ else{
+ this.validTrans = true;
+
+ }
+
+
+ // transferDropdown();
+
+ });
+
+ }
+ else {
this.validTrans = false;
this.nuisanceBLock = true; // this is done to disable S & COntinue in case of incomplete
}
@@ -566,7 +594,6 @@ export class ClosureComponent implements OnInit {
values.isFollowupRequired = this.doFollow;
values.isTransfered = this.doTransfer;
values.isFeedback = this.isFeedbackRequiredFlag;
-
if (values.isFollowupRequired == undefined) {
values.isFollowupRequired = false;
}
@@ -625,8 +652,12 @@ export class ClosureComponent implements OnInit {
values.isCompleted = true;
this.updateOutboundCallStatus(values);
}
+ // this.benDetailSubscription.unsubscribe();
+ console.log("BEN DETAILS CHECK***");
+ this.saved_data.clearBenData();
this.checkForSubmitCloseBtnType(btnType);
}
+
},
(err) => {
console.log(err);
@@ -639,9 +670,12 @@ export class ClosureComponent implements OnInit {
);
}
this.submitContinueBtnType(btnType);
+
}
+
}
+
setbenRegID(values) {
if (this.saved_data !== undefined && this.saved_data !== null) {
this.beneficiaryDetails =
@@ -891,6 +925,7 @@ export class ClosureComponent implements OnInit {
transferToCampaign,
"success"
);
+
sessionStorage.removeItem("onCall");
sessionStorage.removeItem("CLI");
this.router.navigate(["/MultiRoleScreenComponent/dashboard"]);
@@ -908,6 +943,7 @@ export class ClosureComponent implements OnInit {
);
}
}
+
}
transferEmergencyCallSuccessHandeler(response, transferToCampaign) {
@@ -1529,16 +1565,16 @@ export class ClosureComponent implements OnInit {
populateTransferDropDown(response: any) {
// this.benDetailsSelectedData = this.saved_data.benDetailsSelected;
- this.saved_data.isBenDetails$.subscribe((value) => {
+ this.benDetailSubscription = this.saved_data.isBenDetails$.subscribe((value) => {
this.benDetailsSelectedData = value;
if ((this.current_role.toUpperCase() === "RO") && (this.benDetailsSelectedData === null || this.benDetailsSelectedData === undefined || this.benDetailsSelectedData === "")) {
- if (response !== null || response !== undefined || response.length > 0) {
- this.transferCallArr = response.filter(function (item) {
- return item.subServiceName === 'Health Advisory Service';
- });
- }
-
+ if (response !== null || response !== undefined || response.length > 0) {
+ this.transferCallArr = response.filter(function (item) {
+ return item.subServiceName === 'Health Advisory Service';
+ });
+ }
+
}
else {
diff --git a/src/app/services/dataService/data.service.ts b/src/app/services/dataService/data.service.ts
index d8cbfb8..7e1d113 100644
--- a/src/app/services/dataService/data.service.ts
+++ b/src/app/services/dataService/data.service.ts
@@ -125,5 +125,9 @@ export class dataService {
this.isBenDetails = value;
this.isBenDetailsData.next(this.isBenDetails);
}
+ clearBenData(){
+ this.isBenDetails = null;
+ this.isBenDetailsData.next(this.isBenDetails);
+ }
};
From 52d4fc2a6210d3c2b0906c9842a863dafaae0fff Mon Sep 17 00:00:00 2001
From: Parth Kothari
Date: Wed, 20 Dec 2023 21:07:29 +0530
Subject: [PATCH 08/10] small space correction
---
src/app/closure/closure.component.ts | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/app/closure/closure.component.ts b/src/app/closure/closure.component.ts
index a1aa098..097594a 100644
--- a/src/app/closure/closure.component.ts
+++ b/src/app/closure/closure.component.ts
@@ -445,7 +445,6 @@ export class ClosureComponent implements OnInit {
// this.roleFlag=false;
if (callType.toLowerCase() === "valid" || callType.toLowerCase() === "transfer" || callType.toLowerCase() === "referral") {
- // this.validTrans = true;
this.nuisanceBLock = false;
this.benDetailSubscription = this.saved_data.isBenDetails$.subscribe((value) => {
this.benDetailsSelectedData = value;
@@ -458,13 +457,8 @@ export class ClosureComponent implements OnInit {
}
}
else{
- this.validTrans = true;
-
+ this.validTrans = true;
}
-
-
- // transferDropdown();
-
});
}
From 2bd35930a72c83de3961e9dbaa81ef9400a26dd1 Mon Sep 17 00:00:00 2001
From: Parth Kothari
Date: Thu, 21 Dec 2023 10:33:17 +0530
Subject: [PATCH 09/10] Change in condition
---
src/app/closure/closure.component.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/closure/closure.component.ts b/src/app/closure/closure.component.ts
index 097594a..d67a3eb 100644
--- a/src/app/closure/closure.component.ts
+++ b/src/app/closure/closure.component.ts
@@ -1563,7 +1563,7 @@ export class ClosureComponent implements OnInit {
this.benDetailsSelectedData = value;
if ((this.current_role.toUpperCase() === "RO") && (this.benDetailsSelectedData === null || this.benDetailsSelectedData === undefined || this.benDetailsSelectedData === "")) {
- if (response !== null || response !== undefined || response.length > 0) {
+ if (response !== null && response !== undefined && response.length > 0) {
this.transferCallArr = response.filter(function (item) {
return item.subServiceName === 'Health Advisory Service';
});
@@ -1572,7 +1572,7 @@ export class ClosureComponent implements OnInit {
}
else {
- if (response !== null || response !== undefined || response.length > 0) {
+ if (response !== null && response !== undefined && response.length > 0) {
this.transferCallArr = response;
// transferCallArr = response;
}
From 7f8d63c8a9fd5771e82eb8c30990d7941728fc6f Mon Sep 17 00:00:00 2001
From: Parth Kothari
Date: Thu, 21 Dec 2023 12:49:53 +0530
Subject: [PATCH 10/10] change in logic for 104ui
---
src/app/closure/closure.component.ts | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/app/closure/closure.component.ts b/src/app/closure/closure.component.ts
index d67a3eb..bd6a290 100644
--- a/src/app/closure/closure.component.ts
+++ b/src/app/closure/closure.component.ts
@@ -176,7 +176,6 @@ export class ClosureComponent implements OnInit {
ngOnInit() {
console.log("@@@@@@@@@@@@@@@@@@@@");
- this.saved_data.clearBenData();
this.currentLanguageSetValue();
let today = new Date();
this.followupOn = today;