foreman_rh_cloud 4.0.31 → 5.0.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/inventory_upload/report_actions.rb +1 -1
  3. data/app/controllers/foreman_inventory_upload/reports_controller.rb +1 -1
  4. data/app/controllers/insights_cloud/hits_controller.rb +1 -1
  5. data/app/models/insights_hit.rb +4 -0
  6. data/app/models/setting/rh_cloud.rb +0 -1
  7. data/app/models/task_output_line.rb +2 -0
  8. data/app/models/task_output_status.rb +2 -0
  9. data/config/Gemfile.lock.gh_test +204 -168
  10. data/config/package-lock.json.gh_test +14336 -7973
  11. data/config/package-lock.json.plugin +10551 -7500
  12. data/config/routes.rb +1 -1
  13. data/db/migrate/20211027000001_create_task_output.foreman_rh_cloud.rb +18 -0
  14. data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +11 -7
  15. data/lib/foreman_inventory_upload/async/generate_report_job.rb +24 -12
  16. data/lib/foreman_inventory_upload/async/progress_output.rb +5 -28
  17. data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +20 -5
  18. data/lib/foreman_inventory_upload/async/shell_process.rb +17 -4
  19. data/lib/foreman_inventory_upload/async/upload_report_job.rb +22 -13
  20. data/lib/foreman_rh_cloud/engine.rb +12 -11
  21. data/lib/foreman_rh_cloud/version.rb +1 -1
  22. data/lib/insights_cloud/async/insights_scheduled_sync.rb +11 -7
  23. data/lib/tasks/rh_cloud_inventory.rake +2 -2
  24. data/package.json +7 -12
  25. data/test/controllers/insights_sync/settings_controller_test.rb +2 -2
  26. data/test/controllers/uploads_settings_controller_test.rb +2 -2
  27. data/test/jobs/insights_full_sync_test.rb +2 -2
  28. data/test/jobs/insights_resolutions_sync_test.rb +1 -1
  29. data/test/jobs/insights_rules_sync_test.rb +2 -2
  30. data/test/jobs/inventory_full_sync_test.rb +3 -3
  31. data/test/jobs/inventory_hosts_sync_test.rb +1 -1
  32. data/test/jobs/inventory_scheduled_sync_test.rb +2 -2
  33. data/test/jobs/inventory_self_host_sync_test.rb +1 -1
  34. data/test/jobs/upload_report_job_test.rb +6 -4
  35. data/test/test_plugin_helper.rb +0 -2
  36. data/test/unit/rh_cloud_http_proxy_test.rb +1 -1
  37. data/test/unit/rh_cloud_permissions_test.rb +14 -0
  38. data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +1 -1
  39. data/test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb +1 -1
  40. data/test/unit/shell_process_job_test.rb +3 -1
  41. data/test/unit/slice_generator_test.rb +3 -3
  42. data/test/unit/tags_generator_test.rb +2 -2
  43. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +1 -1
  44. data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +8 -0
  45. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +3 -3
  46. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/index.js +0 -2
  47. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +17 -4
  48. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +29 -17
  49. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +58 -47
  50. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +12 -10
  51. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +10 -10
  52. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js +1 -1
  53. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +1 -1
  54. data/webpack/ForemanRhCloudFills.js +14 -0
  55. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsActions.js +1 -1
  56. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +22 -6
  57. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableActions.js +23 -16
  58. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +49 -2
  59. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableHelpers.js +31 -14
  60. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTable.test.js.snap +19 -2
  61. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTableActions.test.js.snap +0 -1
  62. data/webpack/InsightsCloudSync/Components/InsightsTable/table.scss +11 -13
  63. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.scss +0 -14
  64. data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +13 -0
  65. data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/NoTokenEmptyState.test.js.snap +24 -13
  66. data/webpack/InsightsCloudSync/InsightsCloudSyncHelpers.js +8 -0
  67. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +1 -1
  68. data/webpack/InsightsHostDetailsTab/InsightsTab.scss +4 -0
  69. data/webpack/InsightsHostDetailsTab/InsightsTabActions.js +1 -1
  70. data/webpack/InsightsHostDetailsTab/InsightsTabConstants.js +75 -0
  71. data/webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js +147 -0
  72. data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +103 -0
  73. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +1 -0
  74. data/webpack/__mocks__/foremanReact/components/Head.js +11 -0
  75. data/webpack/__mocks__/foremanReact/{redux/actions/toasts.js → components/ToastsList/index.js} +0 -0
  76. data/webpack/common/DropdownToggle.js +24 -0
  77. data/webpack/common/ForemanTasks/ForemanTasksActions.js +1 -1
  78. data/webpack/common/Switcher/__tests__/__snapshots__/SwitcherPF4.test.js.snap +1 -0
  79. metadata +11 -3
  80. data/webpack/__mocks__/foremanReact/components/Layout/LayoutSelectors.js +0 -1
