fix upgrade button status if have errors (#316) (#321)

(cherry picked from commit cb452b962794b38105626b3d55ce6bcdf6e01ee6)

Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
mergify[bot] 2025-05-28 13:00:40 +08:00 committed by GitHub
parent 965c7d9b72
commit 580b2892cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -212,28 +212,6 @@ export default {
}
try {
if (this.deleteExistImage) {
// if not select image, show error
if (!this.deleteImageId) {
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.deleteImage'));
buttonCb(false);
return;
}
// if select image, delete image
const image = this.$store.getters['harvester/byId'](HCI.IMAGE, this.deleteImageId);
if (image) {
this.handleImageDelete(image);
buttonCb(true);
return;
}
return;
}
if (this.imageSource === IMAGE_METHOD.NEW) {
this.imageValue.metadata.annotations[HCI_ANNOTATIONS.OS_UPGRADE_IMAGE] = 'True';
@ -241,6 +219,7 @@ export default {
this.value.spec.image = this.uploadImageId;
} else if (this.sourceType === DOWNLOAD) {
this.imageValue.spec.sourceType = DOWNLOAD;
if (!this.imageValue.spec.url) {
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.imageUrl'));
buttonCb(false);
@ -254,6 +233,7 @@ export default {
} else if (this.imageSource === IMAGE_METHOD.EXIST) {
if (!this.imageId) {
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.chooseFile'));
buttonCb(false);
return;
}