Explorar el Código

- Moves Networking step after Options step in Wizard
- Adds env parameter to networks API call

George Vrancianu hace 8 años
padre
commit
ed230b0217

+ 2 - 1
src/components/WizardNetworks/WizardNetworks.js

@@ -48,6 +48,7 @@ class WizardNetworks extends Component {
         })
       }, this)
     }
+    ConnectionsActions.loadNetworks(this.props.data.targetCloud.credential)
 
     props.data.selectedInstances.forEach((vm) => {
       ConnectionsActions.loadInstanceDetail({ id: this.props.data.sourceCloud.credential.id }, vm)
@@ -66,7 +67,7 @@ class WizardNetworks extends Component {
 
     this.state = {
       networks: props.data.networks || null,
-      nextStep: "WizardOptions",
+      nextStep: "WizardSchedule",
       valid: valid
     }
   }

+ 1 - 1
src/components/WizardOptions/WizardOptions.js

@@ -45,7 +45,7 @@ class WizardOptions extends Reflux.Component {
       diskFormat: "VHD",
       fipPool: "public",
       valid: true,
-      nextStep: "WizardSchedule",
+      nextStep: "WizardNetworks",
       formSubmitted: false,
       nextCallback: (e) => this.nextCallback(e),
       showAdvancedOptions: props.data.showAdvancedOptions

+ 0 - 1
src/components/WizardTarget/WizardTarget.js

@@ -108,7 +108,6 @@ class WizardTarget extends Component {
       connection = this.state.connections.filter(item => item.name === connection.name)[0]
     }
 
-    ConnectionsActions.loadNetworks(connection)
     if (callback) {
       callback()
     }

+ 1 - 1
src/components/WizardVms/WizardVms.js

@@ -55,7 +55,7 @@ class WizardVms extends Component {
       page: 0,
       filterStatus: 'All',
       filteredData: this.props.data.instances ? this.props.data.instances.slice(0, itemsPerPage) : [],
-      nextStep: "WizardNetworks"
+      nextStep: "WizardOptions"
     }
   }
 

+ 5 - 5
src/config.sample.js

@@ -83,16 +83,16 @@ export const migrationSteps = [
     title: "Select instances",
     component: "WizardVms"
   },
-  {
-    name: "Network Mapping",
-    title: "Network Mapping",
-    component: "WizardNetworks"
-  },
   {
     name: "Options",
     title: "Options",
     component: "WizardOptions"
   },
+  {
+    name: "Network Mapping",
+    title: "Network Mapping",
+    component: "WizardNetworks"
+  },
   {
     name: "Schedule",
     title: "Schedule",

+ 2 - 3
src/stores/WizardStore/WizardStore.js

@@ -139,8 +139,8 @@ class UsersStore extends Reflux.Store
       targetNetworks: null
     })
     let projectId = Reflux.GlobalState.userStore.currentUser.project.id
-
-    let url = `${servicesUrl.coriolis}/${projectId}/endpoints/${endpoint.id}/networks`
+    let targetEnv = btoa(JSON.stringify(this.state.destination_environment))
+    let url = `${servicesUrl.coriolis}/${projectId}/endpoints/${endpoint.id}/networks?env=${targetEnv}`
 
     Api.sendAjaxRequest({
       url: url,
@@ -150,7 +150,6 @@ class UsersStore extends Reflux.Store
   }
 
   onLoadNetworksCompleted(response) {
-    console.log(response.data.networks)
     if (response.data.networks) {
       this.setState({
         targetNetworks: response.data.networks