foreman_rh_cloud 11.3.0 → 12.0.0

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +2 -2
  3. data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +3 -3
  4. data/lib/foreman_inventory_upload/async/upload_report_job.rb +4 -4
  5. data/lib/foreman_rh_cloud/version.rb +1 -1
  6. data/package.json +5 -5
  7. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +6 -16
  8. data/test/controllers/inventory_upload/api/inventory_controller_test.rb +1 -1
  9. data/test/jobs/inventory_full_sync_test.rb +6 -5
  10. data/test/jobs/inventory_hosts_sync_test.rb +6 -6
  11. data/test/jobs/upload_report_job_test.rb +1 -1
  12. data/test/test_plugin_helper.rb +14 -0
  13. data/test/unit/archived_report_generator_test.rb +4 -4
  14. data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +7 -6
  15. data/test/unit/slice_generator_test.rb +4 -5
  16. data/test/unit/tags_generator_test.rb +2 -12
  17. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +1 -7
  18. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +1 -5
  19. data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +3 -3
  20. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +1 -1
  21. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss +1 -1
  22. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +5 -5
  23. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +5 -4
  24. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +18 -3
  25. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js +0 -1
  26. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButton.test.js.snap +0 -1
  27. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +2 -10
  28. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +5 -1
  29. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +1 -1
  30. data/webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js +7 -7
  31. data/webpack/InsightsCloudSync/Components/InsightsTable/table.scss +1 -1
  32. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +5 -1
  33. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationTableConstants.js +8 -1
  34. data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +8 -2
  35. data/webpack/InsightsCloudSync/InsightsCloudSync.scss +1 -1
  36. data/webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js +11 -2
  37. data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +5 -4
  38. data/webpack/common/DropdownToggle.js +2 -2
  39. data/webpack/common/Switcher/HelpLabel.js +1 -1
  40. data/webpack/common/Switcher/SwitcherPF4.scss +1 -1
  41. data/webpack/common/Switcher/__tests__/__snapshots__/HelpLabel.test.js.snap +2 -6
  42. data/webpack/common/table/EmptyState.js +25 -18
  43. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aabe6881c75f0293ff48b2a0dc207d8a0295c492cc7e1766659ef450a8eabcb5
4
- data.tar.gz: df041730744b9ac3a63314d2e39bd431260cb10677eef2c3a71d18fe17017dac
3
+ metadata.gz: d3666ab0afa45f6fbf3fbe06ec110cbbf7d7eca432b02686e945afca5b412f31
4
+ data.tar.gz: ce3380aca30486d23d89c3e9b30d17cbc862e51ba55032b1e60565ec63af1cc2
5
5
  SHA512:
6
- metadata.gz: 2bd4865e3035115965e97c4f240e8494aa3ca7e4fa64b731d8cf1b8631847b60eb8aade9619fde9068a61eb168bfb2c245837e4b4b893356c1237eba4541e343
7
- data.tar.gz: c49768ca959a42d96a1efeb8eace4faf1516e676961f492006ca023e5fed4a464b082cc91248891bce7f594ea6dc22a6fbfd2537d3cf5973d0a6b66c826b4fd0
6
+ metadata.gz: b853fd7fe75e52c4127984c2644feb55fb455d52d68a86b55ed9d96b84e03d05408fc9ddf5190253d2938965c8583b33903682fabfe137f42ce06f57a2d96a09
7
+ data.tar.gz: fb4777f06aa6d47e0038cc3533b86779a95694c23e4d01b01bc78e10c07196f16df87ead87d4787e8c4dc518813d7ef4e250d8fe955857ebe6811ad5e8b0d3ec
@@ -18,10 +18,10 @@ module Api
18
18
 
19
19
  api :POST, "/organizations/:organization_id/rh_cloud/report", N_("Start report generation")
20
20
  param :organization_id, Integer, required: true, desc: N_("Set the current organization context for the request")
21
- param :disconnected, :bool, required: false, default: false, desc: N_('Generate the report, but do not upload')
21
+ param :no_upload, :bool, required: false, default: false, desc: N_('Generate the report, but do not upload')
22
22
  def generate_report
23
23
  organization_id = params[:organization_id]
24
- disconnected = params[:disconnected] || false
24
+ disconnected = params[:no_upload] || false
25
25
 
26
26
  start_report_generation(organization_id, disconnected)
27
27
 
@@ -3,7 +3,7 @@ module ForemanInventoryUpload
3
3
  class QueueForUploadJob < ::Actions::EntryAction
4
4
  def plan(base_folder, report_file, organization_id, disconnected)
5
5
  enqueue_task = plan_self(base_folder: base_folder, report_file: report_file)
6
- plan_upload_report(enqueue_task.output[:enqueued_file_name], organization_id) unless disconnected
6
+ plan_upload_report(enqueue_task.output[:enqueued_file_name], organization_id, disconnected)
7
7
  end
8
8
 
9
9
  def run
@@ -59,8 +59,8 @@ module ForemanInventoryUpload
59
59
  input[:report_file]
60
60
  end
