Correct error message for volume size in Launch Instance

In the "Source" tab of the "Launch Instance" form,
when some image is selected as a boot source and
"Create New Volume" is selected, if a decimal number
such as 1.1 is provided in the volume size, the error message
still says "The volume size must be at least 1 GB" even if
the specified value is larger than min_disk.
This is incorrect. This commit corrects the message
for this case.

Change-Id: I36d37407eb208586fb7bacdb941b445c5ea33bcb
Closes-Bug: #1812959
This commit is contained in:
pengyuesheng 2019-01-23 15:34:43 +08:00 committed by Akihiro Motoki
parent 673bf049a0
commit a06e7de97a
2 changed files with 4 additions and 3 deletions

View File

@ -56,6 +56,7 @@
) {
var ctrl = this;
ctrl.volumeSizeError = gettext('Volume size is required and must be an integer');
// Error text for invalid fields
/*eslint-disable max-len */
@ -539,10 +540,10 @@
}
var volumeSizeText = gettext('The volume size must be at least %(minVolumeSize)s GB');
var volumeSizeObj = { minVolumeSize: ctrl.minVolumeSize };
ctrl.volumeSizeError = interpolate(volumeSizeText, volumeSizeObj, true);
ctrl.minVolumeSizeError = interpolate(volumeSizeText, volumeSizeObj, true);
} else {
ctrl.minVolumeSize = 0;
ctrl.volumeSizeError = gettext('Volume size is required and must be an integer');
ctrl.minVolumeSizeError = gettext('Volume size is required and must be an integer');
}
}

View File

@ -63,7 +63,7 @@
<span class="hz-icon-required fa fa-asterisk"></span>
</label>
<input name="volume-size"
min="{$ ctrl.minVolumeSize $}"
validate-number-min="{$ ctrl.minVolumeSize $}"
id="volume-size"
type="number"
class="form-control"