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). 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] ## [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 + Paid status icons added to order's title
+ Order detail redesigned + Order detail redesigned
Components affected: 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 {UserService} from './user.service';
import { Owner } from './owner.model'; import { Owner } from './owner.model';
import { ConfigData } from './configdata';
var Buffer = require('buffer/').Buffer; var Buffer = require('buffer/').Buffer;
//import {User} from './user.model'; //import {User} from './user.model';
@Injectable({providedIn: 'root'}) @Injectable({providedIn: 'root'})
export class FullnodeService{ 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 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 _heightUpdated: BehaviorSubject<number> = new BehaviorSubject(this.dataStore.height);
private _memoUpdated: BehaviorSubject<string[]> = new BehaviorSubject(this.dataStore.memoList); private _memoUpdated: BehaviorSubject<string[]> = new BehaviorSubject(this.dataStore.memoList);
@ -48,7 +50,7 @@ export class FullnodeService{
}; };
constructor(private http: HttpClient, public userService: UserService){ 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.reqHeaders = new HttpHeaders().set('Authorization', auth);
this.ownerUpdate = userService.ownerUpdate; this.ownerUpdate = userService.ownerUpdate;
this.getAddr(); this.getAddr();

View file

@ -3,12 +3,19 @@ import { Injectable } from '@angular/core';
import { Subject, BehaviorSubject, Observable } from 'rxjs'; import { Subject, BehaviorSubject, Observable } from 'rxjs';
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
import { ConfigData } from '../configdata';
var Buffer = require('buffer/').Buffer; var Buffer = require('buffer/').Buffer;
@Injectable({providedIn: 'root'}) @Injectable({providedIn: 'root'})
export class ItemService{ 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 dataStore: { items: Item[] } = { items: [] } ;
private _itemsUpdated: BehaviorSubject<Item[]> = new BehaviorSubject(this.dataStore.items); private _itemsUpdated: BehaviorSubject<Item[]> = new BehaviorSubject(this.dataStore.items);
public readonly itemsUpdated: Observable<Item[]> = this._itemsUpdated.asObservable(); public readonly itemsUpdated: Observable<Item[]> = this._itemsUpdated.asObservable();
@ -16,7 +23,7 @@ export class ItemService{
private reqHeaders: HttpHeaders; private reqHeaders: HttpHeaders;
constructor(private http: HttpClient){ 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); this.reqHeaders = new HttpHeaders().set('Authorization', auth);
} }

View file

@ -3,9 +3,9 @@
} }
.text2 { .text2 {
font-family: 'Noto sans'; font-family: 'Roboto Mono';
font-size: 15px; font-size: 14px;
color: #000080; color: #000000;
text-align: left; text-align: left;
margin-left: 5px; margin-left: 5px;
background: lightgray; background: lightgray;
@ -16,12 +16,12 @@
} }
.orderdetail { .orderdetail {
font-family: 'Noto sans'; font-family: 'Roboto Mono';
font-size: 15px; font-size: 12px;
color: #000080; color: #000000;
text-align: left; text-align: left;
margin-left: 5px; margin-left: 5px;
background: lightyellow; background: lightcyan;
} }
@ -50,12 +50,13 @@ img.icon{
} }
.total{ .total{
font-size: large; font-size: 15px;
font-family: 'Roboto Mono', monospace; font-family: 'Roboto Mono', monospace;
margin: auto;
} }
img.total{ img.total{
margin-bottom:-2px; margin-bottom: -15px !important;
} }
.central{ .central{

View file

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

View file

@ -76,7 +76,7 @@ export class ListOrdersComponent implements OnInit, OnDestroy{
getIconStyle(order : Order) { getIconStyle(order : Order) {
if( order.paid ) 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;"; return "color: #88293d; cursor: pointer;";
} }

View file

@ -8,12 +8,14 @@ import { User } from '../user.model';
import { Owner } from '../owner.model'; import { Owner } from '../owner.model';
import { LineItem} from '../items/lineitem.model'; import { LineItem} from '../items/lineitem.model';
import { ConfigData } from '../configdata';
var Buffer = require('buffer/').Buffer; var Buffer = require('buffer/').Buffer;
@Injectable({providedIn: 'root'}) @Injectable({providedIn: 'root'})
export class OrderService { export class OrderService {
beUrl = 'https://test.zgo.cash/'; beUrl = ConfigData.Be_URL;
private dataStore: {allOrders: Order[], user: User, order: Order, owner: Owner } = { private dataStore: {allOrders: Order[], user: User, order: Order, owner: Owner } = {
allOrders: [], allOrders: [],
user:{ user:{
@ -81,7 +83,7 @@ export class OrderService {
public fullnodeService: FullnodeService, public fullnodeService: FullnodeService,
public userService: UserService 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.reqHeaders = new HttpHeaders().set('Authorization', auth);
this.userUpdate = userService.userUpdate; this.userUpdate = userService.userUpdate;
this.ownerUpdate = userService.ownerUpdate; this.ownerUpdate = userService.ownerUpdate;

View file

@ -5,13 +5,15 @@ import { Order } from './order/order.model';
import { Owner } from './owner.model'; import { Owner } from './owner.model';
import { UserService } from './user.service'; import { UserService } from './user.service';
import { ConfigData } from './configdata';
var Buffer = require('buffer/').Buffer; var Buffer = require('buffer/').Buffer;
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class ReceiptService { export class ReceiptService {
beUrl = 'https://test.zgo.cash/'; beUrl = ConfigData.Be_URL;
private dataStore: {order: Order, owner: Owner } = { private dataStore: {order: Order, owner: Owner } = {
owner: { owner: {
_id: '', _id: '',
@ -67,7 +69,7 @@ export class ReceiptService {
private http: HttpClient, private http: HttpClient,
public userService: UserService 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.reqHeaders = new HttpHeaders().set('Authorization', auth);
this.ownerUpdate = userService.ownerUpdate; this.ownerUpdate = userService.ownerUpdate;
} }

View file

@ -6,12 +6,14 @@ import {Owner} from './owner.model';
import { Country } from './country.model'; import { Country } from './country.model';
import {Tx} from './tx.model'; import {Tx} from './tx.model';
import { ConfigData } from './configdata';
var Buffer = require('buffer/').Buffer; var Buffer = require('buffer/').Buffer;
@Injectable({providedIn: 'root'}) @Injectable({providedIn: 'root'})
export class UserService{ export class UserService{
beUrl = 'https://test.zgo.cash/'; beUrl = ConfigData.Be_URL;
private dataStore: { user: User, owner: Owner, txs: Tx[], countries: Country[]} = { private dataStore: { user: User, owner: Owner, txs: Tx[], countries: Country[]} = {
user: { user: {
address: '', address: '',
@ -66,7 +68,7 @@ export class UserService{
private reqHeaders: HttpHeaders; private reqHeaders: HttpHeaders;
constructor(private http: HttpClient){ 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); this.reqHeaders = new HttpHeaders().set('Authorization', auth);
//console.log('US:', this.reqHeaders); //console.log('US:', this.reqHeaders);
this.session = localStorage.getItem('s4z_token'); 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