foreman_rh_cloud 11.0.1 → 11.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ad60942e47521d64a7a896a330d8d03471fc7d6fc6f54e29937fa619614846e
4
- data.tar.gz: 66e1f83283d36cf8e9d48d7719411c99cf027643453924fd7792580030c7e7ae
3
+ metadata.gz: 5f59aefea33a7933386cdc77e326b13ceca715d51f4fdf3c02905896363bcc33
4
+ data.tar.gz: 95b711179cb036dbfcb8a6261db1f6c9911ff931807a4a0d9765440534c30c8f
5
5
  SHA512:
6
- metadata.gz: 25b4d4e6a5503ae59fafd7c4a9d2ab61391a6fc7df458415f3b28eb19a9da411d086693aa1f130a97dd814ee4c3e1292628e82eff12f333b146eb2ecec930741
7
- data.tar.gz: a7327156fe02cd95ce112d1a3a8d4260f99cdca7af1e101f2b77a44d422d24be4424f873ac0da8e342f9b1d1e42b66d004404819addd8940da1d242386b4ce93
6
+ metadata.gz: 4bf762fb0c67730e9317948e6ca74921717d8699fb532b4f3c196049ac38f5ba145d7a9a54122f9c18710e4ede293c4d35beb3e3b462b20e936acd8c5547ed8f
7
+ data.tar.gz: 91e0dceccebc4fb48d93c7916f0a229a0b1d2077f0319e67fa014ecb29f0adade7c28e6af1ac717d0b12488065031b37ecf20b84c816086d260385211d15e468
@@ -1,3 +1,5 @@
1
+ require "#{ForemanRhCloud::Engine.root}/lib/foreman_rh_cloud/version"
2
+
1
3
  Rails.autoloaders.main.ignore(
2
4
  ForemanRhCloud::Engine.root.join('lib/foreman_rh_cloud/version.rb')
3
5
  )
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '11.0.1'.freeze
2
+ VERSION = '11.0.2'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "11.0.1",
3
+ "version": "11.0.2",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,12 +22,11 @@
22
22
  "@theforeman/vendor": ">= 10.1.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/core": "~7.7.0",
25
+ "@babel/core": "^7.7.0",
26
26
  "@theforeman/builder": ">= 10.1.1",
27
27
  "@theforeman/test": ">= 10.1.1",
28
28
  "@theforeman/eslint-plugin-foreman": ">= 10.1.1",
29
29
  "babel-eslint": "~10.0.0",
30
- "cosmiconfig-typescript-loader": "~4.3.0",
31
30
  "eslint": "~6.7.2",
32
31
  "eslint-plugin-spellcheck": "~0.0.17",
33
32
  "jed": "~1.1.1",
