foreman_rh_cloud 14.1.2 → 14.2.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/services/foreman_rh_cloud/insights_api_forwarder.rb +157 -5
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +26 -4
- data/lib/foreman_inventory_upload.rb +8 -1
- data/lib/foreman_rh_cloud/plugin.rb +16 -5
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/foreman_rh_cloud.rb +36 -9
- data/lib/insights_cloud/async/insights_generate_notifications.rb +10 -1
- data/lib/inventory_sync/async/inventory_self_host_sync.rb +12 -2
- data/package.json +1 -1
- data/test/jobs/insights_generate_notifications_test.rb +26 -0
- data/test/jobs/inventory_self_host_sync_test.rb +9 -0
- data/test/unit/foreman_rh_cloud_self_host_test.rb +50 -2
- data/test/unit/metadata_generator_test.rb +24 -1
- data/test/unit/services/foreman_rh_cloud/insights_api_forwarder_test.rb +240 -4
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +0 -6
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/EmptyResults.test.js +10 -9
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +13 -9
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +20 -9
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +31 -8
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +26 -10
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +33 -9
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +53 -35
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +13 -9
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +12 -15
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +32 -12
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +1 -2
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +13 -7
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +0 -5
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageTitle.test.js +47 -7
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +23 -9
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButtonSelectors.test.js +19 -17
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/integrations.test.js +25 -37
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/ToolbarButtons.js +0 -4
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/ToolbarButtons.test.js +18 -47
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +28 -8
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +25 -8
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +11 -9
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +11 -9
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +4 -4
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +33 -12
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +36 -8
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsActions.test.js +61 -47
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTable.test.js +48 -4
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableActions.test.js +126 -35
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js +90 -24
- data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +79 -21
- data/webpack/InsightsCloudSync/__tests__/InsightsCloudSyncActions.test.js +31 -6
- data/webpack/InsightsHostDetailsTab/__tests__/InsightsTab.test.js +42 -9
- data/webpack/__tests__/ForemanRhCloudHelpers.test.js +91 -53
- data/webpack/common/Switcher/__tests__/HelpLabel.test.js +25 -10
- data/webpack/common/Switcher/__tests__/SwitcherPF4.test.js +41 -10
- metadata +4 -77
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/__snapshots__/EmptyResults.test.js.snap +0 -18
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +0 -25
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +0 -20
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +0 -47
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +0 -59
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +0 -34
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +0 -25
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +0 -49
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +0 -86
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +0 -75
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +0 -46
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +0 -26
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterActions.test.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +0 -28
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterSelectors.test.js +0 -21
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilter.test.js.snap +0 -21
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterActions.test.js.snap +0 -17
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterReducer.test.js.snap +0 -19
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterSelectors.test.js.snap +0 -9
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/integration.test.js.snap +0 -43
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/AdvancedSettingActions.test.js +0 -9
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/__snapshots__/AdvancedSettingActions.test.js.snap +0 -18
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettingsActions.test.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettingsActions.test.js.snap +0 -26
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +0 -68
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorActions.js +0 -21
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorButton.js +0 -59
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorConstants.js +0 -6
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorSelectors.js +0 -19
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorActions.test.js +0 -9
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorButton.test.js +0 -22
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorActions.test.js.snap +0 -11
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorButton.test.js.snap +0 -59
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js +0 -34
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.js +0 -66
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.test.js +0 -18
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/__snapshots__/SettingsWarning.test.js.snap +0 -32
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/index.js +0 -25
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButton.test.js.snap +0 -15
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButtonSelectors.test.js.snap +0 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/integrations.test.js.snap +0 -58
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +0 -23
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +0 -74
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +0 -18
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +0 -12
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +0 -96
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryUpload.test.js +0 -10
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +0 -5
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryUpload.test.js.snap +0 -14
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js +0 -33
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsSelectors.test.js +0 -21
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsActions.test.js.snap +0 -65
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsReducer.test.js.snap +0 -19
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsSelectors.test.js.snap +0 -9
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTableActions.test.js.snap +0 -131
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTableSelectors.test.js.snap +0 -87
- data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +0 -10
- data/webpack/InsightsCloudSync/__tests__/InsightsCloudSyncHelpers.test.js +0 -9
- data/webpack/InsightsCloudSync/__tests__/__snapshots__/InsightsCloudSyncActions.test.js.snap +0 -15
- data/webpack/InsightsCloudSync/__tests__/__snapshots__/InsightsCloudSyncHelpers.test.js.snap +0 -3
- data/webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js +0 -19
- data/webpack/InsightsHostDetailsTab/__tests__/InsightsTabReducer.test.js +0 -26
- data/webpack/InsightsHostDetailsTab/__tests__/InsightsTabSelectors.test.js +0 -13
- data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTab.test.js.snap +0 -34
- data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabActions.test.js.snap +0 -56
- data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabReducer.test.js.snap +0 -32
- data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabSelectors.test.js.snap +0 -18
- data/webpack/__tests__/ForemanRhCloudSelectors.test.js +0 -22
- data/webpack/__tests__/ForemanRhCloudTestHelpers.test.js +0 -20
- data/webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap +0 -19
- data/webpack/__tests__/__snapshots__/ForemanRhCloudSelectors.test.js.snap +0 -25
- data/webpack/__tests__/__snapshots__/ForemanRhCloudTestHelpers.test.js.snap +0 -39
- data/webpack/common/Switcher/__tests__/__snapshots__/HelpLabel.test.js.snap +0 -16
- data/webpack/common/Switcher/__tests__/__snapshots__/SwitcherPF4.test.js.snap +0 -24
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"CloudConnectorStatus": Object {
|
|
6
|
-
"id": 7,
|
|
7
|
-
"task": Object {
|
|
8
|
-
"id": 11,
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
"accounts": Object {
|
|
12
|
-
"Account1": Object {
|
|
13
|
-
"generated_status": "running",
|
|
14
|
-
"id": 1,
|
|
15
|
-
"uploaded_status": "running",
|
|
16
|
-
},
|
|
17
|
-
"Account2": Object {
|
|
18
|
-
"generated_status": "failure",
|
|
19
|
-
"id": 2,
|
|
20
|
-
"uploaded_status": "unknown",
|
|
21
|
-
},
|
|
22
|
-
"Account3": Object {
|
|
23
|
-
"generated_status": "running",
|
|
24
|
-
"id": 3,
|
|
25
|
-
"uploaded_status": "success",
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
"error": null,
|
|
29
|
-
"pollingProcessID": 0,
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
-
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING_ERROR 1`] = `
|
|
34
|
-
Object {
|
|
35
|
-
"accounts": Object {},
|
|
36
|
-
"error": "some-error",
|
|
37
|
-
"pollingProcessID": 0,
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING_START 1`] = `
|
|
42
|
-
Object {
|
|
43
|
-
"accounts": Object {},
|
|
44
|
-
"error": null,
|
|
45
|
-
"pollingProcessID": 0,
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
|
|
49
|
-
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING_STOP 1`] = `
|
|
50
|
-
Object {
|
|
51
|
-
"accounts": Object {},
|
|
52
|
-
"error": null,
|
|
53
|
-
"pollingProcessID": 0,
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
exports[`AccountList reducer should handle INVENTORY_PROCESS_RESTART 1`] = `
|
|
58
|
-
Object {
|
|
59
|
-
"accounts": Object {
|
|
60
|
-
"user@redhat.com": Object {
|
|
61
|
-
"upload_report_status": "Restarting...",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
"error": null,
|
|
65
|
-
"pollingProcessID": 0,
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
68
|
-
|
|
69
|
-
exports[`AccountList reducer should return the initial state 1`] = `
|
|
70
|
-
Object {
|
|
71
|
-
"accounts": Object {},
|
|
72
|
-
"error": null,
|
|
73
|
-
"pollingProcessID": 0,
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`AccountList selectors should return AccountList accounts 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"Account1": Object {
|
|
6
|
-
"generated_status": "running",
|
|
7
|
-
"id": 1,
|
|
8
|
-
"uploaded_status": "running",
|
|
9
|
-
},
|
|
10
|
-
"Account2": Object {
|
|
11
|
-
"generated_status": "failure",
|
|
12
|
-
"id": 2,
|
|
13
|
-
"uploaded_status": "unknown",
|
|
14
|
-
},
|
|
15
|
-
"Account3": Object {
|
|
16
|
-
"generated_status": "running",
|
|
17
|
-
"id": 3,
|
|
18
|
-
"uploaded_status": "success",
|
|
19
|
-
},
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
exports[`AccountList selectors should return AccountList pollingProcessID 1`] = `0`;
|
|
24
|
-
|
|
25
|
-
exports[`AccountList selectors should return AccountsList 1`] = `
|
|
26
|
-
Object {
|
|
27
|
-
"accounts": Object {
|
|
28
|
-
"Account1": Object {
|
|
29
|
-
"generated_status": "running",
|
|
30
|
-
"id": 1,
|
|
31
|
-
"uploaded_status": "running",
|
|
32
|
-
},
|
|
33
|
-
"Account2": Object {
|
|
34
|
-
"generated_status": "failure",
|
|
35
|
-
"id": 2,
|
|
36
|
-
"uploaded_status": "unknown",
|
|
37
|
-
},
|
|
38
|
-
"Account3": Object {
|
|
39
|
-
"generated_status": "running",
|
|
40
|
-
"id": 3,
|
|
41
|
-
"uploaded_status": "success",
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
"pollingProcessID": 0,
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`FileDownload rendering render without Props 1`] = `
|
|
4
|
-
<Col
|
|
5
|
-
bsClass="col"
|
|
6
|
-
componentClass="div"
|
|
7
|
-
sm={12}
|
|
8
|
-
>
|
|
9
|
-
<Button
|
|
10
|
-
active={false}
|
|
11
|
-
block={false}
|
|
12
|
-
bsClass="btn"
|
|
13
|
-
bsStyle="default"
|
|
14
|
-
className="download-button"
|
|
15
|
-
disabled={false}
|
|
16
|
-
onClick={[Function]}
|
|
17
|
-
>
|
|
18
|
-
Download Report
|
|
19
|
-
|
|
20
|
-
<Icon
|
|
21
|
-
name="download"
|
|
22
|
-
type="fa"
|
|
23
|
-
/>
|
|
24
|
-
</Button>
|
|
25
|
-
</Col>
|
|
26
|
-
`;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
-
import {
|
|
3
|
-
handleFilterChange,
|
|
4
|
-
handleFilterClear,
|
|
5
|
-
} from '../InventoryFilterActions';
|
|
6
|
-
import { filterTerm } from '../InventoryFilter.fixtures';
|
|
7
|
-
|
|
8
|
-
const fixtures = {
|
|
9
|
-
'should handleFilterChange': () => handleFilterChange(filterTerm),
|
|
10
|
-
'should handleFilterClear': () => handleFilterClear(),
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
describe('InventoryFilter actions', () =>
|
|
14
|
-
testActionSnapshotWithFixtures(fixtures));
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { testReducerSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
-
import reducer from '../InventoryFilterReducer';
|
|
3
|
-
import { filterTerm } from '../InventoryFilter.fixtures';
|
|
4
|
-
import {
|
|
5
|
-
INVENTORY_FILTER_UPDATE,
|
|
6
|
-
INVENTORY_FILTER_CLEAR,
|
|
7
|
-
} from '../InventoryFilterConstants';
|
|
8
|
-
|
|
9
|
-
const fixtures = {
|
|
10
|
-
'should return the initial state': {},
|
|
11
|
-
'should handle INVENTORY_FILTER_UPDATE': {
|
|
12
|
-
action: {
|
|
13
|
-
type: INVENTORY_FILTER_UPDATE,
|
|
14
|
-
payload: {
|
|
15
|
-
filterTerm,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
'should handle INVENTORY_FILTER_CLEAR': {
|
|
20
|
-
action: {
|
|
21
|
-
type: INVENTORY_FILTER_CLEAR,
|
|
22
|
-
payload: {},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
describe('AccountList reducer', () =>
|
|
28
|
-
testReducerSnapshotWithFixtures(reducer, fixtures));
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
-
import { filterTerm } from '../InventoryFilter.fixtures';
|
|
3
|
-
import { rhCloudStateWrapper } from '../../../../ForemanRhCloudTestHelpers';
|
|
4
|
-
import {
|
|
5
|
-
selectInventoryFilter,
|
|
6
|
-
selectFilterTerm,
|
|
7
|
-
} from '../InventoryFilterSelectors';
|
|
8
|
-
|
|
9
|
-
const state = rhCloudStateWrapper({
|
|
10
|
-
inventoryFilter: {
|
|
11
|
-
filterTerm,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const fixtures = {
|
|
16
|
-
'should return InventoryFilter': () => selectInventoryFilter(state),
|
|
17
|
-
'should return filterTerm': () => selectFilterTerm(state),
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
describe('InventoryFilter selectors', () =>
|
|
21
|
-
testSelectorsSnapshotWithFixtures(fixtures));
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`InventoryFilter rendering render with props 1`] = `
|
|
4
|
-
<form
|
|
5
|
-
id="inventory_filter_form"
|
|
6
|
-
>
|
|
7
|
-
<FormGroup>
|
|
8
|
-
<TextInput
|
|
9
|
-
id="inventory_filter_input"
|
|
10
|
-
onChange={[Function]}
|
|
11
|
-
ouiaId="inventory_filter_input"
|
|
12
|
-
placeholder="Filter.."
|
|
13
|
-
type="text"
|
|
14
|
-
value="test_filter_term"
|
|
15
|
-
/>
|
|
16
|
-
<ClearButton
|
|
17
|
-
onClear={[Function]}
|
|
18
|
-
/>
|
|
19
|
-
</FormGroup>
|
|
20
|
-
</form>
|
|
21
|
-
`;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`InventoryFilter actions should handleFilterChange 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"payload": Object {
|
|
6
|
-
"filterTerm": "test_filter_term",
|
|
7
|
-
},
|
|
8
|
-
"type": "INVENTORY_FILTER_UPDATE",
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
exports[`InventoryFilter actions should handleFilterClear 1`] = `
|
|
13
|
-
Object {
|
|
14
|
-
"payload": Object {},
|
|
15
|
-
"type": "INVENTORY_FILTER_CLEAR",
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`AccountList reducer should handle INVENTORY_FILTER_CLEAR 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"filterTerm": "",
|
|
6
|
-
}
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
exports[`AccountList reducer should handle INVENTORY_FILTER_UPDATE 1`] = `
|
|
10
|
-
Object {
|
|
11
|
-
"filterTerm": "test_filter_term",
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`AccountList reducer should return the initial state 1`] = `
|
|
16
|
-
Object {
|
|
17
|
-
"filterTerm": "",
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`InventoryFilter selectors should return InventoryFilter 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"filterTerm": "test_filter_term",
|
|
6
|
-
}
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
exports[`InventoryFilter selectors should return filterTerm 1`] = `"test_filter_term"`;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`InventoryFilter integration test should flow: filter have been updated 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"action": Array [
|
|
6
|
-
Array [
|
|
7
|
-
Object {
|
|
8
|
-
"payload": Object {
|
|
9
|
-
"filterTerm": "some-org",
|
|
10
|
-
},
|
|
11
|
-
"type": "INVENTORY_FILTER_UPDATE",
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
],
|
|
15
|
-
"state": Object {
|
|
16
|
-
"ForemanRhCloud": Object {
|
|
17
|
-
"InsightsCloudSync": Object {
|
|
18
|
-
"settings": Object {
|
|
19
|
-
"insightsSyncEnabled": false,
|
|
20
|
-
},
|
|
21
|
-
"table": Object {
|
|
22
|
-
"isAllSelected": false,
|
|
23
|
-
"selectedIds": Object {},
|
|
24
|
-
"showSelectAllAlert": false,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
"hostInsights": Object {
|
|
28
|
-
"hits": Array [],
|
|
29
|
-
},
|
|
30
|
-
"inventoryUpload": Object {
|
|
31
|
-
"accountsList": Object {
|
|
32
|
-
"accounts": Object {},
|
|
33
|
-
"error": null,
|
|
34
|
-
"pollingProcessID": 0,
|
|
35
|
-
},
|
|
36
|
-
"inventoryFilter": Object {
|
|
37
|
-
"filterTerm": "some-org",
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
@@ -1,9 +0,0 @@
|
|
|
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));
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1,14 +0,0 @@
|
|
|
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));
|
|
@@ -1,26 +0,0 @@
|
|
|
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,68 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
3
|
-
import { post } from 'foremanReact/redux/API';
|
|
4
|
-
import { CONFIGURE_CLOUD_CONNECTOR } from './CloudConnectorConstants';
|
|
5
|
-
import { inventoryUrl } from '../../../../ForemanInventoryHelpers';
|
|
6
|
-
import { foremanUrl } from '../../../../../ForemanRhCloudHelpers';
|
|
7
|
-
|
|
8
|
-
export const configureCloudConnector = () =>
|
|
9
|
-
post({
|
|
10
|
-
key: CONFIGURE_CLOUD_CONNECTOR,
|
|
11
|
-
url: inventoryUrl('cloud_connector'),
|
|
12
|
-
successToast: response => (
|
|
13
|
-
<span>
|
|
14
|
-
{__('Cloud connector setup is in progress now: ')}
|
|
15
|
-
<a href={foremanUrl(`/job_invocations/${response.data.id}`)}>
|
|
16
|
-
{__('Cloud connector job link')}
|
|
17
|
-
</a>
|
|
18
|
-
</span>
|
|
19
|
-
),
|
|
20
|
-
errorToast: error => `${__('Cloud connector setup has failed: ')} ${error}`,
|
|
21
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Spinner, Button, Popover } from '@patternfly/react-core';
|
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
5
|
-
import { CONNECTOR_STATUS } from './CloudConnectorConstants';
|
|
6
|
-
|
|
7
|
-
export const CloudConnectorButton = ({ status, onClick, jobLink }) => {
|
|
8
|
-
const [isPopoverVisible, setIsPopoverVisible] = useState(false);
|
|
9
|
-
if (status === CONNECTOR_STATUS.PENDING) {
|
|
10
|
-
return (
|
|
11
|
-
<Popover
|
|
12
|
-
isVisible={isPopoverVisible}
|
|
13
|
-
shouldClose={() => setIsPopoverVisible(false)}
|
|
14
|
-
bodyContent={
|
|
15
|
-
<div>
|
|
16
|
-
{__('Cloud connector setup has started: ')}
|
|
17
|
-
<a href={jobLink} target="_blank" rel="noopener noreferrer">
|
|
18
|
-
{__('view the job in progress')}
|
|
19
|
-
</a>
|
|
20
|
-
</div>
|
|
21
|
-
}
|
|
22
|
-
aria-label="Popover with Link to cloud connector job"
|
|
23
|
-
closeBtnAriaLabel="Close cloud connector Popover"
|
|
24
|
-
>
|
|
25
|
-
<div
|
|
26
|
-
className="cloud-connector-pending-button"
|
|
27
|
-
onMouseEnter={() => setIsPopoverVisible(true)}
|
|
28
|
-
>
|
|
29
|
-
<Button variant="secondary" ouiaId="button-in-progress" isDisabled>
|
|
30
|
-
<Spinner size="sm" /> {__('Cloud Connector is in progress')}
|
|
31
|
-
</Button>
|
|
32
|
-
</div>
|
|
33
|
-
</Popover>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (status === CONNECTOR_STATUS.RESOLVED) {
|
|
38
|
-
return (
|
|
39
|
-
<Button variant="secondary" ouiaId="button-reconfigure" onClick={onClick}>
|
|
40
|
-
{__('Reconfigure cloud connector')}
|
|
41
|
-
</Button>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<Button variant="secondary" ouiaId="button-configure" onClick={onClick}>
|
|
47
|
-
{__('Configure cloud connector')}
|
|
48
|
-
</Button>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
CloudConnectorButton.propTypes = {
|
|
53
|
-
status: PropTypes.string.isRequired,
|
|
54
|
-
onClick: PropTypes.func.isRequired,
|
|
55
|
-
jobLink: PropTypes.string,
|
|
56
|
-
};
|
|
57
|
-
CloudConnectorButton.defaultProps = {
|
|
58
|
-
jobLink: '',
|
|
59
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { foremanUrl } from '../../../../../ForemanRhCloudHelpers';
|
|
2
|
-
import { selectAccountsList } from '../../../AccountList/AccountListSelectors';
|
|
3
|
-
import { CONNECTOR_STATUS } from './CloudConnectorConstants';
|
|
4
|
-
|
|
5
|
-
export const SelectCloudConnectorStatus = state =>
|
|
6
|
-
selectAccountsList(state).CloudConnectorStatus || {};
|
|
7
|
-
|
|
8
|
-
export const selectStatus = state => {
|
|
9
|
-
const { task } = SelectCloudConnectorStatus(state);
|
|
10
|
-
if (!task) return CONNECTOR_STATUS.NOT_RESOLVED;
|
|
11
|
-
if (task.result === 'pending') return CONNECTOR_STATUS.PENDING;
|
|
12
|
-
if (task.result === 'success') return CONNECTOR_STATUS.RESOLVED;
|
|
13
|
-
return CONNECTOR_STATUS.NOT_RESOLVED;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const selectJobLink = state => {
|
|
17
|
-
const { id } = SelectCloudConnectorStatus(state);
|
|
18
|
-
return id ? foremanUrl(`/job_invocations/${id}`) : '';
|
|
19
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
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,22 +0,0 @@
|
|
|
1
|
-
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
-
import { CloudConnectorButton } from '../CloudConnectorButton';
|
|
3
|
-
import { CONNECTOR_STATUS } from '../CloudConnectorConstants';
|
|
4
|
-
|
|
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
|
-
};
|
|
20
|
-
|
|
21
|
-
describe('CloudConnectorButton', () =>
|
|
22
|
-
testComponentSnapshotsWithFixtures(CloudConnectorButton, fixtures));
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
`;
|