diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json index 1b9a9fc..1ff164c 100755 --- a/ng6-seed/package-lock.json +++ b/ng6-seed/package-lock.json @@ -7836,6 +7836,14 @@ "object-visit": "^1.0.0" } }, + "mat-video": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/mat-video/-/mat-video-2.8.1.tgz", + "integrity": "sha512-HyLi0n9AE77BVbv3dfKMYB/CgH74+oLgneHjqTH9nSptqpIPhYD1YEbkCt4uVFrVW+LUs03qvNokslE7LRUpIw==", + "requires": { + "tslib": "^1.9.0" + } + }, "math-random": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", diff --git a/ng6-seed/package.json b/ng6-seed/package.json index b4510aa..6494c2d 100755 --- a/ng6-seed/package.json +++ b/ng6-seed/package.json @@ -52,6 +52,7 @@ "jquery": "^3.5.1", "karma-jasmine": "^1.1.1", "leaflet": "^1.4.0", + "mat-video": "^2.8.1", "moment": "^2.24.0", "ng-pick-datetime": "^6.0.16", "ng2-charts": "1.6.0", diff --git a/ng6-seed/src/app/app.module.ts b/ng6-seed/src/app/app.module.ts index c445327..c5f433b 100755 --- a/ng6-seed/src/app/app.module.ts +++ b/ng6-seed/src/app/app.module.ts @@ -52,6 +52,7 @@ import { AdvanceFilterComponent } from './sales-pd/advance-filter/advance-filter import { ServiceWorkerModule } from '@angular/service-worker'; import { environment } from '../environments/environment'; import { ReqTokenInterceptor } from './_guard/req-token.interceptor'; +import { MatVideoModule } from 'mat-video'; export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http); } @@ -108,6 +109,7 @@ export function createTranslateLoader(http: HttpClient) { }), FlexLayoutModule, ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), + MatVideoModule ], providers: [ { diff --git a/ng6-seed/src/app/error/404/error-404-component.html b/ng6-seed/src/app/error/404/error-404-component.html index a4166c1..f5cfdac 100755 --- a/ng6-seed/src/app/error/404/error-404-component.html +++ b/ng6-seed/src/app/error/404/error-404-component.html @@ -10,7 +10,7 @@

Sorry, an error has occured, Requested page not found!

