1
0
Fork 0
forked from lthn/blockchain

zero amount error message in contracts

This commit is contained in:
wildkif 2019-05-24 17:59:51 +03:00
parent 82b9d1046a
commit d441de9e9f
6 changed files with 19 additions and 6 deletions

View file

@ -387,6 +387,7 @@
"SELLER_NOT_VALID": "Invalid address.",
"ALIAS_NOT_VALID": "Alias not valid.",
"AMOUNT_REQUIRED": "Amount is required.",
"AMOUNT_ZERO": "Amount cannot be zero.",
"YOUR_DEPOSIT_REQUIRED": "Deposit required.",
"SELLER_DEPOSIT_REQUIRED": "Seller deposit is required.",
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract.",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -57,6 +57,9 @@
<div *ngIf="purchaseForm.controls['amount'].errors['required']">
{{ 'PURCHASE.FORM_ERRORS.AMOUNT_REQUIRED' | translate }}
</div>
<div *ngIf="purchaseForm.controls['amount'].errors['amount_zero']">
{{ 'PURCHASE.FORM_ERRORS.AMOUNT_ZERO' | translate }}
</div>
</div>
</div>
</div>
@ -100,8 +103,6 @@
</div>
</div>
<button type="button" class="purchase-select" (click)="toggleOptions()">
<span>{{ 'PURCHASE.DETAILS' | translate }}</span><i class="icon arrow" [class.down]="!additionalOptions" [class.up]="additionalOptions"></i>
</button>

View file

@ -82,7 +82,12 @@ export class PurchaseComponent implements OnInit, OnDestroy {
}
return null;
}]),
amount: new FormControl(null, Validators.required),
amount: new FormControl(null, [Validators.required, (g: FormControl) => {
if (parseInt(g.value, 10) === 0) {
return {'amount_zero': true};
}
return null;
}]),
yourDeposit: new FormControl(null, Validators.required),
sellerDeposit: new FormControl(null, Validators.required),
sameAmount: new FormControl({value: false, disabled: false}),

View file

@ -387,6 +387,7 @@
"SELLER_NOT_VALID": "Invalid address.",
"ALIAS_NOT_VALID": "Alias not valid.",
"AMOUNT_REQUIRED": "Amount is required.",
"AMOUNT_ZERO": "Amount cannot be zero.",
"YOUR_DEPOSIT_REQUIRED": "Deposit required.",
"SELLER_DEPOSIT_REQUIRED": "Seller deposit is required.",
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract.",