Fairoj : twilio video integration, employer info questions coloured, playback changes

This commit is contained in:
venbatechnologies@gmail.com 2020-10-01 19:18:54 +05:30
parent 85f6f20885
commit c70b100e1c
10 changed files with 167 additions and 130 deletions

View File

@ -63,7 +63,6 @@ import { IncomingCallComponent } from './video-chat/incoming-call/incoming-call.
import { VideoChatComponent } from './video-chat/video-chat.component' import { VideoChatComponent } from './video-chat/video-chat.component'
import { PushNotifyService } from './shared/push-notify.service'; import { PushNotifyService } from './shared/push-notify.service';
import { MatVideoModule } from 'mat-video'; import { MatVideoModule } from 'mat-video';
import { VideoPlayerComponent } from './video-chat/video-player/video-player.component';
import { ReqTokenInterceptor } from './_guard/req-token.interceptor'; import { ReqTokenInterceptor } from './_guard/req-token.interceptor';
export function HttpLoaderFactory(http: HttpClient) { export function HttpLoaderFactory(http: HttpClient) {
@ -78,14 +77,15 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
suppressScrollX: true suppressScrollX: true
}; };
const socketConfig: SocketIoConfig = { url: environment.socketServerUrl, options: {} }; // const socketConfig: SocketIoConfig = { url: environment.socketServerUrl, options: {} };
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
AdminLayoutComponent, AdminLayoutComponent,
AuthLayoutComponent, AuthLayoutComponent,
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent, IncomingCallComponent, VideoChatComponent, VideoPlayerComponent NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent,
IncomingCallComponent, VideoChatComponent,
], ],
imports: [ imports: [
MatDialogModule, MatDialogModule,
@ -126,7 +126,7 @@ const socketConfig: SocketIoConfig = { url: environment.socketServerUrl, options
AngularFireAuthModule, AngularFireAuthModule,
AngularFireMessagingModule, AngularFireMessagingModule,
AngularFireModule.initializeApp(environment.firebase), AngularFireModule.initializeApp(environment.firebase),
SocketIoModule.forRoot(socketConfig), // SocketIoModule.forRoot(socketConfig),
MatVideoModule MatVideoModule
], ],
providers: [ providers: [
@ -149,7 +149,8 @@ const socketConfig: SocketIoConfig = { url: environment.socketServerUrl, options
}, },
MessagingService, AsyncPipe,LoaderService MessagingService, AsyncPipe,LoaderService
], ],
entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,IncomingCallComponent,VideoChatComponent,VideoPlayerComponent], entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,]
bootstrap: [AppComponent] // IncomingCallComponent,VideoChatComponent,],
,bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }

View File

