2021-10-28 20:34:48 +00:00
|
|
|
import { Inject, Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core';
|
|
|
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
2022-03-07 19:46:00 +00:00
|
|
|
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
2022-07-13 12:20:47 +00:00
|
|
|
import { UntypedFormBuilder, Validators, UntypedFormGroup, FormControl } from '@angular/forms';
|
2023-02-14 03:39:11 +00:00
|
|
|
import { Subject, Observable } from 'rxjs';
|
2022-07-18 23:41:31 +00:00
|
|
|
import { Owner } from '../owner.model';
|
2022-08-10 19:12:28 +00:00
|
|
|
import { XeroService } from '../xero.service';
|
2022-12-23 20:40:24 +00:00
|
|
|
import { WoocommerceService } from '../woocommerce.service';
|
2022-08-09 22:23:58 +00:00
|
|
|
|
2022-08-31 20:50:53 +00:00
|
|
|
import { NotifierService } from '../notifier.service';
|
|
|
|
import { faCopy } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
|
2023-02-14 03:39:11 +00:00
|
|
|
import { LanguageService } from '../language.service';
|
|
|
|
import { LanguageData } from '../language.model';
|
2022-08-31 20:50:53 +00:00
|
|
|
|
2021-10-28 20:34:48 +00:00
|
|
|
@Component({
|
|
|
|
selector: 'app-settings',
|
|
|
|
templateUrl: './settings.component.html',
|
|
|
|
styleUrls: ['/settings.component.css']
|
|
|
|
})
|
|
|
|
|
|
|
|
export class SettingsComponent implements OnInit {
|
|
|
|
|
2022-08-31 20:50:53 +00:00
|
|
|
// ------------------------------------
|
|
|
|
//
|
|
|
|
faCopy = faCopy;
|
|
|
|
// ------------------------------------
|
2022-07-13 12:20:47 +00:00
|
|
|
settingsForm: UntypedFormGroup;
|
2022-09-07 02:44:36 +00:00
|
|
|
accCodForm: UntypedFormGroup;
|
2021-10-28 20:34:48 +00:00
|
|
|
owner: Owner;
|
2022-03-07 19:46:00 +00:00
|
|
|
useZats: boolean;
|
2022-08-23 21:22:34 +00:00
|
|
|
proVersion: boolean = false;
|
2022-07-20 01:48:52 +00:00
|
|
|
useVKey: boolean = false;
|
2023-02-14 03:39:11 +00:00
|
|
|
linkMsg: string = '';
|
2022-09-06 20:44:01 +00:00
|
|
|
xeroAccCod: string = '';
|
2022-09-02 11:33:24 +00:00
|
|
|
saveAccOk: boolean = false;
|
2023-05-09 16:16:09 +00:00
|
|
|
private viewkey: string = '';
|
2022-08-31 20:50:53 +00:00
|
|
|
|
2021-11-22 20:37:45 +00:00
|
|
|
coins = [
|
|
|
|
{
|
|
|
|
label: 'US Dollar',
|
|
|
|
symbol: 'usd'
|
|
|
|
},{
|
|
|
|
label: 'Euro',
|
|
|
|
symbol: 'eur'
|
|
|
|
},{
|
|
|
|
label: 'British Pound',
|
|
|
|
symbol: 'gbp'
|
|
|
|
},{
|
|
|
|
label: 'Canadian Dollar',
|
|
|
|
symbol: 'cad'
|
|
|
|
},{
|
|
|
|
label: 'Australian Dollar',
|
|
|
|
symbol: 'aud'
|
2022-09-06 15:06:22 +00:00
|
|
|
},{
|
|
|
|
label: 'New Zealand Dollar',
|
|
|
|
symbol: 'nzd'
|
2021-11-22 20:37:45 +00:00
|
|
|
}
|
|
|
|
];
|
2022-08-09 22:23:58 +00:00
|
|
|
xeroLink: string = '';
|
|
|
|
localToken: string = '';
|
2022-08-10 19:12:28 +00:00
|
|
|
clientId: string = '';
|
2022-12-23 20:40:24 +00:00
|
|
|
wooOwner: string = '';
|
|
|
|
wooToken: string = '';
|
|
|
|
wooUrl: string = '';
|
|
|
|
wooOwnerUpdate: Observable<string>;
|
|
|
|
wooTokenUpdate: Observable<string>;
|
|
|
|
wooUrlUpdate: Observable<string>;
|
|
|
|
|
2022-08-10 19:12:28 +00:00
|
|
|
clientIdUpdate: Observable<string>;
|
2022-09-06 20:44:01 +00:00
|
|
|
accCodeUpdate: Observable<string>;
|
2022-08-31 20:50:53 +00:00
|
|
|
linked2Xero : boolean = false;
|
|
|
|
pmtServiceURL : string = '';
|
2023-02-14 03:39:11 +00:00
|
|
|
// -------------------------------------
|
|
|
|
//
|
|
|
|
// Language Support
|
|
|
|
//
|
|
|
|
vE = {
|
|
|
|
settingsAcodeInvalid : '',
|
|
|
|
settingsAcodeLbl : '',
|
|
|
|
settingsAcodeNotsaved : '',
|
|
|
|
settingsAcodeSaved : '',
|
|
|
|
settingsCloseBtn : '',
|
|
|
|
settingsConfirmPayments : '',
|
|
|
|
settingsCopyNotavail : '',
|
|
|
|
settingsCurrencyLbl : '',
|
|
|
|
settingsLink2Xero : '',
|
|
|
|
settingsNameLbl : '',
|
|
|
|
settingsNamePlaceholder : '',
|
|
|
|
settingsNotservClose : '',
|
|
|
|
settingsNotservError : '',
|
|
|
|
settingsNotservSuccess : '',
|
|
|
|
settingsNotservWarning : '',
|
|
|
|
settingsOwneridCopied : '',
|
|
|
|
settingsOwneridNotcopied : '',
|
|
|
|
settingsPmtservURL : '',
|
|
|
|
settingsRelink2Xero : '',
|
|
|
|
settingsSaveBtn : '',
|
|
|
|
settingsTabIntegrations : '',
|
|
|
|
settingsTabMainlbl : '',
|
|
|
|
settingsURLCopied : '',
|
|
|
|
settingsUseSatoshi : '',
|
|
|
|
settingsViewTitle : '',
|
|
|
|
settingsVkeyLbl : '',
|
|
|
|
settingsVkeyPlaceholder : '',
|
|
|
|
settingsWCClosebtn : '',
|
|
|
|
settingsWCGentoken : '',
|
|
|
|
settingsWCLbl : '',
|
|
|
|
settingsWCOwnerlbl : '',
|
|
|
|
settingsWCTokenCopied : '',
|
|
|
|
settingsWCTokenGenerated : '',
|
|
|
|
settingsWCTokenGenfail : '',
|
|
|
|
settingsWCTokenNotcopied : '',
|
|
|
|
settingsXeroClosebtn : '',
|
|
|
|
settingsXeroLbl : '',
|
|
|
|
settingsXeropmtConfirmdis : '',
|
|
|
|
settingsXeroSavebtn : ''
|
|
|
|
};
|
|
|
|
//
|
|
|
|
languageRdy = new Subject<boolean>();
|
2021-10-28 20:34:48 +00:00
|
|
|
|
2023-02-14 03:39:11 +00:00
|
|
|
// ------------------------------------------------------------
|
2021-10-28 20:34:48 +00:00
|
|
|
constructor(
|
2023-02-14 03:39:11 +00:00
|
|
|
private languageService : LanguageService,
|
2022-08-31 20:50:53 +00:00
|
|
|
private notifierService : NotifierService,
|
2022-07-13 12:20:47 +00:00
|
|
|
private fb: UntypedFormBuilder,
|
2022-08-10 19:12:28 +00:00
|
|
|
public xeroService: XeroService,
|
2022-12-23 20:40:24 +00:00
|
|
|
public wooService: WoocommerceService,
|
2021-10-28 20:34:48 +00:00
|
|
|
private dialogRef: MatDialogRef<SettingsComponent>,
|
2023-05-15 14:48:57 +00:00
|
|
|
@Inject(MAT_DIALOG_DATA) public data: {o: Owner}) {
|
2023-05-09 16:16:09 +00:00
|
|
|
this.useZats = data.o.zats;
|
|
|
|
this.useVKey = data.o.payconf;
|
2022-07-22 04:06:23 +00:00
|
|
|
this.settingsForm = fb.group({
|
2023-05-09 16:16:09 +00:00
|
|
|
name: [data.o.name, Validators.required],
|
|
|
|
currency: [data.o.currency, Validators.required],
|
|
|
|
useZats: [data.o.zats, Validators.required],
|
|
|
|
useVKey: [data.o.payconf, Validators.required],
|
2022-09-07 02:44:36 +00:00
|
|
|
// proVersion: [data.invoices, Validators.required],
|
2023-05-15 14:48:57 +00:00
|
|
|
vKey: [data.o.viewkey]
|
2022-09-07 02:44:36 +00:00
|
|
|
});
|
|
|
|
this.accCodForm = fb.group ({
|
|
|
|
xAcc: [this.xeroAccCod]
|
|
|
|
});
|
|
|
|
|
2023-05-09 16:16:09 +00:00
|
|
|
if (data.o.payconf) {
|
2022-07-22 04:06:23 +00:00
|
|
|
this.settingsForm.get('vKey')!.enable();
|
|
|
|
}
|
2023-05-09 16:16:09 +00:00
|
|
|
this.owner = data.o;
|
2023-05-15 14:48:57 +00:00
|
|
|
this.viewkey = data.o.viewkey;
|
2022-08-27 00:16:00 +00:00
|
|
|
this.proVersion = this.owner.invoices;
|
2022-08-31 20:50:53 +00:00
|
|
|
if ( this.owner.crmToken !== '' ) {
|
|
|
|
this.linked2Xero = true;
|
|
|
|
}
|
2022-08-10 19:12:28 +00:00
|
|
|
this.clientIdUpdate = xeroService.clientIdUpdate;
|
|
|
|
xeroService.getXeroConfig();
|
|
|
|
this.clientIdUpdate.subscribe(clientId => {
|
|
|
|
this.clientId = clientId;
|
2022-09-07 22:00:01 +00:00
|
|
|
this.xeroLink = `https://login.xero.com/identity/connect/authorize?response_type=code&client_id=${this.clientId}&redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Fxeroauth&scope=accounting.transactions offline_access&state=${this.owner.address.substring(0, 6)}`
|
2022-08-10 19:12:28 +00:00
|
|
|
});
|
2022-09-06 20:44:01 +00:00
|
|
|
this.accCodeUpdate = xeroService.accCodeUpdate;
|
|
|
|
xeroService.getXeroAccountCode(this.owner.address);
|
|
|
|
this.accCodeUpdate.subscribe(accData => {
|
|
|
|
this.xeroAccCod = accData;
|
2023-05-10 16:05:15 +00:00
|
|
|
//console.log("xeroAccCod -> [" + this.xeroAccCod + "]");
|
2022-09-07 02:44:36 +00:00
|
|
|
this.accCodForm.get('xAcc')!.setValue(this.xeroAccCod);
|
2022-09-06 20:44:01 +00:00
|
|
|
});
|
2022-12-23 20:40:24 +00:00
|
|
|
this.wooOwnerUpdate = wooService.ownerUpdate;
|
|
|
|
this.wooTokenUpdate = wooService.tokenUpdate;
|
|
|
|
this.wooUrlUpdate = wooService.siteurlUpdate;
|
|
|
|
wooService.getWooToken(this.owner._id!);
|
|
|
|
this.wooOwnerUpdate.subscribe(owData => {
|
|
|
|
this.wooOwner = owData;
|
|
|
|
});
|
|
|
|
this.wooTokenUpdate.subscribe(tkData => {
|
|
|
|
this.wooToken = tkData;
|
|
|
|
});
|
|
|
|
this.wooUrlUpdate.subscribe(uData => {
|
|
|
|
this.wooUrl = uData;
|
|
|
|
});
|
2021-10-28 20:34:48 +00:00
|
|
|
}
|
|
|
|
|
2023-02-14 03:39:11 +00:00
|
|
|
|
2021-10-28 20:34:48 +00:00
|
|
|
ngOnInit() {
|
2023-02-14 03:39:11 +00:00
|
|
|
|
2022-08-12 20:31:01 +00:00
|
|
|
this.settingsForm.get('vKey')!.disable();
|
2023-02-14 03:39:11 +00:00
|
|
|
//
|
|
|
|
this.chgUILanguage();
|
2023-05-10 16:05:15 +00:00
|
|
|
//console.log('SETTINGS: Return from chgUILanguage()');
|
2023-02-14 03:39:11 +00:00
|
|
|
//
|
|
|
|
this.languageRdy.subscribe (
|
|
|
|
data => {
|
|
|
|
this.linkMsg = this.vE.settingsLink2Xero;
|
|
|
|
this.pmtServiceURL + '';
|
|
|
|
if ( this.linked2Xero ) {
|
|
|
|
this.linkMsg = this.vE.settingsRelink2Xero; //'Relink to Xero';
|
|
|
|
this.pmtServiceURL =
|
|
|
|
'https://zgo.cash/pmtservice?owner=' +
|
|
|
|
this.owner._id +
|
|
|
|
'&invoiceNo=[INVOICENUMBER]¤cy=[CURRENCY]&amount=[AMOUNTDUE]&shortCode=[SHORTCODE]';
|
|
|
|
}
|
|
|
|
});
|
2022-08-09 22:23:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
safeURL(s: string){
|
|
|
|
return s.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
2021-10-28 20:34:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
close() {
|
2022-09-02 11:33:24 +00:00
|
|
|
|
|
|
|
this.dialogRef.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
closeIntegration() {
|
2022-09-08 16:35:55 +00:00
|
|
|
if ( (this.xeroAccCod == '') && (this.linked2Xero) )
|
2022-09-02 11:33:24 +00:00
|
|
|
this.notifierService
|
2023-02-14 03:39:11 +00:00
|
|
|
.showNotification(this.vE.settingsXeropmtConfirmdis ,
|
|
|
|
this.vE.settingsNotservClose,'warning',
|
|
|
|
this.vE.settingsNotservWarning);
|
2021-10-28 20:34:48 +00:00
|
|
|
this.dialogRef.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
save() {
|
|
|
|
this.owner.name = this.settingsForm.value.name;
|
2021-11-22 20:37:45 +00:00
|
|
|
this.owner.currency = this.settingsForm.value.currency;
|
2022-07-20 01:48:52 +00:00
|
|
|
this.owner.zats = this.settingsForm.value.useZats;
|
2022-07-20 16:10:24 +00:00
|
|
|
this.owner.payconf = this.settingsForm.value.useVKey;
|
2023-05-09 16:16:09 +00:00
|
|
|
this.viewkey = this.settingsForm.value.vKey;
|
2022-10-08 13:52:09 +00:00
|
|
|
//this.owner.invoices = this.settingsForm.value.proVersion
|
2021-10-28 20:34:48 +00:00
|
|
|
this.dialogRef.close(this.owner);
|
|
|
|
}
|
2022-03-07 19:46:00 +00:00
|
|
|
|
|
|
|
onChange(ob: MatSlideToggleChange) {
|
|
|
|
this.useZats = ob.checked;
|
|
|
|
}
|
2022-07-18 23:41:31 +00:00
|
|
|
|
2022-08-23 21:22:34 +00:00
|
|
|
onChangeProVersion(ob: MatSlideToggleChange) {
|
|
|
|
this.proVersion = ob.checked;
|
|
|
|
}
|
|
|
|
|
2022-07-18 23:41:31 +00:00
|
|
|
onChangeVKeyOn(ob: MatSlideToggleChange) {
|
2022-07-26 00:21:15 +00:00
|
|
|
// console.log("Viewing key switch is " +
|
|
|
|
// ( ob.checked ? "[ON]." : "[OFF]." ) );
|
2022-07-20 01:48:52 +00:00
|
|
|
|
|
|
|
this.useVKey = ob.checked;
|
|
|
|
|
|
|
|
if ( ob.checked )
|
2022-07-20 15:31:23 +00:00
|
|
|
this.settingsForm.get('vKey')!.enable();
|
2022-07-20 01:48:52 +00:00
|
|
|
else
|
2022-07-20 15:31:23 +00:00
|
|
|
this.settingsForm.get('vKey')!.disable();
|
2022-07-20 01:48:52 +00:00
|
|
|
|
2022-07-18 23:41:31 +00:00
|
|
|
}
|
2022-08-31 20:50:53 +00:00
|
|
|
|
|
|
|
copyUrl() {
|
|
|
|
// console.log("Inside copyUrl()");
|
|
|
|
if (navigator.clipboard) {
|
|
|
|
};
|
|
|
|
try {
|
|
|
|
navigator.clipboard.writeText(this.pmtServiceURL);
|
|
|
|
this.notifierService
|
2023-02-14 03:39:11 +00:00
|
|
|
.showNotification(this.vE.settingsURLCopied,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
'success',
|
|
|
|
this.vE.settingsNotservSuccess);
|
2022-08-31 20:50:53 +00:00
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
// console.error("Error", err);
|
|
|
|
this.notifierService
|
2023-02-14 03:39:11 +00:00
|
|
|
.showNotification(this.vE.settingsCopyNotavail,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
'error',
|
|
|
|
this.vE.settingsNotservError);
|
2022-08-31 20:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-02 11:33:24 +00:00
|
|
|
|
2022-12-23 20:40:24 +00:00
|
|
|
copyWooOwner(){
|
|
|
|
try {
|
|
|
|
navigator.clipboard.writeText(this.wooOwner);
|
2023-02-14 03:39:11 +00:00
|
|
|
this.notifierService.showNotification(this.vE.settingsOwneridCopied,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"success",
|
|
|
|
this.vE.settingsNotservSuccess);
|
2022-12-23 20:40:24 +00:00
|
|
|
} catch (err) {
|
2023-02-14 03:39:11 +00:00
|
|
|
this.notifierService.showNotification(this.vE.settingsOwneridNotcopied,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"error",
|
|
|
|
this.vE.settingsNotservError);
|
2022-12-23 20:40:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
copyWooToken(){
|
|
|
|
try {
|
|
|
|
navigator.clipboard.writeText(this.wooToken);
|
2023-02-14 03:39:11 +00:00
|
|
|
this.notifierService.showNotification(this.vE.settingsWCTokenCopied,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"success",
|
|
|
|
this.vE.settingsNotservSuccess);
|
2022-12-23 20:40:24 +00:00
|
|
|
} catch (err) {
|
2023-02-14 03:39:11 +00:00
|
|
|
this.notifierService.showNotification(this.vE.settingsWCTokenNotcopied,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"error",
|
|
|
|
this.vE.settingsNotservError);
|
2022-12-23 20:40:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
generateWooToken(){
|
2023-01-04 20:50:52 +00:00
|
|
|
this.wooService.createWooToken(this.owner._id!).subscribe(responseData => {
|
|
|
|
if (responseData.status == 202) {
|
2023-02-14 03:39:11 +00:00
|
|
|
this.notifierService.showNotification(
|
|
|
|
this.vE.settingsWCTokenGenerated,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"success",
|
|
|
|
this.vE.settingsNotservSuccess);
|
2023-01-04 20:50:52 +00:00
|
|
|
this.wooService.getWooToken(this.owner._id!);
|
|
|
|
this.wooOwnerUpdate.subscribe(owData => {
|
|
|
|
this.wooOwner = owData;
|
|
|
|
});
|
|
|
|
this.wooTokenUpdate.subscribe(tkData => {
|
|
|
|
this.wooToken = tkData;
|
|
|
|
});
|
|
|
|
this.wooUrlUpdate.subscribe(uData => {
|
|
|
|
this.wooUrl = uData;
|
|
|
|
});
|
|
|
|
close();
|
|
|
|
} else {
|
2023-02-14 03:39:11 +00:00
|
|
|
this.notifierService.showNotification(
|
|
|
|
this.vE.settingsWCTokenGenfail,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"error",
|
|
|
|
this.vE.settingsNotservError);
|
2023-01-04 20:50:52 +00:00
|
|
|
}
|
|
|
|
});
|
2022-12-23 20:40:24 +00:00
|
|
|
}
|
|
|
|
|
2022-09-07 02:44:36 +00:00
|
|
|
saveAccCod() {
|
2022-09-07 22:04:07 +00:00
|
|
|
|
2022-09-07 02:44:36 +00:00
|
|
|
this.xeroAccCod = this.accCodForm.value.xAcc;
|
2023-05-10 16:05:15 +00:00
|
|
|
//console.log(">>> " + this.xeroAccCod);
|
2022-09-07 02:44:36 +00:00
|
|
|
if ( this.xeroAccCod.length <= 10 ) {
|
2022-09-08 03:00:43 +00:00
|
|
|
const obs = this.xeroService
|
|
|
|
.setXeroAccountCode(this.owner.address,
|
|
|
|
this.xeroAccCod);
|
2023-05-10 16:05:15 +00:00
|
|
|
obs.subscribe({ next: responseData => {
|
|
|
|
if (responseData.status == 202) {
|
|
|
|
//console.log('Account saved');
|
|
|
|
this.notifierService
|
|
|
|
.showNotification(this.vE.settingsAcodeSaved,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"success",
|
|
|
|
this.vE.settingsNotservSuccess);
|
|
|
|
} else {
|
|
|
|
//console.log('Account not saved -> status[' + responseData.status + ']');
|
|
|
|
this.notifierService
|
|
|
|
.showNotification(
|
|
|
|
this.vE.settingsAcodeNotsaved,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"error",
|
|
|
|
this.vE.settingsNotservError);
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
error: error => {
|
|
|
|
//console.log('Error saving Account Code -> ' + error.msg)
|
|
|
|
}});
|
2022-09-07 02:44:36 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
this.notifierService
|
2023-02-14 03:39:11 +00:00
|
|
|
.showNotification(
|
|
|
|
this.vE.settingsAcodeInvalid,
|
|
|
|
this.vE.settingsNotservClose,
|
|
|
|
"error",
|
|
|
|
this.vE.settingsNotservError);
|
2022-09-07 22:04:07 +00:00
|
|
|
};
|
2022-09-07 02:44:36 +00:00
|
|
|
}
|
2022-09-09 00:57:11 +00:00
|
|
|
/*
|
2022-09-02 11:33:24 +00:00
|
|
|
xeroAccCodChanged( arg: any ) {
|
2022-09-09 00:57:11 +00:00
|
|
|
console.log("Account Code changed: " + arg.target.value);
|
2022-09-02 11:33:24 +00:00
|
|
|
// console.log(arg);
|
2022-09-07 02:44:36 +00:00
|
|
|
this.saveAccOk = (arg.target.value != this.xeroAccCod );
|
2022-09-02 11:33:24 +00:00
|
|
|
}
|
2022-09-09 00:57:11 +00:00
|
|
|
*/
|
|
|
|
checkStatus( arg : any ) {
|
2023-05-10 16:05:15 +00:00
|
|
|
//console.log('onChange - checkStatus');
|
|
|
|
//console.log(arg.target.value);
|
2022-09-09 00:57:11 +00:00
|
|
|
this.saveAccOk = (arg.target.value != this.xeroAccCod );
|
|
|
|
}
|
2023-02-14 03:39:11 +00:00
|
|
|
|
|
|
|
chgUILanguage(){
|
2023-05-10 16:05:15 +00:00
|
|
|
//console.log('SETTINGS.chgUILanguage Called ');
|
2023-05-10 16:21:24 +00:00
|
|
|
this.languageService.getViewElements('settings').subscribe({
|
|
|
|
next: response => {
|
|
|
|
//console.log('Received >> ', response );
|
|
|
|
//console.log('Language Code : ', response.language);
|
|
|
|
//console.log('Component Name : ',response.component);
|
|
|
|
//console.log('Language data : ',response.data);
|
|
|
|
|
|
|
|
this.vE.settingsViewTitle = response.data.settings_view_title;
|
|
|
|
this.vE.settingsTabMainlbl = response.data.settings_tab_mainlbl;
|
|
|
|
this.vE.settingsNameLbl = response.data.settings_name_lbl;
|
|
|
|
this.vE.settingsCurrencyLbl = response.data.settings_currency_lbl;
|
|
|
|
this.vE.settingsNamePlaceholder = response.data.settings_name_placeholder;
|
|
|
|
this.vE.settingsUseSatoshi = response.data.settings_use_satoshi;
|
|
|
|
this.vE.settingsVkeyLbl = response.data.settings_vkey_lbl;
|
|
|
|
this.vE.settingsVkeyPlaceholder = response.data.settings_vkey_placeholder;
|
|
|
|
this.vE.settingsConfirmPayments = response.data.settings_confirm_payments;
|
|
|
|
this.vE.settingsCloseBtn = response.data.settings_close_btn;
|
|
|
|
this.vE.settingsSaveBtn = response.data.settings_save_btn;
|
|
|
|
this.vE.settingsTabIntegrations = response.data.settings_tab_integrations;
|
|
|
|
this.vE.settingsXeroLbl = response.data.settings_xero_lbl;
|
|
|
|
this.vE.settingsLink2Xero = response.data.settings_link_2xero;
|
|
|
|
this.vE.settingsRelink2Xero = response.data.settings_relink_2xero;
|
|
|
|
this.vE.settingsXeropmtConfirmdis = response.data.settings_xeropmt_confirmdis;
|
|
|
|
this.vE.settingsNotservClose = response.data.settings_notserv_close;
|
|
|
|
this.vE.settingsNotservWarning = response.data.settings_notserv_warning;
|
|
|
|
this.vE.settingsPmtservURL = response.data.settings_pmtserv_url;
|
|
|
|
this.vE.settingsAcodeLbl = response.data.settings_acode_lbl;
|
|
|
|
this.vE.settingsXeroClosebtn = response.data.settings_xero_closebtn;
|
|
|
|
this.vE.settingsXeroSavebtn = response.data.settings_xero_savebtn;
|
|
|
|
this.vE.settingsWCLbl = response.data.settings_wc_lbl;
|
|
|
|
this.vE.settingsWCGentoken = response.data.settings_wc_gentoken;
|
|
|
|
this.vE.settingsWCOwnerlbl = response.data.settings_wc_ownerlbl;
|
|
|
|
this.vE.settingsWCClosebtn = response.data.settings_wc_closebtn;
|
|
|
|
this.vE.settingsURLCopied = response.data.settings_url_copied;
|
|
|
|
this.vE.settingsNotservSuccess = response.data.settings_notserv_success;
|
|
|
|
this.vE.settingsNotservError = response.data.settings_notserv_error;
|
|
|
|
this.vE.settingsCopyNotavail = response.data.settings_copy_notavail;
|
|
|
|
this.vE.settingsOwneridCopied = response.data.settings_ownerid_copied;
|
|
|
|
this.vE.settingsOwneridNotcopied = response.data.settings_ownerid_notcopied;
|
|
|
|
this.vE.settingsWCTokenCopied = response.data.settings_wctoken_copied;
|
|
|
|
this.vE.settingsWCTokenNotcopied = response.data.settings_wctoken_notcopied;
|
|
|
|
this.vE.settingsWCTokenGenerated = response.data.settings_wctoken_generated;
|
|
|
|
this.vE.settingsWCTokenGenfail = response.data.settings_wctoken_genfail;
|
|
|
|
this.vE.settingsAcodeSaved = response.data.settings_acode_saved;
|
|
|
|
this.vE.settingsAcodeNotsaved = response.data.settings_acode_notsaved;
|
|
|
|
this.vE.settingsAcodeInvalid = response.data.settings_acode_invalid;
|
|
|
|
//
|
|
|
|
this.languageRdy.next(true);
|
|
|
|
},
|
|
|
|
error: error => { console.log('Error >> ',error); }
|
2023-05-10 16:05:15 +00:00
|
|
|
});
|
2023-02-14 03:39:11 +00:00
|
|
|
}
|
2021-10-28 20:34:48 +00:00
|
|
|
}
|