61
61
 
62
- def plan_upload_report(enqueued_file_name, organization_id)
63
- plan_action(UploadReportJob, enqueued_file_name, organization_id)
62
+ def plan_upload_report(enqueued_file_name, organization_id, disconnected)
63
+ plan_action(UploadReportJob, enqueued_file_name, organization_id, disconnected)
64
64
  end
65
65
  end
66
66
  end
@@ -7,15 +7,15 @@ module ForemanInventoryUpload
7
7
  "upload_for_#{label}"
8
8
  end
9
9
 
10
- def plan(filename, organization_id)
10
+ def plan(filename, organization_id, disconnected = false)
11
11
  label = UploadReportJob.output_label(organization_id)
12
- super(label, filename: filename, organization_id: organization_id)
12
+ super(label, filename: filename, organization_id: organization_id, disconnected: disconnected)
13
13
  end
14
14
 
15
15
  def try_execute
16
16
  if content_disconnected?
17
17
  progress_output do |progress_output|
18
- progress_output.write_line('Upload was stopped since disconnected mode setting is enabled for content on this instance.')
18
+ progress_output.write_line('Upload canceled because connection to Insights is not enabled or the --no-upload option was passed.')
19
19
  progress_output.status = "Task aborted, exit 1"
20
20
  done!
21
21
  end
@@ -78,7 +78,7 @@ module ForemanInventoryUpload
78
78
  end
79
79
 
80
80
  def content_disconnected?
81
- !Setting[:subscription_connection_enabled]
81
+ input[:disconnected] || !Setting[:subscription_connection_enabled]
82
82
  end
83
83
  end
84
84
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '11.3.0'.freeze
2
+ VERSION = '12.0.0'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "11.3.0",
3
+ "version": "12.0.0",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,13 +19,13 @@
19
19
  "url": "http://projects.theforeman.org/projects/foreman_rh_cloud/issues"
20
20
  },
21
21
  "peerDependencies": {
22
- "@theforeman/vendor": ">= 10.1.1"
22
+ "@theforeman/vendor": ">= 15.0.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@babel/core": "^7.7.0",
26
- "@theforeman/builder": ">= 10.1.1",
27
- "@theforeman/test": ">= 10.1.1",
28
- "@theforeman/eslint-plugin-foreman": ">= 10.1.1",
26
+ "@theforeman/builder": ">= 15.0.1",
27
+ "@theforeman/test": ">= 15.0.1",
28
+ "@theforeman/eslint-plugin-foreman": ">= 15.0.1",
29
29
  "babel-eslint": "~10.0.0",
30
30
  "eslint": "~6.7.2",
31
31
  "eslint-plugin-spellcheck": "~0.0.17",
@@ -3,6 +3,8 @@ require 'rest-client'
3
3
 
4
4
  module InsightsCloud::Api
5
5
  class MachineTelemetriesControllerTest < ActionController::TestCase
6
+ include KatelloCVEHelper
7
+
6
8
  setup do
7
9
  FactoryBot.create(:common_parameter, name: InsightsCloud.enable_client_param, key_type: 'boolean', value: true)
8
10
  end
@@ -122,9 +124,8 @@ module InsightsCloud::Api
122
124
  setup do
123
125
  UpstreamOnlySettingsTestHelper.set_if_available('allow_multiple_content_views')
124
126
  User.current = User.find_by(login: 'secret_admin')
125
-
126
- @env = FactoryBot.create(:katello_k_t_environment)
127
- @env2 = FactoryBot.create(:katello_k_t_environment, organization: @env.organization)
127
+ env = FactoryBot.create(:katello_k_t_environment)
128
+ env2 = FactoryBot.create(:katello_k_t_environment, organization: env.organization)
128
129
 
129
130
  @host = FactoryBot.create(
130
131
  :host,
@@ -132,19 +133,8 @@ module InsightsCloud::Api
132
133
  :with_content,
133
134
  :with_hostgroup,
134
135
  :with_parameter,
135
- content_view_environments: [
136
- FactoryBot.create(
137
- :katello_content_view_environment,
138
- content_view: FactoryBot.create(:katello_content_view, organization: @env.organization),
139
- lifecycle_environment: @env
140
- ),
141
- FactoryBot.create(
142
- :katello_content_view_environment,
143
- content_view: FactoryBot.create(:katello_content_view, organization: @env.organization),
144
- lifecycle_environment: @env2
145
- ),
146
- ],
147
- organization: @env.organization
136
+ content_view_environments: [make_cve(lifecycle_environment: env), make_cve(lifecycle_environment: env2)],
137
+ organization: env.organization
148
138
  )
149
139
 
150
140
  @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
@@ -14,7 +14,7 @@ module InventoryUpload::Api
14
14
  .expects(:start_report_generation)
15
15
  .with(@test_org.id.to_s, @disconnected)
16
16
 
17
- post :generate_report, params: { organization_id: @test_org.id, disconnected: @disconnected }
17
+ post :generate_report, params: { organization_id: @test_org.id, no_upload: @disconnected }
18
18
 
19
19
  assert_response :success
20
20
  end
@@ -4,6 +4,7 @@ require 'foreman_tasks/test_helpers'
4
4
  class InventoryFullSyncTest < ActiveSupport::TestCase
5
5
  include ForemanTasks::TestHelpers::WithInThreadExecutor
6
6
  include MockCerts
7
+ include KatelloCVEHelper
7
8
 
8
9
  setup do
9
10
  User.current = User.find_by(login: 'secret_admin')
@@ -11,15 +12,15 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
11
12
  InventorySync::Async::InventoryFullSync.any_instance.stubs(:plan_self_host_sync)
12
13
  Organization.any_instance.stubs(:manifest_expired?).returns(false)
13
14
 
14
- env = FactoryBot.create(:katello_k_t_environment)
15
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
15
+ cve = make_cve
16
+ env = cve.lifecycle_environment
16
17
 
17
18
  # this host would pass our plugin queries, so it could be uploaded to the cloud.
18
19
  @host1 = FactoryBot.create(
19
20
  :host,
20
21
  :with_subscription,
21
22
  :with_content,
22
- content_view: cv.first,
23
+ content_view: cve.content_view,
23
24
  lifecycle_environment: env,
24
25
  organization: env.organization
25
26
  )
@@ -33,7 +34,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
33
34
  :host,
34
35
  :with_subscription,
35
36
  :with_content,
36
- content_view: cv.first,
37
+ content_view: cve.content_view,
37
38
  lifecycle_environment: env,
38
39
  organization: env.organization
39
40
  )
