Skip to content

Commit

Permalink
Staging (#10)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
klassare authored and Dee297 committed Sep 23, 2018
1 parent a32112d commit 09fccd3
Show file tree
Hide file tree
Showing 53 changed files with 3,384 additions and 491 deletions.
18 changes: 17 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kukai",
"version": "1.1.0",
"version": "1.2.0",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand All @@ -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": {
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-home-page></app-home-page>
<app-home-page></app-home-page>
27 changes: 16 additions & 11 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import { Component, OnInit } from '@angular/core';

import { WalletService } from './services/wallet.service';
import { CoordinatorService } from './services/coordinator.service';
import { TranslateService } from '@ngx-translate/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {

constructor(
private walletService: WalletService,
private coordinatorService: CoordinatorService) { }
ngOnInit() {
this.walletService.loadStoredWallet();
if (this.walletService.wallet) {
this.coordinatorService.startAll();
constructor(
private walletService: WalletService,
private coordinatorService: CoordinatorService
) { }

ngOnInit() {
this.walletService.loadStoredWallet();

if (this.walletService.wallet) {
this.coordinatorService.startAll();
}
}
}
}
24 changes: 22 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { BsModalService } from 'ngx-bootstrap/modal';

// For translation
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';

// External libraries
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader/component-loader.factory';
import { ModalModule, AlertModule, ProgressbarModule, ButtonsModule, BsDropdownModule, TabsModule } from 'ngx-bootstrap';
import { CollapseModule } from 'ngx-bootstrap/collapse';

import { AppComponent } from './app.component';

Expand Down Expand Up @@ -52,6 +57,13 @@ import { DelegatorNamePipe } from './pipes/delegator-name.pipe';
import { TruncatePipe } from './pipes/truncate.pipe';
import { TimeAgoPipe } from './pipes/time-ago.pipe';

// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}



@NgModule({
declarations: [
AppComponent,
Expand Down Expand Up @@ -87,12 +99,20 @@ import { TimeAgoPipe } from './pipes/time-ago.pipe';
AppRoutingModule,
HttpClientModule,
NgbModule.forRoot(),
CollapseModule.forRoot(),
ModalModule.forRoot(),
AlertModule.forRoot(),
ProgressbarModule.forRoot(),
ButtonsModule.forRoot(),
BsDropdownModule.forRoot(),
TabsModule.forRoot()
TabsModule.forRoot(),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}) // lazy loading will need TranslateModule.forChild() in the lazy loaded modules
],
providers: [
// Services
Expand Down
11 changes: 8 additions & 3 deletions src/app/components/account/account.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container" *ngIf="this.walletService.wallet">
<div class="row">
<div class="col-6">
<h1 class="page-header">Account</h1>
<h1 class="page-header">{{ 'ACCOUNTCOMPONENT.ACCOUNT' | translate }}</h1>
</div>
</div>
<div class="row">
Expand All @@ -13,7 +13,7 @@ <h1 class="page-header">Account</h1>
</div>
<div class="row bottom-separator">
<div class="col-12">
Balance: {{ balance / 1000000 | number:'1.0' }} &#42793;
{{ 'ACCOUNTCOMPONENT.BALANCE' | translate }} {{ balance / 1000000 | number:'1.0' }} &#42793;
<span *ngIf="balanceUSD > 0">(${{ balanceUSD | number:'1.00'}} USD)</span>
</div>
</div>
Expand All @@ -26,13 +26,18 @@ <h1 class="page-header">Account</h1>
<div class="container" *ngIf="!this.walletService.wallet">
<div class="row bottom-separator-no-account">
<div class="col-lg-12">
<h1 class="page-header-no-account">Account</h1>
<h1 class="page-header-no-account">{{ 'ACCOUNTCOMPONENT.ACCOUNT' | translate }}</h1>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<!--
<p>You can get your individual account details in here but before, you will need to
<a routerLink="">create or import</a> a wallet.</p>
-->
<p>
{{ 'ACCOUNTCOMPONENT.EMPTY' | translate }}
</p>
</div>
</div>
</div>
14 changes: 7 additions & 7 deletions src/app/components/activate/activate.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
<div class="center-content">
<div class="card text-center fix-size">
<div class="card-body">
<h1 class="card-title">Activate your ICO Wallet</h1>
<h1 class="card-title">{{ 'ACTIVATECOMPONENT.TITLE' | translate }}</h1>
<div class="card-text">
<form class="form-group">
<!-- pkh -->
<div class="form-group row">
<div class="col-sm-12">
<input type="text" [(ngModel)]="pkh" [ngModelOptions]="{standalone: true}" class="form-control" placeholder="tz1...">
<small class="form-text text-left">Your public key hash</small>
<small class="form-text text-left">{{ 'ACTIVATECOMPONENT.PKH' | translate }}</small>
</div>
</div>
<!-- secret -->
<div class="form-group row">
<div class="col-sm-12">
<input type="text" [(ngModel)]="secret" [ngModelOptions]="{standalone: true}" class="form-control" placeholder="code">
<small class="form-text text-left">Your activation code</small>
<small class="form-text text-left">{{ 'ACTIVATECOMPONENT.CODE' | translate }}</small>
</div>
</div>
</form>
<p class="p-margin-botton">Wallets created during the ICO need to be activated.</p>
<p>No private key is required for the activation process.</p>
<p class="p-margin-botton">{{ 'ACTIVATECOMPONENT.INFO1' | translate }}</p>
<p>{{ 'ACTIVATECOMPONENT.INFO2' | translate }}</p>
</div>
</div>
<div class="card-footer text-right">
<a routerLink="/">
<button type="button" class="btn btn-primary btn-lg btn-float-left">Back</button>
<button type="button" class="btn btn-primary btn-lg btn-float-left">{{ 'ACTIVATECOMPONENT.BACK' | translate }}</button>
</a>
<button type="button" class="btn btn-primary btn-lg" (click)="activate()">Activate</button>
<button type="button" class="btn btn-primary btn-lg" (click)="activate()">{{ 'ACTIVATECOMPONENT.ACTIVATE' | translate }}</button>
</div>
</div>
</div>
Expand Down
43 changes: 28 additions & 15 deletions src/app/components/activity/activity.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<div *ngIf='accounts'>
<ng-container *ngFor="let account of accounts">
<ng-container *ngIf="account.pkh === activePkh && account.activities.length > 0">
<ng-container *ngIf="account.pkh === activePkh && 'ACTIVITYCOMPONENT.TXNHASH' | translate">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Txn Hash</th>
<th scope="col">Block</th>
<th scope="col">Date</th>
<th scope="col">Type</th>
<th scope="col">Counterparty</th> <!-- To or From -->
<th scope="col">Amount (&#42793;)</th>
<th scope="col">Status</th>
<th scope="col">{{ 'ACTIVITYCOMPONENT.TXNHASH' | translate }}</th>
<th scope="col">{{ 'ACTIVITYCOMPONENT.BLOCK' | translate }}</th>
<th scope="col">{{ 'ACTIVITYCOMPONENT.DATE' | translate }}</th>
<th scope="col">{{ 'ACTIVITYCOMPONENT.TYPE' | translate }}</th>
<th scope="col">{{ 'ACTIVITYCOMPONENT.COUNTERPARTY' | translate }}</th> <!-- To or From -->
<th scope="col">{{ 'ACTIVITYCOMPONENT.AMOUNT' | translate }} (&#42793;)</th>
<th scope="col">{{ 'ACTIVITYCOMPONENT.STATUS' | translate }}</th>
</tr>
</thead>
<tbody *ngFor="let transaction of account.activities">
<tr class="table-row">
<tbody>
<tr class="table-row" *ngFor="let transaction of account.activities">
<!-- Txn Hash -->
<th scope="row" class="row-hash table-cell">
<span data-toggle="tooltip" [title]="transaction.hash">
Expand Down Expand Up @@ -45,10 +45,11 @@
<!-- Counterparty: `To` or `From` -->
<td class="table-cell">
<!-- {{ transaction.source.tz }} -->
<span *ngIf="transaction.type != 'activation'">
<span *ngIf="activePkh === transaction.source;then to else from"> From </span>
<ng-template #from><span class="smallText">from</span></ng-template>
<ng-template #to><span class="smallText">to</span></ng-template>
<span *ngIf="transaction.type != 'activation' && !(transaction.type === 'delegation' && !transaction.destination)">
<!-- to and from only shown when it's not an origination (transaction.type != 'activation') and when it's not an undelegate operation: !(transaction.type === 'delegation' && !transaction.destination) -->
<span *ngIf="activePkh === transaction.source;then to else from"> {{ 'ACTIVITYCOMPONENT.FROM' | translate }} </span>
<ng-template #from><span class="smallText">{{ 'ACTIVITYCOMPONENT.FROM' | translate }}</span></ng-template>
<ng-template #to><span class="smallText">{{ 'ACTIVITYCOMPONENT.TO' | translate }}</span></ng-template>
</span>
<br>
<span class="counterparty">
Expand All @@ -68,14 +69,26 @@
<a href="{{ CONSTANTS.NET.BLOCK_EXPLORER_URL + transaction.hash }}" target="_blank">{{ getStatus(transaction) }}</a>
</td>
</tr>
<!-- Show More Button -->
<!--
<tr class="last-btn-column">
<td colspan="6">
</td>
<td>
<button type="button" class="btn btn-outline-light btn-sm btn-balance show-more" aria-label="More" (click)="toggleTransactions()">
<span aria-hidden="true"> {{ showBtn }} </span>
</button>
</td>
</tr>
-->
</tbody>
</table>
</ng-container>
</ng-container>
</div>

<p *ngIf='!accounts'>
Wallet not configured!
{{ 'ACTIVITYCOMPONENT.EMPTY' | translate }}
</p>

<!-- Type of operations: activation, transfers, delegation, origination --- endorsements, baking, rewards -->
19 changes: 19 additions & 0 deletions src/app/components/activity/activity.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 09fccd3

Please sign in to comment.