handleBasicOnExit () {
    const resetNics = this.state.steps.network.updated === 0
    const resetDisks = this.state.steps.storage.updated === 0

    if (resetNics || resetDisks) {
      this.setState(state => {
        const template = this.props.templates.get(this.state.steps.basic.templateId)
        const update = { steps: { ...state.steps } }

        if (resetNics) {
          update.steps.network = {
            updated: (state.steps.network.updated + 1),
            nics: !template
              ? []
              : template.get('nics', List())
                .map(nic => ({
                  id: nic.get('id'),
                  name: nic.get('name'),
                  vnicProfileId: nic.getIn(['vnicProfile', 'id']),
                  deviceType: nic.get('interface'),
                  isFromTemplate: true,
                }))
                .toJS(),
          }
        }

        if (resetDisks) {
          update.steps.storage = {
            updated: (state.steps.storage.updated + 1),
            disks: !template
              ? []
              : template.get('disks', List())
                .map(disk => ({
                  id: disk.get('attachmentId'),
                  name: disk.get('name'),

                  diskId: disk.get('id'),
                  storageDomainId: disk.get('storageDomainId'),

                  bootable: disk.get('bootable'),
                  iface: disk.get('iface'),
                  type: disk.get('type'), // [ image | lun | cinder ]
                  format: disk.get('format'), // [ cow | raw ]
                  size: disk.get('provisionedSize'), // bytes
                  isFromTemplate: true,
                }))
                .toJS(),
          }
        }

        return update
      })
    }
  }
/**
   * Before transitioning off the Basic page, setup the NICs and Disks as appropriate
   * based on what has been selected/changed.
   */
Before transitioning off the Basic page, setup the NICs and Disks as appropriate
based on what has been selected/changed.
Before transitioning off the Basic page setup the NICs and Disks as appropriate based on what has been selected / changed .
handleBasicOnExit () {
    const resetNics = this.state.steps.network.updated === 0
    const resetDisks = this.state.steps.storage.updated === 0
    if (resetNics || resetDisks) {
      this.setState(state => {
        const template = this.props.templates.get(this.state.steps.basic.templateId)
        const update = { steps: { ...state.steps } }
        if (resetNics) {
          update.steps.network = {
            updated: (state.steps.network.updated + 1),
            nics: !template
              ? []
              : template.get('nics', List())
                .map(nic => ({
                  id: nic.get('id'),
                  name: nic.get('name'),
                  vnicProfileId: nic.getIn(['vnicProfile', 'id']),
                  deviceType: nic.get('interface'),
                  isFromTemplate: true,
                }))
                .toJS(),
          }
        }
        if (resetDisks) {
          update.steps.storage = {
            updated: (state.steps.storage.updated + 1),
            disks: !template
              ? []
              : template.get('disks', List())
                .map(disk => ({
                  id: disk.get('attachmentId'),
                  name: disk.get('name'),
                  diskId: disk.get('id'),
                  storageDomainId: disk.get('storageDomainId'),
                  bootable: disk.get('bootable'),
                  iface: disk.get('iface'),
                  type: disk.get('type'), 
                  format: disk.get('format'), 
                  size: disk.get('provisionedSize'), 
                  isFromTemplate: true,
                }))
                .toJS(),
          }
        }
        return update
      })
    }
  }
handleBasicOnExit ( ) { const resetNics = this . state . steps . network . updated === 0 const resetDisks = this . state . steps . storage . updated === 0 if ( resetNics || resetDisks ) { this . setState ( state => { const template = this . props . templates . get ( this . state . steps . basic . templateId ) const update = { steps : { ... state . steps } } if ( resetNics ) { update . steps . network = { updated : ( state . steps . network . updated + 1 ) , nics : ! template ? [ ] : template . get ( 'nics' , List ( ) ) . map ( nic => ( { id : nic . get ( 'id' ) , name : nic . get ( 'name' ) , vnicProfileId : nic . getIn ( [ 'vnicProfile' , 'id' ] ) , deviceType : nic . get ( 'interface' ) , isFromTemplate : true , } ) ) . toJS ( ) , } } if ( resetDisks ) { update . steps . storage = { updated : ( state . steps . storage . updated + 1 ) , disks : ! template ? [ ] : template . get ( 'disks' , List ( ) ) . map ( disk => ( { id : disk . get ( 'attachmentId' ) , name : disk . get ( 'name' ) , diskId : disk . get ( 'id' ) , storageDomainId : disk . get ( 'storageDomainId' ) , bootable : disk . get ( 'bootable' ) , iface : disk . get ( 'iface' ) , type : disk . get ( 'type' ) , format : disk . get ( 'format' ) , size : disk . get ( 'provisionedSize' ) , isFromTemplate : true , } ) ) . toJS ( ) , } } return update } ) } }
Before transitioning off the Basic page, setup the NICs and Disks as appropriate
 based on what has been selected/changed.
Before transitioning off the Basic page setup the NICs and Disks as appropriate based on what has been selected / changed .
// [ image | lun | cinder ] // [ cow | raw ] // bytes