@@ -1,6 +1,8 @@
1
1
  require 'test_plugin_helper'
2
+ require 'foreman_tasks/test_helpers'
2
3
 
3
- class UploadReportJobTest < ActiveJob::TestCase
4
+ class UploadReportJobTest < ActiveSupport::TestCase
5
+ include ForemanTasks::TestHelpers::WithInThreadExecutor
4
6
  include FolderIsolation
5
7
 
6
8
  test 'returns aborted state when disconnected' do
@@ -10,9 +12,9 @@ class UploadReportJobTest < ActiveJob::TestCase
10
12
  'idCert' => 'TEST_CERT',
11
13
  }
12
14
  )
13
- FactoryBot.create(:setting, :name => 'content_disconnected', :value => true)
15
+ Setting[:content_disconnected] = true
14
16
 
15
- ForemanInventoryUpload::Async::UploadReportJob.perform_now('', organization.id)
17
+ ForemanTasks.sync_task(ForemanInventoryUpload::Async::UploadReportJob, '', organization.id)
16
18
 
17
19
  label = ForemanInventoryUpload::Async::UploadReportJob.output_label(organization.id)
18
20
  progress_output = ForemanInventoryUpload::Async::ProgressOutput.get(label)
@@ -24,7 +26,7 @@ class UploadReportJobTest < ActiveJob::TestCase
24
26
  organization = FactoryBot.create(:organization)
25
27
  Organization.any_instance.expects(:owner_details).returns(nil)
26
28
 
27
- ForemanInventoryUpload::Async::UploadReportJob.perform_now('', organization.id)
29
+ ForemanTasks.sync_task(ForemanInventoryUpload::Async::UploadReportJob, '', organization.id)
28
30
 
29
31
  label = ForemanInventoryUpload::Async::UploadReportJob.output_label(organization.id)
30
32
  progress_output = ForemanInventoryUpload::Async::ProgressOutput.get(label)
@@ -32,8 +32,6 @@ module KatelloLocationFix
32
32
 
33
33
  included do
34
34
  setup do
35
- FactoryBot.create(:setting, name: 'default_location_subscribed_hosts')
36
- FactoryBot.create(:setting, name: 'default_location_puppet_content')
37
35
  Setting[:default_location_subscribed_hosts] = Location.first.title
38
36
  end
39
37
  end
@@ -41,7 +41,7 @@ class RhCloudHttpProxyTest < ActiveSupport::TestCase
41
41
  end
42
42
 
43
43
  def setup_global_foreman_proxy
44
- FactoryBot.create(:setting, :name => 'http_proxy', :value => @global_foreman_proxy_mock)
44
+ Setting[:http_proxy] = @global_foreman_proxy_mock
45
45
  end
46
46
 
47
47
  def setup_cdn_proxy
@@ -0,0 +1,14 @@
1
+ require 'test_plugin_helper'
2
+ require 'unit/shared/access_permissions_test_base'
3
+
4
+ class RhCloudPermissionsTest < ActiveSupport::TestCase
5
+ include AccessPermissionsTestBase
6
+
7
+ check_routes(
8
+ Rails.application.routes,
9
+ [
10
+ 'insights_cloud/api/machine_telemetries/forward_request',
11
+ 'insights_cloud/api/machine_telemetries/branch_info',
12
+ ],
13
+ skip_patterns: [/^(?!foreman_inventory_upload|insights_cloud|.*rh_cloud).*/]) # include only plugin paths
14
+ end
@@ -38,7 +38,7 @@ class BranchInfoTest < ActiveSupport::TestCase
38
38
  test 'should generate appropriate labels' do