@ -15,10 +15,10 @@ import { AwsService } from '../../AwsService/aws.service';
import { RoleMenuItemsPipe } from './../role-menu-items.pipe'; import { RoleMenuItemsPipe } from './../role-menu-items.pipe';
import 'rxjs/add/observable/interval'; import 'rxjs/add/observable/interval';
import { MessagingService } from 'app/shared/messaging.service'; import { MessagingService } from 'app/shared/messaging.service';
import { IncomingCallComponent } from '../../video-chat/incoming-call/incoming-call.component'; // import { IncomingCallComponent } from '../../video-chat/incoming-call/incoming-call.component';
import { Socket } from 'ngx-socket-io'; import { Socket } from 'ngx-socket-io';
import { MatDialog } from '@angular/material'; import { MatDialog } from '@angular/material';
import { VideoChatComponent } from 'app/video-chat/video-chat.component'; // import { VideoChatComponent } from 'app/video-chat/video-chat.component';
import { PushNotifyService } from 'app/shared/push-notify.service'; import { PushNotifyService } from 'app/shared/push-notify.service';
@ -66,8 +66,9 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
countTAT: number; countTAT: number;
incomingDialogOpened:boolean = false incomingDialogOpened:boolean = false
dialogRef: any; dialogRef: any;
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService,private messagingService:MessagingService,private socket:Socket,private matDialog:MatDialog, constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService,private messagingService:MessagingService
private _notificationService:PushNotifyService) { // ,private socket:Socket,private matDialog:MatDialog
,private _notificationService:PushNotifyService) {
const browserLang: string = translate.getBrowserLang(); const browserLang: string = translate.getBrowserLang();
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en'); translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
@ -147,9 +148,9 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
// Ps.update(elemContent); // Ps.update(elemContent);
} }
}); });
setTimeout(()=>{ // setTimeout(()=>{
this.listenForCalls() // this.listenForCalls()
},5000) // },5000)
// this.openIncomingDialog(); // this.openIncomingDialog();
console.log("Ng On Init") console.log("Ng On Init")
} }
@ -329,87 +330,87 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
} }
} }
// FOR LISTENING TO RECIEVE CALLS FROM CALLER // FOR LISTENING TO RECIEVE CALLS FROM CALLER
listenForCalls() { // listenForCalls() {
// this.socket.on('BackOffer', this.connectPeer) // // this.socket.on('BackOffer', this.connectPeer)
let userrole = localStorage.getItem('user_role') // let userrole = localStorage.getItem('user_role')
if(userrole == '5') { // if(userrole == '5') {
this.socket.fromEvent('BackOffer').subscribe((res:any)=>{ // this.socket.fromEvent('BackOffer').subscribe((res:any)=>{
let pd_short_info:any = localStorage.getItem('pd_short_info') // let pd_short_info:any = localStorage.getItem('pd_short_info')
pd_short_info = JSON.parse(pd_short_info); // pd_short_info = JSON.parse(pd_short_info);
console.log(res) // console.log(res)
if(res && res.hasOwnProperty('random_string') && res.random_string && res.hasOwnProperty('user_type') && res.user_type != 'officer'){ // if(res && res.hasOwnProperty('random_string') && res.random_string && res.hasOwnProperty('user_type') && res.user_type != 'officer'){
if(pd_short_info.filter(val=>val.random_string == res.random_string).length > 0){ // if(pd_short_info.filter(val=>val.random_string == res.random_string).length > 0){
let curr_pd_info= pd_short_info.filter(val=>val.random_string == res.random_string)[0] // let curr_pd_info= pd_short_info.filter(val=>val.random_string == res.random_string)[0]
if(curr_pd_info && (curr_pd_info.pd_type == '3' || curr_pd_info.pd_type == '2')) { // if(curr_pd_info && (curr_pd_info.pd_type == '3' || curr_pd_info.pd_type == '2')) {
this.connectPeer(res,curr_pd_info); // this.connectPeer(res,curr_pd_info);
} // }
} // }
} // }
}) // })
} // }
} // }
connectPeer(offer,curr_pd_info) { // connectPeer(offer,curr_pd_info) {
console.log(offer) // console.log(offer)
// alert("Offer is listened"); // // alert("Offer is listened");
this.notify('Incoming Call','Calling from ' + curr_pd_info.applicant_name + ' (' +curr_pd_info.pd_sno+ ')') // this.notify('Incoming Call','Calling from ' + curr_pd_info.applicant_name + ' (' +curr_pd_info.pd_sno+ ')')
this.openIncomingDialog(offer,curr_pd_info); // this.openIncomingDialog(offer,curr_pd_info);
} // }
openIncomingDialog(offer?,curr_pd_info?) { // openIncomingDialog(offer?,curr_pd_info?) {
offer.pd_id = curr_pd_info.pd_id // offer.pd_id = curr_pd_info.pd_id
if(this.incomingDialogOpened == true) { // if(this.incomingDialogOpened == true) {
if(this.dialogRef) { // if(this.dialogRef) {
console.log("dialog",this.dialogRef) // console.log("dialog",this.dialogRef)
this.dialogRef.close(); // this.dialogRef.close();
} // }
else { // else {
return; // return;
} // }
} // }
let autoCloseDialog:any; // let autoCloseDialog:any;
this.incomingDialogOpened = true // this.incomingDialogOpened = true
this.dialogRef = this.matDialog.open(IncomingCallComponent,{ // this.dialogRef = this.matDialog.open(IncomingCallComponent,{
// minWidth:'25%', // // minWidth:'25%',
// maxWidth:'30%', // // maxWidth:'30%',
data:curr_pd_info, // data:curr_pd_info,
disableClose: true, // disableClose: true,
backdropClass: 'incoming-call-background' , // backdropClass: 'incoming-call-background' ,
panelClass:'incoming-call-background' // panelClass:'incoming-call-background'
}) // })
autoCloseDialog = setTimeout(()=>{ // autoCloseDialog = setTimeout(()=>{
this.dialogRef.close() // this.dialogRef.close()
},30000) // },30000)
this.dialogRef.afterClosed().subscribe(data=>{ // this.dialogRef.afterClosed().subscribe(data=>{
console.log(data) // console.log(data)
if(autoCloseDialog != undefined && autoCloseDialog) { // if(autoCloseDialog != undefined && autoCloseDialog) {
clearTimeout(autoCloseDialog) // clearTimeout(autoCloseDialog)
} // }
if(data == 'decline'){ // if(data == 'decline'){
this.incomingDialogOpened = false // this.incomingDialogOpened = false
this.socket.emit('callStatus',{random_string:curr_pd_info.random_string,status:'declined',status_code:3}) // this.socket.emit('callStatus',{random_string:curr_pd_info.random_string,status:'declined',status_code:3})
} // }
else if(data == 'answered'){ // else if(data == 'answered'){
this.incomingDialogOpened = false // this.incomingDialogOpened = false
this.openVideoChatDialog(offer) // this.openVideoChatDialog(offer)
} // }
}) // })
} // }
openVideoChatDialog(offer) { // openVideoChatDialog(offer) {
let dialogRef = this.matDialog.open(VideoChatComponent,{ // let dialogRef = this.matDialog.open(VideoChatComponent,{
data:offer, // data:offer,
maxWidth: '100vw', // maxWidth: '100vw',
maxHeight: '100vh', // maxHeight: '100vh',
height: '100%', // height: '100%',
width: '100%', // width: '100%',
disableClose: true, // disableClose: true,
panelClass:'video-chat' // panelClass:'video-chat'
}) // })
} // }
notify(title,approval) { // notify(title,approval) {
let data: Array < any >= []; // let data: Array < any >= [];
data.push({ // data.push({
'title': title, // 'title': title,
'body': approval // 'body': approval
}); // });
this._notificationService.generateNotificationWithTitle(data); // this._notificationService.generateNotificationWithTitle(data);
} // }
} }

