import React from 'react'; import PropTypes from 'prop-types'; import { cloneDeep } from 'lodash'; import { DualListControlled } from 'patternfly-react'; import { translate as __ } from 'foremanReact/common/I18n'; import ServiceSelector from './components/ServiceSelector'; import { arrayToObject } from '../../helper'; class ExistingHostSelection extends React.Component { componentDidMount() { const { allHosts, initExistingHostSelection } = this.props; initExistingHostSelection(allHosts); } render() { const { services, serviceId, availableHosts, alreadyUsedHosts, loadHostsOfHostgroup, hostSelectionChanged, } = this.props; const serviceList = arrayToObject(services, 'id', 'name'); const loadHostgroupUrl = '/api/v2/hostgroups/__hostgroup_id__/hosts'; return (