foreman_rh_cloud 13.2.11 → 14.0.1
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/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +61 -61
- data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +68 -68
- data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +9 -9
- data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +60 -60
- data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +60 -60
- data/app/controllers/concerns/insights_cloud/package_profile_upload_extensions.rb +0 -9
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +10 -13
- data/app/controllers/insights_cloud/ui_requests_controller.rb +7 -3
- data/app/models/concerns/rh_cloud_host.rb +4 -71
- data/app/models/insights_client_report_status.rb +1 -9
- data/app/models/inventory_sync/inventory_status.rb +4 -16
- data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +5 -12
- data/app/services/foreman_rh_cloud/url_remediations_retriever.rb +5 -19
- data/lib/foreman_inventory_upload/async/create_missing_insights_facets.rb +2 -8
- data/lib/foreman_inventory_upload/async/upload_report_direct_job.rb +0 -2
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +4 -34
- data/lib/foreman_inventory_upload/generators/queries.rb +1 -1
- data/lib/foreman_inventory_upload/generators/slice.rb +1 -1
- data/lib/foreman_inventory_upload.rb +1 -8
- data/lib/foreman_rh_cloud/engine.rb +0 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/foreman_rh_cloud.rb +9 -36
- data/lib/insights_cloud/async/insights_generate_notifications.rb +1 -10
- data/lib/insights_cloud/async/vmaas_reposcan_sync.rb +8 -23
- data/lib/inventory_sync/async/inventory_full_sync.rb +3 -39
- data/lib/inventory_sync/async/inventory_self_host_sync.rb +2 -12
- data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/fr/foreman_rh_cloud.edit.po +1032 -0
- data/locale/fr/foreman_rh_cloud.po +65 -66
- data/locale/fr/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ja/foreman_rh_cloud.edit.po +1026 -0
- data/locale/ja/foreman_rh_cloud.po +70 -72
- data/locale/ja/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ka/foreman_rh_cloud.edit.po +1025 -0
- data/locale/ka/foreman_rh_cloud.po +10 -11
- data/locale/ka/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ko/foreman_rh_cloud.edit.po +1029 -0
- data/locale/ko/foreman_rh_cloud.po +63 -64
- data/locale/ko/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/zh_CN/foreman_rh_cloud.edit.po +1031 -0
- data/locale/zh_CN/foreman_rh_cloud.po +64 -65
- data/locale/zh_CN/foreman_rh_cloud.po.time_stamp +0 -0
- data/package.json +1 -1
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +3 -57
- data/test/controllers/insights_cloud/ui_requests_controller_test.rb +2 -16
- data/test/jobs/insights_client_status_aging_test.rb +0 -40
- data/test/jobs/inventory_full_sync_test.rb +4 -219
- data/test/jobs/inventory_hosts_sync_test.rb +5 -7
- data/test/jobs/inventory_self_host_sync_test.rb +1 -10
- data/test/jobs/upload_report_direct_job_test.rb +0 -29
- data/test/models/insights_client_report_status_test.rb +0 -109
- data/test/unit/archived_report_generator_test.rb +1 -2
- data/test/unit/fact_helpers_test.rb +0 -16
- data/test/unit/foreman_rh_cloud_self_host_test.rb +2 -50
- data/test/unit/insights_facet_test.rb +0 -5
- data/test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb +25 -80
- data/test/unit/metadata_generator_test.rb +1 -24
- data/test/unit/rh_cloud_host_test.rb +0 -282
- data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +1 -1
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +1 -1
- data/test/unit/services/foreman_rh_cloud/url_remediations_retriever_test.rb +5 -82
- data/test/unit/slice_generator_test.rb +2 -21
- data/webpack/CVEsHostDetailsTab/CVEsHostDetailsTab.js +3 -30
- data/webpack/CVEsHostDetailsTab/__tests__/CVEsHostDetailsTab.test.js +10 -112
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/EmptyResults.test.js +9 -10
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/__snapshots__/EmptyResults.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +9 -13
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +9 -20
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +8 -31
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +47 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +10 -26
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +59 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +9 -33
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +34 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +35 -55
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +25 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +49 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +86 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +75 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +46 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +9 -13
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +15 -12
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterActions.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +28 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterSelectors.test.js +21 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilter.test.js.snap +21 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterActions.test.js.snap +17 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterReducer.test.js.snap +19 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterSelectors.test.js.snap +9 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/integration.test.js.snap +43 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +12 -32
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/AdvancedSettingActions.test.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/__snapshots__/AdvancedSettingActions.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettingsActions.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettingsActions.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageTitle.test.js +7 -15
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +68 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorActions.test.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorButton.test.js +18 -47
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorActions.test.js.snap +11 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorButton.test.js.snap +59 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +1 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.test.js +15 -58
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/__snapshots__/SettingsWarning.test.js.snap +32 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js +2 -8
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +9 -23
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButtonSelectors.test.js +17 -19
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButton.test.js.snap +15 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButtonSelectors.test.js.snap +3 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/integrations.test.js.snap +57 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/integrations.test.js +36 -25
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Toast.js +17 -43
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +8 -28
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +23 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +8 -25
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +74 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +9 -11
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +9 -11
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +12 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +1 -8
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +12 -33
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +96 -0
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +8 -36
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryUpload.test.js +10 -0
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +5 -0
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryUpload.test.js.snap +14 -0
- data/webpack/ForemanRhCloudHelpers.js +0 -22
- data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +15 -71
- metadata +57 -18
- data/app/controllers/concerns/insights_cloud/candlepin_proxies_extensions.rb +0 -23
- data/test/controllers/insights_cloud/candlepin_proxies_extensions_test.rb +0 -70
- data/test/jobs/insights_generate_notifications_test.rb +0 -26
- data/test/models/inventory_sync/inventory_status_test.rb +0 -85
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/__tests__/Toast.test.js +0 -82
- data/webpack/InsightsHostDetailsTab/__tests__/NewHostDetailsTab.test.js +0 -266
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`SyncButton integration test Successful task was triggered on the server resulting in an info toast and polling on the task: handleSync was called 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
Array [
|
|
6
|
+
Object {
|
|
7
|
+
"payload": Object {
|
|
8
|
+
"message": Object {
|
|
9
|
+
"message": <Toast
|
|
10
|
+
disconnectHosts={2}
|
|
11
|
+
syncHosts={0}
|
|
12
|
+
/>,
|
|
13
|
+
"sticky": true,
|
|
14
|
+
"type": "success",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
"type": "TOASTS_ADD",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
Array [
|
|
21
|
+
Object {
|
|
22
|
+
"errorToast": [Function],
|
|
23
|
+
"interval": 3000,
|
|
24
|
+
"type": "API_GET",
|
|
25
|
+
"url": "/foreman_tasks/api/tasks/1/details?include_permissions",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
Array [
|
|
29
|
+
Object {
|
|
30
|
+
"payload": Object {
|
|
31
|
+
"message": Object {
|
|
32
|
+
"message": <span>
|
|
33
|
+
Inventory sync has started:
|
|
34
|
+
<br />
|
|
35
|
+
<a
|
|
36
|
+
href="/foreman_tasks/tasks/1"
|
|
37
|
+
rel="noopener noreferrer"
|
|
38
|
+
target="_blank"
|
|
39
|
+
>
|
|
40
|
+
view the task page for more details
|
|
41
|
+
</a>
|
|
42
|
+
</span>,
|
|
43
|
+
"type": "info",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
"type": "TOASTS_ADD",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
Array [
|
|
50
|
+
Object {
|
|
51
|
+
"errorToast": [Function],
|
|
52
|
+
"type": "API_POST",
|
|
53
|
+
"url": "/foreman_inventory_upload/tasks",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
]
|
|
57
|
+
`;
|
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Provider } from 'react-redux';
|
|
4
|
-
import configureMockStore from 'redux-mock-store';
|
|
5
|
-
import thunk from 'redux-thunk';
|
|
2
|
+
import { IntegrationTestHelper } from '@theforeman/test';
|
|
6
3
|
import * as API from 'foremanReact/redux/API';
|
|
7
|
-
import
|
|
4
|
+
import { noop } from 'foremanReact/common/helpers';
|
|
5
|
+
import SyncButton from '../index';
|
|
8
6
|
import { successResponse } from './SyncButtonFixtures';
|
|
9
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
INVENTORY_SYNC,
|
|
9
|
+
INVENTORY_SYNC_TASK_UPDATE,
|
|
10
|
+
} from '../SyncButtonConstants';
|
|
10
11
|
|
|
11
12
|
jest.spyOn(API, 'post');
|
|
12
|
-
|
|
13
|
-
const mockStore = configureMockStore([thunk]);
|
|
13
|
+
jest.spyOn(API, 'get');
|
|
14
14
|
|
|
15
15
|
describe('SyncButton integration test', () => {
|
|
16
|
-
it('
|
|
17
|
-
API.post.mockImplementation(({ handleSuccess, key, ...action }) => {
|
|
18
|
-
if (key === INVENTORY_SYNC
|
|
16
|
+
it('Successful task was triggered on the server resulting in an info toast and polling on the task', async () => {
|
|
17
|
+
API.post.mockImplementation(({ handleSuccess = noop, key, ...action }) => {
|
|
18
|
+
if (key === INVENTORY_SYNC) {
|
|
19
19
|
handleSuccess(successResponse);
|
|
20
20
|
}
|
|
21
21
|
return { type: 'API_POST', ...action };
|
|
22
22
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
API.get.mockImplementation(({ handleSuccess = noop, key, ...action }) => {
|
|
24
|
+
if (key === INVENTORY_SYNC_TASK_UPDATE) {
|
|
25
|
+
handleSuccess(
|
|
26
|
+
{
|
|
27
|
+
data: {
|
|
28
|
+
endedAt: '2021-03-22T15:59:02.468+02:00',
|
|
29
|
+
output: {
|
|
30
|
+
host_statuses: {
|
|
31
|
+
sync: 0,
|
|
32
|
+
disconnect: 2,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
result: 'success',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
jest.fn
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return { type: 'API_GET', ...action };
|
|
26
42
|
});
|
|
27
43
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
fireEvent.click(screen.getByRole('button'));
|
|
35
|
-
|
|
36
|
-
const actions = store.getActions();
|
|
37
|
-
const syncAction = actions.find(a => a.type === 'API_POST');
|
|
38
|
-
expect(syncAction).toBeTruthy();
|
|
44
|
+
const integrationTestHelper = new IntegrationTestHelper();
|
|
45
|
+
const wrapper = integrationTestHelper.mount(<SyncButton />);
|
|
46
|
+
const instance = wrapper.find('SyncButton').instance();
|
|
47
|
+
instance.props.handleSync();
|
|
48
|
+
await IntegrationTestHelper.flushAllPromises();
|
|
49
|
+
integrationTestHelper.takeActionsSnapshot('handleSync was called');
|
|
39
50
|
});
|
|
40
51
|
});
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Toast.js
CHANGED
|
@@ -1,55 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Link } from 'react-router-dom';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import { translate as __ } from 'foremanReact/common/I18n';
|
|
4
|
+
import { foremanUrl } from '../../../../../../ForemanRhCloudHelpers';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const DISCONNECT = 'disconnect';
|
|
9
|
-
const SYNC = 'sync';
|
|
10
|
-
const USER_OMITTED = 'user_omitted';
|
|
11
|
-
const HostsWithStatusLink = ({ statusName, children }) => (
|
|
12
|
-
<Link to={statusSearchParams(statusName)}>{children}</Link>
|
|
13
|
-
);
|
|
14
|
-
HostsWithStatusLink.propTypes = {
|
|
15
|
-
statusName: PropTypes.string.isRequired,
|
|
16
|
-
children: PropTypes.node.isRequired,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const Toast = ({ syncHosts, disconnectHosts, userOmittedHosts }) => {
|
|
20
|
-
const totalHosts = syncHosts + disconnectHosts + userOmittedHosts;
|
|
6
|
+
const Toast = ({ syncHosts, disconnectHosts }) => {
|
|
7
|
+
const totalHosts = syncHosts + disconnectHosts;
|
|
21
8
|
return (
|
|
22
9
|
<span>
|
|
23
10
|
<p>
|
|
24
|
-
{__('
|
|
25
|
-
<
|
|
26
|
-
{totalHosts}
|
|
27
|
-
</Link>
|
|
11
|
+
{__('Hosts with subscription in organization: ')}
|
|
12
|
+
<strong>{totalHosts}</strong>
|
|
28
13
|
</p>
|
|
29
14
|
<p>
|
|
30
|
-
{__('
|
|
31
|
-
<
|
|
15
|
+
{__('Successfully synced hosts: ')}
|
|
16
|
+
<strong>{syncHosts}</strong>
|
|
32
17
|
</p>
|
|
33
18
|
<p>
|
|
34
|
-
{__('
|
|
35
|
-
<
|
|
36
|
-
{disconnectHosts}
|
|
37
|
-
</HostsWithStatusLink>
|
|
19
|
+
{__('Disconnected hosts: ')}
|
|
20
|
+
<strong>{disconnectHosts}</strong>
|
|
38
21
|
</p>
|
|
39
|
-
{!!userOmittedHosts && (
|
|
40
|
-
<p>
|
|
41
|
-
{__(
|
|
42
|
-
'Excluded from upload to console.redhat.com Inventory service because host_registration_insights_inventory parameter value is false: '
|
|
43
|
-
)}
|
|
44
|
-
<HostsWithStatusLink statusName={USER_OMITTED}>
|
|
45
|
-
{userOmittedHosts}
|
|
46
|
-
</HostsWithStatusLink>
|
|
47
|
-
</p>
|
|
48
|
-
)}
|
|
49
22
|
<p>
|
|
50
|
-
{__(
|
|
51
|
-
|
|
52
|
-
|
|
23
|
+
{__('For more info, please visit the')}{' '}
|
|
24
|
+
<a
|
|
25
|
+
href={foremanUrl('/hosts')}
|
|
26
|
+
target="_blank"
|
|
27
|
+
rel="noopener noreferrer"
|
|
28
|
+
>
|
|
29
|
+
{__('hosts page')}
|
|
30
|
+
</a>
|
|
53
31
|
</p>
|
|
54
32
|
</span>
|
|
55
33
|
);
|
|
@@ -58,10 +36,6 @@ const Toast = ({ syncHosts, disconnectHosts, userOmittedHosts }) => {
|
|
|
58
36
|
Toast.propTypes = {
|
|
59
37
|
syncHosts: PropTypes.number.isRequired,
|
|
60
38
|
disconnectHosts: PropTypes.number.isRequired,
|
|
61
|
-
userOmittedHosts: PropTypes.number,
|
|
62
|
-
};
|
|
63
|
-
Toast.defaultProps = {
|
|
64
|
-
userOmittedHosts: 0,
|
|
65
39
|
};
|
|
66
40
|
|
|
67
41
|
export default Toast;
|
|
@@ -1,33 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { IntlProvider } from 'react-intl';
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
|
|
4
3
|
import ScheduledRun from '../ScheduledRun';
|
|
4
|
+
import { props } from '../ScheduledRun.fixtures';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
render
|
|
6
|
+
const fixtures = {
|
|
7
|
+
'render with Props': props,
|
|
8
|
+
};
|
|
8
9
|
|
|
9
10
|
describe('ScheduledRun', () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<ScheduledRun date="2019-08-21T16:14:16.520+03:00" autoUploadEnabled />
|
|
13
|
-
);
|
|
14
|
-
expect(screen.getByText(/Next run:/)).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('renders nothing when autoUploadEnabled is false', () => {
|
|
18
|
-
renderWithIntl(
|
|
19
|
-
<ScheduledRun
|
|
20
|
-
date="2019-08-21T16:14:16.520+03:00"
|
|
21
|
-
autoUploadEnabled={false}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
expect(screen.queryByText(/Next run:/)).toBeNull();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('renders nothing when date is null', () => {
|
|
28
|
-
renderWithIntl(
|
|
29
|
-
<ScheduledRun date={null} autoUploadEnabled />
|
|
30
|
-
);
|
|
31
|
-
expect(screen.queryByText(/Next run:/)).toBeNull();
|
|
32
|
-
});
|
|
11
|
+
describe('rendering', () =>
|
|
12
|
+
testComponentSnapshotsWithFixtures(ScheduledRun, fixtures));
|
|
33
13
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`ScheduledRun rendering render with Props 1`] = `
|
|
4
|
+
<Col
|
|
5
|
+
bsClass="col"
|
|
6
|
+
className="scheduled_run"
|
|
7
|
+
componentClass="div"
|
|
8
|
+
sm={12}
|
|
9
|
+
>
|
|
10
|
+
<p>
|
|
11
|
+
<Icon
|
|
12
|
+
name="calendar"
|
|
13
|
+
type="fa"
|
|
14
|
+
/>
|
|
15
|
+
Next run:
|
|
16
|
+
<FormattedRelative
|
|
17
|
+
updateInterval={10000}
|
|
18
|
+
value="2019-08-21T16:14:16.520+03:00"
|
|
19
|
+
/>
|
|
20
|
+
.
|
|
21
|
+
</p>
|
|
22
|
+
</Col>
|
|
23
|
+
`;
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
|
|
3
3
|
import StatusChart from '../StatusChart';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<span>{title?.primary}</span>
|
|
10
|
-
<span>{title?.secondary}</span>
|
|
11
|
-
</div>
|
|
12
|
-
),
|
|
13
|
-
}));
|
|
5
|
+
const fixtures = {
|
|
6
|
+
'render without Props': {},
|
|
7
|
+
/** fixtures, props for the component */
|
|
8
|
+
};
|
|
14
9
|
|
|
15
10
|
describe('StatusChart', () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
expect(container.querySelector('.status-chart')).toBeTruthy();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('passes the completed percentage to the chart', () => {
|
|
22
|
-
const { getByText } = render(<StatusChart completed={75} />);
|
|
23
|
-
expect(getByText('75%')).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('shows Completed label', () => {
|
|
27
|
-
const { getByText } = render(<StatusChart completed={50} />);
|
|
28
|
-
expect(getByText('Completed')).toBeTruthy();
|
|
29
|
-
});
|
|
11
|
+
describe('rendering', () =>
|
|
12
|
+
testComponentSnapshotsWithFixtures(StatusChart, fixtures));
|
|
30
13
|
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`StatusChart rendering render without Props 1`] = `
|
|
4
|
+
<Col
|
|
5
|
+
bsClass="col"
|
|
6
|
+
componentClass="div"
|
|
7
|
+
sm={4}
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
className="status-chart"
|
|
11
|
+
>
|
|
12
|
+
<DonutChart
|
|
13
|
+
className="donut-chart-pf"
|
|
14
|
+
color={
|
|
15
|
+
Object {
|
|
16
|
+
"pattern": Array [
|
|
17
|
+
"#0088ce",
|
|
18
|
+
"#d1d1d1",
|
|
19
|
+
],
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
data={
|
|
23
|
+
Object {
|
|
24
|
+
"columns": Array [
|
|
25
|
+
Array [
|
|
26
|
+
"Completed",
|
|
27
|
+
0,
|
|
28
|
+
],
|
|
29
|
+
Array [
|
|
30
|
+
"Remain",
|
|
31
|
+
100,
|
|
32
|
+
],
|
|
33
|
+
],
|
|
34
|
+
"order": null,
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
donut={
|
|
38
|
+
Object {
|
|
39
|
+
"label": Object {
|
|
40
|
+
"show": false,
|
|
41
|
+
},
|
|
42
|
+
"title": undefined,
|
|
43
|
+
"width": 11,
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
id="donut-chart-1"
|
|
47
|
+
legend={
|
|
48
|
+
Object {
|
|
49
|
+
"show": false,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
size={
|
|
53
|
+
Object {
|
|
54
|
+
"height": 210,
|
|
55
|
+
"width": 210,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
title={
|
|
59
|
+
Object {
|
|
60
|
+
"primary": "0%",
|
|
61
|
+
"secondary": "Completed",
|
|
62
|
+
"type": "percent",
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
tooltip={
|
|
66
|
+
Object {
|
|
67
|
+
"contents": [Function],
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
type="donut"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</Col>
|
|
74
|
+
`;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
|
|
3
3
|
import TabContainer from '../TabContainer';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
5
|
+
const fixtures = {
|
|
6
|
+
'render without Props': {},
|
|
7
|
+
/** fixtures, props for the component */
|
|
8
|
+
};
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
10
|
+
describe('TabContainer', () => {
|
|
11
|
+
describe('rendering', () =>
|
|
12
|
+
testComponentSnapshotsWithFixtures(TabContainer, fixtures));
|
|
15
13
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`TabContainer rendering render without Props 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
className=""
|
|
6
|
+
>
|
|
7
|
+
<Grid
|
|
8
|
+
bsClass="container"
|
|
9
|
+
componentClass="div"
|
|
10
|
+
fluid={false}
|
|
11
|
+
>
|
|
12
|
+
<Col
|
|
13
|
+
bsClass="col"
|
|
14
|
+
componentClass="div"
|
|
15
|
+
/>
|
|
16
|
+
</Grid>
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
|
|
3
3
|
import TabFooter from '../TabFooter';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
5
|
+
const fixtures = {
|
|
6
|
+
'render without Props': {},
|
|
7
|
+
/** fixtures, props for the component */
|
|
8
|
+
};
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
10
|
+
describe('TabFooter', () => {
|
|
11
|
+
describe('rendering', () =>
|
|
12
|
+
testComponentSnapshotsWithFixtures(TabFooter, fixtures));
|
|
15
13
|
});
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import URI from 'urijs';
|
|
2
|
-
import { getDocsURL } from 'foremanReact/common/helpers';
|
|
3
2
|
import { foremanUrl } from '../ForemanRhCloudHelpers';
|
|
4
3
|
|
|
5
4
|
export const inventoryUrl = path =>
|
|
6
5
|
foremanUrl(`/foreman_inventory_upload/${path}`);
|
|
7
6
|
|
|
8
7
|
export const getInventoryDocsUrl = () =>
|
|
9
|
-
getDocsURL(
|
|
10
|
-
'Managing_Hosts',
|
|
11
|
-
'configuring-foreman-server-for-cloud-connection'
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
export const getSubscriptionServiceDocsUrl = () =>
|
|
15
8
|
foremanUrl(
|
|
16
9
|
`/links/manual/?root_url=${URI.encode(
|
|
17
|
-
'https://docs.redhat.com/en/documentation/
|
|
10
|
+
'https://docs.redhat.com/en/documentation/red_hat_lightspeed/1-latest/html-single/red_hat_lightspeed_remediations_guide/index'
|
|
18
11
|
)}`
|
|
19
12
|
);
|
|
20
13
|
|
|
@@ -1,38 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import InventoryAutoUpload from '../InventoryAutoUpload';
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
import { noop } from 'foremanReact/common/helpers';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
'../../../Components/InventorySettings/InventorySettings',
|
|
7
|
-
() => () => <div data-testid="inventory-settings">InventorySettings</div>
|
|
8
|
-
);
|
|
4
|
+
import InventoryAutoUpload from '../InventoryAutoUpload';
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const fixtures = {
|
|
7
|
+
'render with props': {
|
|
12
8
|
autoUploadEnabled: true,
|
|
13
|
-
setSetting:
|
|
14
|
-
getSettings:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
it('renders the heading', () => {
|
|
19
|
-
render(<InventoryAutoUpload {...buildProps()} />);
|
|
20
|
-
expect(screen.getByText('Red Hat Cloud Inventory')).toBeTruthy();
|
|
21
|
-
});
|
|
9
|
+
setSetting: noop,
|
|
10
|
+
getSettings: noop,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('renders the advanced settings button', () => {
|
|
29
|
-
render(<InventoryAutoUpload {...buildProps()} />);
|
|
30
|
-
expect(screen.getByRole('button', { name: /Show Advanced Settings/ })).toBeTruthy();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('calls getSettings on mount', () => {
|
|
34
|
-
const props = buildProps();
|
|
35
|
-
render(<InventoryAutoUpload {...props} />);
|
|
36
|
-
expect(props.getSettings).toHaveBeenCalled();
|
|
37
|
-
});
|
|
14
|
+
describe('InventoryAutoUpload', () => {
|
|
15
|
+
describe('rendering', () =>
|
|
16
|
+
testComponentSnapshotsWithFixtures(InventoryAutoUpload, fixtures));
|
|
38
17
|
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`InventoryAutoUpload rendering render with props 1`] = `
|
|
4
|
+
<FormGroup
|
|
5
|
+
bsClass="form-group"
|
|
6
|
+
>
|
|
7
|
+
<Grid
|
|
8
|
+
bsClass="container"
|
|
9
|
+
componentClass="div"
|
|
10
|
+
fluid={false}
|
|
11
|
+
>
|
|
12
|
+
<h3>
|
|
13
|
+
Red Hat Cloud Inventory
|
|
14
|
+
</h3>
|
|
15
|
+
<hr />
|
|
16
|
+
<Row
|
|
17
|
+
bsClass="row"
|
|
18
|
+
componentClass="div"
|
|
19
|
+
>
|
|
20
|
+
<Switcher
|
|
21
|
+
SwitchCol={2}
|
|
22
|
+
id="auto-upload"
|
|
23
|
+
isChecked={true}
|
|
24
|
+
label="Inventory Auto Upload"
|
|
25
|
+
labelCol={5}
|
|
26
|
+
onChange={[Function]}
|
|
27
|
+
tooltip="Enable automatic upload of your hosts inventory to the Red Hat cloud"
|
|
28
|
+
/>
|
|
29
|
+
<Col
|
|
30
|
+
bsClass="col"
|
|
31
|
+
componentClass="div"
|
|
32
|
+
sm={5}
|
|
33
|
+
>
|
|
34
|
+
<Popover
|
|
35
|
+
bodyContent={<InventorySettings />}
|
|
36
|
+
headerContent={
|
|
37
|
+
<strong>
|
|
38
|
+
Advanced Inventory Settings
|
|
39
|
+
</strong>
|
|
40
|
+
}
|
|
41
|
+
position="right"
|
|
42
|
+
>
|
|
43
|
+
<Button
|
|
44
|
+
ouiaId="button-advanced-settings"
|
|
45
|
+
style={
|
|
46
|
+
Object {
|
|
47
|
+
"fontSize": "small",
|
|
48
|
+
"marginTop": "-4px",
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
variant="secondary"
|
|
52
|
+
>
|
|
53
|
+
Show Advanced Settings
|
|
54
|
+
|
|
55
|
+
<CaretRightIcon />
|
|
56
|
+
</Button>
|
|
57
|
+
</Popover>
|
|
58
|
+
</Col>
|
|
59
|
+
</Row>
|
|
60
|
+
<br />
|
|
61
|
+
<Row
|
|
62
|
+
bsClass="row"
|
|
63
|
+
componentClass="div"
|
|
64
|
+
>
|
|
65
|
+
<Col
|
|
66
|
+
bsClass="col"
|
|
67
|
+
componentClass="div"
|
|
68
|
+
sm={12}
|
|
69
|
+
>
|
|
70
|
+
<Text
|
|
71
|
+
component="p"
|
|
72
|
+
ouiaId="text-more-details"
|
|
73
|
+
>
|
|
74
|
+
<InfoAltIcon />
|
|
75
|
+
|
|
76
|
+
More details can be found in
|
|
77
|
+
|
|
78
|
+
<Text
|
|
79
|
+
component="a"
|
|
80
|
+
href="/foreman_rh_cloud/inventory_upload"
|
|
81
|
+
ouiaId="text-details-link"
|
|
82
|
+
rel="noopener noreferrer"
|
|
83
|
+
target="_blank"
|
|
84
|
+
>
|
|
85
|
+
<strong>
|
|
86
|
+
Configure
|
|
87
|
+
>
|
|
88
|
+
Inventory Upload
|
|
89
|
+
</strong>
|
|
90
|
+
</Text>
|
|
91
|
+
</Text>
|
|
92
|
+
</Col>
|
|
93
|
+
</Row>
|
|
94
|
+
</Grid>
|
|
95
|
+
</FormGroup>
|
|
96
|
+
`;
|