39
39
  2.times { FactoryBot.create(:katello_host_collection, :organization_id => @host.organization.id) }
40
40
 
41
- FactoryBot.create(:setting, :settings_type => 'boolean', :default => true, :name => :include_parameter_tags)
41
+ Setting[:include_parameter_tags] = true
42
42
 
43
43
  Katello::HostCollection.all.map do |collection|
44
44
  FactoryBot.create(:katello_host_collection_host, :host_id => @host.id, :host_collection_id => collection.id)
@@ -8,7 +8,7 @@ class TemplateRendererHelperTest < ActiveSupport::TestCase
8
8
  response.stubs(:body).returns('TEST PLAYBOOK')
9
9
  ForemanRhCloud::RemediationsRetriever.any_instance.stubs(:query_playbook).returns(response)
10
10
  @host1 = FactoryBot.create(:host)
11
- FactoryBot.create(:setting, name: 'rh_cloud_token', value: 'MOCK_TOKEN')
11
+ Setting[:rh_cloud_token] = 'MOCK_TOKEN'
12
12
  end
13
13
 
14
14
  test 'Generates a playbook for hit and remediation' do
@@ -1,4 +1,5 @@
1
1
  require 'test_plugin_helper'
2
+ require 'foreman_tasks/test_helpers'
2
3
 
3
4
  class ShellProcessJobTest < ActiveSupport::TestCase
4
5
  class TestProcessJob < ForemanInventoryUpload::Async::ShellProcess
@@ -13,11 +14,12 @@ class ShellProcessJobTest < ActiveSupport::TestCase
13
14
  end
14
15
  end
15
16
 
17
+ include ForemanTasks::TestHelpers::WithInThreadExecutor
16
18
  include FolderIsolation
17
19
 
18
20
  test 'Runs a process with environment vars' do
19
21
  label = Foreman.uuid
20
- TestProcessJob.perform_now(label)
22
+ ForemanTasks.sync_task(TestProcessJob, label)
21
23
 
22
24
  progress_output = ForemanInventoryUpload::Async::ProgressOutput.get(label)
23
25
 
@@ -189,7 +189,7 @@ class SliceGeneratorTest < ActiveSupport::TestCase
189
189
  end
190
190
 
191
191
  test 'generates obfuscated ip_address fields without inisghts-client' do
192
- FactoryBot.create(:setting, :name => 'obfuscate_inventory_ips', :value => true)
192
+ Setting[:obfuscate_inventory_ips] = true
193
193
 
194
194
  @host.interfaces << FactoryBot.build(:nic_managed)
195
195
  batch = Host.where(id: @host.id).in_batches.first
@@ -260,7 +260,7 @@ class SliceGeneratorTest < ActiveSupport::TestCase
260
260
  end
261
261
 
262
262
  test 'obfuscates fqdn when setting set' do
263
- FactoryBot.create(:setting, :name => 'obfuscate_inventory_hostnames', :value => true)
263
+ Setting[:obfuscate_inventory_hostnames] = true
264
264
 
265
265
  batch = Host.where(id: @host.id).in_batches.first
266
266
  generator = create_generator(batch)
@@ -637,7 +637,7 @@ class SliceGeneratorTest < ActiveSupport::TestCase
637
637
  end
638
638
 
639
639
  test 'include packages installed in the report' do
640
- FactoryBot.create(:setting, :name => 'exclude_installed_packages', :value => false)
640
+ Setting[:exclude_installed_packages] = false
641
641
  installed_package = ::Katello::InstalledPackage.create(name: 'test-package', nvrea: 'test-package-1.0.x86_64', nvra: 'test-package-1.0.x86_64')
642
642
 
