Sha256: f25b4f8cf1b646a1c2bc229e96b09baa2dcf2ff08c09bb1f5acdc37987991898

Contents?: true

Size: 1.49 KB

Versions: 3

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: __('Severity'), 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

3 entries across 3 versions & 1 rubygems

Version Path
foreman_leapp-0.1.2 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.1 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js
foreman_leapp-0.1.0 webpack/components/PreupgradeReportsList/components/PreupgradeReportsListHeader.js