Sha256: b1716afa63cf64f4dd87b1a049c1f4c595c5632a2e63e9f1fbea4a6df91eeda2

Contents?: true

Size: 808 Bytes

Versions: 39

Compression:

Stored size: 808 Bytes

Contents

import React from 'react';
import { Link } from 'react-router-dom';
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) {
    cellContent = (
      <span>
        {__('Guests of')}
        {' '}
        <Link to={urlBuilder('content_hosts', '', rowData.hypervisor.id)}>{rowData.hypervisor.name}</Link>
      </span>
    );
  } else if (rowData.unmapped_guest) {
    cellContent = __('Temporary');
  } else {
    cellContent = __('Virtual');
  }

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

export default subscriptionTypeFormatter;

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
katello-3.16.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.1.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.1.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc5.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc5 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc4.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.15.3.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.15.3 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc4 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc3.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.15.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc3 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc2.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.15.1.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc1.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.15.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js
katello-3.16.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js