function createVNicProfileList (vnicProfiles, { dataCenterId = null, cluster = null } = {}) {
  const clusterNetworks = cluster === null ? [] : cluster.get('networks')

  const vnicList =
    vnicProfiles
      .toList()
      .filter(vnic =>
        vnic.get('canUserUseProfile') &&
        (dataCenterId === null ? true : vnic.get('dataCenterId') === dataCenterId) &&
        (cluster === null ? true : clusterNetworks.contains(vnic.getIn(['network', 'id'])))
      )
      .map(vnic => ({
        id: vnic.get('id'),
        value: `${vnic.getIn(['network', 'name'])}/${vnic.get('name')}`,
      }))
      .sort((a, b) => localeCompare(a.value, b.value))
      .toJS()

  return vnicList
}
/**
 * Filter the set of vNIC profiles to display to the user such that:
 *   - each vNIC is in the same data center as the VM
 *   - each vNIC's network is available on the same cluster as the VM
 */
Filter the set of vNIC profiles to display to the user such that:
- each vNIC is in the same data center as the VM
- each vNIC's network is available on the same cluster as the VM
Filter the set of vNIC profiles to display to the user such that : - each vNIC is in the same data center as the VM - each vNIC ' s network is available on the same cluster as the VM
function createVNicProfileList (vnicProfiles, { dataCenterId = null, cluster = null } = {}) {
  const clusterNetworks = cluster === null ? [] : cluster.get('networks')
  const vnicList =
    vnicProfiles
      .toList()
      .filter(vnic =>
        vnic.get('canUserUseProfile') &&
        (dataCenterId === null ? true : vnic.get('dataCenterId') === dataCenterId) &&
        (cluster === null ? true : clusterNetworks.contains(vnic.getIn(['network', 'id'])))
      )
      .map(vnic => ({
        id: vnic.get('id'),
        value: `${vnic.getIn(['network', 'name'])}/${vnic.get('name')}`,
      }))
      .sort((a, b) => localeCompare(a.value, b.value))
      .toJS()
  return vnicList
}
function createVNicProfileList ( vnicProfiles , { dataCenterId = null , cluster = null } = { } ) { const clusterNetworks = cluster === null ? [ ] : cluster . get ( 'networks' ) const vnicList = vnicProfiles . toList ( ) . filter ( vnic => vnic . get ( 'canUserUseProfile' ) && ( dataCenterId === null ? true : vnic . get ( 'dataCenterId' ) === dataCenterId ) && ( cluster === null ? true : clusterNetworks . contains ( vnic . getIn ( [ 'network' , 'id' ] ) ) ) ) . map ( vnic => ( { id : vnic . get ( 'id' ) , value : ` ${ vnic . getIn ( [ 'network' , 'name' ] ) } ${ vnic . get ( 'name' ) } ` , } ) ) . sort ( ( a , b ) => localeCompare ( a . value , b . value ) ) . toJS ( ) return vnicList }
Filter the set of vNIC profiles to display to the user such that:
   - each vNIC is in the same data center as the VM
   - each vNIC's network is available on the same cluster as the VM
Filter the set of vNIC profiles to display to the user such that : - each vNIC is in the same data center as the VM - each vNIC ' s network is available on the same cluster as the VM