Skip to content

Commit

Permalink
Merge pull request #10 from nebulaai/init
Browse files Browse the repository at this point in the history
fix transaction wrong password without warning message bug
  • Loading branch information
NBAI-Cloud-Platform authored Jun 28, 2019
2 parents 4fd8336 + 83af0e9 commit d9ca5ad
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/app/manage/add-wallet/add-wallet.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
for="password">{{translationService.isEn? translationService.enMap['ENTER']:translationService.cnMap['ENTER']}}</label>
</div>
<input type="password" name="password" #password="ngModel" ngModel maxlength="30" required
pattern="^(?=.*\d)(?=.*[a-z]).{6,30}$">
pattern="^(?=.*\d)(?=.*[a-z]).{6,30}$" (keyup) = "valid()">
<span
*ngIf="password.errors?.pattern && (password.dirty || password.touched )">{{translationService.isEn? translationService.enMap['PASSFORMAT']:translationService.cnMap['PASSFORMAT']}}</span>
</div>
Expand All @@ -39,7 +39,6 @@
<span
*ngIf="rePassword.errors?.compare && (rePassword.dirty || rePassword.touched )">{{translationService.isEn? translationService.enMap['PASSWORDNOTMATCH']:translationService.cnMap['PASSWORDNOTMATCH']}}</span>
</div>

</div>
<div class="modal-footer">
<div><span class="dot active"></span>
Expand Down
4 changes: 4 additions & 0 deletions src/app/manage/add-wallet/add-wallet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ export class AddWalletComponent implements OnInit {
this.router.navigate([{ outlets: { popup: ['mnemonic'] } }]);
}
}

valid() {
this.form.controls['rePassword'].updateValueAndValidity();
}
}
3 changes: 2 additions & 1 deletion src/app/manage/details/details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<a href="javascript:;" copy [copyValue]="account.address"><img src="assets/imgs/icons/copy.svg"
style="width: 20px;" /></a>
</div>
<div class="wallet-balance">{{account['balance'] | number:'.2-2'}} NBAI</div>
<!-- <div class="wallet-balance">{{account['balance'] | number:'.2-2'}} NBAI</div> -->
<div class="wallet-balance">{{account['balance'] | number:'.0-18'}} NBAI</div>

<div class="wallet-details">

