From 23532f12a23cf2a288b05ace2a80b4f6c23fafa7 Mon Sep 17 00:00:00 2001 From: Rene Vergara A Date: Thu, 2 Mar 2023 21:59:33 -0500 Subject: [PATCH] UI language management: Global UI revision - Part 1 --- src/app/cancel/cancel.component.html | 23 ++++-- src/app/cancel/cancel.component.ts | 8 ++- src/app/header/header.component.ts | 15 +++- src/app/items/item-add/item-add.component.css | 2 +- .../items/item-list/item-list.component.ts | 30 ++++++-- src/app/language.service.ts | 8 +-- src/app/listorders/listorders.component.css | 4 +- src/app/order/order.component.css | 6 +- src/app/order/order.component.html | 6 +- .../prompt-invoice.component.css | 5 ++ .../prompt-invoice.component.html | 4 +- .../prompt-receipt.component.css | 5 ++ src/app/scan/scan.component.css | 70 ++++++++++++++++++- src/app/scan/scan.component.html | 70 ++++++++++++------- src/app/scan/scan.component.ts | 6 +- src/app/settings/settings.component.css | 5 ++ src/app/settings/settings.component.html | 3 +- 17 files changed, 209 insertions(+), 61 deletions(-) diff --git a/src/app/cancel/cancel.component.html b/src/app/cancel/cancel.component.html index 7eae7d6..a6c5f4f 100644 --- a/src/app/cancel/cancel.component.html +++ b/src/app/cancel/cancel.component.html @@ -1,19 +1,32 @@ -
{{ vE.cancelTitle }}
+
{{title}}
- -

{{msg}}