@@ -8,19 +8,19 @@ export const PageDescription = () => (
8
8
  <div id="inventory_page_description">
9
9
  <Text>
10
10
  {__(
11
- 'The Red Hat Hybrid Cloud Console provides a set of cloud services, including Red Hat Insights and Subscriptions, that provide predictive analysis, remediation of issues, and unified subscription reporting for this Satellite instance.'
11
+ 'The Red Hat Hybrid Cloud Console provides a set of cloud services, including Red Hat Insights and Subscriptions, that provide predictive analysis, remediation of issues, and unified subscription reporting for this Foreman instance.'
12
12
  )}
13
13
  </Text>
14
14
  <Text>
15
15
  {__(
16
- 'The Satellite inventory upload plugin automatically uploads Satellite host inventory data to the Inventory service of Insights, where it can also be used by the Subscriptions service for subscription reporting. If you use the Subscriptions service, enabling inventory uploads is required.'
16
+ 'The Foreman inventory upload plugin automatically uploads Foreman host inventory data to the Inventory service of Insights, where it can also be used by the Subscriptions service for subscription reporting. If you use the Subscriptions service, enabling inventory uploads is required.'
17
17
  )}
18
18
  </Text>
19
19
  <Text>
20
20
  <FormattedMessage
21
21
  id="enable-upload-hint"
22
22
  defaultMessage={__(
23
- 'To enable this reporting for all Satellite organizations, set {uploadButtonName} to on. The data will be reported automatically once per day.'
23
+ 'To enable this reporting for all Foreman organizations, set {uploadButtonName} to on. The data will be reported automatically once per day.'
24
24
  )}
25
25
  values={{
26
26
  uploadButtonName: <strong>{__('Automatic inventory upload')}</strong>,
@@ -5,14 +5,14 @@ exports[`PageDescription rendering render without Props 1`] = `
5
5
  id="inventory_page_description"
6
6
  >
7
7
  <Text>
8
- The Red Hat Hybrid Cloud Console provides a set of cloud services, including Red Hat Insights and Subscriptions, that provide predictive analysis, remediation of issues, and unified subscription reporting for this Satellite instance.
8
+ The Red Hat Hybrid Cloud Console provides a set of cloud services, including Red Hat Insights and Subscriptions, that provide predictive analysis, remediation of issues, and unified subscription reporting for this Foreman instance.
9
9
  </Text>
10
10
  <Text>
11
- The Satellite inventory upload plugin automatically uploads Satellite host inventory data to the Inventory service of Insights, where it can also be used by the Subscriptions service for subscription reporting. If you use the Subscriptions service, enabling inventory uploads is required.
11
+ The Foreman inventory upload plugin automatically uploads Foreman host inventory data to the Inventory service of Insights, where it can also be used by the Subscriptions service for subscription reporting. If you use the Subscriptions service, enabling inventory uploads is required.
12
12
  </Text>
13
13
  <Text>
14
14
  <FormattedMessage
15
- defaultMessage="To enable this reporting for all Satellite organizations, set {uploadButtonName} to on. The data will be reported automatically once per day."
15
+ defaultMessage="To enable this reporting for all Foreman organizations, set {uploadButtonName} to on. The data will be reported automatically once per day."
16
16
  id="enable-upload-hint"
17
17
  values={
18
18
  Object {
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import { addGlobalFill } from 'foremanReact/components/common/Fill/GlobalFill';
3
3
  import InventoryAutoUploadSwitcher from './ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload';
4
4
  import NewHostDetailsTab from './InsightsHostDetailsTab/NewHostDetailsTab';
5
- import InsightsTotalRiskCard from './InsightsHostDetailsTab/InsightsTotalRiskChart';
5
+ import { InsightsTotalRiskChartWrapper } from './InsightsHostDetailsTab/InsightsTotalRiskChartWrapper';
6
+ import { isNotRhelHost } from './ForemanRhCloudHelpers';
6
7
 
7
8
  const fills = [
8
9
  {
@@ -16,22 +17,27 @@ const fills = [
16
17
  name: 'Insights',
17
18
  component: props => <NewHostDetailsTab {...props} />,
18
19
  weight: 400,
20
+ metadata: {
21
+ hideTab: isNotRhelHost,
22
+ },
19
23
  },
20
24
  {
21
25
  slot: 'host-overview-cards',
22
26
  name: 'insights-total-risk-chart',
23
- component: props => <InsightsTotalRiskCard {...props} />,
27
+ component: props => <InsightsTotalRiskChartWrapper {...props} />,
24
28
  weight: 2800,
25
29
  },
26
30
  ];
27
31
 
28
32
  export const registerFills = () => {
29
- fills.forEach(({ slot, name, component: Component, weight }, index) =>
30
- addGlobalFill(
31
- slot,
32
- name,
33
- <Component key={`rh-cloud-fill-${index}`} />,
34
- weight
35
- )
33
+ fills.forEach(
34
+ ({ slot, name, component: Component, weight, metadata }, index) =>
35
+ addGlobalFill(
36
+ slot,
37
+ name,
38
+ <Component key={`rh-cloud-fill-${index}`} />,
39
+ weight,
40
+ metadata
41
+ )
36
42
  );
37
43
  };
@@ -4,3 +4,7 @@
4
4
  * should be imported once core moves it to the ReactApp folder.
5
5
  */
6
6
  export const foremanUrl = path => `${window.URL_PREFIX}${path}`;
7
+
8
+ export const isNotRhelHost = ({ hostDetails }) =>
9
+ // eslint-disable-next-line camelcase
10
+ !new RegExp('red\\s?hat', 'i').test(hostDetails?.operatingsystem_name);
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import InsightsTotalRiskChart from './InsightsTotalRiskChart';
4
+ import { isNotRhelHost } from '../ForemanRhCloudHelpers';
5
+
6
+ export const InsightsTotalRiskChartWrapper = props => {
7
+ if (props.status === 'RESOLVED') {
8
+ return (
9
+ !isNotRhelHost(props.hostDetails) && <InsightsTotalRiskChart {...props} /> // check for RHEL hosts
10
+ );
11
+ }
12
+ return null;
13
+ };
14
+
15
+ InsightsTotalRiskChartWrapper.propTypes = {
16
+ status: PropTypes.string,
17
+ hostDetails: PropTypes.object,
18
+ };
19
+
20
+ InsightsTotalRiskChartWrapper.defaultProps = {
21
+ status: 'PENDING',
22
+ hostDetails: {},
23
+ };
@@ -37,7 +37,7 @@ const NewHostDetailsTab = ({ hostName, router }) => {
37
37
 
38
38
  const dropdownItems = [
39
39
  <DropdownItem key="insights-link" ouiaId="insights-link">
40
- <a onClick={onSatInsightsClick}>{__('Go to Satellite Insights page')}</a>
40
+ <a onClick={onSatInsightsClick}>{__('Go to Foreman Insights page')}</a>
41
41
  </DropdownItem>,
42
42
  ];
43
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.1
4
+ version: 11.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-25 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman_ansible
@@ -585,6 +585,7 @@ files:
585
585
  - webpack/InsightsHostDetailsTab/InsightsTabReducer.js
586
586
  - webpack/InsightsHostDetailsTab/InsightsTabSelectors.js
587
587
  - webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js
588
+ - webpack/InsightsHostDetailsTab/InsightsTotalRiskChartWrapper.js
588
589
  - webpack/InsightsHostDetailsTab/NewHostDetailsTab.js
589
590
  - webpack/InsightsHostDetailsTab/__tests__/InsightsTab.fixtures.js
590
591
  - webpack/InsightsHostDetailsTab/__tests__/InsightsTab.test.js