diff --git a/package.json b/package.json index b2f64ed..544bf31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zgo", - "version": "2.1.0", + "version": "2.2.0", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/src/app/app.component.html b/src/app/app.component.html index edb451e..6506163 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -45,7 +45,7 @@ style="margin-top: 10px; margin-bottom: 20px;">
© 2023 Vergara Technologies LLC
-
Version 2.1.0
+
Version 2.2.0
{{ vE.mainPriceData }}
diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index 433503a..d0df700 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -161,7 +161,7 @@ export class SettingsComponent implements OnInit { xeroService.getXeroAccountCode(this.owner.address); this.accCodeUpdate.subscribe(accData => { this.xeroAccCod = accData; - console.log("xeroAccCod -> [" + this.xeroAccCod + "]"); + //console.log("xeroAccCod -> [" + this.xeroAccCod + "]"); this.accCodForm.get('xAcc')!.setValue(this.xeroAccCod); }); this.wooOwnerUpdate = wooService.ownerUpdate; @@ -185,7 +185,7 @@ export class SettingsComponent implements OnInit { this.settingsForm.get('vKey')!.disable(); // this.chgUILanguage(); - console.log('SETTINGS: Return from chgUILanguage()'); + //console.log('SETTINGS: Return from chgUILanguage()'); // this.languageRdy.subscribe ( data => { @@ -334,32 +334,33 @@ export class SettingsComponent implements OnInit { saveAccCod() { this.xeroAccCod = this.accCodForm.value.xAcc; - console.log(">>> " + this.xeroAccCod); + //console.log(">>> " + this.xeroAccCod); if ( this.xeroAccCod.length <= 10 ) { const obs = this.xeroService .setXeroAccountCode(this.owner.address, this.xeroAccCod); - obs.subscribe(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); - } + 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 => { - console.log('Error saving Account Code -> ' + error.msg) - }); + }, + error: error => { + //console.log('Error saving Account Code -> ' + error.msg) + }}); } else { this.notifierService @@ -378,19 +379,19 @@ export class SettingsComponent implements OnInit { } */ checkStatus( arg : any ) { - console.log('onChange - checkStatus'); - console.log(arg.target.value); + //console.log('onChange - checkStatus'); + //console.log(arg.target.value); this.saveAccOk = (arg.target.value != this.xeroAccCod ); } chgUILanguage(){ - console.log('SETTINGS.chgUILanguage Called '); - this.languageService.getViewElements('settings').subscribe( - response => { - console.log('Received >> ', response ); - console.log('Language Code : ', response.language); - console.log('Component Name : ',response.component); - console.log('Language data : ',response.data); + //console.log('SETTINGS.chgUILanguage Called '); + 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; @@ -434,7 +435,7 @@ export class SettingsComponent implements OnInit { // this.languageRdy.next(true); }, - error => { console.log('Error >> ',error); } - ); + error: error => { console.log('Error >> ',error); } + }); } } diff --git a/src/app/viewer/viewer.component.ts b/src/app/viewer/viewer.component.ts index d14d500..f76d7a6 100644 --- a/src/app/viewer/viewer.component.ts +++ b/src/app/viewer/viewer.component.ts @@ -1,17 +1,15 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'; +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { UserService } from '../user.service'; import { FullnodeService } from '../fullnode.service'; -import { ItemService } from '../items/items.service'; -import { Subscription, Observable } from 'rxjs'; +import { Observable } from 'rxjs'; import { SettingsComponent } from '../settings/settings.component'; import {Owner} from '../owner.model'; import {User} from '../user.model'; import { LanguageService } from '../language.service'; -import { LanguageData } from '../language.model'; @Component({ selector: 'app-viewer', @@ -116,7 +114,7 @@ export class ViewerComponent implements OnInit { dialogConfig.disableClose = true; dialogConfig.autoFocus = true; - dialogConfig.data = this.owner; + dialogConfig.data = {o: this.owner, v: ''}; const dialogRef = this.dialog.open(SettingsComponent, dialogConfig); dialogRef.afterClosed().subscribe((val) => { diff --git a/src/app/xero.service.ts b/src/app/xero.service.ts index 1edeb0f..b31b3ad 100644 --- a/src/app/xero.service.ts +++ b/src/app/xero.service.ts @@ -37,17 +37,21 @@ export class XeroService { public readonly tokenUpdate: Observable = this._tokenUpdated.asObservable(); public readonly accCodeUpdate: Observable = this._accCodeUpdated.asObservable(); private reqHeaders: HttpHeaders; + private reqParams: HttpParams; + private session: null | string; constructor( private http: HttpClient ) { var auth = 'Basic ' + Buffer.from(ConfigData.UsrPwd).toString('base64'); this.reqHeaders = new HttpHeaders().set('Authorization', auth); + this.session = localStorage.getItem('s4z_token'); + this.reqParams = new HttpParams().append('session', this.session!); this.getXeroConfig(); } getXeroConfig(){ - let obs = this.http.get<{message: string, xeroConfig: any}>(this.beUrl+'api/xero', { headers:this.reqHeaders, observe: 'response'}); + let obs = this.http.get<{message: string, xeroConfig: any}>(this.beUrl+'api/xero', { headers:this.reqHeaders, observe: 'response', params: this.reqParams}); obs.subscribe(xeroDataResponse => { if (xeroDataResponse.status == 200) { @@ -64,13 +68,13 @@ export class XeroService { } getXeroAccessToken(code: string, address: string){ - const params = new HttpParams().append('code', code).append('address', address); + const params = this.reqParams.append('code', code).append('address', address); let obs = this.http.get(this.beUrl + 'api/xerotoken' , {headers: this.reqHeaders, params: params, observe: 'response'}); return obs; } getXeroAccountCode(address: string){ - const params = new HttpParams().append('address', address); + const params = this.reqParams.append('address', address); let obs = this.http.get<{message: string, code: string}>(this.beUrl + 'api/xeroaccount', {headers: this.reqHeaders, params: params, observe: 'response'}); obs.subscribe(accountResponse => { if (accountResponse.status == 200) { @@ -85,7 +89,7 @@ export class XeroService { setXeroAccountCode(address: string, code: string) { - const params = new HttpParams().append('address', address).append('code', code); + const params = this.reqParams.append('address', address).append('code', code); let obs = this.http.post(this.beUrl + 'api/xeroaccount', {}, {headers: this.reqHeaders, params: params, observe: 'response'}); /* obs.subscribe(responseData => {