diff --git a/CHANGELOG.md b/CHANGELOG.md index ae4c373..e394551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -- (20022-07-11) Order's list UI updated (Alpha version) +- (2022-07-12) Set configuration global parameters in one place + + Static class ConfigData created + - configdata.ts created inside "src/app/" folder + + Services modified to include config data + +- (2022-07-11) Order's list UI updated (Alpha version) + Paid status icons added to order's title + Order detail redesigned Components affected: diff --git a/src/app/configdata.ts b/src/app/configdata.ts new file mode 100644 index 0000000..d8246a0 --- /dev/null +++ b/src/app/configdata.ts @@ -0,0 +1,4 @@ +export class ConfigData { + public static Be_URL : string = 'https://test.zgo.cash/'; + public static UsrPwd : string = 'user:superSecret2'; +} \ No newline at end of file diff --git a/src/app/fullnode.service.ts b/src/app/fullnode.service.ts index ca57ecd..b911059 100644 --- a/src/app/fullnode.service.ts +++ b/src/app/fullnode.service.ts @@ -4,12 +4,14 @@ import {HttpClient, HttpParams, HttpHeaders} from '@angular/common/http'; import {UserService} from './user.service'; import { Owner } from './owner.model'; +import { ConfigData } from './configdata'; + var Buffer = require('buffer/').Buffer; //import {User} from './user.model'; @Injectable({providedIn: 'root'}) export class FullnodeService{ - beUrl = 'https://test.zgo.cash/'; + beUrl = ConfigData.Be_URL; private dataStore: { height: number, memoList: string[], addr: string, price: number } = { height: 0, memoList: [], addr: '', price:0 }; private _heightUpdated: BehaviorSubject = new BehaviorSubject(this.dataStore.height); private _memoUpdated: BehaviorSubject = new BehaviorSubject(this.dataStore.memoList); @@ -48,7 +50,7 @@ export class FullnodeService{ }; constructor(private http: HttpClient, public userService: UserService){ - var auth = 'Basic ' + Buffer.from('user:superSecret2').toString('base64'); + var auth = 'Basic ' + Buffer.from(ConfigData.UsrPwd).toString('base64'); this.reqHeaders = new HttpHeaders().set('Authorization', auth); this.ownerUpdate = userService.ownerUpdate; this.getAddr(); diff --git a/src/app/items/items.service.ts b/src/app/items/items.service.ts index a23ea37..96f45c6 100644 --- a/src/app/items/items.service.ts +++ b/src/app/items/items.service.ts @@ -3,12 +3,19 @@ import { Injectable } from '@angular/core'; import { Subject, BehaviorSubject, Observable } from 'rxjs'; import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http'; +import { ConfigData } from '../configdata'; + var Buffer = require('buffer/').Buffer; @Injectable({providedIn: 'root'}) export class ItemService{ - beUrl = 'https://test.zgo.cash/'; +// beUrl = 'https://test.zgo.cash/'; + + beUrl = ConfigData.Be_URL; + +// console.log(ConfigData.Be_URL); + private dataStore: { items: Item[] } = { items: [] } ; private _itemsUpdated: BehaviorSubject = new BehaviorSubject(this.dataStore.items); public readonly itemsUpdated: Observable = this._itemsUpdated.asObservable(); @@ -16,7 +23,7 @@ export class ItemService{ private reqHeaders: HttpHeaders; constructor(private http: HttpClient){ - var auth = 'Basic ' + Buffer.from('user:superSecret2').toString('base64'); + var auth = 'Basic ' + Buffer.from(ConfigData.UsrPwd).toString('base64'); this.reqHeaders = new HttpHeaders().set('Authorization', auth); } diff --git a/src/app/listorders/listorders.component.css b/src/app/listorders/listorders.component.css index 335fd28..6c87d46 100644 --- a/src/app/listorders/listorders.component.css +++ b/src/app/listorders/listorders.component.css @@ -3,9 +3,9 @@ } .text2 { - font-family: 'Noto sans'; - font-size: 15px; - color: #000080; + font-family: 'Roboto Mono'; + font-size: 14px; + color: #000000; text-align: left; margin-left: 5px; background: lightgray; @@ -16,12 +16,12 @@ } .orderdetail { - font-family: 'Noto sans'; - font-size: 15px; - color: #000080; + font-family: 'Roboto Mono'; + font-size: 12px; + color: #000000; text-align: left; margin-left: 5px; - background: lightyellow; + background: lightcyan; } @@ -50,12 +50,13 @@ img.icon{ } .total{ - font-size: large; + font-size: 15px; font-family: 'Roboto Mono', monospace; + margin: auto; } img.total{ - margin-bottom:-2px; + margin-bottom: -15px !important; } .central{ diff --git a/src/app/listorders/listorders.component.html b/src/app/listorders/listorders.component.html index 5119ca5..07e8e65 100644 --- a/src/app/listorders/listorders.component.html +++ b/src/app/listorders/listorders.component.html @@ -8,25 +8,25 @@
- +

