foreman_rh_cloud 13.0.3 → 13.0.4
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 +4 -4
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/tasks/rh_cloud_inventory.rake +1 -0
- data/package.json +1 -1
- data/webpack/ForemanRhCloudFills.js +6 -2
- data/webpack/ForemanRhCloudHelpers.js +4 -0
- data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +3 -16
- data/webpack/__tests__/ForemanRhCloudHelpers.test.js +16 -1
- data/webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f9c21862525b394bf03e7490168fc1f0d66e8af832c4ce8e3f8d5796bde269
|
4
|
+
data.tar.gz: b88f3038b40d623c2d5df92f801d328bd568f9360d17760a6b2c0dff3808bf11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8773fa656f0fbd4f50833faf50e7d4a88bca97f9b39d0c62d944ba2bbfbef9fd18f5adaa1647e8d4ece97a0fca330935d1acb46fd54359428aa8f43cb3b9d403
|
7
|
+
data.tar.gz: 98c7cec90e073a517582fcd789add89684e2788c425bab6d2d4793611277d65ce7d21e3b0fc18b66beeb8fd553407c9172308f89e60e7516bdacd49bdfcbadaf
|
@@ -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
@@ -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 {
|
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
|
135
|
-
const isLocalAdvisorEngine =
|
136
|
-
// eslint-disable-next-line camelcase
|
137
|
-
response?.insights_attributes?.use_iop_mode;
|
134
|
+
const isLocalIop = useAdvisorEngineConfig();
|
138
135
|
|
139
|
-
return
|
136
|
+
return isLocalIop ? (
|
140
137
|
<IopInsightsTabWrapped {...props} />
|
141
138
|
) : (
|
142
139
|
<NewHostDetailsTab {...props} />
|
143
140
|
);
|
144
141
|
};
|
145
142
|
|
146
|
-
InsightsTab.
|
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`;
|