You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/07/10 15:53:06 UTC

[incubator-dlab] 03/19: [DLAB-829]: added limit quantities of characters for project name

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

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

commit c7fe69aaa2e179967af9c2314d46d7567c52e3e9
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Jul 5 12:32:14 2019 +0300

    [DLAB-829]: added limit quantities of characters for project name
---
 .../administration/project/project-form/project-form.component.ts   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
index 45dd8d7..efcf23e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
@@ -127,7 +127,7 @@ export class ProjectFormComponent implements OnInit {
   private initFormModel(): void {
     this.projectForm = this._fb.group({
       'key': ['', Validators.required],
-      'name': ['', Validators.compose([Validators.required, Validators.pattern(PATTERNS.namePattern), this.checkDuplication.bind(this)])],
+      'name': ['', Validators.compose([Validators.required, Validators.pattern(PATTERNS.namePattern), this.checkDuplication.bind(this), this.providerMaxLength.bind(this)])],
       'endpoints': [[], Validators.required],
       'tag': ['', Validators.compose([Validators.required, Validators.pattern(PATTERNS.namePattern)])],
       'groups': [[], Validators.required]
@@ -173,4 +173,8 @@ export class ProjectFormComponent implements OnInit {
       }
     }
   }
+
+  private providerMaxLength(control) {
+    return control.value.length <= 50 ? null : { limit: true };
+  }
 }


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