Sha256: 5c173897efc6f0eac4b029ccbc018a121283a083808cfadc4fe9272d4de9850c

Contents?: true

Size: 1.02 KB

Versions: 44

Compression:

Stored size: 1.02 KB

Contents

import React from 'react';
import { TableText } from '@patternfly/react-table';
import { translate as __ } from 'foremanReact/common/I18n';
import {
  CheckIcon,
  LongArrowAltUpIcon,
} from '@patternfly/react-icons';
import PropTypes from 'prop-types';

const PackagesStatus = ({ upgradable_versions: upgradableVersions }) => {
  let PackagesIcon;
  let label;
  let color;

  if (upgradableVersions === null) {
    color = 'green';
    label = __('Up-to date');
    PackagesIcon = CheckIcon;
  } else {
    color = 'blue';
    label = __('Upgradable');
    PackagesIcon = LongArrowAltUpIcon;
  }
  if (!PackagesIcon) return null;

  return (
    <TableText wrapModifier="nowrap">
      {color && <PackagesIcon color={color} title={label} />} {label}
    </TableText>
  );
};

PackagesStatus.propTypes = {
  upgradable_versions: PropTypes.arrayOf(PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.arrayOf(PropTypes.string),
  ])),
};

PackagesStatus.defaultProps = {
  upgradable_versions: null,
};

export default PackagesStatus;

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
katello-4.15.0.rc2 webpack/components/Packages/index.js
katello-4.15.0.rc1 webpack/components/Packages/index.js
katello-4.14.1 webpack/components/Packages/index.js
katello-4.14.0 webpack/components/Packages/index.js
katello-4.14.0.rc3 webpack/components/Packages/index.js
katello-4.14.0.rc2 webpack/components/Packages/index.js
katello-4.14.0.rc1.1 webpack/components/Packages/index.js
katello-4.14.0.rc1 webpack/components/Packages/index.js
katello-4.13.1 webpack/components/Packages/index.js
katello-4.13.0 webpack/components/Packages/index.js
katello-4.12.1 webpack/components/Packages/index.js
katello-4.13.0.rc1 webpack/components/Packages/index.js
katello-4.12.0 webpack/components/Packages/index.js
katello-4.12.0.rc3 webpack/components/Packages/index.js
katello-4.12.0.rc2 webpack/components/Packages/index.js
katello-4.12.0.rc1 webpack/components/Packages/index.js
katello-4.11.1 webpack/components/Packages/index.js
katello-4.11.0 webpack/components/Packages/index.js
katello-4.11.0.rc2 webpack/components/Packages/index.js
katello-4.11.0.rc1 webpack/components/Packages/index.js