@@ -46,7 +47,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
46
47
  :host,
47
48
  :with_subscription,
48
49
  :with_content,
49
- content_view: cv.first,
50
+ content_view: cve.content_view,
50
51
  lifecycle_environment: env,
51
52
  organization: env.organization
52
53
  )
@@ -4,19 +4,19 @@ require 'foreman_tasks/test_helpers'
4
4
  class InventoryHostsSyncTest < ActiveSupport::TestCase
5
5
  include ForemanTasks::TestHelpers::WithInThreadExecutor
6
6
  include MockCerts
7
+ include KatelloCVEHelper
7
8
 
8
9
  setup do
9
10
  User.current = User.find_by(login: 'secret_admin')
10
-
11
- env = FactoryBot.create(:katello_k_t_environment)
12
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
13
-
11
+ cve = make_cve
12
+ env = cve.lifecycle_environment
13
+ cv = cve.content_view
14
14
  # this host would pass our plugin queries, so it could be uploaded to the cloud.
15
15
  @host1 = FactoryBot.create(
16
16
  :host,
17
17
  :with_subscription,
18
18
  :with_content,
19
- content_view: cv.first,
19
+ content_view: cv,
20
20
  lifecycle_environment: env,
21
21
  organization: env.organization
22
22
  )
@@ -30,7 +30,7 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
30
30
  :host,
31
31
  :with_subscription,
32
32
  :with_content,
33
- content_view: cv.first,
33
+ content_view: cv,
34
34
  lifecycle_environment: env,
35
35
  organization: env.organization
36
36
  )
@@ -18,7 +18,7 @@ class UploadReportJobTest < ActiveSupport::TestCase
18
18
 
19
19
  label = ForemanInventoryUpload::Async::UploadReportJob.output_label(organization.id)
20
20
  progress_output = ForemanInventoryUpload::Async::ProgressOutput.get(label)
21
- assert_match(/Upload was stopped/, progress_output.full_output)
21
+ assert_match(/Upload canceled/, progress_output.full_output)
22
22
  assert_match(/exit 1/, progress_output.status)
23
23
  end
24
24
 
@@ -118,6 +118,20 @@ module CandlepinIsolation
118
118
  end
119
119
  end
120
120
 
121
+ module KatelloCVEHelper
122
+ def make_cve(lifecycle_environment: nil, content_view: nil)
123
+ env = lifecycle_environment || FactoryBot.create(:katello_k_t_environment)
124
+ content_view ||= FactoryBot.create(:katello_content_view, organization: env.organization)
125
+ cvv = ::Katello::ContentViewVersion.create!(:major => 2, :content_view => content_view)
126
+ FactoryBot.create(
127
+ :katello_content_view_environment,
128
+ content_view_version: cvv,
129
+ content_view: content_view,
130
+ lifecycle_environment: env
131
+ )
132
+ end
133
+ end
134
+
121
135
  module UpstreamOnlySettingsTestHelper
122
136
  def self.set_if_available(setting_name, value: true)
123
137
  Setting[setting_name] = value
@@ -2,18 +2,18 @@ require 'test_plugin_helper'
2
2
 
3
3
  class ArchivedReportGeneratorTest < ActiveSupport::TestCase
4
4
  include MockForemanHostname
5
+ include KatelloCVEHelper
5
6
 
6
7
  setup do
7
8
  User.current = User.find_by(login: 'secret_admin')
8
-
9
- env = FactoryBot.create(:katello_k_t_environment)
10
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
9
+ cve = make_cve
10
+ env = cve.lifecycle_environment
11
11
 
