Fix Group related issues

1. Fix Ldap group name to required item
2. Edit Group DN is not allowed

Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
Qian Deng 2018-08-15 18:10:08 +08:00
parent 07da2fd5d6
commit 6d91a0d66e
5 changed files with 19 additions and 6 deletions

View File

@ -14,6 +14,7 @@
[class.invalid]="isDNInvalid">
<input type="text" id="ldap_group_dn" name="ldap_group_dn"
required
[disabled]="mode !== 'create'"
[(ngModel)]="group.ldap_group_dn"
#groupDN="ngModel">
<span class="tooltip-content">
@ -26,11 +27,19 @@
<label id="type">LDAP</label>
</div>
<div class="form-group">
<label for="group_name">{{'GROUP.NAME' | translate}}</label>
<label for="group_name">
<label for="group_name" class="required">{{'GROUP.NAME' | translate}}</label>
<label for="group_name"
aria-haspopup="true"
role="tooltip"
class="tooltip tooltip-validation tooltip-sm tooltip-right"
[class.invalid]="isNameInvalid">
<input type="text" id="group_name" name="group_name"
required
[(ngModel)]="group.group_name"
#groupDN="ngModel">
#groupName="ngModel">
<span class="tooltip-content">
{{dnTooltip | translate}}
</span>
</label>
</div>
</section>

View File

@ -45,6 +45,10 @@ export class AddGroupModalComponent implements OnInit, OnDestroy {
let dnControl = this.groupForm.controls['ldap_group_dn'];
return dnControl && dnControl.invalid && (dnControl.dirty || dnControl.touched);
}
public get isNameInvalid(): boolean {
let dnControl = this.groupForm.controls['group_name'];
return dnControl && dnControl.invalid && (dnControl.dirty || dnControl.touched);
}
public get isFormValid(): boolean {
return this.groupForm.valid;

View File

@ -487,7 +487,7 @@
"MAINTAINERS": "Maintainers",
"PULLS": "Pull Count",
"VERSION": "Version",
"APP_VERSION": "App Version",
"APP_VERSION": "Application Version",
"INSTALL": "Install",
"INSTALL_CHART": "Install Chart",
"NAME": "Name",

View File

@ -486,7 +486,7 @@
"MAINTAINERS": "Maintainers",
"PULLS": "Pull Count",
"VERSION": "Version",
"APP_VERSION": "App Version",
"APP_VERSION": "Application Version",
"INSTALL": "Install",
"INSTALL_CHART": "Install Chart",
"NAME": "Name",

View File

@ -462,7 +462,7 @@
"MAINTAINERS": "Maintainers",
"PULLS": "Pull Count",
"VERSION": "Version",
"APP_VERSION": "App Version",
"APP_VERSION": "Application Version",
"INSTALL": "Install",
"INSTALL_CHART": "Install Chart",
"NAME": "Name",