On branch zgo-test

Changes to be committed:
	modified:   CHANGELOG.md
	new file:   src/app/configdata.ts
	modified:   src/app/fullnode.service.ts
	modified:   src/app/items/items.service.ts
	modified:   src/app/listorders/listorders.component.css
	modified:   src/app/listorders/listorders.component.html
	modified:   src/app/listorders/listorders.component.ts
	modified:   src/app/order/order.service.ts
	modified:   src/app/receipt.service.ts
	modified:   src/app/user.service.ts
	new file:   src/assets/zec_rv.png
This commit is contained in:
Rene V. Vergara A. 2022-07-12 13:22:17 -05:00
parent d7875ba445
commit 2f32bbae47
11 changed files with 63 additions and 38 deletions

View file

@ -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:

4
src/app/configdata.ts Normal file
View file

@ -0,0 +1,4 @@
export class ConfigData {
public static Be_URL : string = 'https://test.zgo.cash/';
public static UsrPwd : string = 'user:superSecret2';
}

View file

@ -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<number> = new BehaviorSubject(this.dataStore.height);
private _memoUpdated: BehaviorSubject<string[]> = 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();

View file

@ -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<Item[]> = new BehaviorSubject(this.dataStore.items);
public readonly itemsUpdated: Observable<Item[]> = 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);
}

View file

@ -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{

View file

@ -8,25 +8,25 @@
<mat-divider></mat-divider>
<div align="center">
<div class="central">
<table class="text" width="75%">
<table class="text" style="font-size: 12px !important;" width="75%">
<tr>
<td width="50%" align="center">
<h3>Today's Total:</h3>
<p class="total">
<img src="/assets/zcash.png"
style='height: 18px;
margin: auto;'/>
<div class="total">
<img src="/assets/zec_rv.png"
style='height: 16px !important;
margin: -2px;'/>
{{todayTotal | number: '1.0-6'}}
</p>
</div>
</td>
<td width="50%" align="center">
<h3>Overall Total:</h3>
<p class="total">
<img src="/assets/zcash.png"
style='height: 18px;
margin: auto;'/>
<div class="total">
<img src="/assets/zec_rv.png"
style='height: 16px !important;
margin: -2px;'/>
{{total | number: '1.0-6'}}
</p>
</div>
</td>
</tr>
</table>
@ -40,20 +40,20 @@
<mat-expansion-panel-header class="text" >
<mat-panel-title>
<span class="price"
style='font-family: Noto sans !important;
font-size: 15px;
style='font-family: Roboto Mono !important;
font-size: 14px;
font-weight: strong;
color: black !important;
margin: auto;'>
<img src="/assets/zcash.png"
style='height: 18px;
<img src="/assets/zec_rv.png"
style='height: 16px;
margin: auto; '/>&nbsp;{{order.totalZec | number: '1.0-6'}}
</span>
</mat-panel-title>
<mat-panel-description>
<fa-icon [icon]="getIcon(order)" [style]="getIconStyle(order)" ></fa-icon>
<div style='font-family: Noto sans !important;
font-size: 15px;
<div style='font-family: Roboto Mono !important;
font-size: 14px;
font-weight: strong;
color: black !important;
margin: auto;'>

View file

@ -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;";
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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');

BIN
src/assets/zec_rv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB