foreman_rh_cloud 12.2.8 → 12.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38498696c8d02e84313b43772ce7bdb72dc2acdbe13531fa2791461b57197f57
4
- data.tar.gz: 988fe5f03e6f151e3030b76086cb88d93882fd2e636a0a3af4cbe9424ff6b237
3
+ metadata.gz: 63d8defd7b60eed828c60406f2b1a033fa933355f02b040b0f44e9018ca8d5d1
4
+ data.tar.gz: fbe5cb540881d63b46deea02356a85a091813fe7b379743eacb40b274f9e0975
5
5
  SHA512:
6
- metadata.gz: 9e5df4e3ae29100c018dfa8ed7b3398e4c37b4eab0af566b2310835e45eca0741ccc645ce343791f81b955ef502ee40b4372038311cddf010ee8ed71ceeda1b1
7
- data.tar.gz: 5d49315537875841245a6cc17ddfc560e2721bccde4bf55cd42a01d71c91b7bbdf21b34225b142374cce46763bf7eae37f06708c3e4ebe81eee95741de8a75db
6
+ metadata.gz: f7d0c5e06c009759a191f015ac3fe8fd81380591c1ce8357618bd2b80a202f499d011b599ee6e7ab370dd451188fe0db2a8b952d66bd8ac841f7a35c0fdcf7eb
7
+ data.tar.gz: 7f8968b0aaea95c2b8e3f656964dae6a7ccdf7ec4cab1b2eecc550ebf0fea889e64eda671959ce3a13aa99318918977fbe5ee39fe4c06f8bbd6067813f40945d
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '12.2.8'.freeze
2
+ VERSION = '12.2.9'.freeze
3
3
  end
@@ -45,6 +45,7 @@ namespace :rh_cloud_inventory do
45
45
  archived_report_generator = ForemanInventoryUpload::Generators::ArchivedReport.new(target, Logger.new(STDOUT))
46
46
  archived_report_generator.render(organization: organization, filter: filter)
47
47
  puts "Successfully generated #{target} for organization id #{organization}"
48
+ puts "Check the Uploading tab for report uploading status." if Setting[:subscription_connection_enabled]
48
49
 
49
50
  next unless ForemanRhCloud.with_iop_smart_proxy?
50
51
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "12.2.8",
3
+ "version": "12.2.9",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,7 +4,11 @@ import { translate as __ } from 'foremanReact/common/I18n';
4
4
  import InventoryAutoUploadSwitcher from './ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload';
5
5
  import NewHostDetailsTab from './InsightsHostDetailsTab/NewHostDetailsTab';
6
6
  import { InsightsTotalRiskChartWrapper } from './InsightsHostDetailsTab/InsightsTotalRiskChartWrapper';
7
- import { isNotRhelHost, vulnerabilityDisabled } from './ForemanRhCloudHelpers';
7
+ import {
8
+ isNotRhelHost,
9
+ vulnerabilityDisabled,
10
+ hasNoInsightsFacet,
11
+ } from './ForemanRhCloudHelpers';
8
12
  import CVEsHostDetailsTabWrapper from './CVEsHostDetailsTab/CVEsHostDetailsTab';
9
13
 
10
14
  const fills = [
@@ -20,7 +24,7 @@ const fills = [
20
24
  component: props => <NewHostDetailsTab {...props} />,
21
25
  weight: 400,
22
26
  metadata: {
23
- hideTab: isNotRhelHost,
27
+ hideTab: props => isNotRhelHost(props) || hasNoInsightsFacet(props),
24
28
  title: __('Recommendations'),
25
29
  },
26
30
  },
@@ -14,3 +14,7 @@ export const isNotRhelHost = ({ hostDetails }) =>
14
14
 
15
15
  export const vulnerabilityDisabled = ({ hostDetails }) =>
16
16
  isNotRhelHost({ hostDetails }) || !hostDetails?.vulnerability?.enabled;
17
+
18
+ export const hasNoInsightsFacet = ({ response, hostDetails }) =>
19
+ // eslint-disable-next-line camelcase
20
+ !(response?.insights_attributes || hostDetails?.insights_attributes);
@@ -131,28 +131,15 @@ const IopInsightsTabWrapped = props => (
131
131
  );
132
132
 
133
133
  const InsightsTab = props => {
134
- const { response } = props;
135
- const isLocalAdvisorEngine =
136
- // eslint-disable-next-line camelcase
137
- response?.insights_attributes?.use_iop_mode;
134
+ const isLocalIop = useAdvisorEngineConfig();
138
135
 
139
- return isLocalAdvisorEngine ? (
136
+ return isLocalIop ? (
140
137
  <IopInsightsTabWrapped {...props} />
141
138
  ) : (
142
139
  <NewHostDetailsTab {...props} />
143
140
  );
144
141
  };
145
142
 
146
- InsightsTab.propTypes = {
147
- response: PropTypes.shape({
148
- insights_attributes: {
149
- use_iop_mode: PropTypes.bool,
150
- },
151
- }),
152
- };
153
-
154
- InsightsTab.defaultProps = {
155
- response: {},
156
- };
143
+ InsightsTab.defaultProps = {};
157
144
 
158
145
  export default InsightsTab;
@@ -1,5 +1,5 @@
1
1
  import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
2
- import { foremanUrl, vulnerabilityDisabled } from '../ForemanRhCloudHelpers';
2
+ import { foremanUrl, vulnerabilityDisabled, hasNoInsightsFacet } from '../ForemanRhCloudHelpers';
3
3
 
4
4
  global.URL_PREFIX = 'MY_TEST_URL_PREFIX.example.com';
5
5
 
@@ -34,6 +34,21 @@ const fixtures = {
34
34
  }),
35
35
  'vulnerabilityDisabled returns true for missing hostDetails': () =>
36
36
  vulnerabilityDisabled({}),
37
+ 'hasNoInsightsFacet returns false when insights_attributes is present': () =>
38
+ hasNoInsightsFacet({
39
+ response: {
40
+ insights_attributes: {
41
+ uuid: 'test-uuid',
42
+ insights_hits_count: 5,
43
+ },
44
+ },
45
+ }),
46
+ 'hasNoInsightsFacet returns true when insights_attributes is missing': () =>
47
+ hasNoInsightsFacet({
48
+ response: {},
49
+ }),
50
+ 'hasNoInsightsFacet returns true when response is missing': () =>
51
+ hasNoInsightsFacet({}),
37
52
  };
38
53
 
39
54
  describe('ForemanRhCloud helpers', () =>
@@ -1,5 +1,11 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`ForemanRhCloud helpers hasNoInsightsFacet returns false when insights_attributes is present 1`] = `false`;
4
+
5
+ exports[`ForemanRhCloud helpers hasNoInsightsFacet returns true when insights_attributes is missing 1`] = `true`;
6
+
7
+ exports[`ForemanRhCloud helpers hasNoInsightsFacet returns true when response is missing 1`] = `true`;
8
+
3
9
  exports[`ForemanRhCloud helpers should return foreman Url 1`] = `"MY_TEST_URL_PREFIX.example.com/test_path"`;
4
10
 
5
11
  exports[`ForemanRhCloud helpers vulnerabilityDisabled returns false for RHEL host with vulnerability enabled 1`] = `false`;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.2.8
4
+ version: 12.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team