You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2021/08/05 09:57:43 UTC

[GitHub] [submarine] kevin85421 commented on a change in pull request #692: SUBMARINE-955. Add Limit on Experiment Name

kevin85421 commented on a change in pull request #692:
URL: https://github.com/apache/submarine/pull/692#discussion_r683303800



##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-predefined-form/experiment-predefined-form.component.ts
##########
@@ -151,8 +151,11 @@ export class ExperimentPredefinedFormComponent implements OnInit, OnDestroy {
     let controls = {};
     for (let item of this.templates[this.currentOption].templateParams) {
       controls[item.name] = [item.value];
-      if (item.required === 'true') controls[item.name].push([Validators.required]);
+      if (item.required === 'true') {
+        if(item.name !== 'experiment_name') controls[item.name].push([Validators.required]);
+        else controls[item.name].push([Validators.required, Validators.pattern('[a-zA-Z0-9]+[a-zA-Z0-9\-]*')]);
     }

Review comment:
       indentation

##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
##########
@@ -42,7 +42,7 @@
             placeholder="mnist-example"
           />
           <div class="alert-message" *ngIf="experiment.get('experimentName').hasError('pattern')">
-            Only letters(a-z), numbers(0-9), and hyphens(-) are allowed.
+            Only letters(a-z), numbers(0-9), and hyphens(-)(but cannot start with them) are allowed.

Review comment:
       We can discuss that should we need to change the error message in today's meeting. 

##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-predefined-form/experiment-predefined-form.component.scss
##########
@@ -16,3 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
+ .alert-message {
+    color: red;
+    margin-top: .3rem;
+    line-height: normal;
+   }

Review comment:
       indentation

##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-predefined-form/experiment-predefined-form.component.ts
##########
@@ -151,8 +151,11 @@ export class ExperimentPredefinedFormComponent implements OnInit, OnDestroy {
     let controls = {};
     for (let item of this.templates[this.currentOption].templateParams) {
       controls[item.name] = [item.value];
-      if (item.required === 'true') controls[item.name].push([Validators.required]);
+      if (item.required === 'true') {
+        if(item.name !== 'experiment_name') controls[item.name].push([Validators.required]);
+        else controls[item.name].push([Validators.required, Validators.pattern('[a-zA-Z0-9]+[a-zA-Z0-9\-]*')]);
     }
+  }

Review comment:
       indentation




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org