Today's Total:

-

- +

+ {{todayTotal | number: '1.0-6'}} -

+

Overall Total:

-

- +

+ {{total | number: '1.0-6'}} -

+
@@ -40,20 +40,20 @@ -  {{order.totalZec | number: '1.0-6'}} -
diff --git a/src/app/listorders/listorders.component.ts b/src/app/listorders/listorders.component.ts index 2791e71..20bf397 100644 --- a/src/app/listorders/listorders.component.ts +++ b/src/app/listorders/listorders.component.ts @@ -76,7 +76,7 @@ export class ListOrdersComponent implements OnInit, OnDestroy{ getIconStyle(order : Order) { if( order.paid ) - return "font-size: 16px; color: #72cc50; margin: auto;"; + return "font-size: 14px; color: #72cc50; margin-bottom: -2px;"; return "color: #88293d; cursor: pointer;"; } diff --git a/src/app/order/order.service.ts b/src/app/order/order.service.ts index 4deb7bb..8338be3 100644 --- a/src/app/order/order.service.ts +++ b/src/app/order/order.service.ts @@ -8,12 +8,14 @@ import { User } from '../user.model'; import { Owner } from '../owner.model'; import { LineItem} from '../items/lineitem.model'; +import { ConfigData } from '../configdata'; + var Buffer = require('buffer/').Buffer; @Injectable({providedIn: 'root'}) export class OrderService { - beUrl = 'https://test.zgo.cash/'; + beUrl = ConfigData.Be_URL; private dataStore: {allOrders: Order[], user: User, order: Order, owner: Owner } = { allOrders: [], user:{ @@ -81,7 +83,7 @@ export class OrderService { public fullnodeService: FullnodeService, public userService: UserService ) { - var auth = 'Basic ' + Buffer.from('user:superSecret2').toString('base64'); + var auth = 'Basic ' + Buffer.from(ConfigData.UsrPwd).toString('base64'); this.reqHeaders = new HttpHeaders().set('Authorization', auth); this.userUpdate = userService.userUpdate; this.ownerUpdate = userService.ownerUpdate; diff --git a/src/app/receipt.service.ts b/src/app/receipt.service.ts index 096a150..d897ca1 100644 --- a/src/app/receipt.service.ts +++ b/src/app/receipt.service.ts @@ -5,13 +5,15 @@ import { Order } from './order/order.model'; import { Owner } from './owner.model'; import { UserService } from './user.service'; +import { ConfigData } from './configdata'; + var Buffer = require('buffer/').Buffer; @Injectable({ providedIn: 'root' }) export class ReceiptService { - beUrl = 'https://test.zgo.cash/'; + beUrl = ConfigData.Be_URL; private dataStore: {order: Order, owner: Owner } = { owner: { _id: '', @@ -67,7 +69,7 @@ export class ReceiptService { private http: HttpClient, public userService: UserService ) { - var auth = 'Basic ' + Buffer.from('user:superSecret2').toString('base64'); + var auth = 'Basic ' + Buffer.from(ConfigData.UsrPwd).toString('base64'); this.reqHeaders = new HttpHeaders().set('Authorization', auth); this.ownerUpdate = userService.ownerUpdate; } diff --git a/src/app/user.service.ts b/src/app/user.service.ts index 4e462a5..dc316ff 100644 --- a/src/app/user.service.ts +++ b/src/app/user.service.ts @@ -6,12 +6,14 @@ import {Owner} from './owner.model'; import { Country } from './country.model'; import {Tx} from './tx.model'; +import { ConfigData } from './configdata'; + var Buffer = require('buffer/').Buffer; @Injectable({providedIn: 'root'}) export class UserService{ - beUrl = 'https://test.zgo.cash/'; + beUrl = ConfigData.Be_URL; private dataStore: { user: User, owner: Owner, txs: Tx[], countries: Country[]} = { user: { address: '', @@ -66,7 +68,7 @@ export class UserService{ private reqHeaders: HttpHeaders; constructor(private http: HttpClient){ - var auth = 'Basic ' + Buffer.from('user:superSecret2').toString('base64'); + var auth = 'Basic ' + Buffer.from(ConfigData.UsrPwd).toString('base64'); this.reqHeaders = new HttpHeaders().set('Authorization', auth); //console.log('US:', this.reqHeaders); this.session = localStorage.getItem('s4z_token'); diff --git a/src/assets/zec_rv.png b/src/assets/zec_rv.png new file mode 100644 index 0000000..8a08d64 Binary files /dev/null and b/src/assets/zec_rv.png differ