mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
Merge pull request #38519 from rhcs-dashboard/fix-47727-master
mgr/dashboard: RGW User Form is validating disabled fields Reviewed-by: Avan Thakkar <athakkar@redhat.com> Reviewed-by: Nizamudeen A <nia@redhat.com> Reviewed-by: Volker Theile <vtheile@suse.com>
This commit is contained in:
commit
6a40305be4
@ -61,6 +61,8 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
|
||||
this.subuserLabel = $localize`subuser`;
|
||||
this.s3keyLabel = $localize`S3 Key`;
|
||||
this.capabilityLabel = $localize`capability`;
|
||||
this.editing = this.router.url.startsWith(`/rgw/user/${URLVerbs.EDIT}`);
|
||||
this.action = this.editing ? this.actionLabels.EDIT : this.actionLabels.CREATE;
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
@ -70,7 +72,7 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
|
||||
uid: [
|
||||
null,
|
||||
[Validators.required],
|
||||
[CdValidators.unique(this.rgwUserService.exists, this.rgwUserService)]
|
||||
this.editing ? [] : [CdValidators.unique(this.rgwUserService.exists, this.rgwUserService)]
|
||||
],
|
||||
display_name: [null, [Validators.required]],
|
||||
email: [
|
||||
@ -148,8 +150,6 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.editing = this.router.url.startsWith(`/rgw/user/${URLVerbs.EDIT}`);
|
||||
this.action = this.editing ? this.actionLabels.EDIT : this.actionLabels.CREATE;
|
||||
// Process route parameters.
|
||||
this.route.params.subscribe((params: { uid: string }) => {
|
||||
if (!params.hasOwnProperty('uid')) {
|
||||
|
Loading…
Reference in New Issue
Block a user