From 09fccd3bcccf7f2842cb3dcb17f965cafacc2bde Mon Sep 17 00:00:00 2001
From: Klas <31806893+klassare@users.noreply.github.com>
Date: Sun, 23 Sep 2018 19:14:29 +0200
Subject: [PATCH] Staging (#10)
* topbar
* offline signing option
* decode signed operation hash UI
* fix new data structure
* update api for operations
* Account table re-adjusted
* set up zeronet
* minor changes
* delegator pipe update
* truncatePipe
* time-ago pipe
* tooltips for app-activity
* add class for constants
* switch to betanet
* update betanet chain_id
* ActivityComponent revamped
* fix signed decoding
* move online signing warning
* tweak row padding
* minor UI fix
* minor fix
* small change buttons
* context-menu for electron
* fix TypeError at Menu.popup
* allow to unset delegate in integrity check
* code cleanup
* change walletService to public in home-page
* delegate UI fix
* minor text changes
* minor spelling
* spelling
* test of TranslateService
* fix account import bug
* update to betanet
* test code transferred to homePage and Language button
* homePageComponent and startComponent translated into fr
* 3 more components translated
* ru and jp json completed
* 6 components translated
* finishing translation
* translation completed
* fix electron issue
* update css for home-page component
* fix start component height
* lifecycle hook for 'Show help' btn
* top-bar-btn vertical aligned
* translation text
* update for zeronet
* first send modal modified
* update operation service for multiple transactions
* send modals 90% completed
* Fix Show More btn
* Show More btn in activityComponent
* more btn
* added portuguese
* jp updated
* Fee input added
* korean language added
* minor change
* version number
* fix translation race condition
* add support for multi-send in account
* add alphanet
* add total fee for multi-send
* randomize api server
* fix some translation race errors
* fix operations from api
* fix css heights
---
package-lock.json | 18 +-
package.json | 12 +-
src/app/app.component.html | 2 +-
src/app/app.component.ts | 27 +-
src/app/app.module.ts | 24 +-
.../components/account/account.component.html | 11 +-
.../activate/activate.component.html | 14 +-
.../activity/activity.component.html | 43 ++-
.../activity/activity.component.scss | 19 +
.../components/activity/activity.component.ts | 29 +-
.../components/backup/backup.component.html | 37 +-
.../components/bakery/bakery.component.html | 19 +-
.../delegate/delegate.component.html | 36 +-
.../home-page/home-page.component.html | 129 ++++++-
.../home-page/home-page.component.scss | 59 ++-
.../home-page/home-page.component.ts | 56 ++-
.../components/import/import.component.html | 20 +-
src/app/components/import/import.component.ts | 35 +-
.../mnemonic-import.component.html | 58 +--
.../mnemonic-import.component.scss | 2 +-
.../mnemonic-import.component.ts | 46 ++-
.../new-account/new-account.component.html | 41 +--
.../new-account/new-account.component.ts | 24 +-
.../new-wallet/new-wallet.component.html | 74 ++--
.../new-wallet/new-wallet.component.scss | 9 +-
.../offline-signing.component.html | 77 ++--
.../offline-signing.component.scss | 4 +-
.../offline-signing.component.ts | 85 +++--
.../overview/overview.component.html | 37 +-
.../overview/overview.component.scss | 8 +
.../components/overview/overview.component.ts | 11 +-
.../components/receive/receive.component.html | 8 +-
src/app/components/send/send.component.html | 147 +++++---
src/app/components/send/send.component.scss | 17 +
src/app/components/send/send.component.ts | 197 +++++++++-
src/app/components/start/start.component.html | 6 +-
src/app/components/start/start.component.scss | 2 +-
src/app/constants.ts | 27 +-
src/app/pipes/time-ago.pipe.ts | 89 ++++-
src/app/services/activity.service.ts | 21 +-
src/app/services/balance.service.ts | 11 +-
src/app/services/coordinator.service.ts | 21 +-
src/app/services/operation.service.ts | 96 +++--
src/app/services/tzscan.service.ts | 95 ++---
src/app/services/wallet.service.ts | 3 +
src/assets/i18n/en.json | 331 +++++++++++++++++
src/assets/i18n/fr.json | 331 +++++++++++++++++
src/assets/i18n/jp.json | 331 +++++++++++++++++
src/assets/i18n/kor.json | 335 ++++++++++++++++++
src/assets/i18n/por.json | 329 +++++++++++++++++
src/assets/i18n/ru.json | 331 +++++++++++++++++
src/assets/i18n/template.json | 79 +++++
src/electron/package.json | 2 +-
53 files changed, 3384 insertions(+), 491 deletions(-)
create mode 100644 src/assets/i18n/en.json
create mode 100644 src/assets/i18n/fr.json
create mode 100644 src/assets/i18n/jp.json
create mode 100644 src/assets/i18n/kor.json
create mode 100644 src/assets/i18n/por.json
create mode 100644 src/assets/i18n/ru.json
create mode 100644 src/assets/i18n/template.json
diff --git a/package-lock.json b/package-lock.json
index 7ee716777..cbe532510 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "kukai",
- "version": "1.0.4",
+ "version": "1.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -236,6 +236,16 @@
"webpack-sources": "1.1.0"
}
},
+ "@ngx-translate/core": {
+ "version": "9.1.1",
+ "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-9.1.1.tgz",
+ "integrity": "sha1-rhA5KINrip4Gn9Li52+iGYzH5ig="
+ },
+ "@ngx-translate/http-loader": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-2.0.1.tgz",
+ "integrity": "sha1-qmd4jmS/qGUmkad7Ais7QDEgkRM="
+ },
"@schematics/angular": {
"version": "0.1.17",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-0.1.17.tgz",
@@ -1997,6 +2007,12 @@
"wrap-ansi": "2.1.0"
}
},
+ "cloc": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/cloc/-/cloc-2.3.3.tgz",
+ "integrity": "sha1-rL1ndlnZun9n9iaar+q3JxVNf9g=",
+ "dev": true
+ },
"clone": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz",
diff --git a/package.json b/package.json
index 081376263..ccc8a3bb1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "kukai",
- "version": "1.1.0",
+ "version": "1.2.0",
"license": "MIT",
"scripts": {
"ng": "ng",
@@ -19,7 +19,8 @@
"package-electron-linux-ia32": "electron-packager dist --overwrite --asar --platform=linux --arch=ia32 --icon=dist/assets/icons/png/1024x1024.png --prune=true --out=release-builds",
"package-electron-linux-x64": "electron-packager dist --overwrite --asar --platform=linux --arch=x64 --icon=dist/assets/icons/png/1024x1024.png --prune=true --out=release-builds",
"package-electron-all": "npm run build-electron && npm run package-electron-win && npm run package-electron-mac && npm run package-electron-linux",
- "run-electron": "npm run build-electron && electron dist"
+ "run-electron": "npm run build-electron && electron dist",
+ "count": "cloc app/"
},
"private": true,
"dependencies": {
@@ -33,6 +34,8 @@
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.1",
+ "@ngx-translate/core": "9.1.1",
+ "@ngx-translate/http-loader": "2.0.1",
"@types/crypto-js": "^3.1.39",
"aes-js": "^3.1.1",
"angular-cli-ghpages": "^0.5.2",
@@ -65,9 +68,11 @@
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
+ "cloc": "^2.3.3",
"codelyzer": "^4.0.1",
"electron": "^2.0.4",
"electron-packager": "^12.1.0",
+ "font-awesome": "^4.7.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
@@ -78,7 +83,6 @@
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
- "typescript": "~2.5.3",
- "font-awesome": "^4.7.0"
+ "typescript": "~2.5.3"
}
}
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 71bda04ef..b010bf29a 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1 +1 @@
-
+ {{ 'ACCOUNTCOMPONENT.EMPTY' | translate }} +
Wallets created during the ICO need to be activated.
-No private key is required for the activation process.
+{{ 'ACTIVATECOMPONENT.INFO1' | translate }}
+{{ 'ACTIVATECOMPONENT.INFO2' | translate }}
Txn Hash | -Block | -Date | -Type | -Counterparty | -Amount (ꜩ) | -Status | +{{ 'ACTIVITYCOMPONENT.TXNHASH' | translate }} | +{{ 'ACTIVITYCOMPONENT.BLOCK' | translate }} | +{{ 'ACTIVITYCOMPONENT.DATE' | translate }} | +{{ 'ACTIVITYCOMPONENT.TYPE' | translate }} | +{{ 'ACTIVITYCOMPONENT.COUNTERPARTY' | translate }} | +{{ 'ACTIVITYCOMPONENT.AMOUNT' | translate }} (ꜩ) | +{{ 'ACTIVITYCOMPONENT.STATUS' | translate }} |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -45,10 +45,11 @@ |
-
- From
- @@ -68,6 +69,18 @@ {{ getStatus(transaction) }} |
- Wallet not configured! + {{ 'ACTIVITYCOMPONENT.EMPTY' | translate }}
\ No newline at end of file diff --git a/src/app/components/activity/activity.component.scss b/src/app/components/activity/activity.component.scss index 022214e48..c058c55de 100644 --- a/src/app/components/activity/activity.component.scss +++ b/src/app/components/activity/activity.component.scss @@ -43,9 +43,28 @@ .amount { text-align: right; } + .smallText { font-size: 80%; } + +.btn-balance { + color: #6c757d; + padding-right: 0rem; // original 0.5rem; + padding-left: 0rem; // original 0.5rem; +} + +.last-btn-column > td { + background-color: white; + padding-top: 0.25rem; // default at 0.75rem + padding-bottom: 0.25rem; // default at 0.75rem +} + +.show-more { + font-size: 0.9rem; + width: 73px; +} + @media(min-width:768px) { #page-wrapper { position: inherit; diff --git a/src/app/components/activity/activity.component.ts b/src/app/components/activity/activity.component.ts index c016de234..8ae1ae86b 100644 --- a/src/app/components/activity/activity.component.ts +++ b/src/app/components/activity/activity.component.ts @@ -1,6 +1,10 @@ import { Component, Input, OnInit, AfterViewInit, SimpleChange } from '@angular/core'; import { WalletService } from '../../services/wallet.service'; +import { TzscanService } from '../../services/tzscan.service'; + import { Constants } from '../../constants'; +import { TimeAgoPipe } from '../../pipes/time-ago.pipe'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-activity', @@ -10,16 +14,19 @@ import { Constants } from '../../constants'; export class ActivityComponent implements OnInit { accounts = null; CONSTANTS = new Constants(); + @Input() activePkh: string; constructor( - private walletService: WalletService + private walletService: WalletService, + private tzscanService: TzscanService, ) {} ngOnInit() { if (this.walletService.wallet) { this.init(); } } init() { this.accounts = this.walletService.wallet.accounts; - console.log('transaction', this.accounts[0].activities); + console.log('activePkh: ', this.activePkh); } + getStatus(transaction: any): string { if (transaction.failed) { return 'Failed'; @@ -32,7 +39,15 @@ export class ActivityComponent implements OnInit { getType(transaction: any): string { if (transaction.type !== 'transaction') { - return transaction.type; + if (transaction.type === 'delegation') { + if (transaction.destination) { + return 'delegate'; + } else { + return 'undelegate'; + } + } else { + return transaction.type; + } } else { let operationType = ''; if (transaction.amount > 0) { @@ -45,12 +60,16 @@ export class ActivityComponent implements OnInit { } getCounterparty(transaction: any): string { - console.log('transaction - getCounterparty', transaction); + // console.log('transaction - getCounterparty', transaction); let counterparty = ''; // Checks for delegation as destination is stored in transaction.destination.tz if (transaction.type === 'delegation') { - return transaction.destination.tz; + if (transaction.destination) { + return transaction.destination.tz; + } else { + return ''; // User has undelegate + } } if (this.activePkh === transaction.source) { diff --git a/src/app/components/backup/backup.component.html b/src/app/components/backup/backup.component.html index e83aeb7ba..b9878995f 100644 --- a/src/app/components/backup/backup.component.html +++ b/src/app/components/backup/backup.component.html @@ -2,7 +2,7 @@A wallet backup protects your tez against computer or software failure. If you lose the backup and can't - access your wallet for some reasons, your tez are permanently lost!
-It is recommended that you store backups of both forms of your key (the Keystore file version and paper wallet - version) in physically separate, offline environments.
+{{ 'BACKUPCOMPONENT.HEADING1' | translate }}
+{{ 'BACKUPCOMPONENT.HEADING2' | translate }}
This wallet file will contain your private seed encrypted with your password.
-This wallet file will contain your public key.
-This wallet file will contain your public key hash.
+{{ 'BACKUPCOMPONENT.INFOFULLWALLET' | translate }}
+{{ 'BACKUPCOMPONENT.INFOVIEWONLYWALLET' | translate }}
+{{ 'BACKUPCOMPONENT.INFOOBSERVERWALLET' | translate }}
This wallet file will contain your public key (Needed to create unsigned operations).
+{{ 'BACKUPCOMPONENT.INFOVIEWONLYWALLET2' | translate }}
In the bakery, you can easily set different delegates for your accounts.
-Please note that you can't delegate with your identity. You need to create new accounts.
+{{ 'BAKERYCOMPONENT.HEADING' | translate }}
+{{ 'BAKERYCOMPONENT.INFO' | translate }}
+ {{ 'BAKERYCOMPONENT.EMPTY' | translate }} +