Sha256: 45cafb5ab8759231bf2663982f679bcb076b8ffe00fc4965be735858c716c660

Contents?: true

Size: 1.67 KB

Versions: 23

Compression:

Stored size: 1.67 KB

Contents

import React from 'react';
import { ListView, Grid, Icon } from 'patternfly-react';
import PropTypes from 'prop-types';
import './foreman_leapp.scss';

import InhibitorInfoItem from './InhibitorInfoItem';

import {
  itemIteratorId,
  hasRemediations,
  getExternals,
  getRemediations,
  getTitle,
  getSeverity,
  getSummary,
  getTags,
  getSeverityImg,
} from './helpers';

import { entryFixable } from '../../PreupgradeReports/PreupgradeReportsHelpers';

const PreupgradeReportEntry = ({ entry, isEntrySelected, toggleSelected }) => (
  <ListView.Item
    key={entry.id}
    stacked
    checkboxInput={
      <input
        type="checkbox"
        value={isEntrySelected}
        checked={isEntrySelected}
        disabled={!entryFixable(entry)}
        onChange={() => toggleSelected(entry, isEntrySelected)}
      />
    }
    description={entry.title}
    additionalInfo={[
      <ListView.InfoItem key={itemIteratorId(entry, entry.hostname)}>
        <Icon type="pf" name="cluster" /> {entry.hostname}
      </ListView.InfoItem>,
      <ListView.InfoItem key={itemIteratorId(entry, entry.severity)}>
        {getSeverityImg(entry)}
      </ListView.InfoItem>,
      hasRemediations(entry),
      <InhibitorInfoItem key={itemIteratorId(entry, 'flags')} entry={entry} />,
    ]}
  >
    <Grid fluid>
      {getTitle(entry)}
      {getSeverity(entry)}
      {getSummary(entry)}
      {getTags(entry)}
      {getExternals(entry)}
      {getRemediations(entry)}
    </Grid>
  </ListView.Item>
);

PreupgradeReportEntry.propTypes = {
  entry: PropTypes.object.isRequired,
  isEntrySelected: PropTypes.bool.isRequired,
  toggleSelected: PropTypes.func.isRequired,
};

export default PreupgradeReportEntry;

Version data entries

23 entries across 23 versions & 1 rubygems

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