+ + {{msg1}}
{{msg2}}
-
-
diff --git a/src/app/cancel/cancel.component.ts b/src/app/cancel/cancel.component.ts index 05ddac2..49edc6f 100644 --- a/src/app/cancel/cancel.component.ts +++ b/src/app/cancel/cancel.component.ts @@ -12,7 +12,8 @@ import { LanguageData } from '../language.model'; export class CancelComponent { title: string; - msg: string; + msg1: string; + msg2: string; // ------------------------------------- // // Language Support @@ -27,10 +28,11 @@ export class CancelComponent { constructor( private languageService : LanguageService, private dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: { title: string, msg: string} + @Inject(MAT_DIALOG_DATA) public data: { title: string, msg1: string, msg2: string;} ) { this.title = data.title; - this.msg = data.msg; + this.msg1 = data.msg1; + this.msg2 = data.msg2; } ngOnInit() { diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index cd7c33e..951be7e 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -57,7 +57,10 @@ export class HeaderComponent implements OnInit, OnDestroy { // vE = { headerGetCurrency : '', - headerLastBlock : '' + headerLastBlock : '', + headerLogoutLbl : '', + headerLogoutMsg1 : '', + headerLogoutMsg2 : '' } // // ------------------------------------------------------------ @@ -92,7 +95,11 @@ export class HeaderComponent implements OnInit, OnDestroy { dialogConfig.disableClose = true; dialogConfig.autoFocus = true; - dialogConfig.data = {title: 'Logout?', msg: 'Are you sure you want to disconnect from ZGo? You will have to re-link your wallet via shielded memo.'}; + dialogConfig.data = { title: this.vE.headerLogoutLbl, + msg1: this.vE.headerLogoutMsg1, + msg2: this.vE.headerLogoutMsg2 }; + + console.log(dialogConfig.data); const dialogRef = this.dialog.open(CancelComponent, dialogConfig); dialogRef.afterClosed().subscribe(val => { @@ -118,6 +125,10 @@ export class HeaderComponent implements OnInit, OnDestroy { this.vE.headerLastBlock = response.data.header_last_block; this.vE.headerGetCurrency = response.data.header_get_currency; + this.vE.headerLogoutLbl = response.data.header_logout_lbl; + this.vE.headerLogoutMsg1 = response.data.header_logout_msg1; + this.vE.headerLogoutMsg2 = response.data.header_logout_msg2; + }, error => { console.log('Error >> ',error); } ); diff --git a/src/app/items/item-add/item-add.component.css b/src/app/items/item-add/item-add.component.css index 5f8cb81..3cf7c20 100644 --- a/src/app/items/item-add/item-add.component.css +++ b/src/app/items/item-add/item-add.component.css @@ -12,5 +12,5 @@ input[type=number]{ color: white; font-size: 26px; text-align: center; - padding: 5px; + padding: 10px; } \ No newline at end of file diff --git a/src/app/items/item-list/item-list.component.ts b/src/app/items/item-list/item-list.component.ts index 9281bb7..70b5d50 100644 --- a/src/app/items/item-list/item-list.component.ts +++ b/src/app/items/item-list/item-list.component.ts @@ -69,7 +69,12 @@ export class ItemListComponent implements OnInit{ // vE = { itemlistAvailItems : '', - itemlistListEmpty : '' + itemlistListEmpty : '', + itemlistItemAdded : '', + itemlistItemUpdated : '', + itemlistItemDeleted : '', + itemlistNotifClose : '', + itemlistNotifSuccess : '' } // // ------------------------------------------------------------ @@ -115,8 +120,10 @@ export class ItemListComponent implements OnInit{ var item:Item = {_id: '', name: val.name, description: val.description, cost: val.cost, owner: this.owner.address}; this.itemService.addItem(item); this.notifierService - .showNotification("Item successfully created!", - "Close","success"); + .showNotification(this.vE.itemlistItemAdded , + this.vE.itemlistNotifClose, + "success", + this.vE.itemlistNotifSuccess); } this.itemService.getItems(this.owner.address); this.itemsUpdate.subscribe((items) => { @@ -150,8 +157,10 @@ export class ItemListComponent implements OnInit{ this.itemService.getItems(this.owner.address); }); this.notifierService - .showNotification("Item information updated!!", - "Close","success"); + .showNotification(this.vE.itemlistItemUpdated, + this.vE.itemlistNotifClose, + "success", + this.vE.itemlistNotifSuccess); } this.itemService.getItems(this.owner.address); }); @@ -174,8 +183,10 @@ export class ItemListComponent implements OnInit{ this.itemService.deleteItem(val); this.items = []; this.notifierService - .showNotification("Item deleted!!", - "Close","success"); + .showNotification(this.vE.itemlistItemDeleted, + this.vE.itemlistNotifClose, + "success", + this.vE.itemlistNotifSuccess); } this.itemService.getItems(this.owner.address); this.itemsUpdate.subscribe((items) => { @@ -222,6 +233,11 @@ export class ItemListComponent implements OnInit{ this.vE.itemlistListEmpty = response.data.itemlist_list_empty; this.vE.itemlistAvailItems = response.data.itemlist_avail_items; + this.vE.itemlistItemAdded = response.data.itemlist_item_added; + this.vE.itemlistItemUpdated = response.data.itemlist_item_updated; + this.vE.itemlistItemDeleted = response.data.itemlist_item_deleted; + this.vE.itemlistNotifClose = response.data.itemlist_notif_close; + this.vE.itemlistNotifSuccess = response.data.itemlist_notif_success; }, error => { console.log('Error >> ',error); } ); diff --git a/src/app/language.service.ts b/src/app/language.service.ts index 7497db1..696dc09 100644 --- a/src/app/language.service.ts +++ b/src/app/language.service.ts @@ -12,13 +12,13 @@ var Buffer = require('buffer/').Buffer; export class LanguageService { // // URL for test using REST API to local MariaDB database -// private baseURL = 'http://localhost:8080/zgointl'; + private baseURL = 'http://localhost:8080/zgointl'; // // URL for test using REST API to local MongoDB database // private baseURL = 'http://localhost:5000/zgointl'; // // URL for access MongoDB database from remote server - private baseURL = ConfigData.Be_URL + 'api/getlang'; +// private baseURL = ConfigData.Be_URL + 'api/getlang'; public zgoLanguage: string = ''; @@ -48,8 +48,8 @@ export class LanguageService { return this.http.get(this.baseURL + '/?lang=' + this.zgoLanguage + '&component=' + viewName - , - { headers : reqHeaders } +// , +// { headers : reqHeaders } ); } } diff --git a/src/app/listorders/listorders.component.css b/src/app/listorders/listorders.component.css index 163e8f5..142b3cf 100644 --- a/src/app/listorders/listorders.component.css +++ b/src/app/listorders/listorders.component.css @@ -128,12 +128,12 @@ img.icon{ .minibutton { font-family: 'Spartan', sans-serif; - font-size: 12px; + font-size: 14px; background: #ff5722; color: white; height: 24px; line-height: 20px; - padding: 2px; + padding: 10px; } .spacer { diff --git a/src/app/order/order.component.css b/src/app/order/order.component.css index 769d15a..683d1cb 100644 --- a/src/app/order/order.component.css +++ b/src/app/order/order.component.css @@ -55,8 +55,8 @@ img.icon{ background-color: #ff5722; color: white; font-weight: 500; - height: 25px !important; - width: 105px !important; + height: 30px !important; + width: 115px !important; display: flex; align-items: center; justify-content: center; @@ -67,7 +67,7 @@ img.icon{ .button-cancel-class { font-family: 'Spartan', sans-serif; font-weight: 500; - height: 25px !important; + height: 30px !important; width: 100px !important; display: flex; align-items: center; diff --git a/src/app/order/order.component.html b/src/app/order/order.component.html index 64be3f5..768ffc8 100644 --- a/src/app/order/order.component.html +++ b/src/app/order/order.component.html @@ -79,7 +79,7 @@
- {{ vE.orderInvoiceBtn }} + {{vE.orderInvoiceBtn}}