View File

@ -22,11 +22,11 @@
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Questions">
<ng-template matTabContent> <ng-template matTabContent>
<mat-card style="min-height: 550px;background-color: #b9e9f1 !important"> <mat-card style="min-height: 550px" >
<mat-card-title> <mat-card-title>
<p>Address Details</p> <p>Address Details</p>
</mat-card-title> </mat-card-title>
<mat-card-content style="background-color: #b9e9f1 !important"> <mat-card-content [ngClass]="{'smartPd':fk_pd_type == '2'}">
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<div formArrayName="addresses"> <div formArrayName="addresses">

View File

@ -74,7 +74,7 @@
</mat-select> </mat-select>
<mat-error *ngIf="employmentForm.controls['was_met'].hasError('required')">Was the employer met Required</mat-error> <mat-error *ngIf="employmentForm.controls['was_met'].hasError('required')">Was the employer met Required</mat-error>
</mat-form-field> </mat-form-field>
<div fxLayout="row wrap" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'"> <div fxLayout="row wrap" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<input matInput placeholder="Name of Person Met" formControlName="name_person_met" <input matInput placeholder="Name of Person Met" formControlName="name_person_met"
autocomplete="off" required> autocomplete="off" required>
@ -128,17 +128,19 @@
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%"> <div [ngClass]="{'smartPd':fk_pd_type == '2'}">
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%" >
<mat-select placeholder="Salary amount confirmed ?" formControlName="confirm_salary" <mat-select placeholder="Salary amount confirmed ?" formControlName="confirm_salary"
required> required >
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="employmentForm.controls['confirm_salary'].hasError('required')">Salary amount confirmed Required</mat-error> <mat-error *ngIf="employmentForm.controls['confirm_salary'].hasError('required')">Salary amount confirmed Required</mat-error>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field appearance="outline" style="width: 45%" *ngIf="employmentForm.controls['confirm_salary'].value == 'no'"> <mat-form-field appearance="outline" style="width: 45%" *ngIf="employmentForm.controls['confirm_salary'].value == 'no'" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<!-- <mat-label>why salary amount was not confirmed</mat-label> --> <!-- <mat-label>why salary amount was not confirmed</mat-label> -->
<textarea matInput placeholder="why salary amount was not confirmed" formControlName="sal_amount_was_not_confirmed"></textarea> <textarea matInput placeholder="why salary amount was not confirmed" formControlName="sal_amount_was_not_confirmed"></textarea>
<!-- <mat-error *ngIf="employmentForm.controls['sal_amount_was_not_confirmed'].hasError('required')">why salary amount was not confirmed Required</mat-error> --> <!-- <mat-error *ngIf="employmentForm.controls['sal_amount_was_not_confirmed'].hasError('required')">why salary amount was not confirmed Required</mat-error> -->
@ -155,7 +157,8 @@
</div> </div>
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%"> <div [ngClass]="{'smartPd':fk_pd_type == '2'}">
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'" style="width: 45%" >
<mat-select placeholder="Attendance register seen ?" formControlName="attendance_seen" <mat-select placeholder="Attendance register seen ?" formControlName="attendance_seen"
required> required>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
@ -173,7 +176,8 @@
</mat-select> </mat-select>
<mat-error *ngIf="employmentForm.controls['sal_reg_seen'].hasError('required')">Salary register seen Required</mat-error> <mat-error *ngIf="employmentForm.controls['sal_reg_seen'].hasError('required')">Salary register seen Required</mat-error>
</mat-form-field> </mat-form-field>
<div *ngIf="fk_pd_type == '2' || fk_pd_type == '3'"> </div>
<div *ngIf="fk_pd_type == '2' || fk_pd_type == '3'" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<mat-select placeholder="Cash voucher" formControlName="cash_voucher" <mat-select placeholder="Cash voucher" formControlName="cash_voucher"
required> required>
@ -232,8 +236,8 @@
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div [ngClass]="{'smartPd':fk_pd_type == '2'}">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%" >
<mat-select placeholder="Mode of getting salary" formControlName="mode_of_getting_salary" <mat-select placeholder="Mode of getting salary" formControlName="mode_of_getting_salary"
required> required>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
@ -243,6 +247,7 @@
</mat-select> </mat-select>
<!-- <mat-error *ngIf="employmentForm.controls['mode_of_getting_salary'].hasError('required')">Mode of getting salary Required</mat-error> --> <!-- <mat-error *ngIf="employmentForm.controls['mode_of_getting_salary'].hasError('required')">Mode of getting salary Required</mat-error> -->
</mat-form-field> </mat-form-field>
</div>
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
@ -251,7 +256,7 @@
<mat-card-content> <mat-card-content>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<div fxLayout="nowrap" style="padding-left: 2%; width: 100%"> <div fxLayout="nowrap" style="padding-left: 2%; width: 100%" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<p>Date of Salary</p> <p>Date of Salary</p>
<mat-form-field style="width: 8%;"> <mat-form-field style="width: 8%;">
<mat-select placeholder="From" formControlName="from_date_the_salary_is_rcv" (selectionChange)="formDate($event.value)"> <mat-select placeholder="From" formControlName="from_date_the_salary_is_rcv" (selectionChange)="formDate($event.value)">
@ -313,14 +318,14 @@
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<mat-form-field style="width: 80%"> <mat-form-field style="width: 80%" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" <input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary"
OnlyNumber type="text" autocomplete="off" required (change)="setValidationForNetSal($event.target.value)"> OnlyNumber type="text" autocomplete="off" required (change)="setValidationForNetSal($event.target.value)">
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['gross_monthly_salary'].value != ''">{{"&#8377;"}} {{employmentForm.controls['gross_monthly_salary'].value | numberToWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['gross_monthly_salary'].value != ''">{{"&#8377;"}} {{employmentForm.controls['gross_monthly_salary'].value | numberToWords}} Only</mat-hint>
<mat-error *ngIf="employmentForm.controls['gross_monthly_salary'].hasError('required')">Gross Monthly Salary Required</mat-error> <mat-error *ngIf="employmentForm.controls['gross_monthly_salary'].hasError('required')">Gross Monthly Salary Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:80%"> <mat-form-field style="width:80%" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" <input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary"
OnlyNumber type="text" autocomplete="off" required> OnlyNumber type="text" autocomplete="off" required>
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['net_monthly_salary'].value != ''">{{"&#8377;"}} {{employmentForm.controls['net_monthly_salary'].value | numberToWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['net_monthly_salary'].value != ''">{{"&#8377;"}} {{employmentForm.controls['net_monthly_salary'].value | numberToWords}} Only</mat-hint>
@ -329,14 +334,14 @@
<!-- <input matInput placeholder="Net Take Home" <!-- <input matInput placeholder="Net Take Home"
formControlName="net_take_home"> --> formControlName="net_take_home"> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 80%" *ngIf="employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'"> <mat-form-field style="width: 80%" *ngIf="employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<input matInput placeholder="Amount paid through Bank" <input matInput placeholder="Amount paid through Bank"
formControlName="amount_paid_through_bank" OnlyNumber type="text" autocomplete="off" (change)="ValidateNetSalary()"> formControlName="amount_paid_through_bank" OnlyNumber type="text" autocomplete="off" (change)="ValidateNetSalary()">
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['amount_paid_through_bank'].value != ''">{{"&#8377;"}} {{employmentForm.controls['amount_paid_through_bank'].value | numberToWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['amount_paid_through_bank'].value != ''">{{"&#8377;"}} {{employmentForm.controls['amount_paid_through_bank'].value | numberToWords}} Only</mat-hint>
<mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('max')">Given Value is More than Net Salary</mat-error> <mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('max')">Given Value is More than Net Salary</mat-error>
<mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('min')">Given Value is Less than Net Salary</mat-error> <mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('min')">Given Value is Less than Net Salary</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 80%" *ngIf="employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'"> <mat-form-field style="width: 80%" *ngIf="employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'" [ngClass]="{'smartPd':fk_pd_type == '2'}">
<input matInput placeholder="Amount paid in Cash" <input matInput placeholder="Amount paid in Cash"
formControlName="amount_paid_in_cash" OnlyNumber type="text" autocomplete="off" (change)="ValidateNetSalary()"> formControlName="amount_paid_in_cash" OnlyNumber type="text" autocomplete="off" (change)="ValidateNetSalary()">
<mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['amount_paid_in_cash'].value != ''">{{"&#8377;"}} {{employmentForm.controls['amount_paid_in_cash'].value | numberToWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="employmentForm.controls['amount_paid_in_cash'].value != ''">{{"&#8377;"}} {{employmentForm.controls['amount_paid_in_cash'].value | numberToWords}} Only</mat-hint>