643
643
  another_host = FactoryBot.create(
@@ -63,7 +63,7 @@ class TagsGeneratorTest < ActiveSupport::TestCase
63
63
  end
64
64
 
65
65
  test 'generates parameter tags' do
66
- FactoryBot.create(:setting, :name => 'include_parameter_tags', :settings_type => "boolean", :category => "Setting::RhCloud", :default => false, :value => true)
66
+ Setting[:include_parameter_tags] = true
67
67
 
68
68
  @host.stubs(:host_params).returns(
69
69
  {
@@ -85,7 +85,7 @@ class TagsGeneratorTest < ActiveSupport::TestCase
85
85
  end
86
86
 
87
87
  test 'skips parameter tags if include_parameter_tags setting is off' do
88
- FactoryBot.create(:setting, :name => 'include_parameter_tags', :settings_type => "boolean", :category => "Setting::RhCloud", :default => false, :value => false)
88
+ Setting[:include_parameter_tags] = false
89
89
 
90
90
  @host.stubs(:host_params).returns(
91
91
  {
@@ -1,5 +1,5 @@
1
1
  import { API } from 'foremanReact/redux/API';
2
- import { addToast } from 'foremanReact/redux/actions/toasts';
2
+ import { addToast } from 'foremanReact/components/ToastsList';
3
3
  import { inventoryUrl } from '../../ForemanInventoryHelpers';
4
4
  import {
5
5
  INVENTORY_ACCOUNT_STATUS_POLLING,
@@ -1,4 +1,12 @@
1
1
  .rh-cloud-inventory-page {
2
+ #main {
3
+ padding: 0;
4
+
5
+ #breadcrumb {
6
+ display: none;
7
+ }
8
+ }
9
+
2
10
  .account-list {
3
11
  .pf-c-accordion__toggle {
4
12
  margin-top: 10px;
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { FormGroup, TextInput } from '@patternfly/react-core';
5
5
  import { noop } from 'foremanReact/common/helpers';
6
6
  import { translate as __ } from 'foremanReact/common/I18n';
7
+ import { useForemanOrganization } from 'foremanReact/Root/Context/ForemanContext';
7
8
  import ClearButton from './Components/ClearButton';
8
9
  import './inventoryFilter.scss';
9
10
  import { ANY_ORGANIZATION } from './InventoryFilterConstants';
@@ -12,13 +13,14 @@ const InventoryFilter = ({
12
13
  handleFilterChange,
13
14
  handleFilterClear,
14
15
  filterTerm,
15
- organization,
16
16
  }) => {
17
17
  useEffect(() => {
18
18
  const initialTerm = organization === ANY_ORGANIZATION ? '' : organization;
19
19
  handleFilterChange(initialTerm);
20
20
  }, []);
21
21
 
22
+ const organization = useForemanOrganization()?.title;
23
+
22
24
  return (
23
25
  <form id="inventory_filter_form">
24
26
  <FormGroup>
@@ -39,14 +41,12 @@ InventoryFilter.propTypes = {
39
41
  handleFilterChange: PropTypes.func,
40
42
  handleFilterClear: PropTypes.func,
41
43
  filterTerm: PropTypes.string,
42
- organization: PropTypes.string,
43
44
  };
44
45
 
45
46
  InventoryFilter.defaultProps = {
46
47
  handleFilterChange: noop,
47
48
  handleFilterClear: noop,
48
49
  filterTerm: '',
49
- organization: '',
50
50
  };
51
51
 
52
52
  export default InventoryFilter;
@@ -1,6 +1,5 @@
1
1
  import { bindActionCreators } from 'redux';
2
2
  import { connect } from 'react-redux';
3
- import { selectCurrentOrganization } from 'foremanReact/components/Layout/LayoutSelectors';
4
3
  import reducer from './InventoryFilterReducer';
5
4
  import * as actions from './InventoryFilterActions';
6
5
  import InventoryFilter from './InventoryFilter';
@@ -10,7 +9,6 @@ export const reducers = { inventoryFilter: reducer };
10
9
 
11
10
  const mapStateToProps = state => ({
12
11
  filterTerm: selectFilterTerm(state),
13
- organization: selectCurrentOrganization(state),
14
12
  });
15
13
  // map action dispatchers to props
16
14
  const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
@@ -1,5 +1,21 @@
1
1
  .rh-cloud-inventory-page {
2
2
  .inventory-upload-header {
3
+ margin-top: 35px;
4
+
5
+ h1 {
6
+ font-family: 'RedHatDisplay';
7
+ font-weight: 400;
8
+ margin: 0;
9
+ }
10
+
11
+ p {
12
+ font-size: 16px;
13
+ }
14
+
15
+ .pf-c-dropdown__toggle {
16
+ margin-right: -20px;
17
+ }
18
+
3
19
  .settings-alert {
4
20
  margin-bottom: 30px;
5
21
  .pf-c-alert {
@@ -18,10 +34,7 @@
18
34
 
19
35
  .inventory-upload-header-title {
20
36
  margin-top: -15px;
21
-
22
- h1 {
23
- margin: 0;
24
- }
37
+ margin-bottom: 8px;
25
38
  }
26
39
 
27
40
  .title-dropdown {
@@ -4,7 +4,10 @@ import {
4
4
  DropdownItem,
5
5
  KebabToggle,
6
6
  DropdownPosition,
7
+ Grid,
8
+ GridItem,
7
9
  } from '@patternfly/react-core';
10
+ import Head from 'foremanReact/components/Head';
8
11
  import {
9
12
  INVENTORY_PAGE_TITLE,
10
13
  ACTIONS_HISTORY_BUTTON_TEXT,
@@ -43,23 +46,32 @@ const PageTitle = () => {
43
46
  </DropdownItem>,
44
47
  ];
45
48
  return (
46
- <div className="row form-group inventory-upload-header-title">
47
- <h1 className="col-md-8">{INVENTORY_PAGE_TITLE}</h1>
48
- <Dropdown
49
- className="title-dropdown"
50
- onSelect={() => setIsDropdownOpen(false)}
51
- toggle={<KebabToggle onToggle={isOpen => setIsDropdownOpen(isOpen)} />}
52
- isOpen={isDropdownOpen}
53
- isPlain
54
- dropdownItems={dropdownItems}
55
- position={DropdownPosition.right}
56
- />
57
- <CloudPingModal
58
- isOpen={showPingModal}
59
- toggle={togglePingModal}
60
- title={CLOUD_PING_TITLE}
61
- />
62
- </div>
49
+ <Grid className="inventory-upload-header-title">
50
+ <GridItem span={6}>
51
+ <Head>
52
+ <title>{INVENTORY_PAGE_TITLE}</title>
53
+ </Head>
54
+ <h1>{INVENTORY_PAGE_TITLE}</h1>
55
+ </GridItem>
56
+ <GridItem span={6}>
57
+ <Dropdown
58
+ className="title-dropdown"
59
+ onSelect={() => setIsDropdownOpen(false)}
60
+ toggle={
61
+ <KebabToggle onToggle={isOpen => setIsDropdownOpen(isOpen)} />
62
+ }
63
+ isOpen={isDropdownOpen}
64
+ isPlain
65
+ dropdownItems={dropdownItems}
66
+ position={DropdownPosition.right}
67
+ />
68
+ <CloudPingModal
69
+ isOpen={showPingModal}
70
+ toggle={togglePingModal}
71
+ title={CLOUD_PING_TITLE}
72
+ />
73
+ </GridItem>
74
+ </Grid>
63
75
  );
64
76
  };
65
77
  export default PageTitle;
@@ -1,53 +1,64 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`PageTitle rendering render without Props 1`] = `
4
- <div
5
- className="row form-group inventory-upload-header-title"
4
+ <Grid
5
+ className="inventory-upload-header-title"
6
6
  >
7
- <h1
8
- className="col-md-8"
7
+ <GridItem
8
+ span={6}
9
9
  >
10
- Red Hat Inventory
11
- </h1>
12
- <Dropdown
13
- className="title-dropdown"
14
- dropdownItems={
15
- Array [
16
- <DropdownItem
17
- href="/foreman_tasks/tasks?search=action++%3D++ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateReportJob+or+action++%3D++ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateAllReportsJob&page=1"
18
- rel="noopener noreferrer"
19
- target="_blank"
20
- >
21
- Actions history
22
- </DropdownItem>,
23
- <DropdownItem
24
- href="/links/manual/+?root_url=https%3A%2F%2Faccess.redhat.com%2Fproducts%2Fsubscription-central"
25
- rel="noopener noreferrer"
26
- target="_blank"
27
- >
28
- Documentation
29
- </DropdownItem>,
30
- <DropdownItem
31
- onClick={[Function]}
32
- >
33
- Connectivity test
34
- </DropdownItem>,
35
- ]
36
- }
37
- isOpen={false}
38
- isPlain={true}
39
- onSelect={[Function]}
40
- position="right"
41
- toggle={
42
- <KebabToggle
43
- onToggle={[Function]}
44
- />
45
- }
46
- />
47
- <CloudPingModal
48
- isOpen={false}
49
- title="Connectivity test"
50
- toggle={[Function]}
51
- />
52
- </div>
10
+ <Head>
11
+ <title>
12
+ Red Hat Inventory
13
+ </title>
14
+ </Head>
15
+ <h1>
16
+ Red Hat Inventory
17
+ </h1>
18
+ </GridItem>
19
+ <GridItem
20
+ span={6}
21
+ >
22
+ <Dropdown
23
+ className="title-dropdown"
24
+ dropdownItems={
25
+ Array [
26
+ <DropdownItem
27
+ href="/foreman_tasks/tasks?search=action++%3D++ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateReportJob+or+action++%3D++ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateAllReportsJob&page=1"
28
+ rel="noopener noreferrer"
29
+ target="_blank"
30
+ >
31
+ Actions history
32
+ </DropdownItem>,
33
+ <DropdownItem
34
+ href="/links/manual/+?root_url=https%3A%2F%2Faccess.redhat.com%2Fproducts%2Fsubscription-central"
35
+ rel="noopener noreferrer"
36
+ target="_blank"
37
+ >
38
+ Documentation
39
+ </DropdownItem>,
40
+ <DropdownItem
41
+ onClick={[Function]}
42
+ >
43
+ Connectivity test
44
+ </DropdownItem>,
45
+ ]
46
+ }
47
+ isOpen={false}
48
+ isPlain={true}
49
+ onSelect={[Function]}
50
+ position="right"
51
+ toggle={
52
+ <KebabToggle
53
+ onToggle={[Function]}
54
+ />
55
+ }
56
+ />
57
+ <CloudPingModal
58
+ isOpen={false}
59
+ title="Connectivity test"
60
+ toggle={[Function]}
61
+ />
62
+ </GridItem>
63
+ </Grid>
53
64
  `;
@@ -1,24 +1,26 @@
1
1
  import React from 'react';
2
+ import { Text } from '@patternfly/react-core';
3
+
2
4
  import { translate as __ } from 'foremanReact/common/I18n';
3
5
 
4
6
  export const PageDescription = () => (
5
7
  <div id="inventory_page_description">
6
- <p>
8
+ <Text>
7
9
  {__(
8
10
  'Red Hat Insights is a set of cloud services which provide unified subscription reporting, predictive analysis and remediation of issues through this Satellite instance.'
9
11
  )}
10
- </p>
11
- <p>
12
+ </Text>
13
+ <Text>
12
14
  {__(
13
15
  'You can toggle the Auto upload switch to the ON position to enable Satellite to automatically upload your host inventory once a day.'
14
16
  )}
15
- </p>
16
- <p>
17
+ </Text>
18
+ <Text>
17
19
  {__(
18
20
  'Click Restart to upload your host inventory to Red Hat Insights. Perform this step for each organization from which you want to manually upload a host inventory.'
19
21
  )}
20
- </p>
21
- <p>
22
+ </Text>
23
+ <Text>
22
24
  {__(
23
25
  'Enabling inventory uploads is required by subscription watch. For more information about subscription watch see link:'
24
26
  )}
@@ -30,8 +32,8 @@ export const PageDescription = () => (
30
32
  >
31
33
  {__('About subscription watch')}
32
34
  </a>
33
- </p>
34
- <p>
35
+ </Text>
36
+ <Text>
35
37
  {__('For more information about Insights and Cloud Connector read')}
36
38
  &nbsp;
37
39
  <a
@@ -41,7 +43,7 @@ export const PageDescription = () => (
41
43
  >
42
44
  {__('Red Hat Insights Data and Application Security')}
43
45
  </a>
44
- </p>
46
+ </Text>
45
47
  </div>
46
48
  );
47
49
 
@@ -4,16 +4,16 @@ exports[`PageDescription rendering render without Props 1`] = `
4
4
  <div
5
5
  id="inventory_page_description"
6
6
  >
7
- <p>
7
+ <Text>
8
8
  Red Hat Insights is a set of cloud services which provide unified subscription reporting, predictive analysis and remediation of issues through this Satellite instance.
9
- </p>
10
- <p>
9
+ </Text>
10
+ <Text>
11
11
  You can toggle the Auto upload switch to the ON position to enable Satellite to automatically upload your host inventory once a day.
12
- </p>
13
- <p>
12
+ </Text>
13
+ <Text>
14
14
  Click Restart to upload your host inventory to Red Hat Insights. Perform this step for each organization from which you want to manually upload a host inventory.
15
- </p>
16
- <p>
15
+ </Text>
16
+ <Text>
17
17
  Enabling inventory uploads is required by subscription watch. For more information about subscription watch see link:
18
18
   
19
19
  <a
@@ -23,8 +23,8 @@ exports[`PageDescription rendering render without Props 1`] = `
23
23
  >
24
24
  About subscription watch
25
25
  </a>
26
- </p>
27
- <p>
26
+ </Text>
27
+ <Text>
28
28
  For more information about Insights and Cloud Connector read
29
29
   
30
30
  <a
@@ -34,6 +34,6 @@ exports[`PageDescription rendering render without Props 1`] = `
34
34
  >
35
35
  Red Hat Insights Data and Application Security
36
36
  </a>
37
- </p>
37
+ </Text>
38
38
  </div>
39
39
  `;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { post } from 'foremanReact/redux/API';
3
- import { addToast } from 'foremanReact/redux/actions/toasts';
3
+ import { addToast } from 'foremanReact/components/ToastsList';
4
4
  import { translate as __ } from 'foremanReact/common/I18n';
5
5
  import { inventoryUrl } from '../../../../ForemanInventoryHelpers';
6
6
  import Toast from './components/Toast';
@@ -33,7 +33,7 @@ exports[`InventoryAutoUpload rendering render with props 1`] = `
33
33
  >
34
34
  <Popover
35
35
  bodyContent={
36
- <UNDEFINED
36
+ <Memo(Connect(AdvancedSettings))
37
37
  autoUploadEnabled={true}
38
38
  handleToggle={[Function]}
39
39
  />
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { addGlobalFill } from 'foremanReact/components/common/Fill/GlobalFill';
3
3
  import InventoryAutoUploadSwitcher from './ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload';
4
+ import NewHostDetailsTab from './InsightsHostDetailsTab/NewHostDetailsTab';
5
+ import InsightsTotalRiskCard from './InsightsHostDetailsTab/InsightsTotalRiskChart';
4
6
 
5
7
  const fills = [
6
8
  {
@@ -9,6 +11,18 @@ const fills = [
9
11
  component: () => <InventoryAutoUploadSwitcher />,
10
12
  weight: 50,
11
13
  },
14
+ {
15
+ slot: 'host-details-page-tabs',
16
+ name: 'Insights',
17
+ component: props => <NewHostDetailsTab {...props} />,
18
+ weight: 400,
19
+ },
20
+ {
21
+ slot: 'details-cards',
22
+ name: 'insights-total-risk-chart',
23
+ component: props => <InsightsTotalRiskCard {...props} />,
24
+ weight: 1100,
25
+ },
12
26
  ];
13
27
 
14
28
  export const registerFills = () => {
@@ -1,5 +1,5 @@
1
1
  import { API } from 'foremanReact/redux/API';
2
- import { addToast } from 'foremanReact/redux/actions/toasts';
2
+ import { addToast } from 'foremanReact/components/ToastsList';
3
3
  import { insightsCloudUrl } from '../../InsightsCloudSyncHelpers';
4
4
  import {
5
5
  INSIGHTS_SYNC_SETTING_SET,