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

dyankiv pushed a commit to branch DATALAB-2645
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit 6fa91441cc949e23554b15dc17a3a0e9a2e8c699
Author: Denys Yankiv <[email protected]>
AuthorDate: Sat Aug 20 15:00:55 2022 +0300

    fixed validation
---
 .../computational-resource-create-dialog.component.html           | 8 +++++++-
 .../computational-resource-create-dialog.component.ts             | 5 -----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
 
b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
index f69a76969..228b716a9 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
+++ 
b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
@@ -27,7 +27,7 @@
       <form [formGroup]="resourceForm" *ngIf="clusterTypes.length && 
resourceForm; else placeholder">
         <div class="form-wrapper">
           <div class="col">
-            <div class="control-group" [hidden]="clusterTypes.length === 1">
+            <div class="control-group" *ngIf="PROVIDER !== 'azure'" 
[hidden]="clusterTypes.length === 1">
               <label class="label">Select cluster type</label>
               <div class="control selector-wrapper">
                 <mat-form-field>
@@ -420,6 +420,12 @@
           </button>
           <button
             mat-raised-button
+            [ngClass]="{'not-allowed': !resourceForm?.valid
+              || (selectedImage?.image === 'docker.datalab-dataengine-service' 
&& !resourceForm.value.shape_slave)
+              || (selectedImage?.image === 'docker.datalab-dataengine-service' 
&& !resourceForm.value.version) }"
+            [disabled]="!resourceForm?.valid
+              || (!resourceForm.value.shape_slave)
+              || (selectedImage?.image === 'docker.datalab-dataengine-service' 
&& !resourceForm.value.version)"
             type="button"
             (click)="createComputationalResource(resourceForm.value)"
             class="butt butt-success action"
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
index 8dffa0400..15d9a9d1c 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
@@ -184,7 +184,6 @@ export class ComputationalResourceCreateDialogComponent 
implements OnInit {
   }
 
   private getComputationalResourceLimits(): void {
-    console.log(1111, this.selectedImage);
     if (this.selectedImage && this.selectedImage.image) {
       const activeImage = DICTIONARY[this.PROVIDER][this.selectedImage.image];
 
@@ -204,10 +203,6 @@ export class ComputationalResourceCreateDialogComponent 
implements OnInit {
         this.resourceForm.controls['emr_slave_instance_spot'].setValue(true);
         this.resourceForm.controls['instance_price'].setValue(50);
       }
-      if (this.PROVIDER === 'azure' && this.selectedImage.image === 
'docker.datalab-dataengine-service') {
-        this.minInstanceNumber = 
this.selectedImage.limits['min_hdinsight_instance_count'];
-        this.maxInstanceNumber = 
this.selectedImage.limits['max_hdinsight_instance_count'];
-      }
 
       
this.resourceForm.controls['instance_number'].setValue(this.minInstanceNumber);
       
this.resourceForm.controls['preemptible_instance_number'].setValue(this.minPreemptibleInstanceNumber);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to