Sha256: f50aad443a37f56f60185ede4ee15400d5c9caf2ce7886496e55974de702ffbb

Contents?: true

Size: 1.9 KB

Versions: 80

Compression:

Stored size: 1.9 KB

Contents

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

import { durationInWords } from './TaskHelper';

const Raw = ({ id, label, startedAt, endedAt, input, output, externalId }) => (
  <div>
    <div>
      <span className="param-name list-group-item-heading">{__('Id')}:</span>
      <span className="param-value">{id}</span>
    </div>
    <div>
      <span className="param-name list-group-item-heading">{__('Label')}:</span>
      <span className="param-value">{label}</span>
    </div>
    <div>
      <span className="param-name list-group-item-heading">
        {__('Duration')}:
      </span>
      <span
        className="param-value"
        title={durationInWords(startedAt, endedAt || new Date()).tooltip}
      >
        {durationInWords(startedAt, endedAt || new Date()).text}
      </span>
    </div>
    <div>
      <span className="param-name list-group-item-heading">
        {__('Raw input')}:
      </span>
      <span className="param-value">
        <pre>{JSON.stringify(input, null, '  ')}</pre>
      </span>
    </div>
    <div>
      <span className="param-name list-group-item-heading">
        {__('Raw output')}:
      </span>
      <span className="param-value">
        <pre>{JSON.stringify(output, null, '  ')}</pre>
      </span>
    </div>
    <div>
      <span className="param-name list-group-item-heading">
        {__('External Id')}:
      </span>
      <span className="param-value">{externalId}</span>
    </div>
  </div>
);

Raw.propTypes = {
  id: PropTypes.string,
  label: PropTypes.string,
  startedAt: PropTypes.string,
  endedAt: PropTypes.string,
  input: PropTypes.oneOfType([PropTypes.array, PropTypes.shape({})]),
  output: PropTypes.shape({}),
  externalId: PropTypes.string,
};

Raw.defaultProps = {
  id: '',
  label: '',
  startedAt: '',
  endedAt: '',
  input: [],
  output: {},
  externalId: '',
};

export default Raw;

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
foreman-tasks-5.2.0 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-5.1.1 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-5.1.0 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.1.5 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.1.4 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.1.3 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-3.0.6 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-5.0.0 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.1.2 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.1.1 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.0.1 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.1.0 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-3.0.5 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-4.0.0 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-3.0.4 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-2.0.3 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-3.0.3 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-3.0.2 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-3.0.1 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
foreman-tasks-3.0.0 webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js