Sha256: df695621f2c1b1cbe14f77879d3fba90598cf036ebfa2fb6b236a174745e3f83

Contents?: true

Size: 1.49 KB

Versions: 20

Compression:

Stored size: 1.49 KB

Contents

import React from 'react';
import { ListView } from 'patternfly-react';
import PropTypes from 'prop-types';

import { translate as __ } from 'foremanReact/common/I18n';

import InfoItem from './InfoItem';
import SortableHeaderItem from './SortableHeaderItem';

const PreupgradeReportsListHeader = ({ sort, changeSort, toggleSelectAll }) => {
  const additionalInfoColumns = [
    { label: __('Host'), value: 'hostname' },
    { label: __('Risk Factor'), value: 'severity' },
    { label: __('Has Remediation?'), value: 'fix' },
    { label: __('Inhibitor?'), value: 'inhibitor' },
  ];

  const additionalInfo = additionalInfoColumns.map((col, idx) => (
    <InfoItem itemId={idx.toString()} key={idx}>
      <strong>
        <SortableHeaderItem
          title={col.label}
          sort={sort}
          value={col.value}
          changeSort={changeSort}
        />
      </strong>
    </InfoItem>
  ));

  return (
    <ListView.Item
      additionalInfo={additionalInfo}
      className="list-view-header"
      checkboxInput={<input type="checkbox" onClick={toggleSelectAll} />}
      description={
        <SortableHeaderItem
          title={__('Title')}
          sort={sort}
          value="title"
          changeSort={changeSort}
        />
      }
      hideCloseIcon
      stacked
    />
  );
};

PreupgradeReportsListHeader.propTypes = {
  sort: PropTypes.object.isRequired,
  changeSort: PropTypes.func.isRequired,
  toggleSelectAll: PropTypes.func.isRequired,
};

export default PreupgradeReportsListHeader;

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
foreman_leapp-2.0.1 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-2.0.0 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-1.2.1 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-1.2.0 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.15 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-1.1.1 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-1.1.0 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-1.0.0 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.14 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.13 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.12 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.11 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.10 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.9 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.8 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.7 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.6 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.5 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.4 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.3 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js