View File

@ -30,7 +30,7 @@
<div formArrayName="neighbourhood_list"> <div formArrayName="neighbourhood_list">
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index; let last = last" <mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index; let last = last"
[formGroupName]="n"> [formGroupName]="n">
<mat-card-content style="background-color: #b9e9f1 !important"> <mat-card-content [ngClass]="{'smartPd':fk_pd_type == '2'}">
<mat-form-field style="width: 42%" *ngIf="fk_pd_type != '3'"> <mat-form-field style="width: 42%" *ngIf="fk_pd_type != '3'">
<input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name" appCustomTitleCase <input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name" appCustomTitleCase
[value]="neighbourhood.get('neighbourhood_name').value" type="text"> [value]="neighbourhood.get('neighbourhood_name').value" type="text">
@ -110,8 +110,8 @@
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</div> </div>
<mat-card-content style="background-color: #b9e9f1 !important"> <mat-card-content [ngClass]="{'smartPd':fk_pd_type == '2'}">
<mat-form-field style="width: 40%;background-color: #b9e9f1 !important"> <mat-form-field >
<mat-select placeholder="Status of the check as per PD officer?" formControlName="neighbourhood_status"> <mat-select placeholder="Status of the check as per PD officer?" formControlName="neighbourhood_status">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="Positive">Positive</mat-option> <mat-option value="Positive">Positive</mat-option>

