Sha256: ebd11e190076598d3cb56e49588fc72a43ef37d811640ab9dded738922dd56a8

Contents?: true

Size: 1.28 KB

Versions: 78

Compression:

Stored size: 1.28 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Button } from '@patternfly/react-core';
import { translate as __ } from 'foremanReact/common/I18n';
import { JOB_INVOCATION_PATH } from './RemediationTableConstants';

const ModalFooter = ({ toggleModal, resolutions, hostsIds }) => {
  let token = document.querySelector('meta[name="csrf-token"]');
  token = token?.content || '';
  return (
    <form action={JOB_INVOCATION_PATH} method="post">
      <Button type="submit" key="confirm" variant="primary">
        {__('Remediate')}
      </Button>
      <Button key="cancel" variant="link" onClick={toggleModal}>
        {__('Cancel')}
      </Button>
      <input type="hidden" name="feature" value="rh_cloud_remediate_hosts" />
      <input type="hidden" name="authenticity_token" value={token} />
      <input
        type="hidden"
        name="inputs[hit_remediation_pairs]"
        value={JSON.stringify(resolutions)}
      />
      {hostsIds.map(id => (
        <input type="hidden" name="host_ids[]" key={id} value={id} />
      ))}
    </form>
  );
};

ModalFooter.propTypes = {
  toggleModal: PropTypes.func.isRequired,
  resolutions: PropTypes.array,
  hostsIds: PropTypes.array,
};

ModalFooter.defaultProps = {
  resolutions: [],
  hostsIds: [],
};

export default ModalFooter;

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.27 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.26 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.26 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.25.1 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.25 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.25 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.24.1 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.24.1 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.24 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.24 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.23 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.23 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.22 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.22 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-4.0.21.1 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.21.1 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.21 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-3.0.20 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js