12
12
  @host = FactoryBot.create(
13
13
  :host,
14
14
  :with_subscription,
15
15
  :with_content,
16
- content_view: cv.first,
16
+ content_view: cve.content_view,
17
17
  lifecycle_environment: env,
18
18
  organization: env.organization
19
19
  )
@@ -1,21 +1,22 @@
1
1
  require 'test_plugin_helper'
2
2
 
3
3
  class BranchInfoTest < ActiveSupport::TestCase
4
+ include KatelloCVEHelper
5
+
4
6
  setup do
5
7
  User.current = User.find_by(login: 'secret_admin')
6
8
 
7
- @env = FactoryBot.create(:katello_k_t_environment)
8
- cv = @env.content_views << FactoryBot.create(:katello_content_view, organization: @env.organization)
9
-
9
+ cve = make_cve
10
+ env = cve.lifecycle_environment
10
11
  @host = FactoryBot.create(
11
12
  :host,
12
13
  :with_subscription,
13
14
  :with_content,
14
15
  :with_hostgroup,
15
16
  :with_parameter,
16
- content_view: cv.first,
17
- lifecycle_environment: @env,
18
- organization: @env.organization
17
+ content_view: cve.content_view,
18
+ lifecycle_environment: env,
19
+ organization: env.organization
19
20
  )
20
21
 
21
22
  @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
@@ -3,13 +3,12 @@ require 'test_plugin_helper'
3
3
  class SliceGeneratorTest < ActiveSupport::TestCase
4
4
  include KatelloLocationFix
5
5
  include CandlepinIsolation
6
+ include KatelloCVEHelper
6
7
 
7
8
  setup do
8
9
  User.current = User.find_by(login: 'secret_admin')
9
-
10
- env = FactoryBot.create(:katello_k_t_environment)
11
- cv = env.content_views << FactoryBot.create(:katello_content_view, organization: env.organization)
12
-
10
+ cve = make_cve
11
+ env = cve.lifecycle_environment
13
12
  location = FactoryBot.create(:location)
14
13
 
15
14
  @host = FactoryBot.create(
@@ -17,7 +16,7 @@ class SliceGeneratorTest < ActiveSupport::TestCase
17
16
  :redhat,
18
17
  :with_subscription,
19
18
  :with_content,
20
- content_view: cv.first,
19
+ content_view: cve.content_view,
21
20
  lifecycle_environment: env,
22
21
  organization: env.organization,
23
22
  location: location
@@ -3,6 +3,7 @@ require 'test_plugin_helper'
3
3
  class TagsGeneratorTest < ActiveSupport::TestCase
4
4
  include KatelloLocationFix
5
5
  include CandlepinIsolation
6
+ include KatelloCVEHelper
6
7
 
7
8
  setup do
8
9
  UpstreamOnlySettingsTestHelper.set_if_available('allow_multiple_content_views')
@@ -25,18 +26,7 @@ class TagsGeneratorTest < ActiveSupport::TestCase
25
26
  organization: env.organization,
26
27
  location: @location2,
27
28
  hostgroup: @hostgroup2,
28
- content_view_environments: [
29
- FactoryBot.create(
30
- :katello_content_view_environment,
31
- content_view: FactoryBot.create(:katello_content_view, organization: env.organization),
32
- lifecycle_environment: env
33
- ),
34
- FactoryBot.create(
35
- :katello_content_view_environment,
36
- content_view: FactoryBot.create(:katello_content_view, organization: env.organization),
37
- lifecycle_environment: env2
38
- ),
39
- ]
29
+ content_view_environments: [make_cve(lifecycle_environment: env), make_cve(lifecycle_environment: env2)]
40
30
  )
41
31
 
42
32
  @host.organization.pools << FactoryBot.create(:katello_pool, account_number: '1234', cp_id: 1)
@@ -10,13 +10,7 @@ exports[`ListItem rendering render with Props 1`] = `
10
10
  <Label
11
11
  className="account-icon"
12
12
  color="blue"
13
- icon={
14
- <UserIcon
15
- color="currentColor"
16
- noVerticalAlign={false}
17
- size="sm"
18
- />
19
- }
13
+ icon={<UserIcon />}
20
14
  variant="outline"
21
15
  />
22
16
  test
@@ -12,11 +12,7 @@ exports[`ListItemStatus rendering render with Props 1`] = `
12
12
  <p>
13
13
  Generating
14
14
  </p>
15
- <CheckIcon
16
- color="currentColor"
17
- noVerticalAlign={false}
18
- size="sm"
19
- />
15
+ <CheckIcon />
20
16
  </GridItem>
21
17
  <GridItem
22
18
  className="item"
@@ -8,11 +8,11 @@
8
8
  }
9
9
 
