Sha256: 14cdb228099a5fe613dd8b9560feeacb20d4dd99d79e56aa8b6eb43681b3e313

Contents?: true

Size: 1.11 KB

Versions: 60

Compression:

Stored size: 1.11 KB

Contents

import React from 'react';
import { Grid, Row } from 'patternfly-react';
import TaskInfo from './TaskInfo';
import { ForceUnlockModal, UnlockModal } from '../../TaskActions/UnlockModals';
import { TaskButtons } from './TaskButtons';

const Task = props => {
  const {
    taskReload,
    id,
    forceCancelTaskRequest,
    unlockTaskRequest,
    action,
    taskReloadStart,
  } = props;
  const forceUnlock = () => {
    if (!taskReload) {
      taskReloadStart(id);
    }
    forceCancelTaskRequest(id, action);
  };
  const unlock = () => {
    if (!taskReload) {
      taskReloadStart(id);
    }
    unlockTaskRequest(id, action);
  };
  return (
    <React.Fragment>
      <UnlockModal onClick={unlock} />
      <ForceUnlockModal onClick={forceUnlock} />
      <Grid>
        <Row>
          <TaskButtons taskReloadStart={taskReloadStart} {...props} />
        </Row>
        <TaskInfo {...props} />
      </Grid>
    </React.Fragment>
  );
};

Task.propTypes = {
  ...TaskInfo.PropTypes,
  ...TaskButtons.PropTypes,
};

Task.defaultProps = {
  ...TaskInfo.defaultProps,
  ...TaskButtons.defaultProps,
};

export default Task;

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
foreman-tasks-10.0.2 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-10.0.1 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-10.0.0 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.2.3 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.2.2 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.2.1 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.2.0 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.1.1 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.0.4 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.1.0 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.0.2 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.0.1 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-8.3.3 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-9.0.0 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-8.2.1 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-8.1.4 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-8.3.2 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-8.3.1 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-8.1.3 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
foreman-tasks-8.3.0 webpack/ForemanTasks/Components/TaskDetails/Components/Task.js