Sha256: 8b1b23193220885c94515556f2d7a630716eda6d340cc81f18a46c91a34e2e16

Contents?: true

Size: 1.05 KB

Versions: 29

Compression:

Stored size: 1.05 KB

Contents

import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { openConfirmModal } from 'foremanReact/components/ConfirmModal';
import { translate as __ } from 'foremanReact/common/I18n';
import { CloudConnectorButton } from './CloudConnectorButton';
import { configureCloudConnector } from './CloudConnectorActions';
import { selectStatus, selectJobLink } from './CloudConnectorSelectors';

const ConnectedCloudConnectorButton = () => {
  const status = useSelector(selectStatus);
  const jobLink = useSelector(selectJobLink);
  const dispatch = useDispatch();

  return (
    <CloudConnectorButton
      status={status}
      onClick={() =>
        dispatch(
          openConfirmModal({
            title: __('Notice'),
            message: __(
              'This action will also enable automatic reports upload'
            ),
            isWarning: true,
            onConfirm: () => dispatch(configureCloudConnector()),
          })
        )
      }
      jobLink={jobLink}
    />
  );
};

export default ConnectedCloudConnectorButton;

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
foreman_rh_cloud-8.0.49 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-8.0.48 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-8.0.47 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-8.0.46 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-6.0.45 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-7.0.46 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-7.0.45 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-6.0.44 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
foreman_rh_cloud-6.0.43 webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js