Sha256: 8284cee452914b853ef2bf39a8724efb1cf052a26d909051046e21ece2ed2d5a

Contents?: true

Size: 806 Bytes

Versions: 121

Compression:

Stored size: 806 Bytes

Contents

import React from 'react';
import { translate as __ } from 'foremanReact/common/I18n';
import { urlBuilder } from 'foremanReact/common/urlHelpers';

export const subscriptionTypeFormatter = (value, { rowData }) => {
  let cellContent;

  if (rowData.virt_only === false) {
    cellContent = __('Physical');
  } else if (rowData.hypervisor) {
    const hypervisorLink = urlBuilder('content_hosts', '', rowData.hypervisor.id);
    cellContent = (
      <span>
        {__('Guests of')}
        {' '}
        <a href={hypervisorLink}>{rowData.hypervisor.name}</a>
      </span>
    );
  } else if (rowData.unmapped_guest) {
    cellContent = __('Temporary');
  } else {
    cellContent = __('Virtual');
  }

  return (
    <td>
      {cellContent}
    </td>
  );
};

export default subscriptionTypeFormatter;

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
katello-4.14.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.15.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.15.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.15.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.14.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.14.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.14.0.rc3 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.14.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.14.0.rc1.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.14.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.13.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.13.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.12.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.13.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.12.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.12.0.rc3 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.12.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.12.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.11.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.11.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js