feat: added comments from copilot review

Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
This commit is contained in:
Marcelo Fukumoto 2026-07-07 13:31:03 +02:00
parent 107e44bd4b
commit a4299a9597
No known key found for this signature in database
GPG Key ID: 1CA12189625C2543
4 changed files with 22 additions and 9 deletions

View File

@ -1829,6 +1829,7 @@ harvester:
hours: "{hours} {hours, plural, one {hour} other {hours}}"
minutes: "{minutes} {minutes, plural, one {minute} other {minutes}}"
errors:
failedLoadPlans: Failed to load migration plans
failedLoadVms: Failed to load virtual machines
failedRefreshVms: Failed to refresh virtual machines
failedLoadProviders: Failed to load providers

View File

@ -251,7 +251,7 @@ export default class ForkliftPlan extends HarvesterResource {
* Use foreground propagation to ensure children are deleted before the parent.
*/
remove(opt = {}) {
opt.params = { propagationPolicy: 'Foreground' };
opt.params = { ...(opt.params || {}), propagationPolicy: 'Foreground' };
return this._remove(opt);
}

View File

@ -29,7 +29,7 @@ export default class ForkliftProvider extends HarvesterResource {
* Use foreground propagation to ensure children are deleted before the parent.
*/
remove(opt = {}) {
opt.params = { propagationPolicy: 'Foreground' };
opt.params = { ...(opt.params || {}), propagationPolicy: 'Foreground' };
return this._remove(opt);
}

View File

@ -5,6 +5,7 @@ import Loading from '@shell/components/Loading';
import Masthead from '@shell/components/ResourceList/Masthead';
import ResourceTable from '@shell/components/ResourceTable';
import PercentageBar from '@shell/components/PercentageBar';
import { Banner } from '@components/Banner';
import MappingsCell from '../../../../components/MappingsCell';
import { SCHEMA } from '@shell/config/types';
import { useI18n } from '@shell/composables/useI18n';
@ -27,6 +28,7 @@ const store = useStore();
const { t } = useI18n(store);
const loading = ref(true);
const errors = ref([]);
const inStore = computed(() => store.getters['currentProduct'].inStore);
@ -155,13 +157,17 @@ const headers = [
];
const init = async() => {
await Promise.all([
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_PLAN }),
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_STORAGE_MAP }),
]);
loading.value = false;
try {
await Promise.all([
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_PLAN }),
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_STORAGE_MAP }),
]);
} catch (e) {
errors.value = [e?.message || t('harvester.addons.vmMigration.errors.failedLoadPlans')];
} finally {
loading.value = false;
}
};
init();
@ -170,6 +176,12 @@ init();
<template>
<Loading v-if="loading" />
<div v-else>
<Banner
v-for="(err, i) in errors"
:key="i"
color="error"
:label="err"
/>
<Masthead
:schema="schema"
:resource="schema.id"