foreman_rh_cloud 4.0.22 → 4.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +50 -0
- data/app/controllers/concerns/inventory_upload/report_actions.rb +26 -0
- data/app/controllers/concerns/inventory_upload/task_actions.rb +25 -0
- data/app/controllers/foreman_inventory_upload/reports_controller.rb +3 -1
- data/app/controllers/foreman_inventory_upload/tasks_controller.rb +5 -13
- data/app/controllers/foreman_inventory_upload/uploads_controller.rb +4 -4
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +6 -3
- data/app/controllers/insights_cloud/hits_controller.rb +7 -3
- data/app/helpers/foreman_insights_host_helper.rb +19 -0
- data/app/models/insights_client_report_status.rb +11 -22
- data/app/services/foreman_rh_cloud/cloud_auth.rb +4 -0
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +0 -8
- data/app/services/foreman_rh_cloud/insights_status_cleaner.rb +17 -0
- data/app/services/foreman_rh_cloud/remediations_retriever.rb +5 -0
- data/config/package-lock.json.plugin +30931 -0
- data/config/routes.rb +19 -0
- data/db/migrate/20210720000001_remove_old_insights_statuses.foreman_rh_cloud.rb +6 -0
- data/lib/foreman_inventory_upload.rb +9 -1
- data/lib/foreman_inventory_upload/generators/queries.rb +1 -0
- data/lib/foreman_inventory_upload/generators/slice.rb +1 -0
- data/lib/foreman_inventory_upload/generators/tags.rb +3 -1
- data/lib/foreman_rh_cloud/engine.rb +17 -10
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/insights_cloud/async/insights_client_status_aging.rb +23 -0
- data/lib/insights_cloud/async/insights_full_sync.rb +5 -0
- data/lib/insights_cloud/async/insights_resolutions_sync.rb +9 -0
- data/lib/insights_cloud/async/insights_rules_sync.rb +5 -0
- data/lib/inventory_sync/async/host_result.rb +4 -0
- data/lib/inventory_sync/async/inventory_full_sync.rb +5 -0
- data/lib/inventory_sync/async/inventory_hosts_sync.rb +21 -2
- data/lib/inventory_sync/async/inventory_scheduled_sync.rb +4 -0
- data/lib/inventory_sync/async/inventory_self_host_sync.rb +39 -0
- data/lib/inventory_sync/async/query_inventory_job.rb +5 -1
- data/lib/tasks/insights.rake +15 -0
- data/lib/tasks/rh_cloud_inventory.rake +2 -1
- data/package.json +1 -1
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +41 -0
- data/test/controllers/inventory_upload/api/inventory_controller_test.rb +53 -0
- data/test/jobs/insights_client_status_aging_test.rb +33 -0
- data/test/jobs/insights_full_sync_test.rb +1 -0
- data/test/jobs/insights_resolutions_sync_test.rb +1 -0
- data/test/jobs/insights_rules_sync_test.rb +1 -0
- data/test/jobs/inventory_full_sync_test.rb +10 -0
- data/test/jobs/inventory_hosts_sync_test.rb +268 -0
- data/test/jobs/inventory_scheduled_sync_test.rb +22 -0
- data/test/jobs/inventory_self_host_sync_test.rb +104 -0
- data/test/models/insights_client_report_status_test.rb +70 -72
- data/test/test_plugin_helper.rb +2 -0
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +3 -3
- data/test/unit/services/foreman_rh_cloud/insights_status_cleaner_test.rb +31 -0
- data/test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb +1 -0
- data/test/unit/slice_generator_test.rb +15 -0
- data/test/unit/tags_generator_test.rb +41 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +1 -2
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +3 -1
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +2 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +1 -2
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterConstants.js +3 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +12 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +11 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Toast.js +2 -2
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +4 -3
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +3 -1
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +2 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +14 -0
- data/webpack/InsightsCloudSync/Components/InsightsTable/SelectAllAlert.js +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTable.test.js.snap +2 -4
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.scss +14 -0
- data/webpack/InsightsHostDetailsTab/InsightsTab.js +3 -2
- data/webpack/InsightsHostDetailsTab/InsightsTab.scss +4 -4
- data/webpack/InsightsHostDetailsTab/components/ListItem/ListItem.js +9 -7
- metadata +24 -4
- data/app/subscribers/foreman_rh_cloud/insights_subscriber.rb +0 -9
@@ -1,77 +1,75 @@
|
|
1
1
|
require 'test_plugin_helper'
|
2
2
|
|
3
3
|
class InsightsClientReportStatusTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
assert_equal 2, host_status.to_status
|
75
|
-
end
|
4
|
+
setup do
|
5
|
+
@host = FactoryBot.create(:host, :managed)
|
6
|
+
end
|
7
|
+
|
8
|
+
test 'fresh host does not have insights status' do
|
9
|
+
@host.reload
|
10
|
+
|
11
|
+
refute @host.host_statuses.where(type: 'InsightsClientReportStatus').exists?
|
12
|
+
insights_status = @host.get_status(InsightsClientReportStatus)
|
13
|
+
refute insights_status.relevant?
|
14
|
+
end
|
15
|
+
|
16
|
+
test 'host can refresh all its statuses' do
|
17
|
+
@host.refresh_statuses
|
18
|
+
@host.reload
|
19
|
+
|
20
|
+
refute @host.host_statuses.where(type: 'InsightsClientReportStatus').exists?
|
21
|
+
end
|
22
|
+
|
23
|
+
test 'host with correct report status sets global status to OK' do
|
24
|
+
global_status = @host.get_status(HostStatus.find_status_by_humanized_name('Global'))
|
25
|
+
# Status has to be OK before action
|
26
|
+
assert_equal HostStatus::Global::OK, global_status.status
|
27
|
+
|
28
|
+
# force create record
|
29
|
+
@host.get_status(InsightsClientReportStatus).refresh!
|
30
|
+
# now refresh should work
|
31
|
+
@host.refresh_statuses([InsightsClientReportStatus])
|
32
|
+
|
33
|
+
@host.reload
|
34
|
+
global_status = @host.get_status(HostStatus.find_status_by_humanized_name('Global'))
|
35
|
+
# Status has to be OK after the action too
|
36
|
+
assert_equal HostStatus::Global::OK, global_status.status
|
37
|
+
|
38
|
+
insights_status = @host.get_status(InsightsClientReportStatus)
|
39
|
+
# assert the status would be displayed
|
40
|
+
assert insights_status.relevant?
|
41
|
+
end
|
42
|
+
|
43
|
+
test 'host will return to OK once the status is refreshed' do
|
44
|
+
global_status = @host.get_status(HostStatus.find_status_by_humanized_name('Global'))
|
45
|
+
# Status has to be OK before action
|
46
|
+
assert_equal HostStatus::Global::OK, global_status.status
|
47
|
+
|
48
|
+
insights_status = @host.get_status(InsightsClientReportStatus)
|
49
|
+
insights_status.status = InsightsClientReportStatus::NO_REPORT
|
50
|
+
insights_status.save!
|
51
|
+
@host.refresh_global_status!
|
52
|
+
global_status = @host.global_status
|
53
|
+
assert_equal HostStatus::Global::ERROR, global_status
|
54
|
+
|
55
|
+
@host.refresh_statuses([InsightsClientReportStatus])
|
56
|
+
|
57
|
+
@host.reload
|
58
|
+
# Status has to be OK after the action too
|
59
|
+
assert_equal HostStatus::Global::OK, @host.global_status
|
60
|
+
end
|
61
|
+
|
62
|
+
test 'host with stale status would set global to ERROR' do
|
63
|
+
global_status = @host.get_status(HostStatus.find_status_by_humanized_name('Global'))
|
64
|
+
# Status has to be OK before action
|
65
|
+
assert_equal HostStatus::Global::OK, global_status.status
|
66
|
+
|
67
|
+
insights_status = @host.get_status(InsightsClientReportStatus)
|
68
|
+
insights_status.status = InsightsClientReportStatus::NO_REPORT
|
69
|
+
insights_status.save!
|
70
|
+
@host.refresh_global_status!
|
71
|
+
@host.reload
|
72
|
+
|
73
|
+
assert_equal HostStatus::Global::ERROR, @host.global_status
|
76
74
|
end
|
77
75
|
end
|
data/test/test_plugin_helper.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
require 'test_helper'
|
3
3
|
|
4
4
|
# Add plugin to FactoryBot's paths
|
5
|
+
FactoryBot.definition_file_paths << "#{ForemanTasks::Engine.root}/test/factories"
|
6
|
+
FactoryBot.definition_file_paths << "#{ForemanRemoteExecution::Engine.root}/test/factories"
|
5
7
|
FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
|
6
8
|
# FactoryBot.definition_file_paths << "#{Katello::Engine.root}/test/factories"
|
7
9
|
FactoryBot.reload
|
@@ -42,9 +42,9 @@ class CloudRequestForwarderTest < ActiveSupport::TestCase
|
|
42
42
|
test 'should prepare correct cloud url' do
|
43
43
|
paths = {
|
44
44
|
"/redhat_access/r/insights/platform/module-update-router/v1/channel?module=insights-core" => "https://cert.cloud.redhat.com/api/module-update-router/v1/channel?module=insights-core",
|
45
|
-
"/redhat_access/r/insights/v1/static/release/insights-core.egg" => "https://
|
46
|
-
"/redhat_access/r/insights/v1/static/uploader.v2.json" => "https://
|
47
|
-
"/redhat_access/r/insights/v1/static/uploader.v2.json.asc" => "https://
|
45
|
+
"/redhat_access/r/insights/v1/static/release/insights-core.egg" => "https://cert-api.access.redhat.com/r/insights/v1/static/release/insights-core.egg",
|
46
|
+
"/redhat_access/r/insights/v1/static/uploader.v2.json" => "https://cert-api.access.redhat.com/r/insights/v1/static/uploader.v2.json",
|
47
|
+
"/redhat_access/r/insights/v1/static/uploader.v2.json.asc" => "https://cert-api.access.redhat.com/r/insights/v1/static/uploader.v2.json.asc",
|
48
48
|
"/redhat_access/r/insights/platform/inventory/v1/hosts" => "https://cert.cloud.redhat.com/api/inventory/v1/hosts",
|
49
49
|
"/redhat_access/r/insights/platform/ingress/v1/upload" => "https://cert.cloud.redhat.com/api/ingress/v1/upload",
|
50
50
|
"/redhat_access/r/insights/uploads/67200803-132b-474b-a6f9-37be74185df4" => "https://cert-api.access.redhat.com/r/insights/uploads/67200803-132b-474b-a6f9-37be74185df4",
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test_plugin_helper'
|
2
|
+
|
3
|
+
class InsightsStatusCleanerTest < ActiveSupport::TestCase
|
4
|
+
setup do
|
5
|
+
@host1 = FactoryBot.create(:host)
|
6
|
+
@host2 = FactoryBot.create(:host)
|
7
|
+
|
8
|
+
InsightsClientReportStatus.find_or_initialize_by(host_id: @host1.id).update(status: InsightsClientReportStatus::NO_REPORT, reported_at: Time.now - InsightsClientReportStatus::REPORT_INTERVAL + 1.day)
|
9
|
+
InsightsClientReportStatus.find_or_initialize_by(host_id: @host2.id).update(status: InsightsClientReportStatus::NO_REPORT, reported_at: Time.now - InsightsClientReportStatus::REPORT_INTERVAL + 1.day)
|
10
|
+
|
11
|
+
@host1.refresh_global_status!
|
12
|
+
@host2.refresh_global_status!
|
13
|
+
end
|
14
|
+
|
15
|
+
test 'Cleans hosts by search condition' do
|
16
|
+
assert_equal HostStatus::Global::ERROR, @host1.global_status
|
17
|
+
assert_equal HostStatus::Global::ERROR, @host2.global_status
|
18
|
+
|
19
|
+
instance = ForemanRhCloud::InsightsStatusCleaner.new
|
20
|
+
actual_count = instance.clean("name = #{@host1.name}")
|
21
|
+
|
22
|
+
@host1.reload
|
23
|
+
@host2.refresh_global_status!
|
24
|
+
|
25
|
+
assert_equal 1, actual_count
|
26
|
+
assert_equal HostStatus::Global::OK, @host1.global_status
|
27
|
+
assert_equal HostStatus::Global::ERROR, @host2.global_status
|
28
|
+
assert InsightsClientReportStatus.where(host_id: @host1.id).empty?
|
29
|
+
refute InsightsClientReportStatus.where(host_id: @host2.id).empty?
|
30
|
+
end
|
31
|
+
end
|
@@ -8,6 +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
12
|
end
|
12
13
|
|
13
14
|
test 'Generates a playbook for hit and remediation' do
|
@@ -53,6 +53,7 @@ class SliceGeneratorTest < ActiveSupport::TestCase
|
|
53
53
|
'insights_client::hostname',
|
54
54
|
'insights_client::obfuscate_ip_enabled',
|
55
55
|
'insights_client::ips',
|
56
|
+
'insights_id',
|
56
57
|
]
|
57
58
|
end
|
58
59
|
|
@@ -657,6 +658,20 @@ class SliceGeneratorTest < ActiveSupport::TestCase
|
|
657
658
|
assert_not_nil actual_host['bios_uuid']
|
658
659
|
end
|
659
660
|
|
661
|
+
test 'passes valid insights_id field' do
|
662
|
+
FactoryBot.create(:fact_value, fact_name: fact_names['insights_id'], value: 'D30B0B42-7824-2635-C62D-491394DE43F7', host: @host)
|
663
|
+
|
664
|
+
batch = Host.where(id: @host.id).in_batches.first
|
665
|
+
generator = create_generator(batch)
|
666
|
+
|
667
|
+
json_str = generator.render
|
668
|
+
actual = JSON.parse(json_str.join("\n"))
|
669
|
+
|
670
|
+
assert_equal '00000000-0000-0000-0000-000000000000', actual['report_slice_id']
|
671
|
+
assert_not_nil(actual_host = actual['hosts'].first)
|
672
|
+
assert_not_nil actual_host['insights_id']
|
673
|
+
end
|
674
|
+
|
660
675
|
private
|
661
676
|
|
662
677
|
def create_generator(batch, name = '00000000-0000-0000-0000-000000000000')
|
@@ -62,6 +62,47 @@ class TagsGeneratorTest < ActiveSupport::TestCase
|
|
62
62
|
assert_equal false, actual.key?('content_view')
|
63
63
|
end
|
64
64
|
|
65
|
+
test 'generates parameter tags' do
|
66
|
+
FactoryBot.create(:setting, :name => 'include_parameter_tags', :settings_type => "boolean", :category => "Setting::RhCloud", :default => false, :value => true)
|
67
|
+
|
68
|
+
@host.stubs(:host_inherited_params_objects).returns(
|
69
|
+
[
|
70
|
+
OpenStruct.new(name: 'bool_param', value: true),
|
71
|
+
OpenStruct.new(name: 'false_param', value: false),
|
72
|
+
OpenStruct.new(name: 'int_param', value: 1),
|
73
|
+
OpenStruct.new(name: 'empty_param', value: nil),
|
74
|
+
OpenStruct.new(name: 'empty_str_param', value: ''),
|
75
|
+
]
|
76
|
+
)
|
77
|
+
|
78
|
+
generator = create_generator
|
79
|
+
actual = Hash[generator.generate_parameters]
|
80
|
+
|
81
|
+
assert_equal 3, actual.count
|
82
|
+
assert_equal true, actual['bool_param']
|
83
|
+
assert_equal false, actual['false_param']
|
84
|
+
assert_equal 1, actual['int_param']
|
85
|
+
end
|
86
|
+
|
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)
|
89
|
+
|
90
|
+
@host.stubs(:host_inherited_params_objects).returns(
|
91
|
+
[
|
92
|
+
OpenStruct.new(name: 'bool_param', value: true),
|
93
|
+
OpenStruct.new(name: 'false_param', value: false),
|
94
|
+
OpenStruct.new(name: 'int_param', value: 1),
|
95
|
+
OpenStruct.new(name: 'empty_param', value: nil),
|
96
|
+
OpenStruct.new(name: 'empty_str_param', value: ''),
|
97
|
+
]
|
98
|
+
)
|
99
|
+
|
100
|
+
generator = create_generator
|
101
|
+
actual = generator.generate_parameters.group_by { |key, value| key }
|
102
|
+
|
103
|
+
assert_equal 0, actual.count
|
104
|
+
end
|
105
|
+
|
65
106
|
private
|
66
107
|
|
67
108
|
def create_generator
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js
CHANGED
@@ -9,7 +9,7 @@ const inventoryEmptyState = () => (
|
|
9
9
|
<EmptyState.Title>
|
10
10
|
{__('Fetching data about your accounts')}
|
11
11
|
</EmptyState.Title>
|
12
|
-
<EmptyState.Info>{__('Loading')}
|
12
|
+
<EmptyState.Info>{__('Loading...')}</EmptyState.Info>
|
13
13
|
</EmptyState>
|
14
14
|
);
|
15
15
|
|
@@ -2,12 +2,14 @@ import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Grid, Button, Icon } from 'patternfly-react';
|
4
4
|
import { noop } from 'foremanReact/common/helpers';
|
5
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
6
|
+
|
5
7
|
import './fileDownload.scss';
|
6
8
|
|
7
9
|
const FileDownload = ({ onClick }) => (
|
8
10
|
<Grid.Col sm={12}>
|
9
11
|
<Button onClick={onClick} className="download-button">
|
10
|
-
Download Report <Icon name="download" />
|
12
|
+
{__('Download Report')} <Icon name="download" />
|
11
13
|
</Button>
|
12
14
|
</Grid.Col>
|
13
15
|
);
|
@@ -15,8 +15,7 @@ const InventoryFilter = ({
|
|
15
15
|
organization,
|
16
16
|
}) => {
|
17
17
|
useEffect(() => {
|
18
|
-
const initialTerm =
|
19
|
-
organization === __(ANY_ORGANIZATION) ? '' : organization;
|
18
|
+
const initialTerm = organization === ANY_ORGANIZATION ? '' : organization;
|
20
19
|
handleFilterChange(initialTerm);
|
21
20
|
}, []);
|
22
21
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
2
|
+
|
1
3
|
export const INVENTORY_FILTER_UPDATE = 'INVENTORY_FILTER_UPDATE';
|
2
4
|
export const INVENTORY_FILTER_CLEAR = 'INVENTORY_FILTER_CLEAR';
|
3
|
-
export const ANY_ORGANIZATION = 'Any Organization';
|
5
|
+
export const ANY_ORGANIZATION = __('Any Organization');
|
@@ -28,7 +28,18 @@ export const PageDescription = () => (
|
|
28
28
|
target="_blank"
|
29
29
|
rel="noopener noreferrer"
|
30
30
|
>
|
31
|
-
About subscription watch
|
31
|
+
{__('About subscription watch')}
|
32
|
+
</a>
|
33
|
+
</p>
|
34
|
+
<p>
|
35
|
+
{__('For more information about Insights and Cloud Connector read')}
|
36
|
+
|
37
|
+
<a
|
38
|
+
href="https://console.redhat.com/security/insights/"
|
39
|
+
target="_blank"
|
40
|
+
rel="noopener noreferrer"
|
41
|
+
>
|
42
|
+
{__('Red Hat Insights Data and Application Security')}
|
32
43
|
</a>
|
33
44
|
</p>
|
34
45
|
</div>
|
@@ -24,5 +24,16 @@ exports[`PageDescription rendering render without Props 1`] = `
|
|
24
24
|
About subscription watch
|
25
25
|
</a>
|
26
26
|
</p>
|
27
|
+
<p>
|
28
|
+
For more information about Insights and Cloud Connector read
|
29
|
+
|
30
|
+
<a
|
31
|
+
href="https://console.redhat.com/security/insights/"
|
32
|
+
rel="noopener noreferrer"
|
33
|
+
target="_blank"
|
34
|
+
>
|
35
|
+
Red Hat Insights Data and Application Security
|
36
|
+
</a>
|
37
|
+
</p>
|
27
38
|
</div>
|
28
39
|
`;
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Toast.js
CHANGED
@@ -20,13 +20,13 @@ const Toast = ({ syncHosts, disconnectHosts }) => {
|
|
20
20
|
<strong>{disconnectHosts}</strong>
|
21
21
|
</p>
|
22
22
|
<p>
|
23
|
-
For more info, please visit the{' '}
|
23
|
+
{__('For more info, please visit the')}{' '}
|
24
24
|
<a
|
25
25
|
href={foremanUrl('/hosts')}
|
26
26
|
target="_blank"
|
27
27
|
rel="noopener noreferrer"
|
28
28
|
>
|
29
|
-
hosts page
|
29
|
+
{__('hosts page')}
|
30
30
|
</a>
|
31
31
|
</p>
|
32
32
|
</span>
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Grid, DonutChart } from 'patternfly-react';
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
5
|
import './statusChart.scss';
|
5
6
|
|
6
7
|
const StatusChart = ({ completed }) => {
|
7
8
|
const donutConfigData = {
|
8
9
|
columns: [
|
9
|
-
['Completed', completed],
|
10
|
-
['Remain', 100 - completed],
|
10
|
+
[__('Completed'), completed],
|
11
|
+
[__('Remain'), 100 - completed],
|
11
12
|
],
|
12
13
|
order: null,
|
13
14
|
};
|
@@ -37,7 +38,7 @@ const StatusChart = ({ completed }) => {
|
|
37
38
|
title={{
|
38
39
|
type: 'percent',
|
39
40
|
primary: `${completed}%`,
|
40
|
-
secondary: 'Completed',
|
41
|
+
secondary: __('Completed'),
|
41
42
|
}}
|
42
43
|
/>
|
43
44
|
</div>
|