Sha256: 8284cee452914b853ef2bf39a8724efb1cf052a26d909051046e21ece2ed2d5a

Contents?: true

Size: 806 Bytes

Versions: 126

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

126 entries across 126 versions & 1 rubygems

Version Path
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
katello-4.11.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.11.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.10.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.9.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.10.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.10.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.8.4 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.9.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.8.3 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.9.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.7.6 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.8.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.9.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.9.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-4.8.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js