foreman_rh_cloud 11.4.1 → 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.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +2 -2
- data/app/services/foreman_rh_cloud/cloud_request.rb +0 -4
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +1 -17
- data/app/services/foreman_rh_cloud/rules_ingester.rb +1 -12
- data/config/routes.rb +0 -4
- data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +3 -3
- data/lib/foreman_inventory_upload/async/upload_report_job.rb +4 -4
- data/lib/foreman_rh_cloud/engine.rb +0 -11
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +5 -5
- data/test/controllers/inventory_upload/api/inventory_controller_test.rb +1 -1
- data/test/jobs/upload_report_job_test.rb +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +1 -7
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +1 -5
- data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +3 -3
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +5 -5
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +5 -4
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +18 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButton.test.js.snap +0 -1
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +2 -10
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +5 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js +7 -7
- data/webpack/InsightsCloudSync/Components/InsightsTable/table.scss +1 -1
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +5 -1
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationTableConstants.js +8 -1
- data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +8 -2
- data/webpack/InsightsCloudSync/InsightsCloudSync.scss +1 -1
- data/webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js +11 -2
- data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +5 -4
- data/webpack/common/DropdownToggle.js +2 -2
- data/webpack/common/Switcher/HelpLabel.js +1 -1
- data/webpack/common/Switcher/SwitcherPF4.scss +1 -1
- data/webpack/common/Switcher/__tests__/__snapshots__/HelpLabel.test.js.snap +2 -6
- data/webpack/common/table/EmptyState.js +25 -18
- metadata +3 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3666ab0afa45f6fbf3fbe06ec110cbbf7d7eca432b02686e945afca5b412f31
|
4
|
+
data.tar.gz: ce3380aca30486d23d89c3e9b30d17cbc862e51ba55032b1e60565ec63af1cc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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[:
|
24
|
+
disconnected = params[:no_upload] || false
|
25
25
|
|
26
26
|
start_report_generation(organization_id, disconnected)
|
27
27
|
|
@@ -8,10 +8,6 @@ module ForemanRhCloud
|
|
8
8
|
proxy: ForemanRhCloud.transformed_http_proxy_string,
|
9
9
|
}.deep_merge(params)
|
10
10
|
|
11
|
-
if ForemanRhCloud.with_local_advisor_engine?
|
12
|
-
final_params[:ssl_ca_file] ||= ForemanRhCloud.ca_cert
|
13
|
-
end
|
14
|
-
|
15
11
|
response = RestClient::Request.execute(final_params)
|
16
12
|
|
17
13
|
logger.debug("Response headers for request url #{final_params[:url]} are: #{response.headers}")
|
@@ -34,13 +34,7 @@ module ForemanRhCloud
|
|
34
34
|
),
|
35
35
|
}
|
36
36
|
requested_url = original_request.original_fullpath.end_with?('/') ? original_request.path + '/' : original_request.path
|
37
|
-
|
38
|
-
|
39
|
-
if ForemanRhCloud.with_local_advisor_engine?
|
40
|
-
params[:ssl_ca_file] = ForemanRhCloud.ca_cert
|
41
|
-
end
|
42
|
-
|
43
|
-
base_params.merge(params)
|
37
|
+
base_params.merge(path_params(requested_url, certs))
|
44
38
|
end
|
45
39
|
|
46
40
|
def prepare_forward_payload(original_request, controller_name)
|
@@ -69,12 +63,6 @@ module ForemanRhCloud
|
|
69
63
|
|
70
64
|
def path_params(request_path, certs)
|
71
65
|
case request_path
|
72
|
-
when lightspeed?
|
73
|
-
{
|
74
|
-
url: ForemanRhCloud.cert_base_url + request_path,
|
75
|
-
ssl_client_cert: OpenSSL::X509::Certificate.new(certs[:cert]),
|
76
|
-
ssl_client_key: OpenSSL::PKey.read(certs[:key]),
|
77
|
-
}
|
78
66
|
when platform_request?
|
79
67
|
{
|
80
68
|
url: ForemanRhCloud.cert_base_url + request_path.sub('/redhat_access/r/insights/platform', '/api'),
|
@@ -107,10 +95,6 @@ module ForemanRhCloud
|
|
107
95
|
headers
|
108
96
|
end
|
109
97
|
|
110
|
-
def lightspeed?
|
111
|
-
->(request_path) { request_path.include? '/lightspeed' }
|
112
|
-
end
|
113
|
-
|
114
98
|
def platform_request?
|
115
99
|
->(request_path) { request_path.include? '/platform' }
|
116
100
|
end
|
@@ -13,18 +13,7 @@ module ForemanRhCloud
|
|
13
13
|
|
14
14
|
def fetch_rules_data
|
15
15
|
advisor_url = "#{ForemanRhCloud.on_premise_url}/r/insights/v1/static/release/content.json"
|
16
|
-
|
17
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
18
|
-
http.use_ssl = true
|
19
|
-
|
20
|
-
# Set CA certificate
|
21
|
-
http.ca_file = ForemanRhCloud.ca_cert
|
22
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
23
|
-
|
24
|
-
request = Net::HTTP::Get.new(uri.request_uri)
|
25
|
-
|
26
|
-
response = http.request(request)
|
27
|
-
JSON.parse(response.body, symbolize_names: true)
|
16
|
+
JSON.parse(Net::HTTP.get(URI.parse(advisor_url)), symbolize_names: true)
|
28
17
|
end
|
29
18
|
|
30
19
|
def fetch_rules_and_resolutions
|
data/config/routes.rb
CHANGED
@@ -49,10 +49,6 @@ Rails.application.routes.draw do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
scope :module => :'insights_cloud/api' do
|
53
|
-
match '/api/lightspeed/*path', to: 'machine_telemetries#forward_request', via: :all
|
54
|
-
end
|
55
|
-
|
56
52
|
# API routes
|
57
53
|
|
58
54
|
namespace :api, :defaults => { :format => 'json' } do
|
@@ -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
|
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
|
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
|
@@ -212,15 +212,4 @@ module ForemanRhCloud
|
|
212
212
|
def self.with_local_advisor_engine?
|
213
213
|
SETTINGS.dig(:foreman_rh_cloud, :use_local_advisor_engine) || false
|
214
214
|
end
|
215
|
-
|
216
|
-
def self.ca_cert
|
217
|
-
# The reference to candlepin ca_cert_file can be removed
|
218
|
-
# once the setting is dropped. Foreman 3.15 introduces
|
219
|
-
# a single CA file that bundles all CAs.
|
220
|
-
if ::SETTINGS.dig(:katello, :candlepin, :ca_cert_file)
|
221
|
-
::SETTINGS[:katello][:candlepin][:ca_cert_file]
|
222
|
-
else
|
223
|
-
::SETTINGS[:ssl_ca_file]
|
224
|
-
end
|
225
|
-
end
|
226
215
|
end
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "foreman_rh_cloud",
|
3
|
-
"version": "
|
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": ">=
|
22
|
+
"@theforeman/vendor": ">= 15.0.1"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
25
|
"@babel/core": "^7.7.0",
|
26
|
-
"@theforeman/builder": ">=
|
27
|
-
"@theforeman/test": ">=
|
28
|
-
"@theforeman/eslint-plugin-foreman": ">=
|
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",
|
@@ -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,
|
17
|
+
post :generate_report, params: { organization_id: @test_org.id, no_upload: @disconnected }
|
18
18
|
|
19
19
|
assert_response :success
|
20
20
|
end
|
@@ -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
|
21
|
+
assert_match(/Upload canceled/, progress_output.full_output)
|
22
22
|
assert_match(/exit 1/, progress_output.status)
|
23
23
|
end
|
24
24
|
|
@@ -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
|
@@ -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
|
}
|
@@ -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
|
-
|
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
|
60
|
+
<KebabToggle
|
61
|
+
onToggle={(_event, isOpen) => setIsDropdownOpen(isOpen)}
|
62
|
+
/>
|
62
63
|
}
|
63
64
|
isOpen={isDropdownOpen}
|
64
65
|
isPlain
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js
CHANGED
@@ -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 {
|
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)
|
112
|
-
|
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
|
|
@@ -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 {
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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,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 {
|
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 ?
|
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 {
|
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={
|
42
|
+
toggle={
|
43
|
+
<KebabToggle onToggle={(_event, isOpen) => setIsDropdownOpen(isOpen)} />
|
44
|
+
}
|
39
45
|
isOpen={isDropdownOpen}
|
40
46
|
isPlain
|
41
47
|
dropdownItems={dropdownItems}
|
@@ -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 {
|
7
|
-
import {
|
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
|
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,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
|
-
|
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.
|
20
|
-
<
|
21
|
-
|
22
|
-
{
|
23
|
-
|
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.
|
29
|
-
<
|
30
|
-
|
31
|
-
|
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.
|
42
|
-
<
|
43
|
-
|
44
|
-
{
|
45
|
-
|
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,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_rh_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Red Hat Cloud team
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 2025-04-01 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: foreman_ansible
|
@@ -16,9 +16,6 @@ dependencies:
|
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: 15.0.0
|
19
|
-
- - "<"
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 16.0.0
|
22
19
|
type: :runtime
|
23
20
|
prerelease: false
|
24
21
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,29 +23,6 @@ dependencies:
|
|
26
23
|
- - ">="
|
27
24
|
- !ruby/object:Gem::Version
|
28
25
|
version: 15.0.0
|
29
|
-
- - "<"
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: 16.0.0
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: foreman_remote_execution
|
34
|
-
requirement: !ruby/object:Gem::Requirement
|
35
|
-
requirements:
|
36
|
-
- - ">="
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: 15.0.0
|
39
|
-
- - "<"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: 16.0.0
|
42
|
-
type: :runtime
|
43
|
-
prerelease: false
|
44
|
-
version_requirements: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">="
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: 15.0.0
|
49
|
-
- - "<"
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: 16.0.0
|
52
26
|
- !ruby/object:Gem::Dependency
|
53
27
|
name: foreman-tasks
|
54
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,9 +30,6 @@ dependencies:
|
|
56
30
|
- - ">="
|
57
31
|
- !ruby/object:Gem::Version
|
58
32
|
version: 10.0.0
|
59
|
-
- - "<"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 11.0.0
|
62
33
|
type: :runtime
|
63
34
|
prerelease: false
|
64
35
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -66,9 +37,6 @@ dependencies:
|
|
66
37
|
- - ">="
|
67
38
|
- !ruby/object:Gem::Version
|
68
39
|
version: 10.0.0
|
69
|
-
- - "<"
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version: 11.0.0
|
72
40
|
- !ruby/object:Gem::Dependency
|
73
41
|
name: katello
|
74
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -697,7 +665,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
697
665
|
- !ruby/object:Gem::Version
|
698
666
|
version: '0'
|
699
667
|
requirements: []
|
700
|
-
rubygems_version: 3.6.
|
668
|
+
rubygems_version: 3.6.2
|
701
669
|
specification_version: 4
|
702
670
|
summary: Summary of ForemanRhCloud.
|
703
671
|
test_files:
|