foreman_rh_cloud 13.0.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f456ece118ec6f05c0457692a01b6a6ab4515d96d8c332df3ae542d63d7c0bde
4
- data.tar.gz: d0934f134fcf9724af3c624a542ec371079f5b5f4ababe62a59eab45dbe17f6b
3
+ metadata.gz: 07f9c21862525b394bf03e7490168fc1f0d66e8af832c4ce8e3f8d5796bde269
4
+ data.tar.gz: b88f3038b40d623c2d5df92f801d328bd568f9360d17760a6b2c0dff3808bf11
5
5
  SHA512:
6
- metadata.gz: bb7f8a102e4b6cc4926365f5584168b93cd774484fa8891ed84db92e62b9556306d62ef51f503e8b4a05ece3c36b9a6f5c787e3668665ada2fdec2e9cc4c7dec
7
- data.tar.gz: 2c5b475fd42ef87c2e672ac1532b167dbda49b2f1df41382cd06b3db4985e74c3ef774e1ac40ea1772d765a4bf336ccb93ed4a13f3b0ee4dc842e12a827d9beb
6
+ metadata.gz: 8773fa656f0fbd4f50833faf50e7d4a88bca97f9b39d0c62d944ba2bbfbef9fd18f5adaa1647e8d4ece97a0fca330935d1acb46fd54359428aa8f43cb3b9d403
7
+ data.tar.gz: 98c7cec90e073a517582fcd789add89684e2788c425bab6d2d4793611277d65ce7d21e3b0fc18b66beeb8fd553407c9172308f89e60e7516bdacd49bdfcbadaf
@@ -115,23 +115,20 @@ module ForemanRhCloud
115
115
  if defined?(Katello) && !Foreman.in_setup_db_rake?
116
116
  Katello::Api::V2::OrganizationsController.include Foreman::Controller::SmartProxyAuth
117
117
  # patch the callbacks order for :download_debug_certificate, since local_find_taxonomy has to run after the user is already initialized
118
- Katello::Api::V2::OrganizationsController.skip_before_action(:local_find_taxonomy, only: :download_debug_certificate)
119
- Katello::Api::V2::OrganizationsController.add_smart_proxy_filters(
120
- [:index, :download_debug_certificate],
121
- features: ForemanRhCloud.on_prem_smart_proxy_features
122
- )
123
- Katello::Api::V2::OrganizationsController.before_action(:local_find_taxonomy, only: :download_debug_certificate)
124
-
118
+ Katello::Api::V2::OrganizationsController.before_find_taxonomy_actions do
119
+ Katello::Api::V2::OrganizationsController.add_smart_proxy_filters(
120
+ [:index, :download_debug_certificate],
121
+ features: ForemanRhCloud.on_prem_smart_proxy_features
122
+ )
123
+ end
125
124
  Katello::Api::V2::RepositoriesController.include Foreman::Controller::SmartProxyAuth
126
125
  # patch the callbacks order for :index, since find_product has to run after the user is already initialized
127
- Katello::Api::V2::RepositoriesController.skip_before_action(:find_product, only: :index)
128
- Katello::Api::V2::RepositoriesController.skip_before_action(:find_optional_organization, only: :index)
129
- Katello::Api::V2::RepositoriesController.add_smart_proxy_filters(
130
- :index,
131
- features: ForemanRhCloud.on_prem_smart_proxy_features
132
- )
133
- Katello::Api::V2::RepositoriesController.before_action(:find_product, only: :index)
134
- Katello::Api::V2::RepositoriesController.before_action(:find_optional_organization, only: :index)
126
+ Katello::Api::V2::RepositoriesController.before_index_actions do
127
+ Katello::Api::V2::RepositoriesController.add_smart_proxy_filters(
128
+ :index,
129
+ features: ForemanRhCloud.on_prem_smart_proxy_features
130
+ )
131
+ end
135
132
  end
136
133
  end
137
134
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '13.0.2'.freeze
2
+ VERSION = '13.0.4'.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": "13.0.2",
3
+ "version": "13.0.4",
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: 13.0.2
4
+ version: 13.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 4.14.0.rc1.1
46
+ version: '4.18'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 4.14.0.rc1.1
53
+ version: '4.18'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: rdoc
56
56
  requirement: !ruby/object:Gem::Requirement