Sha256: 72684f9cb4d926480f6b284099f9baef5db1dd1992cf7860a6af750ed55d3749

Contents?: true

Size: 1.55 KB

Versions: 22

Compression:

Stored size: 1.55 KB

Contents

/* eslint-disable camelcase */
import React from 'react';
import {
  InsightsLabel,
  Section,
} from '@redhat-cloud-services/frontend-components';
import { sortable, cellWidth } from '@patternfly/react-table';
import { CheckCircleIcon } from '@patternfly/react-icons';
import { translate as __ } from 'foremanReact/common/I18n';
import { foremanUrl } from '../../../ForemanRhCloudHelpers';

export const totalRiskFormatter = ({ title: totalRisk }) => ({
  children: (
    <Section className="insights-total-risk" type="icon-group">
      <InsightsLabel value={totalRisk} />
    </Section>
  ),
});

export const hasPlaybookFormatter = ({ title: hasPlaybook }) => ({
  children: hasPlaybook ? <CheckCircleIcon color="green" /> : __('No'),
});

export const columns = [
  {
    sortKey: 'hostname',
    title: __('Hostname'),
    transforms: [cellWidth(20), sortable],
  },
  {
    sortKey: 'title',
    title: __('Recommendation'),
    transforms: [cellWidth(50), sortable],
  },
  {
    sortKey: 'total_risk',
    title: __('Total Risk'),
    transforms: [cellWidth(15), sortable],
    cellTransforms: [totalRiskFormatter],
  },
  {
    title: __('Playbook'),
    transforms: [cellWidth(15)],
    cellTransforms: [hasPlaybookFormatter],
  },
];

export const INSIGHTS_HITS_PATH = foremanUrl('/insights_cloud/hits');

export const INSIGHTS_HITS_API_KEY = 'INSIGHTS_HITS';

export const INSIGHTS_SET_SELECTED_IDS = 'INSIGHTS_SET_SELECTED_IDS';

export const INSIGHTS_SET_SELECT_ALL_ALERT = 'INSIGHTS_SET_SELECT_ALL_ALERT';

export const INSIGHTS_SET_SELECT_ALL = 'INSIGHTS_SET_SELECT_ALL';

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.33 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.32 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.29 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.28 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.26 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.25 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.24.1 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-4.0.24.1 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.24 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-4.0.24 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.23 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-4.0.23 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.22 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-4.0.22 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-4.0.21.1 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.21.1 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.21 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.20 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.19 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
foreman_rh_cloud-3.0.18.1 webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js