Sha256: 9dd5cd992fe13d5439719bb0cf5fa6f62aab6d1df40967182045ae543c371340

Contents?: true

Size: 1.62 KB

Versions: 60

Compression:

Stored size: 1.62 KB

Contents

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

const RunningSteps = ({
  runningSteps,
  id,
  cancelStep,
  taskReload,
  taskReloadStart,
}) => {
  if (!runningSteps.length) return <span>{__('No running steps')}</span>;
  return (
    <div>
      {runningSteps.map((step, i) => (
        <Alert type="warning" key={i}>
          {step.cancellable && (
            <p>
              <Button
                bsSize="small"
                onClick={() => {
                  if (!taskReload) {
                    taskReloadStart(id);
                  }
                  cancelStep(id, step.id);
                }}
              >
                {__('Cancel')}
              </Button>
            </p>
          )}

          <p>
            <span>{__('Action')}:</span>
            <span />
          </p>
          <pre>{step.action_class}</pre>
          <p>
            <span>{__('State')}:</span>
            <span>{step.state}</span>
          </p>
          <span>{__('Input')}:</span>
          <span>
            <pre>{step.input}</pre>
          </span>
          <span>{__('Output')}:</span>
          <span>
            <pre>{step.output}</pre>
          </span>
        </Alert>
      ))}
    </div>
  );
};

RunningSteps.propTypes = {
  runningSteps: PropTypes.array,
  id: PropTypes.string.isRequired,
  cancelStep: PropTypes.func.isRequired,
  taskReload: PropTypes.bool.isRequired,
  taskReloadStart: PropTypes.func.isRequired,
};

RunningSteps.defaultProps = {
  runningSteps: [],
};

export default RunningSteps;

Version data entries

60 entries across 60 versions & 1 rubygems

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