diff --git a/.eslintrc b/.eslintrc index b755d8d0..a632094e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -33,6 +33,7 @@ "remediate", "remediations", "repo", + "rhc", "theforeman", "tooltip", "unmount", diff --git a/webpack/ForemanRhCloudHelpers.js b/webpack/ForemanRhCloudHelpers.js index fe81fcde..e7b07514 100644 --- a/webpack/ForemanRhCloudHelpers.js +++ b/webpack/ForemanRhCloudHelpers.js @@ -6,5 +6,8 @@ export const foremanUrl = path => `${window.URL_PREFIX}${path}`; export const isNotRhelHost = ({ hostDetails }) => - // eslint-disable-next-line camelcase - !new RegExp('red\\s?hat', 'i').test(hostDetails?.operatingsystem_name); + // This regex tries matches sane variations of "RedHat", "RHEL" and "RHCOS" + !new RegExp('red[\\s\\-]?hat|rh[\\s\\-]?el|rhc[\\s\\-]?os', 'i').test( + // eslint-disable-next-line camelcase + hostDetails?.operatingsystem_name + ); diff --git a/webpack/InsightsHostDetailsTab/InsightsTotalRiskChartWrapper.js b/webpack/InsightsHostDetailsTab/InsightsTotalRiskChartWrapper.js index 3e24043f..b8a261a8 100644 --- a/webpack/InsightsHostDetailsTab/InsightsTotalRiskChartWrapper.js +++ b/webpack/InsightsHostDetailsTab/InsightsTotalRiskChartWrapper.js @@ -6,7 +6,7 @@ import { isNotRhelHost } from '../ForemanRhCloudHelpers'; export const InsightsTotalRiskChartWrapper = props => { if (props.status === 'RESOLVED') { return ( - !isNotRhelHost(props.hostDetails) && // check for RHEL hosts + !isNotRhelHost(props) && // check for RHEL hosts ); } return null;