- +
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 4a68725..474e9ad 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 @@ -15,9 +15,9 @@
- Step 1 : -Excel Upload + -
+
@@ -25,7 +25,7 @@
- + PD Details @@ -165,7 +165,16 @@ --> - +
+ Is this Tele PD ? + + + +
+ {{lenderShortName == 'MWISE' ? "Loan amount applied for (Rs)" :'Loan Amount'}} {{"₹"}} {{pdMain.loan_amount.value | numberToWords}} Only @@ -175,7 +184,7 @@
- + Address Details @@ -250,7 +259,7 @@ - + Applicant Details diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss index fe41fbc..ac8192c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.scss @@ -7,4 +7,34 @@ mat-form-field { .mat-error { float: right; } - \ No newline at end of file +mat-radio-button,mat-checkbox{ + margin-top: 13px; +} +.radio-gap{ + // margin-top: 10px; + // margin-bottom: 10px; + margin: 20px; +} +.radio-btn-gap{ + margin:10px; +} + +::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{ + border-color:rgb(212, 15, 15); +} + +::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle{ + color:rgb(212, 15, 15); + background-color:rgb(212, 15, 15); +} + +::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element { + background-color:rgba(224, 22, 22, 0.308); +} +::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar { + background-color: rgb(212, 15, 15); +} + +::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb { + background-color:rgb(212, 15, 15); +} \ No newline at end of file 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 e4acb12..180193f 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 @@ -1164,4 +1164,13 @@ searchFun(control:any,i:number,option){ } }) } + changePDTypeSlideValue(event) { + if(event.checked) { + this._PDtriggerForm.controls['fk_pd_type'].setValue('3') + } + else { + this._PDtriggerForm.controls['fk_pd_type'].setValue('1') + } + console.log(this._PDtriggerForm.value) + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html index ab4ced1..17d9904 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html @@ -80,7 +80,7 @@

{{details.pd_sno_split.lender_name}}
{{details.pd_sno_split.serial_no}}

- + {{details.pd_type_name}}
@@ -124,7 +124,7 @@
{{details.pd_sno}}
- + {{details.pd_type_name}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html index e3cabfd..aa42a4e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html @@ -78,7 +78,7 @@

{{details.pd_sno_split.lender_name}}
{{details.pd_sno_split.serial_no}}

- + {{details.pd_type_name}}
@@ -115,7 +115,7 @@
{{details.pd_sno}}
- + {{details.pd_type_name}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html index 576117b..56c37e6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html @@ -77,7 +77,7 @@

{{details.pd_sno_split.lender_name}}
{{details.pd_sno_split.serial_no}}

- + {{details.pd_type_name}}
@@ -114,7 +114,7 @@
{{details.pd_sno}}
- + {{details.pd_type_name}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html index acc1911..3f8cc14 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/qc-completed-pd/qc-completed-pd.component.html @@ -79,7 +79,7 @@

{{details.pd_sno_split.lender_name}}
{{details.pd_sno_split.serial_no}}

- + {{details.pd_type_name}}
@@ -116,7 +116,7 @@
{{details.pd_sno}}
- + {{details.pd_type_name}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html index 289e91f..e534eb6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/scheduled-pd/scheduled-pd.component.html @@ -77,7 +77,7 @@

{{details.pd_sno_split.lender_name}}
{{details.pd_sno_split.serial_no}}

- + {{details.pd_type_name}}
@@ -114,7 +114,7 @@
{{details.pd_sno}}
- + {{details.pd_type_name}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts index a1e3b8d..61596cc 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/image-capture.component.ts @@ -178,7 +178,7 @@ export class ImageCaptureComponent implements OnInit { "fk_smc_credit_pd_id": this.pdid, "img":imageData[index].is_multiple != 1 ? imageData[index].img_url : imageData[index].img_data[multi_index].img_url, "img_name": imageData[index].img_key, - "location":imageData.is_multiple != 1 ? imageData[index].link : imageData[index].img_data[multi_index].link, + "location":imageData[index].is_multiple != 1 ? imageData[index].link : imageData[index].img_data[multi_index].link, "is_multiple":imageData[index].is_multiple } // setTimeout(()=>{ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.animations.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.animations.ts new file mode 100755 index 0000000..6c84239 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.animations.ts @@ -0,0 +1,52 @@ +import { + animate, + keyframes, + query, + stagger, + state, + style, + transition, + trigger + } from '@angular/animations'; + + export const speedDialFabAnimations = [ + trigger('fabToggler', [ + state('inactive', style({ + transform: 'rotate(0deg)' + })), + state('active', style({ + transform: 'rotate(225deg)' + })), + transition('* <=> *', animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)')), + ]), + trigger('speedDialStagger', [ + transition('* => *', [ + + query(':enter', style({ opacity: 0 }), {optional: true}), + + query(':enter', stagger('40ms', + [ + animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)', + keyframes( + [ + style({opacity: 0, transform: 'translateY(10px)'}), + style({opacity: 1, transform: 'translateY(0)'}), + ] + ) + ) + ] + ), {optional: true}), + + query(':leave', + animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)', + keyframes([ + style({opacity: 1}), + style({opacity: 0}), + ]) + ), {optional: true} + ) + + ]) + ]) + ]; + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.html new file mode 100755 index 0000000..13faaab --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.html @@ -0,0 +1,26 @@ +
+
+ +
+ +
+ +
+
+ \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.scss new file mode 100755 index 0000000..729e995 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.scss @@ -0,0 +1,50 @@ +.fab-container { + position: absolute; + // top: 1%; + // right: 35%; + z-index: 100; + display: flex; + flex-direction: column; + align-items: center; + + > div { + display: flex; + flex-direction: row; + align-items: center; + // margin-top: 5px; + // margin-top: 5px; + position: absolute; + right: 67px; + // top: -13px; + + button { + // margin-top: 17px; + background: #cfdd49; + margin-left:10px; + } + } + } + @media(max-width:580px) { + .fab-container { + > div { + flex-direction: column !important; + right: 0px; + top: 53px; + } + } + } + + .fab-toggler { + float: right; + z-index: 100; + } + + #fab-dismiss { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 99; + } + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.spec.ts new file mode 100755 index 0000000..323c577 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SpeedDialFabComponent } from './speed-dial-fab.component'; + +describe('SpeedDialFabComponent', () => { + let component: SpeedDialFabComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SpeedDialFabComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SpeedDialFabComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.ts new file mode 100755 index 0000000..b478e8a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.ts @@ -0,0 +1,42 @@ +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { speedDialFabAnimations } from './speed-dial-fab.animations'; + +@Component({ + selector: 'app-speed-dial-fab', + templateUrl: './speed-dial-fab.component.html', + styleUrls: ['./speed-dial-fab.component.scss'], + animations: speedDialFabAnimations +}) +export class SpeedDialFabComponent implements OnInit { + + @Input() options; + @Output() fabClick = new EventEmitter() + buttons = []; + fabTogglerState = 'inactive'; + + constructor() { } + + ngOnInit() { + const maxButtons = 6; + if (this.options.buttons.length > maxButtons) { + this.options.buttons.splice(5, this.options.buttons.length - maxButtons); + } + } + + showItems() { + this.fabTogglerState = 'active'; + this.buttons = this.options.buttons; + } + + hideItems() { + this.fabTogglerState = 'inactive'; + this.buttons = []; + } + + onToggleFab() { + this.buttons.length ? this.hideItems() : this.showItems(); + } + onBtnClick(btnValue) { + this.fabClick.emit(btnValue) + } +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index b42d999..ca28cf1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -1,8 +1,26 @@ -
+
+
+ +
+ +
+
+ + + + + + @@ -11,6 +29,7 @@
+
@@ -20,7 +39,7 @@
-
+
{{master.pd_sno}}
@@ -30,7 +49,8 @@
- {{master.lender_short_name}} + {{master.lender_short_name}}
+

{{master.pd_type_name}}

{{master.branch_name}} @@ -53,7 +73,7 @@
- +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss index 62f3666..b40dcee 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss @@ -41,6 +41,14 @@ text-align: center; } } +.fab-group{ + // app-speed-dial-fab { + position: absolute; + @media(min-width:500px) { + // right: 415px; + } + // } +} // .mat-list .mat-list-item.center .mat-list-item-content{ // justify-content: center; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index ccb937b..0802da7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -18,6 +18,7 @@ import { InitiateAdditionalPdComponent } from './../initiate-additional-pd/initi /**sweet alert */ import Swal from 'sweetalert2'; +import { VideoPlayerComponent } from 'app/video-player/video-player.component'; @Component({ selector: 'app-view-pd', @@ -96,6 +97,31 @@ export class ViewPdComponent implements OnInit, OnDestroy { // @Output() loadParent = new EventEmitter(); public _EditPDtriggerForm: FormGroup; masterRandomString: any; + + FabOptions = { + buttons: [ + { + icon: 'camera', + placeholder:'Image Capture', + btnValue:'image' + }, + { + icon: 'videocam', + placeholder:'Video Chat', + btnValue:'video' + }, + // { + // icon: 'room' + // }, + // { + // icon: 'lightbulb_outline' + // }, + // { + // icon: 'lock' + // } + ] + }; + constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder, private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent) { this.notifier = notifier; @@ -420,6 +446,59 @@ export class ViewPdComponent implements OnInit, OnDestroy { this.notifier.notify('error',"Network Error!!") }) } + copyCusURL(event) { + // console.log(window.location); + console.log(event) + let cus_link; + if(event && event.btnValue == 'video') { + cus_link = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string+';id='+this.viewID+';type=1' + } + else if(event && event.btnValue == 'image') { + cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string+'/'+this.pdMasterData[0].lender_short_name; + } + // return; + // let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr; + // console.log(randomStr) + this._pd.copyToClipBoard(cus_link); + this.notifier.notify('info',event.placeholder+' Customer link copied'); + } + + openVideoChat(){ + // let dialogRef = this.dialog.open(VideoChatComponent,{ + // data:{type:'init',random_string:this.pdMasterData[0].random_string,pd_id:this.viewID}, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true, + // 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(){ + // if(this.videoplayback.url == null) { + // this.notifier.notify('info',"No Videos Found"); + // return; + // } + let params = {"pd_id":this.viewID,"random_string":this.masterRandomString} + this._pd.getRecordedPlaybackUrl(params).subscribe(result=>{ + if(result && result['dataStatus'] && result['records'] && result['records'].length > 0) { + let dialogRef = this.dialog.open(VideoPlayerComponent,{ + data:{videoUrl:result['records'],masterData:this.pdMasterData[0]}, + maxWidth: '90vw', + maxHeight: '100vh', + height: '90%', + // width: '70%', + disableClose: false, + panelClass:'video-player' + }) +} +else { + this.notifier.notify('info',"No Videos Found"); +} +}) +} // updateViewComponent(editBack:string) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 3fdec7c..2576df4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -124,6 +124,9 @@ import { GetAnswerableFormsPipe } from './../pd-pipes/get-answerable-forms.pipe' // import { ImageCropComponent } from './list-pd/start-pd/forms/dialogue/image-crop/image-crop.component'; import {AngularSplitModule} from 'angular-split'; import { ExcelUploadDialogComponent } from './list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component' +import { SpeedDialFabComponent } from './list-pd/view-pd/speed-dial-fab/speed-dial-fab.component'; +import { VideoPlayerComponent } from 'app/video-player/video-player.component'; +import { MatVideoModule } from 'mat-video'; /** * Custom angular notifier options @@ -170,7 +173,8 @@ const pdCustomNotifierOptions: NotifierOptions = { }; @NgModule({ - declarations: [TelePdAllocationComponent, ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, PdReportComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, DeleteRecordsCountPipe, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent, ExcelUploadDialogComponent], + declarations: [TelePdAllocationComponent, ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, PdReportComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, DeleteRecordsCountPipe, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent, ExcelUploadDialogComponent, + SpeedDialFabComponent,VideoPlayerComponent], imports: [ CommonModule, ManagePdRoutingModule, @@ -203,7 +207,8 @@ const pdCustomNotifierOptions: NotifierOptions = { NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,ResizableModule, AgmCoreModule.forRoot({apiKey: 'AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg'}),OwlDateTimeModule, OwlNativeDateTimeModule, - AngularSplitModule.forRoot() + AngularSplitModule.forRoot(), + MatVideoModule ], exports: [PdLocatedMapViewDirective, SmartPdAllocationComponent, TelePdAllocationComponent ,EditPdApplicantComponent, EditPdMasterComponent, CompletedPdComponent, QcCompletedPdComponent, PdRequirementComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent], @@ -211,7 +216,7 @@ const pdCustomNotifierOptions: NotifierOptions = { {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective], - entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent], + entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent,VideoPlayerComponent], }) export class ManagePdModule { } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 71e2233..e6897db 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -858,5 +858,27 @@ loadTemplate(form_id) { .pipe(catchError(this.handleError("smcCreditPDReport",[]))) } + // copy to clipboard functionality + copyToClipBoard(message) { + const selBox = document.createElement('textarea'); + selBox.style.position = 'fixed'; + selBox.style.left = '0'; + selBox.style.top = '0'; + selBox.style.opacity = '0'; + selBox.value = message; + document.body.appendChild(selBox); + selBox.focus(); + selBox.select(); + document.execCommand('copy'); + document.body.removeChild(selBox); + } + getRecordedPlaybackUrl(params){ + return this._http.post(this.apiUrl+'getVideoURL',params) + } + updateTwlioVideoStatus(params) { + return this._http.post(this.apiUrl+'updateTwlioVideoStatus',params) + .pipe(catchError(this.handleError("updateTwlioVideoStatus",[]))) + } + } diff --git a/ng6-seed/src/app/video-player/video-player.component.html b/ng6-seed/src/app/video-player/video-player.component.html new file mode 100755 index 0000000..63997bc --- /dev/null +++ b/ng6-seed/src/app/video-player/video-player.component.html @@ -0,0 +1,63 @@ +
+ + + + +
+ +
+
+ + +
+ + + + + +
+
+ +

{{item.video_name}}

+

{{item.date}}

+
+
+
+ +
+ +
+

{{item.duration}}

+

{{item.status}}

+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/ng6-seed/src/app/video-player/video-player.component.scss b/ng6-seed/src/app/video-player/video-player.component.scss new file mode 100755 index 0000000..6599f1a --- /dev/null +++ b/ng6-seed/src/app/video-player/video-player.component.scss @@ -0,0 +1,26 @@ +::ng-deep { .video-player > mat-dialog-container { + background: black; + padding: 0; + overflow-y: scroll !important; + } +} +.mat-raised-button{ + color: #ffffff; + background: #ffffff5c; +} +.mat-stroked-button{ + color: #ffffff; + // background: #ffffff5c; + border-color: #ffffff; +} +.playbackListClass{ + cursor: pointer; + // padding:5px; + min-height: 50px; +} +.playbackListClass :hover{ + background-color: darkred; + padding-bottom:5px; + padding-top: 5px; + // box-shadow: 2px 3px rgba(255, 0, 0, 0.308) +} \ No newline at end of file diff --git a/ng6-seed/src/app/video-player/video-player.component.spec.ts b/ng6-seed/src/app/video-player/video-player.component.spec.ts new file mode 100755 index 0000000..e4f72b3 --- /dev/null +++ b/ng6-seed/src/app/video-player/video-player.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { VideoPlayerComponent } from './video-player.component'; + +describe('VideoPlayerComponent', () => { + let component: VideoPlayerComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ VideoPlayerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(VideoPlayerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/video-player/video-player.component.ts b/ng6-seed/src/app/video-player/video-player.component.ts new file mode 100755 index 0000000..84950dc --- /dev/null +++ b/ng6-seed/src/app/video-player/video-player.component.ts @@ -0,0 +1,98 @@ +import { Component, OnInit, Inject, ViewChild, ElementRef } from '@angular/core'; +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({ + selector: 'app-video-player', + templateUrl: './video-player.component.html', + styleUrls: ['./video-player.component.scss'] +}) +export class VideoPlayerComponent implements OnInit { + playbackList = [] + // [{name:"Playback 1",duration:"20:01",date:"2020-05-20"}, + // {name:"Playback 2",duration:"20:01",date:"2020-05-20"}, + // {name:"Playback 3",duration:"20:01",date:"2020-05-20"}, + // {name:"Playback 4",duration:"20:01",date:"2020-05-20"}, + // {name:"Playback 5",duration:"20:01",date:"2020-05-20"}, + // {name:"Playback 6",duration:"20:01",date:"2020-05-20"}, + // {name:"Playback 7",duration:"20:01",date:"2020-05-20"},] + videoSrc + selectedVideoIndex: Number; + // videos_arr: any; + // = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4' + // = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4' + @ViewChild('videoPlayer') videoPlayerEle:ElementRef + notifier: NotifierService; + pdMasterData: any = {}; + constructor( @Inject(MAT_DIALOG_DATA) public data:any,private matDialogRef:MatDialogRef, + notifier:NotifierService,private _pd:PdTrigerService) { + this.notifier=notifier + if(data) { + if(data.hasOwnProperty('videoUrl') && data.videoUrl && data.videoUrl.length > 0) { + this.playbackList = data.videoUrl + // this.playbackList.push({video_name:"Sample 1",url : "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"}, + // {video_name:"Sample 2",url : "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"}) + // this.videoSrc = data.videoUrl + if(data && data.hasOwnProperty('masterData')) { + this.pdMasterData = data.masterData + console.log(this.pdMasterData) + } + if(this.playbackList.length > 0) { + let processingStatus = this.playbackList.filter(vv=>vv.url == '') + if(processingStatus.length > 0 ){ + processingStatus.forEach((re,index)=>{ + if(re && re.url == '') { + this.checkVideoStatus(index,re) + } + }) + } + + } + if(this.playbackList[0].url != ''){ + this.playVideo(0,this.playbackList[0]); + } + } + } + + } + + ngOnInit() { + let video_blob = localStorage.getItem('blob_url'); + if(video_blob) { + // this.videoSrc = video_blob; + console.log(this.videoSrc); + } + } + playVideo(i,obj) { + 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.videoSrc = obj.url + + if(this.videoPlayerEle && this.videoPlayerEle.nativeElement) { + this.videoPlayerEle.nativeElement.scrollIntoView({ behavior: "smooth", block: "start" }) + } + } + downloadVideo(url) { + console.log(url) + window.open(url); + } + checkVideoStatus(i,obj) { + if(obj && obj.hasOwnProperty('room_id') && obj.room_id) { + this._pd.updateTwlioVideoStatus({"pd_id":this.pdMasterData.pd_id,"random_string":this.pdMasterData.random_string,"room_id":obj.room_id}).subscribe(result=>{ + if(result && result['dataStatus']){ + if(result['records']) { + this.playbackList[i].url = result['records'] + this.playbackList[i].status = 'completed' + } + } + }) + } + + } + +} diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json index 86d1392..a6fd1c0 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json @@ -15,13 +15,6 @@ "onchange_properties": null, "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -35,13 +28,6 @@ "answers": null, "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -54,13 +40,6 @@ "onchange_properties": null, "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -73,13 +52,6 @@ "onchange_properties": null, "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -93,13 +65,6 @@ "onchange_properties": null, "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -141,13 +106,6 @@ "onchange_properties": null, "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -170,13 +128,6 @@ ], "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -199,13 +150,6 @@ ], "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] }, { @@ -228,13 +172,6 @@ ], "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field Required", - "value": null - } ] } ], diff --git a/ng6-seed/src/assets/images/img/video-icon.png b/ng6-seed/src/assets/images/img/video-icon.png new file mode 100755 index 0000000..3a0ed92 Binary files /dev/null and b/ng6-seed/src/assets/images/img/video-icon.png differ diff --git a/ng6-seed/src/assets/spinner/equalizer.gif b/ng6-seed/src/assets/spinner/equalizer.gif new file mode 100644 index 0000000..12ce5f0 Binary files /dev/null and b/ng6-seed/src/assets/spinner/equalizer.gif differ