Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging develop to master #19

Merged
merged 18 commits into from
Dec 22, 2023
Merged
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
2 changes: 1 addition & 1 deletion src/app/closure/closure.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h4 class="f-s-b m-t-10 m-b-10">{{currentLanguageSet?.closure}}</h4>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 p-b-1-5" *ngIf="validTrans">
<md-select [disabled]="disableTransfer" placeholder="{{currentLanguageSet?.transferCall}}" name="transferCall" [(ngModel)]="transferCall" (change)="chooseService(transferCall)" [style.width]="'100%'" [disabled]="current_campaign=='OUTBOUND'">
<md-option [value]="">Select none</md-option>
<md-option *ngFor="let availableService of services" [value]="availableService.subServiceName">{{availableService.subServiceName}}</md-option>
<md-option *ngFor="let availableService of transferCallArr" [value]="availableService.subServiceName">{{availableService.subServiceName}}</md-option>
</md-select>
</div>

Expand Down
96 changes: 90 additions & 6 deletions src/app/closure/closure.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -139,6 +139,10 @@ export class ClosureComponent implements OnInit {
enableInstitute: boolean = false;
varRefral : any;
appointmnetSuccessFlag : boolean;
benDetailsSelectedData: any;
transferCallArr: Array<any> = [];
private benDetailSubscription: Subscription;


constructor(
public dialog: MdDialog,
Expand Down Expand Up @@ -205,6 +209,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;
});
Expand Down Expand Up @@ -286,6 +298,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) {
Expand Down Expand Up @@ -427,10 +443,25 @@ 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.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;
}
});

}
else {
this.validTrans = false;
this.nuisanceBLock = true; // this is done to disable S & COntinue in case of incomplete
}
Expand Down Expand Up @@ -556,7 +587,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;
}
Expand Down Expand Up @@ -615,8 +645,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);
Expand All @@ -629,9 +663,12 @@ export class ClosureComponent implements OnInit {
);
}
this.submitContinueBtnType(btnType);

}

}


setbenRegID(values) {
if (this.saved_data !== undefined && this.saved_data !== null) {
this.beneficiaryDetails =
Expand Down Expand Up @@ -881,6 +918,7 @@ export class ClosureComponent implements OnInit {
transferToCampaign,
"success"
);

sessionStorage.removeItem("onCall");
sessionStorage.removeItem("CLI");
this.router.navigate(["/MultiRoleScreenComponent/dashboard"]);
Expand All @@ -898,6 +936,7 @@ export class ClosureComponent implements OnInit {
);
}
}

}

transferEmergencyCallSuccessHandeler(response, transferToCampaign) {
Expand Down Expand Up @@ -1516,4 +1555,49 @@ export class ClosureComponent implements OnInit {
}
})
}

populateTransferDropDown(response: any) {
// this.benDetailsSelectedData = this.saved_data.benDetailsSelected;
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';
});
}

}

else {
if (response !== null && response !== undefined && response.length > 0) {
this.transferCallArr = response;
// transferCallArr = response;
}
}
// transferDropdown();

});

// let transferCallArr : Array<any> = [];

// 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;
// }
// }

}

}
2 changes: 2 additions & 0 deletions src/app/innerpage/innerpage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
13 changes: 13 additions & 0 deletions src/app/services/dataService/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -116,5 +120,14 @@ export class dataService {
benDataInRO: any;
apiCalledForInbound=false;
appLanguage:any="English";

getBenDetailsOfCall(value : any){
this.isBenDetails = value;
this.isBenDetailsData.next(this.isBenDetails);
}
clearBenData(){
this.isBenDetails = null;
this.isBenDetailsData.next(this.isBenDetails);
}

};
4 changes: 3 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.png">
<script>
document.write('<base href="' + encodeURIComponent(document.location) + '" />');
var baseTag = document.createElement('base');
baseTag.href = document.location.href;
document.head.appendChild(baseTag);
window.console.log = function() {}
window.console.warn = function() {}
</script>
Expand Down
Loading