Explorar el Código

Fix migration title changing on recreation

Fixes an issue where recreating a migration that has a title set, and
the user doesn't update the title, would revert the title to the default
(using the instance name).
Sergiu Miclea hace 2 años
padre
commit
21ea55c3de

+ 3 - 0
src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx

@@ -378,6 +378,9 @@ class TransferItemModal extends React.Component<Props, State> {
     }
 
     if (fieldName === "title") {
+      if (this.props.replica.notes) {
+        return this.props.replica.notes;
+      }
       let title = this.props.instancesDetails?.[0]?.name;
       if (
         this.props.instancesDetails &&

+ 1 - 1
src/sources/MigrationSource.ts

@@ -183,7 +183,7 @@ class MigrationSource {
         opts.replicationCount ||
         2,
       instances: opts.instanceNames,
-      notes: getValue("title") || getValue("notes") || "",
+      notes: opts.updatedDestEnv?.title || opts.migration.notes || "",
     };
 
     const skipOsMorphingValue = getValue("skip_os_morphing");