foreman_rh_cloud 11.0.0 → 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: fcd4ee874e42e9236bbc4fae540911c372af73f3a336507c9421693b8fb128da
4
- data.tar.gz: da0c96b9b8fb3d737d0f8902da7176adbd2f1a8810260ddeba547c3a22004ec7
3
+ metadata.gz: 5f59aefea33a7933386cdc77e326b13ceca715d51f4fdf3c02905896363bcc33
4
+ data.tar.gz: 95b711179cb036dbfcb8a6261db1f6c9911ff931807a4a0d9765440534c30c8f
5
5
  SHA512:
6
- metadata.gz: 12343eaac2bfb4c666c156a84a868f02a3b684f4a4bf044f7a838d9134d140ec6fb698b356c35efb8b11618fa0c36b3a61c0cc411caf48ff91b8fc9957528074
7
- data.tar.gz: 41f578f21a65aee43ade158a99991c1b3b7b37ee2000e0e1c8c7d55cba60ac94d31e734d205e589bfc1bf1850fb98142b91ea975b3d9580361a11803eac8f17b
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
  )
@@ -151,46 +151,46 @@ module ForemanRhCloud
151
151
  end
152
152
  end
153
153
 
154
- rake_tasks do
155
- Rake::Task['db:seed'].enhance do
156
- ForemanRhCloud::Engine.load_seed
157
- end
158
- end
159
-
160
- initializer 'foreman_rh_cloud.register_rex_features', :before => :finisher_hook do |_app|
154
+ initializer 'foreman_rh_cloud.register_scheduled_tasks', :before => :finisher_hook do |_app|
161
155
  # skip database manipulations while tables do not exist, like in migrations
162
- if ActiveRecord::Base.connection.data_source_exists?(ForemanTasks::Task.table_name)
163
- RemoteExecutionFeature.register(
164
- :rh_cloud_remediate_hosts,
165
- N_('Apply Insights recommendations'),
166
- description: N_('Run remediation playbook generated by Insights'),
167
- host_action_button: false
168
- )
169
- RemoteExecutionFeature.register(
170
- :rh_cloud_connector_run_playbook,
171
- N_('Run RH Cloud playbook'),
172
- description: N_('Run playbook genrated by Red Hat remediations app'),
173
- host_action_button: false,
174
- provided_inputs: ['playbook_url', 'report_url', 'correlation_id', 'report_interval']
175
- )
176
- RemoteExecutionFeature.register(
177
- :ansible_configure_cloud_connector,
178
- N_('Configure Cloud Connector on given hosts'),
179
- :description => N_('Configure Cloud Connector on given hosts'),
180
- :proxy_selector_override => ::RemoteExecutionProxySelector::INTERNAL_PROXY
181
- )
182
-
183
- # skip object creation when admin user is not present, for example in test DB
184
- if User.unscoped.find_by_login(User::ANONYMOUS_ADMIN).present?
185
- ::ForemanTasks.dynflow.config.on_init(false) do |world|
186
- ForemanRhCloud::Engine.register_scheduled_task(ForemanInventoryUpload::Async::GenerateAllReportsJob, '0 0 * * *')
187
- ForemanRhCloud::Engine.register_scheduled_task(InventorySync::Async::InventoryScheduledSync, '0 0 * * *')
188
- ForemanRhCloud::Engine.register_scheduled_task(InsightsCloud::Async::InsightsScheduledSync, '0 0 * * *')
189
- ForemanRhCloud::Engine.register_scheduled_task(InsightsCloud::Async::InsightsClientStatusAging, '0 0 * * *')
190
- end
156
+ # skip object creation when admin user is not present, for example in test DB
157
+ if ActiveRecord::Base.connection.data_source_exists?(ForemanTasks::Task.table_name) && User.unscoped.find_by_login(User::ANONYMOUS_ADMIN).present?
158
+ ::ForemanTasks.dynflow.config.on_init(false) do |world|
159
+ ForemanRhCloud::Engine.register_scheduled_task(ForemanInventoryUpload::Async::GenerateAllReportsJob, '0 0 * * *')
160
+ ForemanRhCloud::Engine.register_scheduled_task(InventorySync::Async::InventoryScheduledSync, '0 0 * * *')
161
+ ForemanRhCloud::Engine.register_scheduled_task(InsightsCloud::Async::InsightsScheduledSync, '0 0 * * *')
162
+ ForemanRhCloud::Engine.register_scheduled_task(InsightsCloud::Async::InsightsClientStatusAging, '0 0 * * *')
191
163
  end
192
164
  end
193
165
  rescue ActiveRecord::NoDatabaseError
194
166
  end
167
+
168
+ config.to_prepare do
169
+ RemoteExecutionFeature.register(
170
+ :rh_cloud_remediate_hosts,
171
+ N_('Apply Insights recommendations'),
172
+ description: N_('Run remediation playbook generated by Insights'),
173
+ host_action_button: false
174
+ )
175
+ RemoteExecutionFeature.register(
176
+ :rh_cloud_connector_run_playbook,
177
+ N_('Run RH Cloud playbook'),
178
+ description: N_('Run playbook genrated by Red Hat remediations app'),
179
+ host_action_button: false,
180
+ provided_inputs: ['playbook_url', 'report_url', 'correlation_id', 'report_interval']
181
+ )
182
+ RemoteExecutionFeature.register(
183
+ :ansible_configure_cloud_connector,
184
+ N_('Configure Cloud Connector on given hosts'),
185
+ :description => N_('Configure Cloud Connector on given hosts'),
186
+ :proxy_selector_override => ::RemoteExecutionProxySelector::INTERNAL_PROXY
187
+ )
188
+ end
189
+
190
+ rake_tasks do
191
+ Rake::Task['db:seed'].enhance do
192
+ ForemanRhCloud::Engine.load_seed
193
+ end
194
+ end
195
195
  end
196
196
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '11.0.0'.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.0",
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.0
4
+ version: 11.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-20 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
@@ -639,7 +640,7 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
639
640
  licenses:
640
641
  - GPL-3.0
641
642
  metadata: {}
642
- post_install_message:
643
+ post_install_message:
643
644
  rdoc_options: []
644
645
  require_paths:
645
646
  - lib
@@ -657,8 +658,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
657
658
  - !ruby/object:Gem::Version
658
659
  version: '0'
659
660
  requirements: []
660
- rubygems_version: 3.2.33
661
- signing_key:
661
+ rubygems_version: 3.3.27
662
+ signing_key:
662
663
  specification_version: 4
663
664
  summary: Summary of ForemanRhCloud.
664
665
  test_files: