Sha256: 11b963309504b118ce9b1d392087af1bafea272cca89dad2ffa5385659f6c42a

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
import { Button } from 'patternfly-react';
import ForemanModal from 'foremanReact/components/ForemanModal';
import {
  CANCEL_CONFIRM_MODAL_ID,
  RESUME_CONFIRM_MODAL_ID,
  CANCEL_SELECTED_CONFIRM_MODAL_ID,
  RESUME_SELECTED_CONFIRM_MODAL_ID,
} from '../TasksTableConstants';

export const ResumeConfirm = ({ closeModal, action, selectedRowsLen, id }) => (
  <ForemanModal title={__('Resume Selected Tasks')} id={id}>
    {sprintf(
      __(
        `This will resume %s task(s), putting them in the running state. Are you sure?`
      ),
      selectedRowsLen
    )}
    <ForemanModal.Footer>
      <Button onClick={closeModal}>{__('No')}</Button>
      <Button
        bsStyle="primary"
        onClick={() => {
          action();
          closeModal();
        }}
      >
        {__('Yes')}
      </Button>
    </ForemanModal.Footer>
  </ForemanModal>
);

ResumeConfirm.propTypes = {
  closeModal: PropTypes.func.isRequired,
  selectedRowsLen: PropTypes.number.isRequired,
  action: PropTypes.func,
  id: PropTypes.oneOf([
    CANCEL_CONFIRM_MODAL_ID,
    RESUME_CONFIRM_MODAL_ID,
    CANCEL_SELECTED_CONFIRM_MODAL_ID,
    RESUME_SELECTED_CONFIRM_MODAL_ID,
  ]).isRequired,
};

ResumeConfirm.defaultProps = {
  action: () => null,
};

export default ResumeConfirm;

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman-tasks-1.1.3 webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js
foreman-tasks-1.1.2 webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js
foreman-tasks-1.1.1 webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js
foreman-tasks-1.1.0 webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js
foreman-tasks-1.0.1 webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js