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-11.0.3 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.59 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-11.0.2 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-11.0.1 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-11.0.0 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.58 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-10.0.2 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.57 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-10.0.1 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.56 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.55 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.54 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.53 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.52 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-8.0.52 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-9.0.51 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-8.0.51 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-7.0.48 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-7.0.47 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js
foreman_rh_cloud-8.0.50 webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js