From 195faa695879501cbb044f9530a8dd62b5d14cce Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 31 Aug 2020 20:16:55 +0530 Subject: [PATCH] Fairoj : Tele PD and General Feedback and video call auto disconnection features are added --- .../list-pd/add-pd/add-pd.component.html | 7 +- .../list-pd/add-pd/add-pd.component.ts | 33 +- .../edit-pd-master.component.html | 7 +- .../edit-pd-master.component.ts | 32 +- .../forms/address/address.component.html | 8 + .../forms/address/address.component.ts | 8 + .../assets-info/assets-info.component.html | 7 +- .../assets-info/assets-info.component.ts | 21 ++ .../banking-details.component.html | 7 +- .../banking-details.component.ts | 32 +- .../business-banking-details.component.html | 7 +- .../business-banking-details.component.ts | 30 +- .../business-info.component.html | 292 ++++++++++++++---- .../business-info/business-info.component.ts | 63 +++- .../current-loan/current-loan.component.html | 7 +- .../current-loan/current-loan.component.ts | 35 +++ .../general-info/general-info.component.html | 21 +- .../general-info/general-info.component.ts | 46 +++ .../app/video-chat/video-chat.component.ts | 39 ++- 19 files changed, 622 insertions(+), 80 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index c5bc7fba6..537e78fdc 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -16,8 +16,13 @@ + + + Select - + {{LL.full_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index fca08ff5b..7ec722773 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -10,7 +10,7 @@ import { TitleCasePipe } from '@angular/common'; /**sweet alert */ import Swal from 'sweetalert2'; import { takeUntil } from 'rxjs/operators'; -import { Subject } from 'rxjs'; +import { Subject, ReplaySubject } from 'rxjs'; @Component({ selector: 'app-add-pd', templateUrl: './add-pd.component.html', @@ -65,6 +65,11 @@ export class AddPdComponent implements OnInit, OnDestroy { stateData: any=[]; billingtolist: any; removedControl: any = []; + + public lenderFilterCtrl:FormControl = new FormControl(); + public filteredLenderList:ReplaySubject = new ReplaySubject(1); + + constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, private titleCase : TitleCasePipe) { @@ -90,7 +95,7 @@ export class AddPdComponent implements OnInit, OnDestroy { this.getTitleMaster(); // this.getProCusPDType() this.loadFormData(); - + this.filterList() } getProCusPDType(entity_id){ console.log(entity_id); @@ -251,6 +256,7 @@ export class AddPdComponent implements OnInit, OnDestroy { data => { if (data.status == 200) { this.lenderList = data.records + this.filteredLenderList.next(this.lenderList.slice()); } }, error => this.errorMessage = error); } @@ -1102,5 +1108,28 @@ searchFun(control:any,i:number,option){ // this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1) // ) } + filterList() { + this.lenderFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.lenderFilterCtrl.value,this.filteredLenderList,this.lenderList,'full_name') + }) + + } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index 752578a92..b10dcb3fc 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -22,11 +22,16 @@ + + + Select - {{LL.full_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index 424eb3e9e..d53983f60 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -8,7 +8,7 @@ import { TitleCasePipe } from '@angular/common'; import { getRandomString } from 'selenium-webdriver/safari'; import Swal from 'sweetalert2' import { takeUntil } from 'rxjs/operators'; -import { Subject } from 'rxjs'; +import { Subject, ReplaySubject } from 'rxjs'; @Component({ selector: 'app-edit-pd-master', @@ -74,6 +74,11 @@ export class EditPdMasterComponent implements OnInit { finInstitutionList: any; billingtolist: any; removedControl: any = []; + + public lenderFilterCtrl:FormControl = new FormControl(); + public filteredLenderList:ReplaySubject = new ReplaySubject(1); + + constructor(private _fb: FormBuilder, private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) { @@ -97,6 +102,7 @@ export class EditPdMasterComponent implements OnInit { setTimeout(()=>{ this.loadFormData(); },500) + this.filterList() } getProCusPDType(entity_id,option?){ @@ -163,6 +169,7 @@ export class EditPdMasterComponent implements OnInit { data => { if (data.status == 200) { this.lenderList=data.records; + this.filteredLenderList.next(this.lenderList.slice()) if(this.data.records.fk_lender_id != null){ if(this.data.records.fk_lender_id){ this.getProCusPDType(this.data.records.fk_lender_id,'start') @@ -992,4 +999,27 @@ searchFun(control:any,i:number,option){ // this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1) // ) } + filterList() { + this.lenderFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.lenderFilterCtrl.value,this.filteredLenderList,this.lenderList,'full_name') + }) + + } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index 4a5f1f083..6ed6fc463 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -216,6 +216,14 @@
+ + + Select + Yes + No + + Address Proof is Required + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index 0b725742d..ea169e3da 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -191,6 +191,7 @@ export class AddressComponent implements OnInit { if(datas.comment_locality) { this.addressForm.controls.comment_locality.setValue(datas.comment_locality); } + this.addressForm.controls.locality.setValue(datas.locality ? datas.locality : ''); if (datas.locality) { @@ -235,6 +236,7 @@ export class AddressComponent implements OnInit { this.addressForm = this.fb.group({ addresses: this.fb.array([]), is_pd_done_on_initiated_address: [true], + address_proof_provided: [''], address_type: ['', Validators.compose([Validators.required])], locality: ['', Validators.compose([Validators.required])], locality_mixuse: [''], @@ -543,6 +545,7 @@ export class AddressComponent implements OnInit { records.pdid = this.pdid; records.parent_pdid = this.parent_pdid; records.formid = '5'; + records.address_proof_provided = this.addressForm.controls.address_proof_provided.value; // records.fk_createdby = '250'; // console.log(JSON.stringify(records)); @@ -652,6 +655,8 @@ export class AddressComponent implements OnInit { records.pdid = this.pdid; records.parent_pdid = this.parent_pdid; records.formid = '5'; + records.address_proof_provided = this.addressForm.controls.address_proof_provided.value; + console.log(this.addressForm.controls.address_proof_provided.value,records); // console.log('Final records', records); @@ -909,6 +914,9 @@ export class AddressComponent implements OnInit { } // this.addressForm.controls.was_the_company_name_board_sighted.setValue(data.records.hasOwnProperty('was_the_company_name_board_sighted') ? data.records.was_the_company_name_board_sighted : ''); this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark); + // if(datas.address_proof_provided) { + this.addressForm.controls.address_proof_provided.patchValue(data.records.address_proof_provided) + // } } else { this.loadPDAddressesDetails(); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html index c20ad41ee..c1705b5c8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html @@ -72,7 +72,12 @@
+ autocomplete="off" [matAutocomplete]="auto"> + + + {{address.value}} + + { + console.log('Address Check',data); + let initiated_address_check = data.records.hasOwnProperty('is_pd_done_on_initiated_address') ? data.records.is_pd_done_on_initiated_address : true; + this.addressList.push({ key_name: 'initiate_address', value: data.records.addresses[0].address, description: 'Initiated Address' }); + if (initiated_address_check == false ) { + this.addressList.push({ key_name: 'alternative_addresses', value: data.records.alternative_addresses[0].alternative_address, description: 'Alternative Address' }); + } + console.log(this.addressList); +// debugger; + }) +} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html index 34cfa044b..29113a2f3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html @@ -124,8 +124,13 @@ + + + Select - {{ + {{ btLen.lender_name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts index 774471643..07f062ed7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts @@ -23,6 +23,7 @@ import { import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import { ActivatedRoute, Router } from "@angular/router"; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; +import { ReplaySubject } from 'rxjs'; @Component({ selector: 'app-banking-details', templateUrl: './banking-details.component.html', @@ -53,6 +54,10 @@ export class BankingDetailsComponent implements OnInit { documentsAndFilesList: any = []; image_doc_params: { pdid: number; form_id: any; company_id: string; }; form_id: string; + + public bankFilterCtrl:FormControl = new FormControl(); + public filtered_m_btLenderList:ReplaySubject = new ReplaySubject(1); + constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, @@ -171,9 +176,31 @@ export class BankingDetailsComponent implements OnInit { }); // this.retriveFile(); - + this.filterList(); } - + filterList() { + this.bankFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.bankFilterCtrl.value,this.filtered_m_btLenderList,this.m_btLenderList,'lender_name') + }) + + } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); + } // ====================== getM_AccountType() { @@ -192,6 +219,7 @@ export class BankingDetailsComponent implements OnInit { this._pd.getAllMasterDatas('BTLENDERLIST').subscribe( data => { this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1); + this.filtered_m_btLenderList.next(this.m_btLenderList.slice()); }) } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html index 6d58fcd3c..ffc423b93 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html @@ -57,8 +57,13 @@ + + + Select - {{ + {{ btLen.lender_name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts index 211f12edd..7b8963c6d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts @@ -23,6 +23,7 @@ import { import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import { ActivatedRoute, Router } from "@angular/router"; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; +import { ReplaySubject } from 'rxjs'; @Component({ selector: 'app-business-banking-details', @@ -59,6 +60,9 @@ export class BusinessBankingDetailsComponent implements OnInit { image_doc_params: { pdid: number; form_id: any; company_id: String; }; form_id: string; + public bankFilterCtrl:FormControl = new FormControl(); + public filtered_m_btLenderList:ReplaySubject = new ReplaySubject(1); + constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, @@ -171,8 +175,31 @@ export class BusinessBankingDetailsComponent implements OnInit { } }); //this.retriveFile(); + this.filterList() } - + filterList() { + this.bankFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.bankFilterCtrl.value,this.filtered_m_btLenderList,this.m_btLenderList,'lender_name') + }) + + } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); + } // ====================== getM_AccountType() { @@ -191,6 +218,7 @@ export class BusinessBankingDetailsComponent implements OnInit { this._pd.getAllMasterDatas('BTLENDERLIST').subscribe( data => { this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1); + this.filtered_m_btLenderList.next(this.m_btLenderList.slice()) }) } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html index 03653e846..0d9f911e2 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html @@ -290,7 +290,12 @@ - + + + + {{SL.state_name}} @@ -298,8 +303,13 @@ - + + + + {{CL.city_name}} City Required @@ -332,8 +342,13 @@ States Where Max Sales Done for {{manufacturing.value.main_products}} - - + + + + {{MSL.state_name}} @@ -342,8 +357,13 @@ Cities Where Max Sales Done for {{manufacturing.value.main_products}} - - + + + + {{MCL.city_name}} @@ -420,7 +440,12 @@ - + + + + {{SL.state_name}} @@ -428,8 +453,13 @@ - + + + + {{CL.city_name}} City Required @@ -458,8 +488,13 @@ States Where Max Sales Done for {{manufacturing.value.main_products}} - - + + + + {{MSL.state_name}} @@ -468,8 +503,13 @@ Cities Where Max Sales Done for {{manufacturing.value.main_products}} - - + + + + {{MCL.city_name}} @@ -485,6 +525,11 @@ Countries Where The Export Is Being Done for {{manufacturing.value.main_products}} + + + {{CL.country_name}} @@ -582,7 +627,12 @@ - + + + + {{SL.state_name}} @@ -590,8 +640,13 @@ - + + + + {{CL.city_name}} @@ -623,8 +678,13 @@ States Where Max Sales Done for {{retail.value.main_products}} - - + + + + {{MSL.state_name}} @@ -634,8 +694,13 @@ Cities Where Max Sales Done for {{retail.value.main_products}} - - + + + + {{MCL.city_name}} @@ -713,7 +778,12 @@ - + + + + {{SL.state_name}} @@ -721,8 +791,13 @@ - + + + + {{CL.city_name}} @@ -752,8 +827,13 @@ States Where Max Sales Done for {{retail.value.main_products}} - - + + + + {{MSL.state_name}} @@ -763,8 +843,13 @@ Cities Where Max Sales Done for {{retail.value.main_products}} - - + + + + {{MCL.city_name}} @@ -782,6 +867,11 @@ + + + {{CL.country_name}} @@ -882,7 +972,12 @@ - + + + + {{SL.state_name}} @@ -890,8 +985,13 @@ - + + + + {{CL.city_name}} City Required @@ -922,8 +1022,13 @@ States Where Max Sales Done for {{wholesale.value.main_products}} - - + + + + {{MSL.state_name}} @@ -933,8 +1038,13 @@ Cities Where Max Sales Done for {{wholesale.value.main_products}} - - + + + + {{MCL.city_name}} @@ -1007,7 +1117,12 @@ - + + + + {{SL.state_name}} @@ -1015,8 +1130,13 @@ - + + + + {{CL.city_name}} City Required @@ -1047,8 +1167,13 @@ States Where Max Sales Done for {{wholesale.value.main_products}} - - + + + + {{MSL.state_name}} @@ -1058,8 +1183,13 @@ Cities Where Max Sales Done for {{wholesale.value.main_products}} - - + + + + {{MCL.city_name}} @@ -1078,6 +1208,11 @@ Countries Where The Export Is Being Done for {{wholesale.value.main_products}} + + + {{CL.country_name}} @@ -1177,7 +1312,12 @@ - + + + + {{SL.state_name}} @@ -1185,8 +1325,13 @@ - + + + + {{CL.city_name}} @@ -1216,8 +1361,13 @@ States Where Max Revenue From Services for {{serviceprovider.value.main_products}} - - + + + + {{MSL.state_name}} @@ -1227,8 +1377,13 @@ Cities Where Max Revenue From Services for {{serviceprovider.value.main_products}} - - + + + + {{MCL.city_name}} @@ -1301,7 +1456,12 @@ - + + + + {{SL.state_name}} @@ -1309,8 +1469,13 @@ - + + + + {{CL.city_name}} @@ -1341,8 +1506,13 @@ States Where Max Revenue From Services for {{serviceprovider.value.main_products}} - - + + + + {{MSL.state_name}} @@ -1352,8 +1522,13 @@ Cities Where Max Revenue From Services for {{serviceprovider.value.main_products}} - - + + + + {{MCL.city_name}} @@ -1369,6 +1544,11 @@ Countries Where The Export Is Being Done for {{serviceprovider.value.main_products}} + + + {{CL.country_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index 309351b20..f38d95def 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -29,7 +29,7 @@ import { DatePipe } from '@angular/common'; import Swal from 'sweetalert2'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { takeUntil } from 'rxjs/operators'; -import { Subject } from 'rxjs'; +import { Subject, ReplaySubject } from 'rxjs'; @Component({ selector: 'app-business-info', templateUrl: './business-info.component.html', @@ -106,6 +106,11 @@ export class BusinessInfoComponent implements OnInit { prod_catagory: any; fk_pd_type: any; vendor_data_answers: any = {documents_info:{}}; + + public stateFilterCtrl:FormControl = new FormControl(); + public cityFilterCtrl:FormControl = new FormControl(); + public filteredStateList:ReplaySubject=new ReplaySubject(1) + public filteredCityList:ReplaySubject=new ReplaySubject(1) constructor(notifier: NotifierService, @@ -686,7 +691,8 @@ export class BusinessInfoComponent implements OnInit { val.toUpperCase() == 'YES' ? this.businessForm.addControl('month_of_business_run', new FormControl('', Validators.required)) : this.businessForm.removeControl('month_of_business_run'); }); - // this.retriveFile(); + // this.retriveFile(); + this.filterDropDownDatas() } @@ -739,7 +745,11 @@ export class BusinessInfoComponent implements OnInit { } /************************* END OF VENDOR FORM DATAS *********************************/ - + filterDropDownDatas() { + this.stateFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.stateFilterCtrl.value,this.filteredStateList,this.stateList,'state_name') + }) + } public initBusinessForm(): void { this.businessForm = this.fb.group({ @@ -1375,6 +1385,7 @@ export class BusinessInfoComponent implements OnInit { data => { if (data.status == 200) { this.stateList = data.records + this.filteredStateList.next(this.stateList.slice()) } }); } @@ -1811,10 +1822,20 @@ export class BusinessInfoComponent implements OnInit { // filter cities for other than pan india - filterCity(datasource: any, filterid: number) { + filterCity(datasource: any, filterid: number,searchText?:String) { if (filterid) { let filter = datasource.filter(x => x.state_id == filterid); + let filter_output =[] + if(filter.length > 0){ + filter_output = filter[0].cities + } + if(searchText) { + searchText =searchText.toLowerCase(); + this.filteredCityList.next( filter_output.filter(vv => vv['city_name'].toLowerCase().indexOf(searchText) > -1)) + return + } return filter.length > 0 ? filter[0].cities : []; + } } @@ -1833,7 +1854,7 @@ export class BusinessInfoComponent implements OnInit { } } - filterMaxSaleCities(datasource: any, filterValues: any, selectedCites: any) { + filterMaxSaleCities(datasource: any, filterValues: any, selectedCites: any,searchText?:String) { if (filterValues) { let setCityValues: any=[]; let getOriginalStateList = datasource.map(dval => dval.state_id); @@ -1861,6 +1882,12 @@ export class BusinessInfoComponent implements OnInit { }); }); + if(searchText && setCityValues.length>0) { + setCityValues = setCityValues.filter(fVal=>fVal.city_id!="1") + searchText =searchText.toLowerCase(); + this.filteredCityList.next( setCityValues.filter(vv => vv['city_name'].toLowerCase().indexOf(searchText) > -1)) + return + } return setCityValues.length>0 ? setCityValues.filter(fVal=>fVal.city_id!="1") : []; } @@ -2155,8 +2182,34 @@ export class BusinessInfoComponent implements OnInit { this.searchcountry(control.controls['countrySearch'].value) }) } + else if( option == 'state') { + + // this.filteredStateList = this.applyFilter(control,this.filteredStateList,this.stateList,'state_name') + // takeUntil(this._onDestroy) + // console.log(this.filteredStateList) + + } } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + // return raw_list.slice() + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); + // return raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + } searchcountry(val: any) { console.log("countryData") diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index b3453bdd8..fdeb8368f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -78,8 +78,13 @@ + + + Select - {{ + {{ btLen.lender_name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index 4cf481e3a..c34e1315f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -11,6 +11,7 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import { ActivatedRoute, Router } from "@angular/router"; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; +import { ReplaySubject } from 'rxjs'; @Component({ selector: 'app-current-loan', @@ -48,6 +49,9 @@ export class CurrentLoanComponent implements OnInit { product_abbr: any; prod_catagory: any; + public bankFilterCtrl:FormControl = new FormControl(); + public filteredLenderData:ReplaySubject = new ReplaySubject(1) + constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, @@ -401,7 +405,35 @@ export class CurrentLoanComponent implements OnInit { } }) //this.retriveFile(); +this.filterList() } + +// filter changes for dropdown datas. + filterList() { + this.bankFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.bankFilterCtrl.value,this.filteredLenderData,this.lenderData,'lender_name') + }) + + } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); + } + + checkTenure(details) { let originalTenure = details.value.original_tenure; // alert(originalTenure); @@ -623,6 +655,9 @@ export class CurrentLoanComponent implements OnInit { this.addressTypeData.push(val); } }) + if(type == 1) { + this.filteredLenderData.next(this.lenderData.slice()) + } }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index e5a144778..002a6dedb 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -204,9 +204,14 @@ + + + Select + *ngFor="let entity of filteredBusinessEntityTypeList | async"> {{entity.business_entity_type_name}} Business @@ -293,9 +298,14 @@ + + + Select {{member.name + *ngFor="let member of filteredRelationShipList | async">{{member.name + ' of' | titlecase}} Not Related @@ -364,8 +374,13 @@ + + + Select - {{comrelShip.name | titlecase}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index b2aef1eeb..49e82f1b7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -10,6 +10,8 @@ import { DatePipe, TitleCasePipe } from '@angular/common'; import { SearchRelationPipe } from './../../../../../pd-pipes/search-relation.pipe'; import { Options } from 'selenium-webdriver/edge'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; +import { ReplaySubject } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; // import { ImageCropperComponent } from '../dialogue/image-cropper/image-cropper.component'; @Component({ @@ -89,6 +91,15 @@ export class GeneralInfoComponent implements OnInit { checksalaried: boolean = false; split_customer_abbr: any; fk_pd_type: any; + /** control for the MatSelect filter keyword */ + public entityFilterCtrl: FormControl = new FormControl(); + public relationFilterCtrl: FormControl = new FormControl(); + public companyRelationFilterCtrl:FormControl = new FormControl(); + + /** list filtered by search keyword */ + public filteredBusinessEntityTypeList: ReplaySubject = new ReplaySubject(1); + public filteredRelationShipList: ReplaySubject = new ReplaySubject(1); + public filteredCompanyRelationShipList: ReplaySubject = new ReplaySubject(1); /********************** Declaration Section Ends Here *****************/ @@ -153,6 +164,38 @@ export class GeneralInfoComponent implements OnInit { }); //this.retriveFile(); + // FILTER THE CHANGES DETECTION + this.filterList() + } + + filterList() { + this.entityFilterCtrl.valueChanges.pipe().subscribe(()=>{ + console.log("value changes",this.entityFilterCtrl,this._generalForm.value); + this.applyFilter(this.entityFilterCtrl.value,this.filteredBusinessEntityTypeList,this.businessEntityTypeList,'business_entity_type_name') + }) + this.relationFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.relationFilterCtrl.value,this.filteredRelationShipList,this.relationShipList,'name') + }) + this.companyRelationFilterCtrl.valueChanges.pipe().subscribe(()=>{ + this.applyFilter(this.companyRelationFilterCtrl.value,this.filteredCompanyRelationShipList,this.companyRelationShipList,'name') + }) + } + applyFilter(filtered_text,filter_list,raw_list,obj_name) { + if (!raw_list) { + return; + } + // get the search keyword + let search = filtered_text; + if (!search) { + filter_list.next(raw_list.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the banks + filter_list.next( + raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1) + ); } /***************************** ng Oninit Section Ends Here **********************************/ @@ -185,17 +228,20 @@ export class GeneralInfoComponent implements OnInit { if (data.status == 200) { if (type == 1) { this.relationShipList = data.records.filter(item => item.isactive == 1); + this.filteredRelationShipList.next(this.relationShipList.slice()) //this.relationShipList.push({'relationship_id':"0",'name':'Not Applicable'}); } if (type == 2) { this.companyRelationShipList = data.records.filter(item => item.isactive == 1); this.companyRelationShipList = data.records.filter(item => item.name != 'Others'); + this.filteredCompanyRelationShipList.next(this.companyRelationShipList.slice()) } if (type == 3) { this.qualificationList = data.records; } if (type == 4) { this.businessEntityTypeList = data.records.filter(val=>val.isactive != '0'); + this.filteredBusinessEntityTypeList.next(this.businessEntityTypeList.slice()); } } diff --git a/ng6-seed/src/app/video-chat/video-chat.component.ts b/ng6-seed/src/app/video-chat/video-chat.component.ts index 3e197343f..1c49a9f77 100755 --- a/ng6-seed/src/app/video-chat/video-chat.component.ts +++ b/ng6-seed/src/app/video-chat/video-chat.component.ts @@ -33,6 +33,9 @@ export class VideoChatComponent implements OnInit { start_btn_enable:boolean = true displayMsg:string = "Note : Make sure the Reciever is waiting for your call before start Calling" arr_of_blobs: any = []; + unique_video_key: string = ''; + + callDisconnectTimer:any constructor(private _notificationService:PushNotifyService, private cdRef: ChangeDetectorRef,private socket: Socket, private dialogRef: MatDialogRef, @@ -120,6 +123,7 @@ export class VideoChatComponent implements OnInit { if( supports['facingMode'] === true ) { // switchCameraBtn.disabled = false; } + console.log("entered",stream); peerx = new SimplePeer ({ initiator: option === 'init', @@ -150,6 +154,10 @@ export class VideoChatComponent implements OnInit { if(data.hasOwnProperty('type') && data.type == 'offer'){ console.log("entered!!!!!!!!!!!!!!!!1"); this.user_msg = "Calling..." + this.callDisconnectTimer = setTimeout(()=>{ + this.notify("User is Busy !!.", "Try calling again later") + this.disconnect() + },15000); let event_data = {JSON_to_connect:data,type:'offer',random_string:this.chat_info.random_string,user_type:"officer"} this.socket.emit('Offer', event_data) } @@ -224,6 +232,9 @@ export class VideoChatComponent implements OnInit { // //wait for 1 sec // } function connectPeer(answer) { + if(this.callDisconnectTimer) { + clearTimeout(this.callDisconnectTimer) + } console.log("$$$$$$$$$$$$$$44"); console.log(answer); setTimeout(()=>{ @@ -278,7 +289,7 @@ export class VideoChatComponent implements OnInit { } updateTheMsg(msg_obj) { console.log("CallstatusMsg",msg_obj) - if(msg_obj && msg_obj.status_code == 2){ + if(msg_obj && (msg_obj.status_code == 2) || (msg_obj.status_code == 3) && msg_obj.random_string == this.chat_info.random_string){ console.log("entered"); this.start_btn_enable = false this.displayMsg = msg_obj.msg @@ -307,6 +318,7 @@ export class VideoChatComponent implements OnInit { // this.camereSwitchBtn.nativeElement.disabled = true; console.log("peervideo check",this.peerVideoEnable,this.peervideo.nativeElement.videoWidth,this.peervideo.nativeElement.videoHeight); this.cdRef.detectChanges(); + this.unique_video_key =this.randomStringGenerator(8) this.startRecording(stream) // this.addVideoToRecorder(stream) // this.addVideoToRecorder(this.MediaStream) @@ -407,7 +419,7 @@ this.stopRecording(true); console.log("----------------------------") console.log("video "+this.arr_of_blobs.length, fileURL) console.log("----------------------------") - this.sendVideoToServer(seekableBlob) + this.sendVideoToServer(seekableBlob,autostarRec) }) // var file = new File([blob], 'video.mp4', { @@ -438,11 +450,13 @@ this.stopRecording(true); // }) } -sendVideoToServer(blob) { +sendVideoToServer(blob,is_auto_start) { let formData = new FormData(); formData.append('video_file', blob); let params = { - filename:'video'+this.arr_of_blobs.length+'.mp4', + filename:'video'+this.arr_of_blobs.length+'-'+this.unique_video_key, + is_call_ended:is_auto_start ? '0' : '1', + video_key:this.unique_video_key, random_string:this.chat_info.random_string, pd_id:this.chat_info.pd_id } @@ -474,6 +488,9 @@ sendVideoToServer(blob) { this.stopRecording().then(res=>{ }) + if(this.callDisconnectTimer) { + clearTimeout(this.callDisconnectTimer) + } this.peer.destroy(); this.peerVideoEnable = false this.targetpeer = '' @@ -566,6 +583,20 @@ sendVideoToServer(blob) { this.socket.emit('callStatus',{random_string:this.chat_info.random_string,status:'disconnected',status_code:0}) } } + randomStringGenerator(length: number): string { + const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + const values = new Uint32Array(length); + window.crypto.getRandomValues(values); + + let i; + let result = ""; + for (i = 0; i < length; i++) { + // console.log(values[i], charset.length); + result += charset[values[i] % charset.length]; + } + + return result; + } @HostListener('window:beforeunload', ['$event']) unloadHandler(event) {