Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error notification text and max size validation in Cloud volume service #443

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class CloudVolumeCreateComponent implements OnInit{
this.createVolumeForm.removeControl('iops');
this.createVolumeForm.controls['size'].setValue(500);
this.errorMessage.size.min = "Min: 1 GiB"
this.errorMessage.size.max = "Min: 1024 GiB"
this.errorMessage.size.max = "Max: 1024 GiB"
this.createVolumeForm.controls['size'].setValidators([Validators.required, Validators.min(1), Validators.max(1024)]);
this.createVolumeForm.controls['size'].updateValueAndValidity();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class CloudVolumeModifyComponent implements OnInit{
this.modifyVolumeForm.removeControl('iops');
}
this.errorMessage.size.min = "Min: 1 GiB";
this.errorMessage.size.max = "Min: 1024 GiB";
this.errorMessage.size.max = "Max: 1024 GiB";
this.modifyVolumeForm.controls['size'].setValue(this.selectedVolume && this.selectedVolume['size'] ? (this.selectedVolume['size'] / Math.pow(Consts.TO_GiB_CONVERTER, 3)) : 500);
this.modifyVolumeForm.controls['size'].setValidators([Validators.required, Validators.min(1), Validators.max(1024)]);
this.modifyVolumeForm.controls['size'].updateValueAndValidity();
Expand Down Expand Up @@ -265,17 +265,17 @@ export class CloudVolumeModifyComponent implements OnInit{
let param = this.getVolumeDataArray(value);
this.cloudBS.updateVolume(this.selectedVolumeId, param).subscribe((res)=>{
this.msgs = [];
this.msgs.push({severity: 'success', summary: 'Success', detail: 'Cloud Volume has been created successfully.'});
this.msgs.push({severity: 'success', summary: 'Success', detail: 'Cloud Volume has been modified successfully.'});
let queryParams = {
"message": JSON.stringify({severity: 'success', summary: 'Success', detail: 'Cloud Volume has been created successfully.'})
"message": JSON.stringify({severity: 'success', summary: 'Success', detail: 'Cloud Volume has been modified successfully.'})
};
this.selectedBackends = [];
this.selectType = "";
this.selectedVolType = "";
this.router.navigate(['/block',"fromCloudVolume"], {queryParams: queryParams});
}, (error)=>{
this.msgs = [];
this.msgs.push({severity: 'error', summary: "Error", detail: 'Cloud Volume could not be created.'});
this.msgs.push({severity: 'error', summary: "Error", detail: 'Cloud Volume could not be modified.'});
})
}
}