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/06/11 10:57:20 UTC

[incubator-dlab] 01/05: [DLAB-743]: moved group-name-validarion into general

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

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

commit 4c9ed0c9ddc80700d8f17db8b819997871c412c8
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Mon Jun 10 17:20:08 2019 +0300

    [DLAB-743]: moved group-name-validarion into general
---
 .../roles/group-name-validarion.directive.ts       | 37 ----------------------
 .../webapp/src/app/administration/roles/index.ts   |  5 +--
 .../webapp/src/app/core/directives/index.ts        |  5 +--
 3 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/group-name-validarion.directive.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/group-name-validarion.directive.ts
deleted file mode 100644
index e3f7207..0000000
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/group-name-validarion.directive.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { Directive, forwardRef, Input } from '@angular/core';
-import { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';
-
-@Directive({
-  selector: '[validator][ngModel],[group-dir][ngFormControl]',
-  providers: [{
-    multi: true,
-    provide: NG_VALIDATORS,
-    useExisting: forwardRef(() => GroupNameValidationDirective)
-  }]
-})
-export class GroupNameValidationDirective implements Validator {
-  @Input() validator: Function;
-
-  validate(control: AbstractControl): { [key: string]: any; } {
-    return this.validator(control);
-  }
-}
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
index d0c57cc..da8a224 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
@@ -24,7 +24,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { MaterialModule } from '../../shared/material.module';
 import { FormControlsModule } from '../../shared/form-controls';
 import { RolesComponent, ConfirmDeleteUserAccountDialogComponent } from './roles.component';
-import { GroupNameValidationDirective } from './group-name-validarion.directive';
+import { DirectivesModule } from '../../core/directives';
 
 @NgModule({
   imports: [
@@ -32,9 +32,10 @@ import { GroupNameValidationDirective } from './group-name-validarion.directive'
     FormsModule,
     ReactiveFormsModule,
     MaterialModule,
+    DirectivesModule,
     FormControlsModule
   ],
-  declarations: [RolesComponent, ConfirmDeleteUserAccountDialogComponent, GroupNameValidationDirective],
+  declarations: [RolesComponent, ConfirmDeleteUserAccountDialogComponent],
   entryComponents: [ConfirmDeleteUserAccountDialogComponent],
   exports: [RolesComponent]
 })
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/directives/index.ts b/services/self-service/src/main/resources/webapp/src/app/core/directives/index.ts
index 83a0eae..2d3e564 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/directives/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/directives/index.ts
@@ -22,14 +22,15 @@ import { NgModule } from '@angular/core';
 import { CommonModule } from '@angular/common';
 import { ClickOutsideDirective } from './click-outside.directive';
 import { ScrollDirective } from './scrollTo.directive';
+import { GroupNameValidationDirective } from './group-name-validarion.directive';
 
 export * from './scrollTo.directive';
 export * from './click-outside.directive';
 
 @NgModule({
   imports: [CommonModule],
-  declarations: [ClickOutsideDirective, ScrollDirective],
-  exports: [ClickOutsideDirective, ScrollDirective]
+  declarations: [ClickOutsideDirective, ScrollDirective, GroupNameValidationDirective],
+  exports: [ClickOutsideDirective, ScrollDirective, GroupNameValidationDirective]
 })
 
 export class DirectivesModule { }


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