You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by hs...@apache.org on 2022/10/18 20:32:56 UTC

[incubator-datalab] 01/01: fixed validation

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

hshpak pushed a commit to branch validation-fix
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit 65f573925986be22d6e4e7d11216a8511b7debf9
Author: Hennadii_Shpak <bo...@gmail.com>
AuthorDate: Tue Oct 18 23:32:27 2022 +0300

    fixed validation
---
 .../cluster-details/cluster-details.component.html | 72 +++++++++++-----------
 .../connected-platform-dialog.component.html       |  4 +-
 .../connected-platform-dialog.component.ts         |  4 +-
 3 files changed, 41 insertions(+), 39 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html
index 7870e7796..d8f1b0087 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html
@@ -156,42 +156,42 @@
             </p>
           </div>
         </div>
-        <div
-          class="checkbox-group"
-          *ngIf="resource.image === 'docker.datalab-dataengine'
-              && resource.status === 'running'
-              && environment.image !== 'docker.datalab-zeppelin'
-              && environment.image !== 'docker.datalab-superset'
-              && environment.image !== 'docker.datalab-jupyterlab'"
-        >
-          <label>
-            <input #configurationNode type="checkbox" (change)="selectConfiguration()"/> Cluster configurations
-          </label>
-          <div class="checkbox-group">
-            <form [formGroup]="configurationForm" novalidate>
-              <div class="config-details" [ngClass]="{ show: configuration?.nativeElement['checked'] || false }">
-                <textarea
-                  formControlName="configuration_parameters"
-                  placeholder="Cluster configuration template, JSON"
-                  data-gramm_editor="false"
-                ></textarea>
-                <span class="danger_color"
-                  *ngIf="!configurationForm.controls.configuration_parameters.valid
-                      && configurationForm.controls['configuration_parameters'].dirty">
-                      Configuration parameters is not in a valid format
-                </span>
-              </div>
-            </form>
-          </div>
-        </div>
-        <div *ngIf="environment.image === 'docker.datalab-zeppelin' && resource.status === 'running'">
-          <small>Spark default configuration for Apache Zeppelin can not be changed from DataLab UI.
-            Currently it can be done directly through Apache Zeppelin interpreter menu.
-              For more details please refer for Apache Zeppelin
-              <a href="https://zeppelin.apache.org/docs/0.9.0/usage/interpreter/overview.html" target="_blank">official
-                  documentation</a>.
-          </small>
-        </div>
+<!--        <div-->
+<!--          class="checkbox-group"-->
+<!--          *ngIf="resource.image === 'docker.datalab-dataengine'-->
+<!--              && resource.status === 'running'-->
+<!--              && environment.image !== 'docker.datalab-zeppelin'-->
+<!--              && environment.image !== 'docker.datalab-superset'-->
+<!--              && environment.image !== 'docker.datalab-jupyterlab'"-->
+<!--        >-->
+<!--          <label>-->
+<!--            <input #configurationNode type="checkbox" (change)="selectConfiguration()"/> Cluster configurations-->
+<!--          </label>-->
+<!--          <div class="checkbox-group">-->
+<!--            <form [formGroup]="configurationForm" novalidate>-->
+<!--              <div class="config-details" [ngClass]="{ show: configuration?.nativeElement['checked'] || false }">-->
+<!--                <textarea-->
+<!--                  formControlName="configuration_parameters"-->
+<!--                  placeholder="Cluster configuration template, JSON"-->
+<!--                  data-gramm_editor="false"-->
+<!--                ></textarea>-->
+<!--                <span class="danger_color"-->
+<!--                  *ngIf="!configurationForm.controls.configuration_parameters.valid-->
+<!--                      && configurationForm.controls['configuration_parameters'].dirty">-->
+<!--                      Configuration parameters is not in a valid format-->
+<!--                </span>-->
+<!--              </div>-->
+<!--            </form>-->
+<!--          </div>-->
+<!--        </div>-->
+<!--        <div *ngIf="environment.image === 'docker.datalab-zeppelin' && resource.status === 'running'">-->
+<!--          <small>Spark default configuration for Apache Zeppelin can not be changed from DataLab UI.-->
+<!--            Currently it can be done directly through Apache Zeppelin interpreter menu.-->
+<!--              For more details please refer for Apache Zeppelin-->
+<!--              <a href="https://zeppelin.apache.org/docs/0.9.0/usage/interpreter/overview.html" target="_blank">official-->
+<!--                  documentation</a>.-->
+<!--          </small>-->
+<!--        </div>-->
         <div class="text-center m-top-30" *ngIf="configuration?.nativeElement['checked'] || false">
           <button
             mat-raised-button type="button"
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.html
index a06d7be60..9540c721f 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.html
@@ -51,7 +51,7 @@
               *ngIf="!connectedPlatformForm?.controls.url.valid
                         && connectedPlatformForm.controls.url.touched"
             >
-              Please provide a valid endpoint url with slash in the end.
+              Please provide a valid platform url.
             </span>
           </div>
         </div>
@@ -64,7 +64,7 @@
               class="error"
               *ngIf="!connectedPlatformForm?.controls.name.valid && connectedPlatformForm.controls.name.touched"
             >
-              Can only contain letters, numbers. Minimum 2 symbols.
+              Platform name cannot be longer than 6 characters.
             </span>
           </div>
         </div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.ts
index 058834ccd..6d2f96fe2 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/connected-platforms/connected-platform-dialog/connected-platform-dialog.component.ts
@@ -25,6 +25,8 @@ import { AddModalData, AddPlatformFromValue } from '../connected-platforms.model
 import { ConfirmButtonNames } from '../connected-platforms.config';
 import { PATTERNS } from '../../../core/util';
 
+const URL_REGEXP_VALIDATION_STRING = '^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]';
+
 @Component({
   selector: 'datalab-connected-platform-dialog',
   templateUrl: './connected-platform-dialog.component.html',
@@ -57,7 +59,7 @@ export class ConnectedPlatformDialogComponent implements OnInit {
   private initForm(): void {
     this.connectedPlatformForm = this.fb.group({
       type: ['', Validators.required],
-      url: ['', [ Validators.required, Validators.pattern(PATTERNS.fullUrl)]],
+      url: ['', [ Validators.required, Validators.pattern(URL_REGEXP_VALIDATION_STRING)]],
       name: ['', [ Validators.required, Validators.pattern(PATTERNS.projectName), Validators.minLength(2)]]
     });
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org