Add AccountCode field in settings component's integration tab

This commit is contained in:
Rene V. Vergara A. 2022-09-02 06:33:24 -05:00
parent 0eb84b8f7c
commit ab11c949eb
2 changed files with 92 additions and 53 deletions

View file

@ -77,69 +77,88 @@
<mat-tab *ngIf="proVersion" <mat-tab *ngIf="proVersion"
label="Integrations" label="Integrations"
style="align-items: center;"> style="align-items: center;">
<div style="height: 20px; <div class="container" style="margin-bottom: 20px;">
margin-top: 10px;"> <mat-dialog-content [formGroup]="settingsForm">
</div> <div style="height: 10px;
<div class="container" margin-top: 10px;">
style="height: 300;"> </div>
<p style="text-align:center"> <mat-form-field class="settings-field" [style.width.%]="100">
<a mat-raised-button <mat-label>Account Code</mat-label>
color="primary" <input matInput
href="{{this.xeroLink}}"> width="100%"
{{ linkMsg }} placeholder="9999999999"
</a> formControlName="xeroAccCod"
</p> (change)="xeroAccCodChanged($event)">
</mat-form-field>
<div style="height: 10px;
margin-top: 10px;">
</div>
<div class="container"
style="height: 300;">
<p style="text-align:center">
<a mat-raised-button
color="primary"
href="{{this.xeroLink}}">
{{ linkMsg }}
</a>
</p>
<table *ngIf="linked2Xero" <table *ngIf="linked2Xero"
style="width:100%; [style.width.%]="100"
margin-top: 10px;"> style="margin-top: 10px;">
<thead style="width: 100%;"> <thead style="width: 100%;">
<tr> <tr>
<th class="urlLabel" <th class="urlLabel"
style="text-align: left;" style="text-align: left;"
width="94%">Payment Service URL: width="94%">Payment Service URL:
</th> </th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<td class="urlDetail" <td class="urlDetail"
style="text-align: left;" style="text-align: left;"
width="94%"> width="94%">
<div> <div>
<textarea disabled <textarea disabled
style="font-size: 10px !important; style="font-size: 10px !important;
border: none; border: none;
outline: none; outline: none;
min-height: 150px; min-height: 150px;
width: 95%;" width: 95%;"
cdkTextareaAutosize cdkTextareaAutosize
cdkAutosizeMinRows="6" cdkAutosizeMinRows="6"
cdkAutosizeMaxRows="10">{{ pmtServiceURL }} cdkAutosizeMaxRows="10">{{ pmtServiceURL }}
</textarea> </textarea>
</div> </div>
</td>
<td class="urlCopyBtn">
<a (click)='copyUrl()' >
<fa-icon [icon]="faCopy"
class="copy-button">
</fa-icon>
</a>
</td>
</tbody>
</table>
</td>
<td class="urlCopyBtn">
<a (click)='copyUrl()' >
<fa-icon [icon]="faCopy"
class="copy-button">
</fa-icon>
</a>
</td>
</tbody>
</table>
</div>
</mat-dialog-content>
</div> </div>
<div class="container" <div class="container"
style="display: flex; style="display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;"> align-items: center;">
<button mat-raised-button <button mat-raised-button
(click)="close()"> (click)="closeIntegration()">
Close Close
</button> </button>
<button *ngIf="saveAccOk"
mat-raised-button
color="primary"
(click)="saveAccCod()">
Save Code
</button>
</div> </div>
<div style="height: 20px; <div style="height: 20px;
margin-top: 10px;"> margin-top: 10px;">

View file

@ -28,6 +28,8 @@ export class SettingsComponent implements OnInit {
proVersion: boolean = false; proVersion: boolean = false;
useVKey: boolean = false; useVKey: boolean = false;
linkMsg: String = 'Link to Xero'; linkMsg: String = 'Link to Xero';
xeroAccCod: String = '';
saveAccOk: boolean = false;
coins = [ coins = [
{ {
@ -103,6 +105,14 @@ export class SettingsComponent implements OnInit {
} }
close() { close() {
this.dialogRef.close();
}
closeIntegration() {
if ( this.xeroAccCod == '' )
this.notifierService
.showNotification("Warning: Payment confirmation disabled","Close",'success');
this.dialogRef.close(); this.dialogRef.close();
} }
@ -137,6 +147,10 @@ export class SettingsComponent implements OnInit {
} }
saveAccCod() {
}
copyUrl() { copyUrl() {
// console.log("Inside copyUrl()"); // console.log("Inside copyUrl()");
if (navigator.clipboard) { if (navigator.clipboard) {
@ -152,6 +166,12 @@ export class SettingsComponent implements OnInit {
.showNotification("Functionality not available for your browser. Use send button instead.","Close",'error'); .showNotification("Functionality not available for your browser. Use send button instead.","Close",'error');
} }
} }
xeroAccCodChanged( arg: any ) {
// console.log("Account Code changed: " + arg.target.value);
// console.log(arg);
this.saveAccOk = (arg.target.value !== '');
}
} }