Просмотр исходного кода

Populate instance details after execution without a refresh

Polling refreshed `transfer.info` once an execution
collected the VM `export_info` but never re-derived
the instance details, so after executing a transfer
those sections stayed empty until a manual page refresh.

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu 1 неделя назад
Родитель
Сommit
ec3c5a7de1
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      src/components/smart/TransferDetailsPage/TransferDetailsPage.tsx

+ 14 - 0
src/components/smart/TransferDetailsPage/TransferDetailsPage.tsx

@@ -385,6 +385,17 @@ class TransferDetailsPage extends React.Component<Props, State> {
     this.setState({ dbInstancesDetails: instancesDetails });
     this.setState({ dbInstancesDetails: instancesDetails });
   }
   }
 
 
+  populateInstanceDetails() {
+    const transfer = this.transfer;
+    if (
+      transfer &&
+      !this.state.dbInstancesDetails.length &&
+      this.hasStoredVmInfo(transfer.info)
+    ) {
+      this.populateInstanceStoreFromTransferInfo(transfer.info);
+    }
+  }
+
   isExecuteDisabled() {
   isExecuteDisabled() {
     const transfer = this.transfer;
     const transfer = this.transfer;
     if (!transfer) {
     if (!transfer) {
@@ -491,10 +502,12 @@ class TransferDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   handleCreateDeploymentClick() {
   handleCreateDeploymentClick() {
+    this.populateInstanceDetails();
     this.setState({ showDeploymentModal: true, pausePolling: true });
     this.setState({ showDeploymentModal: true, pausePolling: true });
   }
   }
 
 
   handleTransferEditClick() {
   handleTransferEditClick() {
+    this.populateInstanceDetails();
     this.setState({ showEditModal: true, pausePolling: true });
     this.setState({ showEditModal: true, pausePolling: true });
   }
   }
 
 
@@ -665,6 +678,7 @@ class TransferDetailsPage extends React.Component<Props, State> {
         }
         }
       })(),
       })(),
     ]);
     ]);
+    this.populateInstanceDetails();
 
 
     setTimeout(() => {
     setTimeout(() => {
       this.pollData();
       this.pollData();