diff --git a/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue b/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue
index 55353a38..e703b0ff 100644
--- a/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue
+++ b/pkg/harvester/components/vm-migration/ConfigureMappingsStep.vue
@@ -1,5 +1,5 @@
-
+
{
steps[0].ready = providerFormValid.value && !providerTesting.value;
}, { immediate: true });
@@ -130,6 +121,12 @@ watch(providerReady, (val) => {
}
});
+watch(providerTesting, (testing) => {
+ if (!testing && pendingProceed.value && !providerReady.value) {
+ pendingProceed.value = false;
+ }
+});
+
const onProviderComplete = (data) => {
providerName.value = data.providerName;
provider.value = data.provider;
@@ -185,7 +182,11 @@ watch(() => stepData.provider.providerName, (newVal, oldVal) => {
// Clear mappings and review when VM selection changes
watch(selectedVMs, (newVal, oldVal) => {
- if (oldVal.length > 0 && JSON.stringify(newVal.map((v) => v.id).sort()) !== JSON.stringify(oldVal.map((v) => v.id).sort())) {
+ const newIds = new Set(newVal.map((v) => v.id));
+ const oldIds = new Set(oldVal.map((v) => v.id));
+ const changed = newIds.size !== oldIds.size || [...newIds].some((id) => !oldIds.has(id));
+
+ if (oldVal.length > 0 && changed) {
stepData.mappings.networkEntries = [];
stepData.mappings.storageEntries = [];
mappingsReady.value = false;
@@ -195,18 +196,19 @@ watch(selectedVMs, (newVal, oldVal) => {
}
});
+const migrationListLocation = {
+ name: `${ PRODUCT_NAME }-c-cluster-vm-migration`,
+ params: {
+ product: store.getters['productId'],
+ cluster: store.getters['clusterId'],
+ }
+};
+
const onFinish = async(buttonCb) => {
try {
await reviewStepRef.value.startMigration();
buttonCb(true);
-
- currentRouter().push({
- name: `${ PRODUCT_NAME }-c-cluster-vm-migration`,
- params: {
- product: store.getters['productId'],
- cluster: store.getters['clusterId'],
- }
- });
+ currentRouter().push(migrationListLocation);
} catch (err) {
errors.value = [err instanceof Error ? err.message : String(err)];
buttonCb(false);
@@ -214,13 +216,7 @@ const onFinish = async(buttonCb) => {
};
const onCancel = () => {
- currentRouter().push({
- name: `${ PRODUCT_NAME }-c-cluster-vm-migration`,
- params: {
- product: store.getters['productId'],
- cluster: store.getters['clusterId'],
- }
- });
+ currentRouter().push(migrationListLocation);
};