10
10
  .account-list {
11
- .pf-c-accordion__toggle {
11
+ .pf-v5-c-accordion__toggle {
12
12
  margin-top: 10px;
13
13
  }
14
14
 
15
- .pf-c-accordion__toggle-text {
15
+ .pf-v5-c-accordion__toggle-text {
16
16
  font-size: 16px;
17
17
  display: flex;
18
18
  justify-content: space-between;
@@ -21,7 +21,7 @@
21
21
  .account-icon {
22
22
  margin-right: 5px;
23
23
 
24
- .pf-c-label__icon {
24
+ .pf-v5-c-label__icon {
25
25
  margin: 0;
26
26
  }
27
27
  }
@@ -29,7 +29,7 @@ const InventoryFilter = ({
29
29
  value={filterTerm}
30
30
  type="text"
31
31
  placeholder={__('Filter..')}
32
- onChange={handleFilterChange}
32
+ onChange={(e, v) => handleFilterChange(v)}
33
33
  />
34
34
  <ClearButton onClear={handleFilterClear} />
35
35
  </FormGroup>
@@ -1,5 +1,5 @@
1
1
  #inventory_filter_form {
2
- .pf-c-form__group-control {
2
+ .pf-v5-c-form__group-control {
3
3
  display: -ms-flexbox;
4
4
  display: -webkit-flex;
5
5
  display: flex;
@@ -12,18 +12,18 @@
12
12
  font-size: 16px;
13
13
  }
14
14
 
15
- .pf-c-dropdown__toggle {
15
+ .pf-v5-c-dropdown__toggle {
16
16
  margin-right: -20px;
17
17
  }
18
18
 
19
19
  .settings-alert {
20
20
  margin-bottom: 30px;
21
- .pf-c-alert {
21
+ .pf-v5-c-alert {
22
22
  margin-bottom: 5px;
23
23
 
24
- .pf-c-alert__title {
25
- font-size: var(--pf-global--FontSize--md);
26
- line-height: var(--pf-global--LineHeight--md);
24
+ .pf-v5-c-alert__title {
25
+ font-size: var(--pf-v5-global--FontSize--md);
26
+ line-height: var(--pf-v5-global--LineHeight--md);
27
27
  }
28
28
  }
29
29
  }
@@ -1,12 +1,11 @@
1
1
  import React, { useState } from 'react';
2
+ import { Grid, GridItem } from '@patternfly/react-core';
2
3
  import {
3
4
  Dropdown,
4
5
  DropdownItem,
5
6
  KebabToggle,
6
7
  DropdownPosition,
7
- Grid,
8
- GridItem,
9
- } from '@patternfly/react-core';
8
+ } from '@patternfly/react-core/deprecated';
10
9
  import Head from 'foremanReact/components/Head';
11
10
  import {
12
11
  INVENTORY_PAGE_TITLE,
@@ -58,7 +57,9 @@ const PageTitle = () => {
58
57
  className="title-dropdown"
59
58
  onSelect={() => setIsDropdownOpen(false)}
60
59
  toggle={
61
- <KebabToggle onToggle={isOpen => setIsDropdownOpen(isOpen)} />
60
+ <KebabToggle
61
+ onToggle={(_event, isOpen) => setIsDropdownOpen(isOpen)}
62
+ />
62
63
  }
63
64
  isOpen={isDropdownOpen}
64
65
  isPlain
@@ -2,7 +2,11 @@
2
2
  import React, { useCallback, useEffect, useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { useDispatch, useSelector } from 'react-redux';
5
- import { Table, TableBody, TableHeader } from '@patternfly/react-table';
5
+ import {
6
+ Table,
7
+ TableBody,
8
+ TableHeader,
9
+ } from '@patternfly/react-table/deprecated';
6
10
  import {
7
11
  Card,
8
12
  CardTitle,
@@ -11,6 +15,7 @@ import {
11
15
  ModalVariant,
12
16
  Spinner,
13
17
  Text,
18
+ Icon,
14
19
  } from '@patternfly/react-core';
15
20
  import {
16
21
  CheckCircleIcon,
@@ -108,8 +113,18 @@ const CloudPingModal = ({ title, isOpen, toggle }) => {
108
113
 
109
114
  const StatusIcon = ({ isPending, authStatus }) => {
110
115
  if (isPending) return <Spinner size="sm" />;
111
- if (authStatus.success) return <CheckCircleIcon color="green" />;
112
- if (authStatus.error) return <ExclamationCircleIcon color="red" />;
116
+ if (authStatus.success)
117
+ return (
118
+ <Icon color="green">
119
+ <CheckCircleIcon />
120
+ </Icon>
121
+ );
122
+ if (authStatus.error)
123
+ return (
124
+ <Icon color="red">
125
+ <ExclamationCircleIcon />
126
+ </Icon>
127
+ );
113
128
  return <Spinner size="sm" />;
114
129
  };
115
130
 
@@ -22,7 +22,6 @@ class SyncButton extends React.Component {
22
22
  <Button
23
23
  className="sync_button"
24
24
  onClick={handleClick}
25
- size="lg"
26
25
  isDisabled={status === STATUS.PENDING}
27
26
  variant="secondary"
28
27
  >
@@ -6,7 +6,6 @@ exports[`SyncButton rendering render with Props 1`] = `
6
6
  className="sync_button"
7
7
  isDisabled={false}
8
8
  onClick={[Function]}
9
- size="lg"
10
9
  variant="secondary"
11
10
  >
12
11
  Sync all inventory status
@@ -56,11 +56,7 @@ exports[`InventoryAutoUpload rendering render with props 1`] = `
56
56
  >
57
57
  Show Advanced Settings
58
58
 
59
- <CaretRightIcon
60
- color="currentColor"
61
- noVerticalAlign={false}
62
- size="sm"
63
- />
59
+ <CaretRightIcon />
64
60
  </Button>
65
61
  </Popover>
66
62
  </Col>
@@ -78,11 +74,7 @@ exports[`InventoryAutoUpload rendering render with props 1`] = `
78
74
  <Text
79
75
  component="p"
80
76
  >
81
- <InfoAltIcon
82
- color="currentColor"
83
- noVerticalAlign={false}
84
- size="sm"
85
- />
77
+ <InfoAltIcon />
86
78
 
87
79
  More details can be found in
88
80
 
@@ -1,7 +1,11 @@
1
1
  /* eslint-disable react-hooks/exhaustive-deps */
2
2
  import React, { useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { Table, TableHeader, TableBody } from '@patternfly/react-table';
4
+ import {
5
+ Table,
6
+ TableHeader,
7
+ TableBody,
8
+ } from '@patternfly/react-table/deprecated';
5
9
  import { useForemanSettings } from 'foremanReact/Root/Context/ForemanContext';
6
10
  import SelectAllAlert from './SelectAllAlert';
7
11
  import {
@@ -4,7 +4,7 @@ import {
4
4
  InsightsLabel,
5
5
  Section,
6
6
  } from '@redhat-cloud-services/frontend-components';
7
- import { DropdownItem } from '@patternfly/react-core';
7
+ import { DropdownItem } from '@patternfly/react-core/deprecated';
8
8
  import { sortable, cellWidth } from '@patternfly/react-table';
9
9
  import { AnsibeTowerIcon, ExternalLinkAltIcon } from '@patternfly/react-icons';
10
10
  import { translate as __ } from 'foremanReact/common/I18n';
@@ -20,13 +20,13 @@ const paginationTitles = {
20
20
  page: '', // doesn't work well with translations as it adds 's' for plural, see: https://github.com/patternfly/patternfly-react/issues/6707
21
21
  itemsPerPage: __('Items per page'),
22
22
  perPageSuffix: __('per page'),
23
- toFirstPage: __('Go to first page'),
24
- toPreviousPage: __('Go to previous page'),
25
- toLastPage: __('Go to last page'),
26
- toNextPage: __('Go to next page'),
27
- optionsToggle: __('Items per page'),
28
- currPage: __('Current page'),
29
- paginationTitle: __('Pagination'),
23
+ toFirstPageAriaLabel: __('Go to first page'),
24
+ toPreviousPageAriaLabel: __('Go to previous page'),
25
+ toLastPageAriaLabel: __('Go to last page'),
26
+ toNextPageAriaLabel: __('Go to next page'),
27
+ optionsToggleAriaLabel: __('Items per page'),
28
+ currPageAriaLabel: __('Current page'),
29
+ paginationAriaLabel: __('Pagination'),
30
30
  };
31
31
 
32
32
  const Pagination = ({ variant, ...props }) => {
@@ -1,5 +1,5 @@
1
1
  .rh-cloud-recommendations-table {
2
- .pf-c-table__check {
2
+ .pf-v5-c-table__check {
3
3
  input:disabled {
4
4
  display: none;
5
5
  }
@@ -1,7 +1,11 @@
1
1
  /* eslint-disable react-hooks/exhaustive-deps */
2
2
  import React, { useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { Table, TableHeader, TableBody } from '@patternfly/react-table';
4
+ import {
5
+ Table,
6
+ TableHeader,
7
+ TableBody,
8
+ } from '@patternfly/react-table/deprecated';
5
9
  import { Modal, ModalVariant, Button } from '@patternfly/react-core';
6
10
  import { isEmpty } from 'lodash';
7
11
  import { STATUS } from 'foremanReact/constants';
@@ -1,11 +1,18 @@
1
1
  import React from 'react';
2
2
  import { cellWidth } from '@patternfly/react-table';
3
+ import { Icon } from '@patternfly/react-core';
3
4
  import { CheckCircleIcon } from '@patternfly/react-icons';
4
5
  import { translate as __ } from 'foremanReact/common/I18n';
5
6
  import { foremanUrl } from '../../../ForemanRhCloudHelpers';
6
7
 
7
8
  export const rebootFormatter = ({ title: reboot }) => ({
8
- children: reboot ? <CheckCircleIcon color="green" /> : __('No'),
9
+ children: reboot ? (
10
+ <Icon color="green">
11
+ <CheckCircleIcon />
12
+ </Icon>
13
+ ) : (
14
+ __('No')
15
+ ),
9
16
  });
10
17
 
11
18
  export const columns = [
@@ -1,7 +1,11 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { translate as __ } from 'foremanReact/common/I18n';
4
- import { Dropdown, DropdownItem, KebabToggle } from '@patternfly/react-core';
4
+ import {
5
+ Dropdown,
6
+ DropdownItem,
7
+ KebabToggle,
8
+ } from '@patternfly/react-core/deprecated';
5
9
  import { ExternalLinkAltIcon } from '@patternfly/react-icons';
6
10
  import { redHatAdvisorSystems } from '../InsightsCloudSyncHelpers';
7
11
  import { useAdvisorEngineConfig } from '../../common/Hooks/ConfigHooks';
@@ -35,7 +39,9 @@ const ToolbarDropdown = ({ onRecommendationSync }) => {
35
39
  <Dropdown
36
40
  className="title-dropdown"
37
41
  onSelect={() => setIsDropdownOpen(false)}
38
- toggle={<KebabToggle onToggle={isOpen => setIsDropdownOpen(isOpen)} />}
42
+ toggle={
43
+ <KebabToggle onToggle={(_event, isOpen) => setIsDropdownOpen(isOpen)} />
44
+ }
39
45
  isOpen={isDropdownOpen}
40
46
  isPlain
41
47
  dropdownItems={dropdownItems}
@@ -78,7 +78,7 @@
78
78
  width: 100%;
79
79
  }
80
80
 
81
- .pf-c-pagination {
81
+ .pf-v5-c-pagination {
82
82
  padding-right: 0;
83
83
  }
84
84
  }
@@ -3,8 +3,14 @@ import PropTypes from 'prop-types';
3
3
  import { useDispatch } from 'react-redux';
4
4
  import { push } from 'connected-react-router';
5
5
  import { useHistory } from 'react-router-dom';
6
- import { DropdownItem, Bullseye, Title } from '@patternfly/react-core';
7
- import { ChartDonut, ChartLegend, ChartLabel } from '@patternfly/react-charts';
6
+ import { Bullseye, Title } from '@patternfly/react-core';
7
+ import { DropdownItem } from '@patternfly/react-core/deprecated';
8
+ import {
9
+ ChartDonut,
10
+ ChartLegend,
11
+ ChartLabel,
12
+ ChartTooltip,
13
+ } from '@patternfly/react-charts';
8
14
  import { STATUS } from 'foremanReact/constants';
9
15
  import { useAPI } from 'foremanReact/common/hooks/API/APIHooks';
10
16
  import CardTemplate from 'foremanReact/components/HostDetails/Templates/CardItem/CardTemplate';
@@ -90,6 +96,9 @@ const InsightsTotalRiskCard = ({ hostDetails: { id } }) => {
90
96
  { x: critical.title, y: critical.value },
91
97
  ]}
92
98
  labels={({ datum: { x, y } }) => `${x}: ${y}`}
99
+ labelComponent={
100
+ <ChartTooltip constrainToVisibleArea renderInPortal={false} />
101
+ }
93
102
  legendComponent={legend}
94
103
  legendPosition="right"
95
104
  subTitle="Recommendations"
@@ -3,13 +3,12 @@ import PropTypes from 'prop-types';
3
3
  import { useDispatch, useSelector } from 'react-redux';
4
4
  import SearchBar from 'foremanReact/components/SearchBar';
5
5
  import { translate as __ } from 'foremanReact/common/I18n';
6
+ import { Grid, GridItem } from '@patternfly/react-core';
6
7
  import {
7
- Grid,
8
- GridItem,
9
8
  Dropdown,
10
9
  DropdownItem,
11
10
  KebabToggle,
12
- } from '@patternfly/react-core';
11
+ } from '@patternfly/react-core/deprecated';
13
12
  import { ExternalLinkAltIcon } from '@patternfly/react-icons';
14
13
  import InsightsTable from '../InsightsCloudSync/Components/InsightsTable';
15
14
  import RemediationModal from '../InsightsCloudSync/Components/RemediationModal';
@@ -76,7 +75,9 @@ const NewHostDetailsTab = ({ hostName, router }) => {
76
75
  ouiaId="insights-dropdown"
77
76
  onSelect={() => setIsDropdownOpen(false)}
78
77
  toggle={
79
- <KebabToggle onToggle={isOpen => setIsDropdownOpen(isOpen)} />
78
+ <KebabToggle
79
+ onToggle={(_event, isOpen) => setIsDropdownOpen(isOpen)}
80
+ />
80
81
  }
81
82
  isOpen={isDropdownOpen}
82
83
  isPlain
@@ -1,13 +1,13 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Dropdown, KebabToggle } from '@patternfly/react-core';
3
+ import { Dropdown, KebabToggle } from '@patternfly/react-core/deprecated';
4
4
 
5
5
  const DropdownToggle = ({ items, ...props }) => {
6
6
  const [isOpen, setOpen] = useState(false);
7
7
  return (
8
8
  <Dropdown
9
9
  onSelect={() => setOpen(false)}
10
- toggle={<KebabToggle onToggle={value => setOpen(value)} />}
10
+ toggle={<KebabToggle onToggle={(_event, value) => setOpen(value)} />}
11
11
  isOpen={isOpen}
12
12
  isPlain
13
13
  dropdownItems={items}
@@ -9,7 +9,7 @@ export const HelpLabel = ({ text, id, className }) => {
9
9
  <Popover id={`${id}-help`} bodyContent={text} aria-label="help-text">
10
10
  <button
11
11
  onClick={e => e.preventDefault()}
12
- className={`pf-c-form__group-label-help ${className}`}
12
+ className={`pf-v5-c-form__group-label-help ${className}`}
13
13
  >
14
14
  <HelpIcon />
15
15
  </button>
@@ -7,7 +7,7 @@ label.foreman-rh-cloud-switcher {
7
7
  padding-left: 5px;
8
8
  }
9
9
 
10
- .pf-c-switch__toggle {
10
+ .pf-v5-c-switch__toggle {
11
11
  margin-right: 5px;
12
12
  }
13
13
  }
@@ -7,14 +7,10 @@ exports[`InsightsCloudSync helpers should return insights cloud Url 1`] = `
7
7
  id="some-id-help"
8
8
  >
9
9
  <button
10
- className="pf-c-form__group-label-help some-class"
10
+ className="pf-v5-c-form__group-label-help some-class"
11
11
  onClick={[Function]}
12
12
  >
13
- <HelpIcon
14
- color="currentColor"
15
- noVerticalAlign={false}
16
- size="sm"
17
- />
13
+ <HelpIcon />
18
14
  </button>
19
15
  </Popover>
20
16
  `;
@@ -5,7 +5,7 @@ import {
5
5
  EmptyStateIcon,
6
6
  Spinner,
7
7
  EmptyStateVariant,
8
- Title,
8
+ EmptyStateHeader,
9
9
  } from '@patternfly/react-core';
10
10
  import { ExclamationCircleIcon, CheckIcon } from '@patternfly/react-icons';
11
11
 
@@ -16,33 +16,40 @@ const TableEmptyState = ({ status, error, rowsLength }) => {
16
16
  switch (status) {
17
17
  case STATUS.PENDING:
18
18
  return (
19
- <EmptyState variant={EmptyStateVariant.small}>
20
- <EmptyStateIcon variant="container" component={Spinner} />
21
- <Title headingLevel="h2" size="lg">
22
- {__('Loading')}
23
- </Title>
19
+ <EmptyState variant={EmptyStateVariant.sm}>
20
+ <EmptyStateHeader
21
+ titleText={<>{__('Loading')}</>}
22
+ icon={<EmptyStateIcon icon={Spinner} />}
23
+ headingLevel="h2"
24
+ />
24
25
  </EmptyState>
25
26
  );
26
27
  case STATUS.ERROR:
27
28
  return (
28
- <EmptyState variant={EmptyStateVariant.small}>
29
- <EmptyStateIcon
30
- variant="container"
31
- component={ExclamationCircleIcon}
29
+ <EmptyState variant={EmptyStateVariant.sm}>
30
+ <EmptyStateHeader
31
+ titleText={
32
+ <>
33
+ {sprintf(
34
+ __('The server returned the following error: %s'),
35
+ error
36
+ )}
37
+ </>
38
+ }
39
+ icon={<EmptyStateIcon icon={ExclamationCircleIcon} />}
40
+ headingLevel="h2"
32
41
  />
33
- <Title headingLevel="h2" size="lg">
34
- {sprintf(__('The server returned the following error: %s'), error)}
35
- </Title>
36
42
  </EmptyState>
37
43
  );
38
44
  case STATUS.RESOLVED:
39
45
  if (rowsLength > 0) return null;
40
46
  return (
41
- <EmptyState variant={EmptyStateVariant.large}>
42
- <EmptyStateIcon variant="container" component={CheckIcon} />
43
- <Title headingLevel="h2" size="lg">
44
- {__('There are no recommendations for your hosts')}
45
- </Title>
47
+ <EmptyState variant={EmptyStateVariant.lg}>
48
+ <EmptyStateHeader
49
+ titleText={<>{__('There are no recommendations for your hosts')}</>}
50
+ icon={<EmptyStateIcon icon={CheckIcon} />}
51
+ headingLevel="h2"
52
+ />
46
53
  </EmptyState>
47
54
  );
48
55
  default:
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.3.0
4
+ version: 12.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-24 00:00:00.000000000 Z
10
+ date: 2025-04-01 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: foreman_ansible
@@ -649,7 +648,6 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
649
648
  licenses:
650
649
  - GPL-3.0
651
650
  metadata: {}
652
- post_install_message:
653
651
  rdoc_options: []
654
652
  require_paths:
655
653
  - lib
@@ -667,8 +665,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
667
665
  - !ruby/object:Gem::Version
668
666
  version: '0'
669
667
  requirements: []
670
- rubygems_version: 3.2.33
671
- signing_key:
668
+ rubygems_version: 3.6.2
672
669
  specification_version: 4
673
670
  summary: Summary of ForemanRhCloud.
674
671
  test_files: