Sha256: fa54559b34f9df39fa47e14a517e607df18758d7b82d35d0775528eb35c7c731

Contents?: true

Size: 978 Bytes

Versions: 6

Compression:

Stored size: 978 Bytes

Contents

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

import { idsForInvocationFromReports } from '../PreupgradeReportsHelpers';

const UpgradeAllButton = ({ preupgradeReports, postUrl, csrfToken }) => {
  const { hostIds } = idsForInvocationFromReports(preupgradeReports);

  return (
    <form action={postUrl} method="post">
      <Button type="submit">{__('Run Upgrade')}</Button>
      <input type="hidden" name="authenticity_token" value={csrfToken} />
      <input type="hidden" name="feature" value="leapp_upgrade" />
      {hostIds.map(hostId => (
        <input type="hidden" name="host_ids[]" key={hostId} value={hostId} />
      ))}
    </form>
  );
};

UpgradeAllButton.propTypes = {
  preupgradeReports: PropTypes.array.isRequired,
  postUrl: PropTypes.string.isRequired,
  csrfToken: PropTypes.string.isRequired,
};

export default UpgradeAllButton;

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_leapp-0.1.5 webpack/components/PreupgradeReports/components/UpgradeAllButton.js
foreman_leapp-0.1.4 webpack/components/PreupgradeReports/components/UpgradeAllButton.js
foreman_leapp-0.1.3 webpack/components/PreupgradeReports/components/UpgradeAllButton.js
foreman_leapp-0.1.2 webpack/components/PreupgradeReports/components/UpgradeAllButton.js
foreman_leapp-0.1.1 webpack/components/PreupgradeReports/components/UpgradeAllButton.js
foreman_leapp-0.1.0 webpack/components/PreupgradeReports/components/UpgradeAllButton.js