Fairoj : copy customer link feature and allocation flow of telepd changed as full pd

This commit is contained in:
venbatechnologies@gmail.com 2020-04-10 13:45:24 +05:30
parent 9b150a0682
commit a0737f1a4d
12 changed files with 102 additions and 21 deletions

View File

@ -135,13 +135,20 @@
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<a style="float: left" [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">
<mat-icon>my_location</mat-icon>
</button>
</a>
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)"
<button *ngIf="details.fk_pd_type == '3'"
mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="copyCusURL(details.random_string)"
matTooltip="Copy Customer Link" matTooltipPosition="above">
<mat-icon>link</mat-icon>
</button>
<button style="float: right" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>

View File

@ -238,4 +238,12 @@ export class AllPdComponent implements OnInit, OnChanges {
this.dataSourceTab1.paginator = this.paginator;
this.dataSourceTab1.sort = this.sort;
}
copyCusURL(randomStr) {
// console.log(window.location);
let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr;
console.log(randomStr)
this._pd.copyToClipBoard(cus_link);
this.notifier.notify('info','Customer link copied');
}
}

View File

@ -119,7 +119,13 @@
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<!-- <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" -->
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" matTooltip="View"
<button *ngIf="details.fk_pd_type == '3'"
mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="copyCusURL(details.random_string)"
matTooltip="Copy Customer Link" matTooltipPosition="above">
<mat-icon>link</mat-icon>
</button>
<button style ="float: right" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" matTooltip="View"
matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>

View File

@ -246,7 +246,13 @@ export class CompletedPdComponent implements OnInit, OnChanges {
this.dataSourceTab4.paginator = this.paginator;
this.dataSourceTab4.sort = this.sort;
}
copyCusURL(randomStr) {
// console.log(window.location);
let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr;
console.log(randomStr)
this._pd.copyToClipBoard(cus_link);
this.notifier.notify('info','Customer link copied');
}
}

View File

@ -115,7 +115,12 @@
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" matTooltip="View" matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
<button *ngIf="details.fk_pd_type == '3'"
mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="copyCusURL(details.random_string)"
matTooltip="Copy Customer Link" matTooltipPosition="above">
<mat-icon>link</mat-icon>
</button>
<button style="float: right" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" matTooltip="View" matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">

View File

@ -238,5 +238,12 @@ export class InprogressPdComponent implements OnInit, OnChanges {
this.dataSourceTab2.paginator = this.paginator;
this.dataSourceTab2.sort = this.sort;
}
copyCusURL(randomStr) {
// console.log(window.location);
let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr;
console.log(randomStr)
this._pd.copyToClipBoard(cus_link);
this.notifier.notify('info','Customer link copied');
}
}

View File

@ -118,7 +118,13 @@
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<!-- <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id)" matTooltip="View" matTooltipPosition="above" color="primary"><mat-icon>visibility</mat-icon></button> -->
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" color="primary" matTooltip="View" matTooltipPosition="above"><mat-icon>visibility</mat-icon></button>
<button *ngIf="details.fk_pd_type == '3'"
mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="copyCusURL(details.random_string)"
matTooltip="Copy Customer Link" matTooltipPosition="above">
<mat-icon>link</mat-icon>
</button>
<button style="float: right" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" color="primary" matTooltip="View" matTooltipPosition="above"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">

View File

@ -220,4 +220,11 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
this.loadPDDetails();
this.xpandStatus = false;
}
copyCusURL(randomStr) {
// console.log(window.location);
let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr;
console.log(randomStr)
this._pd.copyToClipBoard(cus_link);
this.notifier.notify('info','Customer link copied');
}
}

View File

@ -118,7 +118,12 @@
</ng-container>
<ng-container matColumnDef="Action">
<mat-cell class="cell center" *matCellDef="let details;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" color="primary" matTooltip="View" matTooltipPosition="above"><mat-icon>visibility</mat-icon></button>
<button *ngIf="details.fk_pd_type == '3'"
mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="copyCusURL(details.random_string)"
matTooltip="Copy Customer Link" matTooltipPosition="above">
<mat-icon>link</mat-icon>
</button>
<button style="float: right" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" color="primary" matTooltip="View" matTooltipPosition="above"><mat-icon>visibility</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">

View File

@ -234,6 +234,13 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
this.loadPDDetails();
this.xpandStatus = false;
}
copyCusURL(randomStr) {
// console.log(window.location);
let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr;
console.log(randomStr)
this._pd.copyToClipBoard(cus_link);
this.notifier.notify('info','Customer link copied');
}
}

View File

@ -330,7 +330,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// pd allocation to
pdAllocationTo(pdData: any,childData: any) {
pdData.pd_id = childData.assigned_pd;
if (pdData.fk_pd_type == 1) {
if (pdData.fk_pd_type == 1 || pdData.fk_pd_type == 3) {
const dialogRef = this.dialog.open(PdAllocationComponent, {
data: pdData,
position: { right: '0' },
@ -357,20 +357,23 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
else if (pdData.fk_pd_type == 3) {
const dialogRef = this.dialog.open(TelePdAllocationComponent, {
data: pdData,
position: { right: '0' },
width: '80%',
disableClose: true,
});
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID,this.masterRandomString)
});
}
// Tele pd treated as full pd in allocation process
// else if (pdData.fk_pd_type == 3) {
// const dialogRef = this.dialog.open(TelePdAllocationComponent, {
// data: pdData,
// position: { right: '0' },
// width: '80%',
// disableClose: true,
// });
// dialogRef.afterClosed()
// .subscribe(dataresult => {
// // this.notifier.notify('success', 'Successfully allocated.!');
// this.viewPdDetails(this.viewID,this.masterRandomString)
// });
// }
}

View File

@ -823,4 +823,18 @@ export class PdTrigerService {
.pipe(catchError(this.handleError("checkExistPDDetails",[])))
}
// 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);
}
}