import $ from 'jquery'; import React from 'react'; import PropTypes from 'prop-types'; import * as sort from 'sortabular'; import { orderBy } from 'lodash'; import * as resolve from 'table-resolver'; import Select from 'foremanReact/components/common/forms/Select'; import AddTableEntry from '../common/AddTableEntry'; import DeleteTableEntry from '../common/DeleteTableEntry'; import ExtSelect from '../common/ExtSelect'; import { isNewDefinition, isEditDefinition, isDefinition, isNewInstance, isEditInstance, isInstance, transformForemanData, } from './ParameterSelectionHelper'; import { dropRight, findIndex, cloneDeep, } from 'lodash'; import { PARAMETER_SELECTION_TYPES, } from './ParameterSelectionConstants'; import { Icon, Button, Table, FormControl, defaultSortingOrder, customHeaderFormattersDefinition, inlineEditFormatterFactory, } from 'patternfly-react'; const theme = { scheme: 'foreman', backgroundColor: 'rgba(0, 0, 0, 255)', base00: 'rgba(0, 0, 0, 0)', }; class ParameterSelection extends React.Component { constructor(props) { super(props); } isEditing({rowData}) { return (rowData.backup !== undefined); } // enables our custom header formatters extensions to reactabular customHeaderFormatters = customHeaderFormattersDefinition; componentDidMount() { const { data: { mode, parameters, serviceDefinition }, location, organization, loadForemanDataUrl, initParameterSelection, sortParameter, deleteParameter, activateEditParameter, changeEditParameter, loadForemanData, } = this.props; loadForemanData(serviceDefinition.hostgroup_id, { url: loadForemanDataUrl, clearParameters: false }); const inlineEditButtonsFormatter = inlineEditFormatterFactory({ isEditing: additionalData => this.props.editMode, renderValue: (value, additionalData) => (