Expand Down
22 changes: 19 additions & 3 deletions src/app/manage/main/main.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
</div>
<div class="wallet-content" navLink="navLink">
<div routerLink="/dashboard/details/{{account.address}}">
<div class="balance">{{account.balance | number:'.2-2'}} NBAI</div>
<!-- <div class="balance">{{account.balance | number:'.2-2'}} NBAI</div> -->
<div class="balance">{{account.balance | number:'.0-18'}} NBAI</div>
<div class="title">{{account.name}}</div>
<div class="account">{{account.address | address:10:6}}</div>
</div>
Expand Down Expand Up @@ -71,7 +72,7 @@ <h2>{{translationService.isEn? translationService.enMap['RECENT']:translationSer
<th class="action field width-min-s">
{{translationService.isEn? translationService.enMap['ACTION']:translationService.cnMap['ACTION']}}
</th>
<th class="value field width-min">
<th class="value field width-medium">
{{translationService.isEn? translationService.enMap['VALUE']:translationService.cnMap['VALUE']}}
</th>
<th class="from field width-large">
Expand All @@ -86,6 +87,9 @@ <h2>{{translationService.isEn? translationService.enMap['RECENT']:translationSer
<th class="hash field width-large">
{{translationService.isEn? translationService.enMap['TRANSACTIONHASH']:translationService.cnMap['TRANSACTIONHASH']}}
</th>
<!-- <th class="send field width-min">
{{translationService.isEn? translationService.enMap['SENDNBAI']:translationService.cnMap['SENDNBAI']}}
</th> -->
</tr>
</thead>
<tbody>
Expand All @@ -107,8 +111,11 @@ <h2>{{translationService.isEn? translationService.enMap['RECENT']:translationSer
{{transaction.id}}
</div>
</td>
<td class="value field width-min">
<!-- <td class="value field width-min">
{{transaction['value'] | number:'.2-2'}} NBAI
</td> -->
<td class="value field width-medium">
{{transaction['value'] | number:'.0-18'}} NBAI
</td>
<td class="from field width-large">
<a href="{{scanUrl}}address/{{transaction['t_from']}}" target="_blank">
Expand All @@ -128,7 +135,16 @@ <h2>{{translationService.isEn? translationService.enMap['RECENT']:translationSer
</td>
<td class="hash field width-large">
<a href="{{scanUrl}}tx/{{transaction['hash']}}" target="_blank"><span>{{transaction['hash']}}</span></a>
<!-- <a href="{{scanUrl}}tx/{{transaction['hash']}}" target = "_blank">{{transaction['hash'] | address:10:10}}</a> -->
</td>
<!-- <td class="send field width-min">
<a routerLink="/dashboard/transfer" *ngIf="transaction['type'] != 2" [queryParams] = "{addressFrom: transaction['t_from'], addressTo: transaction['t_to'], nameTo: transaction['toNick']}" class="btn-send">
<span>
{{translationService.isEn? translationService.enMap['SENDWITHADD']:translationService.cnMap['SENDWITHADD']}}
</span>
</a>
<a href="{{scanUrl}}tx/{{transaction['hash']}}" target = "_blank">{{transaction['hash'] | address:10:10}}</a>
</td> -->
</tr>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions src/app/manage/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class MainComponent implements OnInit {
for (let account of this.accounts) {
addresses += account.address + ',';
names.push(account.name);
this.refresh(account);
}
addresses = addresses.substring(0, addresses.length - 1);
this.walletService.getRecentTransaction(addresses, 20, 0).subscribe(
Expand Down
3 changes: 2 additions & 1 deletion src/app/manage/manage.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<div class="balance">
<h1>{{translationService.isEn? translationService.enMap['TOTALBALANCE']:translationService.cnMap['TOTALBALANCE']}}
<br>
<span class = "total">{{(total||0) | number: '1.2-2'}}</span> NBAI
<!-- <span class = "total">{{(total||0) | number: '1.2-2'}}</span> NBAI -->
<span class = "total">{{(total||0) | number: '0.2-18'}}</span> NBAI
</h1>
</div>
<ul>
Expand Down
7 changes: 5 additions & 2 deletions src/app/manage/transfer/transfer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
translationService.enMap['FROM']:translationService.cnMap['FROM']}}*</label>
<select required name="account" id="account" (change)="selectAccount()" [(ngModel)]=currentAccount
#account="ngModel" class="form-control form-control-sm">
<!-- <option *ngFor="let account of accounts" [ngValue]="account">{{account.name}}&nbsp;-&nbsp;{{account.address |
address:10:10}}&nbsp;-&nbsp;{{account.balance | number:'.2-2'}} NBAI</option> -->
<option *ngFor="let account of accounts" [ngValue]="account">{{account.name}}&nbsp;-&nbsp;{{account.address |
address:10:10}}&nbsp;-&nbsp;{{account.balance | number:'.2-2'}} NBAI</option>
address:4:4}}&nbsp;-&nbsp;{{account.balance | number:'.0-18'}} NBAI</option>
</select>
<div class="form-control-feedback" *ngIf="account.invalid&&(account.dirty || account.touched)">Wallet Address is
required</div>
Expand All @@ -24,7 +26,8 @@
<div class="data-container" *ngIf="showDropDownTo">
<p *ngFor="let account of accounts;
let i = index" class="data-list" (click)="updateTextBox(i)">
{{account.name}}&nbsp;-&nbsp;{{account.address | address:10:10}}&nbsp;-&nbsp;{{account.balance | number:'.2-2'}}
<!-- {{account.name}}&nbsp;-&nbsp;{{account.address | address:10:10}}&nbsp;-&nbsp;{{account.balance | number:'.2-2'}} -->
{{account.name}}&nbsp;-&nbsp;{{account.address | address:4:4}}&nbsp;-&nbsp;{{account.balance | number:'.0-18'}}
NBAI
</p>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/app/manage/transfer/transfer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class TransferComponent implements OnInit {
@ViewChild('confirmForm') confirmForm: any;
accounts: Account[];
popupConfirm: boolean = false;
errMsg: string;
errMsg: string = "Password does not match";
loading: boolean = false;
showDropDownFrom: boolean = false;
showDropDownTo: boolean = false;
Expand Down Expand Up @@ -159,7 +159,8 @@ export class TransferComponent implements OnInit {
let account = this.accounts[index];
// console.log('account', account);
this.tx.to = account.address;
this.tx.display = account.name + ' ' + this.filter(account.address, 10, 10) + ' ' + Number(account.balance).toFixed(2) + ' NBAI';
// this.tx.display = account.name + ' ' + this.filter(account.address, 10, 10) + ' ' + Number(account.balance).toFixed(2) + ' NBAI';
this.tx.display = account.name + ' ' + this.filter(account.address, 4, 4) + ' ' + Number(account.balance) + ' NBAI';
this.showDropDownTo = false;
}

Expand Down
1 change: 1 addition & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ body{
&.value{
text-align: right;
padding-right: 25px;
text-align: right;
}
&.send{
text-align: center;
Expand Down
83 changes: 79 additions & 4 deletions src/styles.scss.orig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,53 @@ a:hover, a:visited, a:link, a:active
text-decoration: none;
}

.lightbox {
position: fixed;
top: 0;
width: 100vw;
height: 100vh;
text-align: center;
background: rgba(200,200,200,0.5);

.lightbox-content {
margin: 30vh 30vw;
padding: 30px;
background: #fff;

@media (max-width: 980px){
margin: 30vh 25vw;
}

@media (max-width: 480px){
margin: 30vh 5vw;
}

h3{
margin-top: 0;
}

input.node{
margin: 2rem 0;
padding-left: 10px;
}

a.confirm{
margin-top: 2rem;
@include btn(180px, 30px, 12px);
padding: 10px 30px;
}

#close {
position: relative;
top: 20px;
right: -50%;
font-size: 1rem;
cursor: pointer;
}
}

}

body{
font-family: 'Helvetica Neue', sans-serif;
margin: 0 auto;
Expand All @@ -74,6 +121,9 @@ body{
app-head{
header{
height: 80px;
@media(max-width: 480px){
height: 100px
}
background: #fff;
display:flex;
align-items: center;
Expand All @@ -82,18 +132,32 @@ body{
.walletlogo{
left: 5%;
position: relative;
@media(max-width: 480px){
margin-bottom: 1rem;
}
img{
width: 300px;
@media (max-width: 420px) {
width: 200px;
}
}
}
.network{
position: absolute;
right: 20rem;
top: 2rem;
@media(max-width: 980px){
right: 10rem;
}
@media(max-width: 480px){
top: 4rem;
}
}
.download{
display: flex;
position: absolute;
right: 9rem;

right: 8rem;
top: 1.8rem;
a{
color: #fff;
background: $purple;
Expand Down Expand Up @@ -132,7 +196,10 @@ body{
label:hover{
cursor: pointer;
}

i.config{
padding-left: 0.5rem;
}

}
.dropdown{
position: absolute;
Expand Down Expand Up @@ -986,7 +1053,15 @@ body{
top: 0;
// background: #a678ff;
background: rgba(12,12,12, 0.8);
<<<<<<< HEAD
// width: 520px;
width: auto;
=======
width: 520px;
@media(max-width: 480px){
width: 100%;
}
>>>>>>> origin/master
height: 100vh;
color: #fff;
padding: 1rem;
Expand Down Expand Up @@ -1613,7 +1688,7 @@ body{
svg{
width:20px;
}
div.text{font-size: 14px;;}
div.text{font-size: 14px;}
}
}
li.wallet-link{
Expand Down

0 comments on commit d9ca5ad

Please sign in to comment.