This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch DLAB-921
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit afbc8879a4ab8c87007be409f17dcf1d008eaa5a
Author: Andriana Kovalyshyn <andriana_kovalys...@epam.com>
AuthorDate: Wed Aug 14 12:42:27 2019 +0200

    [DLAB-975]: added extra numeric check on budget input
---
 .../manage-environment/manage-environment-dilog.component.html      | 6 ++++--
 .../manage-environment/manage-environment-dilog.component.ts        | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html
 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html
index 602aa44..c336217 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html
@@ -38,7 +38,8 @@
                 <div class="username ellipsis">{{ 
manageUsersForm.controls['projects'].controls[i].value['project'] }}
                 </div>
                 <div class="quotes" *ngIf="DICTIONARY.cloud_provider !== 
'gcp'">
-                  <input type="number" min="0" placeholder="Enter limit, in 
USD" formControlName="budget">
+                  <input type="number" 
(keypress)="CheckUtils.isNumberKey($event)" min="0"
+                    placeholder="Enter limit, in USD" formControlName="budget">
                   <span class="error"
                     
*ngIf="!manageUsersForm?.controls['projects'].controls[i].controls['budget'].valid
 && 
!manageUsersForm?.controls['projects'].controls[i].controls['budget'].hasError('overrun')">Only
                     positive integers are allowed</span>
@@ -74,7 +75,8 @@
             <div class="control-group total-budget" 
*ngIf="DICTIONARY.cloud_provider !== 'gcp'">
               <label class="label">Total budget</label>
               <div class="control">
-                <input type="number" formControlName="total" 
placeholder="Enter total budget, in USD">
+                <input type="number" 
(keypress)="CheckUtils.isNumberKey($event)" formControlName="total"
+                  placeholder="Enter total budget, in USD">
                 <span class="error" 
*ngIf="manageUsersForm?.controls['total'].hasError('overrun')">Total budget
                   cannot be lower than a sum of users quotes</span>
               </div>
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts
index c0bbadb..b939711 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts
@@ -21,6 +21,7 @@ import { Component, Output, EventEmitter, ViewEncapsulation, 
Inject, OnInit } fr
 import { Validators, FormBuilder, FormGroup, FormArray } from '@angular/forms';
 import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
 import { DICTIONARY } from '../../../../dictionary/global.dictionary';
+import { CheckUtils } from '../../../core/util';
 
 @Component({
   selector: 'dlab-manage-env-dilog',
@@ -30,6 +31,8 @@ import { DICTIONARY } from 
'../../../../dictionary/global.dictionary';
 })
 export class ManageEnvironmentComponent implements OnInit {
   readonly DICTIONARY = DICTIONARY;
+  readonly CheckUtils = CheckUtils;
+
   public manageUsersForm: FormGroup;
   public manageTotalsForm: FormGroup;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org
For additional commands, e-mail: commits-h...@dlab.apache.org

Reply via email to