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
data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js
CHANGED
|
@@ -1,38 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import thunk from 'redux-thunk';
|
|
6
|
-
import ConnectedInventoryFilter from '../index';
|
|
7
|
-
import { INVENTORY_FILTER_UPDATE } from '../InventoryFilterConstants';
|
|
8
|
-
|
|
9
|
-
jest.mock('foremanReact/Root/Context/ForemanContext');
|
|
10
|
-
|
|
11
|
-
const mockStore = configureMockStore([thunk]);
|
|
2
|
+
import { IntegrationTestHelper } from '@theforeman/test';
|
|
3
|
+
import InventoryFilter from '../index';
|
|
4
|
+
import reducers from '../../../../ForemanRhCloudReducers';
|
|
12
5
|
|
|
13
6
|
describe('InventoryFilter integration test', () => {
|
|
14
|
-
it('
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
render(
|
|
24
|
-
<Provider store={store}>
|
|
25
|
-
<ConnectedInventoryFilter />
|
|
26
|
-
</Provider>
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const input = screen.getByPlaceholderText('Filter..');
|
|
30
|
-
fireEvent.change(input, { target: { value: 'some_new_filter' } });
|
|
31
|
-
|
|
32
|
-
const actions = store.getActions();
|
|
33
|
-
const filterAction = actions.find(
|
|
34
|
-
a => a.type === INVENTORY_FILTER_UPDATE && a.payload.filterTerm === 'some_new_filter'
|
|
7
|
+
it('should flow', async () => {
|
|
8
|
+
const integrationTestHelper = new IntegrationTestHelper(reducers);
|
|
9
|
+
const wrapper = integrationTestHelper.mount(<InventoryFilter />);
|
|
10
|
+
const input = wrapper.find('input[id="inventory_filter_input"]');
|
|
11
|
+
input.simulate('change', { target: { value: 'some_new_filter' } });
|
|
12
|
+
await IntegrationTestHelper.flushAllPromises();
|
|
13
|
+
wrapper.update();
|
|
14
|
+
integrationTestHelper.takeStoreAndLastActionSnapshot(
|
|
15
|
+
'filter have been updated'
|
|
35
16
|
);
|
|
36
|
-
expect(filterAction).toBeTruthy();
|
|
37
17
|
});
|
|
38
18
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
import { handleToggle } from '../AdvancedSettingActions';
|
|
3
|
+
|
|
4
|
+
const fixtures = {
|
|
5
|
+
'should handleToggle': () => handleToggle('autoUploadEnabled', false),
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
describe('AdvancedSetting actions', () =>
|
|
9
|
+
testActionSnapshotWithFixtures(fixtures));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`AdvancedSetting actions should handleToggle 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
Array [
|
|
6
|
+
Object {
|
|
7
|
+
"errorToast": [Function],
|
|
8
|
+
"key": "INVENTORY_SETTINGS",
|
|
9
|
+
"params": Object {
|
|
10
|
+
"setting": "autoUploadEnabled",
|
|
11
|
+
"value": true,
|
|
12
|
+
},
|
|
13
|
+
"type": "post-some-type",
|
|
14
|
+
"url": "/foreman_inventory_upload/setting",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
]
|
|
18
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
import { getSettings, setSetting } from '../InventorySettingsActions';
|
|
3
|
+
|
|
4
|
+
const fixtures = {
|
|
5
|
+
'should getSettings': () => getSettings(),
|
|
6
|
+
'should setSetting hostObfuscation true': () =>
|
|
7
|
+
setSetting({
|
|
8
|
+
setting: 'hostObfuscation',
|
|
9
|
+
value: true,
|
|
10
|
+
}),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('Inventory settings actions', () =>
|
|
14
|
+
testActionSnapshotWithFixtures(fixtures));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Inventory settings actions should getSettings 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"key": "INVENTORY_SETTINGS",
|
|
6
|
+
"type": "get-some-type",
|
|
7
|
+
"url": "/foreman_inventory_upload/settings",
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
exports[`Inventory settings actions should setSetting hostObfuscation true 1`] = `
|
|
12
|
+
Array [
|
|
13
|
+
Array [
|
|
14
|
+
Object {
|
|
15
|
+
"errorToast": [Function],
|
|
16
|
+
"key": "INVENTORY_SETTINGS",
|
|
17
|
+
"params": Object {
|
|
18
|
+
"setting": "hostObfuscation",
|
|
19
|
+
"value": true,
|
|
20
|
+
},
|
|
21
|
+
"type": "post-some-type",
|
|
22
|
+
"url": "/foreman_inventory_upload/setting",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
]
|
|
26
|
+
`;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
|
|
3
3
|
import PageTitle from '../PageTitle';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
jest.mock('foremanReact/common/helpers', () => ({ getDocsURL: () => {} }));
|
|
5
|
+
const fixtures = {
|
|
6
|
+
'render without Props': {},
|
|
7
|
+
};
|
|
9
8
|
|
|
10
9
|
describe('PageTitle', () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
expect(screen.getByText('Red Hat Inventory')).toBeTruthy();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('renders the kebab dropdown', () => {
|
|
17
|
-
const { container } = render(<PageTitle />);
|
|
18
|
-
expect(container.querySelector('.title-dropdown')).toBeTruthy();
|
|
19
|
-
});
|
|
10
|
+
describe('rendering', () =>
|
|
11
|
+
testComponentSnapshotsWithFixtures(PageTitle, fixtures));
|
|
20
12
|
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`PageTitle rendering render without Props 1`] = `
|
|
4
|
+
<Grid
|
|
5
|
+
className="inventory-upload-header-title"
|
|
6
|
+
>
|
|
7
|
+
<GridItem
|
|
8
|
+
span={6}
|
|
9
|
+
>
|
|
10
|
+
<Head>
|
|
11
|
+
<title>
|
|
12
|
+
Red Hat Inventory
|
|
13
|
+
</title>
|
|
14
|
+
</Head>
|
|
15
|
+
<h1>
|
|
16
|
+
Red Hat Inventory
|
|
17
|
+
</h1>
|
|
18
|
+
</GridItem>
|
|
19
|
+
<GridItem
|
|
20
|
+
span={6}
|
|
21
|
+
>
|
|
22
|
+
<Dropdown
|
|
23
|
+
className="title-dropdown"
|
|
24
|
+
dropdownItems={
|
|
25
|
+
Array [
|
|
26
|
+
<DropdownItem
|
|
27
|
+
href="/foreman_tasks/tasks?search=label+%3D+ForemanInventoryUpload%3A%3AAsync%3A%3AHostInventoryReportJob+or+label+%3D+ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateAllReportsJob&page=1"
|
|
28
|
+
ouiaId="tasks-history-button"
|
|
29
|
+
rel="noopener noreferrer"
|
|
30
|
+
target="_blank"
|
|
31
|
+
>
|
|
32
|
+
Actions history
|
|
33
|
+
</DropdownItem>,
|
|
34
|
+
<DropdownItem
|
|
35
|
+
href="/links/manual/?root_url=https%3A%2F%2Fdocs.redhat.com%2Fen%2Fdocumentation%2Fred_hat_lightspeed%2F1-latest%2Fhtml-single%2Fred_hat_lightspeed_remediations_guide%2Findex"
|
|
36
|
+
ouiaId="inventory-documentation-button"
|
|
37
|
+
rel="noopener noreferrer"
|
|
38
|
+
target="_blank"
|
|
39
|
+
>
|
|
40
|
+
Documentation
|
|
41
|
+
</DropdownItem>,
|
|
42
|
+
<DropdownItem
|
|
43
|
+
onClick={[Function]}
|
|
44
|
+
ouiaId="dropdownItem-cloud-ping"
|
|
45
|
+
>
|
|
46
|
+
Connectivity test
|
|
47
|
+
</DropdownItem>,
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
isOpen={false}
|
|
51
|
+
isPlain={true}
|
|
52
|
+
onSelect={[Function]}
|
|
53
|
+
ouiaId="title-dropdown"
|
|
54
|
+
position="right"
|
|
55
|
+
toggle={
|
|
56
|
+
<KebabToggle
|
|
57
|
+
onToggle={[Function]}
|
|
58
|
+
/>
|
|
59
|
+
}
|
|
60
|
+
/>
|
|
61
|
+
<CloudPingModal
|
|
62
|
+
isOpen={false}
|
|
63
|
+
title="Connectivity test"
|
|
64
|
+
toggle={[Function]}
|
|
65
|
+
/>
|
|
66
|
+
</GridItem>
|
|
67
|
+
</Grid>
|
|
68
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
import { configureCloudConnector } from '../CloudConnectorActions';
|
|
3
|
+
|
|
4
|
+
const fixtures = {
|
|
5
|
+
'should configureCloudConnector': () => configureCloudConnector(),
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
describe('CloudConnector button actions', () =>
|
|
9
|
+
testActionSnapshotWithFixtures(fixtures));
|
|
@@ -1,51 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
3
2
|
import { CloudConnectorButton } from '../CloudConnectorButton';
|
|
4
3
|
import { CONNECTOR_STATUS } from '../CloudConnectorConstants';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
const fixtures = {
|
|
6
|
+
'render no cloud connector': {
|
|
7
|
+
status: CONNECTOR_STATUS.NOT_RESOLVED,
|
|
8
|
+
onClick: jest.fn(),
|
|
9
|
+
},
|
|
10
|
+
'render resolved cloud connector': {
|
|
11
|
+
status: CONNECTOR_STATUS.RESOLVED,
|
|
12
|
+
onClick: jest.fn(),
|
|
13
|
+
},
|
|
14
|
+
'render pending connector': {
|
|
15
|
+
jobLink: '/job-link',
|
|
16
|
+
status: CONNECTOR_STATUS.PENDING,
|
|
17
|
+
onClick: jest.fn(),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<CloudConnectorButton
|
|
20
|
-
status={CONNECTOR_STATUS.RESOLVED}
|
|
21
|
-
onClick={jest.fn()}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
expect(screen.getByRole('button', { name: /Reconfigure cloud connector/ })).toBeTruthy();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('renders in-progress button when pending', () => {
|
|
28
|
-
render(
|
|
29
|
-
<CloudConnectorButton
|
|
30
|
-
status={CONNECTOR_STATUS.PENDING}
|
|
31
|
-
onClick={jest.fn()}
|
|
32
|
-
jobLink="/job-link"
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
expect(
|
|
36
|
-
screen.getByText('Cloud Connector is in progress')
|
|
37
|
-
).toBeTruthy();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('calls onClick when configure button is clicked', () => {
|
|
41
|
-
const onClick = jest.fn();
|
|
42
|
-
render(
|
|
43
|
-
<CloudConnectorButton
|
|
44
|
-
status={CONNECTOR_STATUS.NOT_RESOLVED}
|
|
45
|
-
onClick={onClick}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
fireEvent.click(screen.getByRole('button', { name: /Configure cloud connector/ }));
|
|
49
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
21
|
+
describe('CloudConnectorButton', () =>
|
|
22
|
+
testComponentSnapshotsWithFixtures(CloudConnectorButton, fixtures));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`CloudConnector button actions should configureCloudConnector 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"errorToast": [Function],
|
|
6
|
+
"key": "CONFIGURE_CLOUD_CONNECTOR",
|
|
7
|
+
"successToast": [Function],
|
|
8
|
+
"type": "post-some-type",
|
|
9
|
+
"url": "/foreman_inventory_upload/cloud_connector",
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`CloudConnectorButton render no cloud connector 1`] = `
|
|
4
|
+
<Button
|
|
5
|
+
onClick={[MockFunction]}
|
|
6
|
+
ouiaId="button-configure"
|
|
7
|
+
variant="secondary"
|
|
8
|
+
>
|
|
9
|
+
Configure cloud connector
|
|
10
|
+
</Button>
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
exports[`CloudConnectorButton render pending connector 1`] = `
|
|
14
|
+
<Popover
|
|
15
|
+
aria-label="Popover with Link to cloud connector job"
|
|
16
|
+
bodyContent={
|
|
17
|
+
<div>
|
|
18
|
+
Cloud connector setup has started:
|
|
19
|
+
<a
|
|
20
|
+
href="/job-link"
|
|
21
|
+
rel="noopener noreferrer"
|
|
22
|
+
target="_blank"
|
|
23
|
+
>
|
|
24
|
+
view the job in progress
|
|
25
|
+
</a>
|
|
26
|
+
</div>
|
|
27
|
+
}
|
|
28
|
+
closeBtnAriaLabel="Close cloud connector Popover"
|
|
29
|
+
isVisible={false}
|
|
30
|
+
shouldClose={[Function]}
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
className="cloud-connector-pending-button"
|
|
34
|
+
onMouseEnter={[Function]}
|
|
35
|
+
>
|
|
36
|
+
<Button
|
|
37
|
+
isDisabled={true}
|
|
38
|
+
ouiaId="button-in-progress"
|
|
39
|
+
variant="secondary"
|
|
40
|
+
>
|
|
41
|
+
<Spinner
|
|
42
|
+
size="sm"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
Cloud Connector is in progress
|
|
46
|
+
</Button>
|
|
47
|
+
</div>
|
|
48
|
+
</Popover>
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
exports[`CloudConnectorButton render resolved cloud connector 1`] = `
|
|
52
|
+
<Button
|
|
53
|
+
onClick={[MockFunction]}
|
|
54
|
+
ouiaId="button-reconfigure"
|
|
55
|
+
variant="secondary"
|
|
56
|
+
>
|
|
57
|
+
Reconfigure cloud connector
|
|
58
|
+
</Button>
|
|
59
|
+
`;
|
|
@@ -7,8 +7,6 @@ import { getDocsURL } from 'foremanReact/common/helpers';
|
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
8
8
|
import { selectSubscriptionConnectionEnabled } from '../../../InventorySettings/InventorySettingsSelectors';
|
|
9
9
|
|
|
10
|
-
import { getSubscriptionServiceDocsUrl } from '../../../../ForemanInventoryHelpers';
|
|
11
|
-
|
|
12
10
|
export const PageDescription = () => {
|
|
13
11
|
const subscriptionConnectionEnabled = useSelector(
|
|
14
12
|
selectSubscriptionConnectionEnabled
|
|
@@ -82,7 +80,7 @@ export const PageDescription = () => {
|
|
|
82
80
|
{__('For more information about the Subscriptions service, see:')}
|
|
83
81
|
|
|
84
82
|
<a
|
|
85
|
-
href=
|
|
83
|
+
href="https://docs.redhat.com/en/documentation/subscription_central/1-latest/html/getting_started_with_the_subscriptions_service/index"
|
|
86
84
|
target="_blank"
|
|
87
85
|
rel="noopener noreferrer"
|
|
88
86
|
>
|
|
@@ -1,61 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
3
2
|
import { SettingsWarning } from './SettingsWarning';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const fixtures = {
|
|
5
|
+
'with 2 alerts': {
|
|
6
|
+
autoUpload: false,
|
|
7
|
+
hostObfuscation: true,
|
|
8
|
+
isCloudConnector: true,
|
|
9
|
+
},
|
|
10
|
+
'with isCloudConnector false': {
|
|
11
|
+
autoUpload: true,
|
|
12
|
+
hostObfuscation: true,
|
|
13
|
+
isCloudConnector: false,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<SettingsWarning
|
|
16
|
-
autoUpload
|
|
17
|
-
hostObfuscation={false}
|
|
18
|
-
isCloudConnector
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
expect(screen.queryByRole('alert')).toBeNull();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('renders upload warning when autoUpload is disabled', () => {
|
|
25
|
-
render(
|
|
26
|
-
<SettingsWarning
|
|
27
|
-
autoUpload={false}
|
|
28
|
-
hostObfuscation={false}
|
|
29
|
-
isCloudConnector
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
expect(
|
|
33
|
-
screen.getByText(/inventory auto-upload is disabled/)
|
|
34
|
-
).toBeTruthy();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('renders obfuscation warning when hostObfuscation is enabled', () => {
|
|
38
|
-
render(
|
|
39
|
-
<SettingsWarning autoUpload hostObfuscation isCloudConnector />
|
|
40
|
-
);
|
|
41
|
-
expect(
|
|
42
|
-
screen.getByText(/obfuscating host names setting is enabled/)
|
|
43
|
-
).toBeTruthy();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('renders both warnings when both conditions met', () => {
|
|
47
|
-
render(
|
|
48
|
-
<SettingsWarning
|
|
49
|
-
autoUpload={false}
|
|
50
|
-
hostObfuscation
|
|
51
|
-
isCloudConnector
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
expect(
|
|
55
|
-
screen.getByText(/inventory auto-upload is disabled/)
|
|
56
|
-
).toBeTruthy();
|
|
57
|
-
expect(
|
|
58
|
-
screen.getByText(/obfuscating host names setting is enabled/)
|
|
59
|
-
).toBeTruthy();
|
|
60
|
-
});
|
|
61
|
-
});
|
|
17
|
+
describe('SettingsWarning', () =>
|
|
18
|
+
testComponentSnapshotsWithFixtures(SettingsWarning, fixtures));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`SettingsWarning with 2 alerts 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
className="settings-alert"
|
|
6
|
+
>
|
|
7
|
+
<Alert
|
|
8
|
+
actionClose={
|
|
9
|
+
<AlertActionCloseButton
|
|
10
|
+
onClose={[Function]}
|
|
11
|
+
/>
|
|
12
|
+
}
|
|
13
|
+
key="auto-upload"
|
|
14
|
+
ouiaId="auto-upload"
|
|
15
|
+
title="Cloud Connector has been configured however the inventory auto-upload is disabled, it's recommended to enable it"
|
|
16
|
+
variant="warning"
|
|
17
|
+
/>
|
|
18
|
+
<Alert
|
|
19
|
+
actionClose={
|
|
20
|
+
<AlertActionCloseButton
|
|
21
|
+
onClose={[Function]}
|
|
22
|
+
/>
|
|
23
|
+
}
|
|
24
|
+
key="obfuscating-host"
|
|
25
|
+
ouiaId="obfuscating-host"
|
|
26
|
+
title="Cloud Connector has been configured however obfuscating host names setting is enabled, it's recommended to disable it"
|
|
27
|
+
variant="warning"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
exports[`SettingsWarning with isCloudConnector false 1`] = `""`;
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js
CHANGED
|
@@ -39,20 +39,14 @@ export const setupInventorySyncTaskPolling = (id, dispatch) =>
|
|
|
39
39
|
key: INVENTORY_SYNC_TASK_UPDATE,
|
|
40
40
|
onTaskSuccess: ({
|
|
41
41
|
output: {
|
|
42
|
-
host_statuses: { sync, disconnect
|
|
42
|
+
host_statuses: { sync, disconnect },
|
|
43
43
|
},
|
|
44
44
|
}) =>
|
|
45
45
|
dispatch(
|
|
46
46
|
addToast({
|
|
47
47
|
sticky: true,
|
|
48
48
|
type: 'success',
|
|
49
|
-
message:
|
|
50
|
-
<Toast
|
|
51
|
-
syncHosts={sync}
|
|
52
|
-
disconnectHosts={disconnect}
|
|
53
|
-
userOmittedHosts={userOmitted}
|
|
54
|
-
/>
|
|
55
|
-
),
|
|
49
|
+
message: <Toast syncHosts={sync} disconnectHosts={disconnect} />,
|
|
56
50
|
})
|
|
57
51
|
),
|
|
58
52
|
dispatch,
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import SyncButton from '../SyncButton';
|
|
4
|
-
|
|
5
|
-
describe('SyncButton', () => {
|
|
6
|
-
it('renders the sync button text', () => {
|
|
7
|
-
render(<SyncButton handleSync={jest.fn()} />);
|
|
8
|
-
expect(screen.getByRole('button', { name: /Sync all inventory status/ })).toBeTruthy();
|
|
9
|
-
});
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
import { noop } from 'foremanReact/common/helpers';
|
|
10
3
|
|
|
11
|
-
|
|
12
|
-
const handleSync = jest.fn();
|
|
13
|
-
render(<SyncButton handleSync={handleSync} />);
|
|
14
|
-
fireEvent.click(screen.getByRole('button'));
|
|
15
|
-
expect(handleSync).toHaveBeenCalledTimes(1);
|
|
16
|
-
});
|
|
4
|
+
import SyncButton from '../SyncButton';
|
|
17
5
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
6
|
+
const fixtures = {
|
|
7
|
+
'render with Props': { handleSync: noop },
|
|
8
|
+
};
|
|
22
9
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
10
|
+
describe('SyncButton', () => {
|
|
11
|
+
describe('rendering', () =>
|
|
12
|
+
testComponentSnapshotsWithFixtures(SyncButton, fixtures));
|
|
27
13
|
});
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
|
1
2
|
import { selectTaskStatus } from '../SyncButtonSelectors';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
+
const state = {
|
|
4
5
|
API: {
|
|
5
6
|
INVENTORY_SYNC_TASK_UPDATE: {
|
|
6
7
|
response: {
|
|
7
|
-
|
|
8
|
+
endedAt: '2021-03-08T14:27:30.718+02:00',
|
|
9
|
+
output: {
|
|
10
|
+
host_statuses: {
|
|
11
|
+
sync: 0,
|
|
12
|
+
disconnect: 2,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
result: 'pending',
|
|
8
16
|
},
|
|
17
|
+
status: 'RESOLVED',
|
|
9
18
|
},
|
|
10
19
|
},
|
|
11
|
-
}
|
|
20
|
+
};
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
22
|
+
const fixtures = {
|
|
23
|
+
'should return InventorySync status': () => selectTaskStatus(state),
|
|
24
|
+
};
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('returns null when result is not a string', () => {
|
|
23
|
-
expect(selectTaskStatus(buildState(null))).toBeNull();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('returns null when result is undefined', () => {
|
|
27
|
-
expect(selectTaskStatus(buildState(undefined))).toBeNull();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
26
|
+
describe('SyncButton selectors', () =>
|
|
27
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`SyncButton rendering render with Props 1`] = `
|
|
4
|
+
<Fragment>
|
|
5
|
+
<Button
|
|
6
|
+
className="sync_button"
|
|
7
|
+
isDisabled={false}
|
|
8
|
+
onClick={[Function]}
|
|
9
|
+
ouiaId="sync-button"
|
|
10
|
+
variant="secondary"
|
|
11
|
+
>
|
|
12
|
+
Sync all inventory status
|
|
13
|
+
</Button>
|
|
14
|
+
</Fragment>
|
|
15
|
+
`;
|