View File

@ -209,6 +209,9 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.vendor_form_status_arr = JSON.stringify(data.records.vendor_form_status) this.vendor_form_status_arr = JSON.stringify(data.records.vendor_form_status)
localStorage.setItem("vendorFormStatus_arr",this.vendor_form_status_arr) localStorage.setItem("vendorFormStatus_arr",this.vendor_form_status_arr)
} }
this._pd.updateTwlioVideoStatus({"pd_id":this.viewID,"random_string":this.masterRandomString}).subscribe(rr=>{
})
} }
} }
}, error => { }, error => {
@ -625,7 +628,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
console.log(event) console.log(event)
let cus_link; let cus_link;
if(event && event.btnValue == 'video') { if(event && event.btnValue == 'video') {
cus_link = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string; cus_link = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string+';id='+this.viewID+';type=1'
} }
else if(event && event.btnValue == 'image') { else if(event && event.btnValue == 'image') {
cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string; cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string;
@ -657,15 +660,17 @@ export class ViewPdComponent implements OnInit, OnDestroy {
} }
openVideoChat(){ openVideoChat(){
let dialogRef = this.dialog.open(VideoChatComponent,{ // let dialogRef = this.dialog.open(VideoChatComponent,{
data:{type:'init',random_string:this.pdMasterData[0].random_string,pd_id:this.viewID}, // data:{type:'init',random_string:this.pdMasterData[0].random_string,pd_id:this.viewID},
maxWidth: '100vw', // maxWidth: '100vw',
maxHeight: '100vh', // maxHeight: '100vh',
height: '100%', // height: '100%',
width: '100%', // width: '100%',
disableClose: true, // disableClose: true,
panelClass:'video-chat' // panelClass:'video-chat'
}) // })
let url = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string+';id='+this.viewID+';type=2'
window.open(url,'_blank')
} }
openPlayer(){ openPlayer(){
// if(this.videoplayback.url == null) { // if(this.videoplayback.url == null) {

View File

@ -136,6 +136,8 @@ import { SpeedDialFabComponent } from './list-pd/view-pd/speed-dial-fab/speed-di
import { DynamicFormComponent } from './list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component'; import { DynamicFormComponent } from './list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component';
import { DynamicQuestionTemplateComponent } from './list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component'; import { DynamicQuestionTemplateComponent } from './list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component';
import { QuesFormService } from './list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service'; import { QuesFormService } from './list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service';
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
import { MatVideoModule } from 'mat-video';
/** /**
* Custom angular notifier options * Custom angular notifier options
@ -182,7 +184,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
}; };
@NgModule({ @NgModule({
declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent, declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent,VideoPlayerComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent], DynamicFormComponent,DynamicQuestionTemplateComponent],
imports: [ imports: [
CommonModule, CommonModule,
@ -217,6 +219,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
AgmCoreModule.forRoot({apiKey: environment.map_api_key}),OwlDateTimeModule, AgmCoreModule.forRoot({apiKey: environment.map_api_key}),OwlDateTimeModule,
OwlNativeDateTimeModule, OwlNativeDateTimeModule,
AngularSplitModule, AngularSplitModule,
MatVideoModule
], ],
exports: [DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,PurchaseCalculationComponent], exports: [DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,PurchaseCalculationComponent],
@ -226,7 +229,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
entryComponents: [DuplicatePdComponent,VendorPdAllocationComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent, entryComponents: [DuplicatePdComponent,VendorPdAllocationComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,FuturePlansAndBusinessEnvironmentComponent,ImageCropComponent,QueriesDocsComponent, ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,FuturePlansAndBusinessEnvironmentComponent,ImageCropComponent,QueriesDocsComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent], DynamicFormComponent,DynamicQuestionTemplateComponent,VideoPlayerComponent],
}) })
export class ManagePdModule { export class ManagePdModule {
} }

View File

@ -1003,4 +1003,8 @@ export class PdTrigerService {
return this._http.post(this.apiUrl+'updateVendorFormStatus',params) return this._http.post(this.apiUrl+'updateVendorFormStatus',params)
.pipe(catchError(this.handleError("checkExistPDDetails",[]))) .pipe(catchError(this.handleError("checkExistPDDetails",[])))
} }
updateTwlioVideoStatus(params) {
return this._http.post(this.apiUrl+'updateTwlioVideoStatus',params)
.pipe(catchError(this.handleError("updateTwlioVideoStatus",[])))
}
} }

View File

@ -27,9 +27,9 @@
<mat-card style="background-color: black;margin:0px;margin-top: 3px;"> <mat-card style="background-color: black;margin:0px;margin-top: 3px;">
<mat-card-content > <mat-card-content >
<div class="playbackListClass" fxLayout="row" *ngFor="let item of playbackList;let i=index" (click)="playVideo(i,item)"> <div class="playbackListClass" fxLayout="row" *ngFor="let item of playbackList;let i=index" (click)="playVideo(i,item)">
<div fxLayout="column" fxFlex="94%" > <div fxLayout="column" fxFlex="90%" fxLayoutGap="10px">
<div> <div>
<p style="color:white;margin:0px;font-size: 20px;font-weight: bold">Video {{item.video_name}}</p> <p style="color:white;margin:0px;font-size: 20px;font-weight: bold;white-space:pre-wrap">{{item.video_name}}</p>
<p *ngIf="item.date" style="color:white;margin:0px;font-size:16px;">{{item.date}}</p> <p *ngIf="item.date" style="color:white;margin:0px;font-size:16px;">{{item.date}}</p>
</div> </div>
</div> </div>
@ -42,8 +42,17 @@
</button> --> </button> -->
</div> </div>
<p *ngIf="item.duration" style="color:white;margin:0px;font-size:14px;">{{item.duration}}</p> <p *ngIf="item.duration" style="color:white;margin:0px;font-size:14px;">{{item.duration}}</p>
<p *ngIf="item.status" style="color:white;margin:0px;font-size:14px;">{{item.status}}</p>
</div>
<div fxLayout="column" align="end" fxLayoutAlign="flex-end">
<button align="end" style="float: right" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Copy Link" [disabled]="item.url == ''"
matTooltipPosition="right" (click)="_pd.copyToClipBoard(item.url)">
<mat-icon>link</mat-icon>
</button>
</div> </div>
<mat-divider style="border-top:1px solid rgb(105, 105, 105) !important"></mat-divider> <mat-divider style="border-top:1px solid rgb(105, 105, 105) !important"></mat-divider>
</div> </div>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<notifier-container></notifier-container>

View File

@ -1,5 +1,7 @@
import { Component, OnInit, Inject, ViewChild, ElementRef } from '@angular/core'; import { Component, OnInit, Inject, ViewChild, ElementRef } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
@Component({ @Component({
selector: 'app-video-player', selector: 'app-video-player',
@ -21,7 +23,10 @@ export class VideoPlayerComponent implements OnInit {
// = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4' // = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'
// = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4' // = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4'
@ViewChild('videoPlayer') videoPlayerEle:ElementRef @ViewChild('videoPlayer') videoPlayerEle:ElementRef
constructor( @Inject(MAT_DIALOG_DATA) public data:any,private matDialogRef:MatDialogRef<VideoPlayerComponent>) { notifier: NotifierService;
constructor( @Inject(MAT_DIALOG_DATA) public data:any,private matDialogRef:MatDialogRef<VideoPlayerComponent>,
notifier:NotifierService,private _pd:PdTrigerService) {
this.notifier=notifier
if(data) { if(data) {
if(data.hasOwnProperty('videoUrl') && data.videoUrl && data.videoUrl.length > 0) { if(data.hasOwnProperty('videoUrl') && data.videoUrl && data.videoUrl.length > 0) {
this.playbackList = data.videoUrl this.playbackList = data.videoUrl
@ -42,6 +47,10 @@ export class VideoPlayerComponent implements OnInit {
} }
playVideo(i,obj) { playVideo(i,obj) {
console.log(obj,this.videoPlayerEle); console.log(obj,this.videoPlayerEle);
if(obj.url == '' || !obj.url) {
this.notifier.notify("info","Status of the playback is "+obj.status+' try again later!!')
return
}
this.selectedVideoIndex= i; this.selectedVideoIndex= i;
this.videoSrc = obj.url this.videoSrc = obj.url