foreman_rh_cloud 3.0.17 → 3.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_inventory_upload/accounts_controller.rb +3 -15
- data/app/controllers/foreman_inventory_upload/uploads_controller.rb +0 -48
- data/app/controllers/foreman_inventory_upload/uploads_settings_controller.rb +26 -0
- data/app/controllers/insights_cloud/hits_controller.rb +1 -1
- data/app/services/foreman_rh_cloud/branch_info.rb +3 -14
- data/app/services/foreman_rh_cloud/cloud_connector.rb +12 -7
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +31 -19
- data/config/routes.rb +2 -5
- data/db/migrate/20210307000001_add_unique_to_insights_facet.foreman_rh_cloud.rb +11 -0
- data/lib/foreman_inventory_upload.rb +2 -1
- data/lib/foreman_inventory_upload/generators/json_stream.rb +1 -1
- data/lib/foreman_inventory_upload/generators/slice.rb +14 -21
- data/lib/foreman_inventory_upload/generators/tags.rb +59 -0
- data/lib/foreman_rh_cloud.rb +4 -0
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +1 -1
- data/test/controllers/accounts_controller_test.rb +1 -5
- data/test/controllers/uploads_controller_test.rb +0 -13
- data/test/controllers/uploads_settings_controller_test.rb +31 -0
- data/test/test_plugin_helper.rb +13 -0
- data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +5 -5
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +39 -4
- data/test/unit/slice_generator_test.rb +7 -2
- data/test/unit/tags_generator_test.rb +60 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +4 -19
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +7 -7
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +6 -6
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +0 -34
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss +6 -4
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +6 -4
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +14 -12
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +10 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +7 -7
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +12 -9
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListHelper.test.js +3 -3
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +0 -30
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +1 -23
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +6 -6
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +3 -8
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +3 -35
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +6 -18
- data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +24 -22
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +2 -1
- data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +4 -2
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +2 -1
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +16 -14
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js +2 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +2 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js +3 -11
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +3 -3
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingActions.js +7 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants.js +26 -0
- 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/AdvancedSetting/index.js +29 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +7 -8
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss +15 -9
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsActions.js +23 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettingsActions.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap +16 -4
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettingsActions.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/index.js +16 -1
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +7 -5
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/index.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/modal.scss +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/index.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +8 -6
- data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +9 -7
- data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +4 -2
- data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +7 -5
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +2 -1
- data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +15 -13
- data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +27 -25
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +1 -1
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +13 -8
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +3 -3
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/AdvancedSettings.js +21 -9
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/index.js +3 -8
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/index.js +6 -4
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryUpload.test.js.snap +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettings.test.js +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/InsightsSyncSwitcher.test.js +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/fixtures.js +1 -1
- data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +1 -1
- data/webpack/InsightsHostDetailsTab/InsightsTab.js +2 -1
- data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +1 -1
- data/webpack/common/Switcher/SwitcherPF4.scss +1 -1
- metadata +55 -56
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +0 -3
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js +0 -29
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +0 -29
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +0 -24
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap +0 -15
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap +0 -31
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js +0 -17
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.fixtures.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.js +0 -27
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js +0 -29
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherConstants.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcher.test.js +0 -13
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js +0 -21
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcher.test.js.snap +0 -15
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcherActions.test.js.snap +0 -31
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/integration.test.js.snap +0 -46
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/integration.test.js +0 -36
- data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/index.js +0 -20
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js +0 -27
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js +0 -29
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcher.test.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js +0 -24
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcher.test.js.snap +0 -15
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap +0 -31
- data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/index.js +0 -20
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.fixtures.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.js +0 -27
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions.js +0 -29
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcher.test.js +0 -13
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcherActions.test.js +0 -21
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcher.test.js.snap +0 -15
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcherActions.test.js.snap +0 -31
- data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/index.js +0 -20
@@ -9,17 +9,3 @@ export const selectPollingProcessID = state =>
|
|
9
9
|
selectAccountsList(state).pollingProcessID;
|
10
10
|
|
11
11
|
export const selectError = state => selectAccountsList(state).error;
|
12
|
-
|
13
|
-
export const selectAutoUploadEnabled = state =>
|
14
|
-
selectAccountsList(state).autoUploadEnabled;
|
15
|
-
|
16
|
-
export const selectHostObfuscationEnabled = state =>
|
17
|
-
selectAccountsList(state).hostObfuscationEnabled;
|
18
|
-
|
19
|
-
export const selectIpsObfuscationEnabled = state =>
|
20
|
-
selectAccountsList(state).ipsObfuscationEnabled;
|
21
|
-
|
22
|
-
export const selectCloudToken = state => selectAccountsList(state).cloudToken;
|
23
|
-
|
24
|
-
export const selectExcludePackages = state =>
|
25
|
-
selectAccountsList(state).excludePackages;
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
$error_color: #d10d0d;
|
2
2
|
|
3
|
-
.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
.rh-cloud-inventory-page {
|
4
|
+
.error_state {
|
5
|
+
margin-top: 100px;
|
6
|
+
text-align: center;
|
7
|
+
font-weight: bold;
|
8
|
+
font-size: 16px;
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
.error_icon {
|
11
|
+
color: $error_color;
|
12
|
+
margin-right: 15px;
|
13
|
+
margin-bottom: 10px;
|
14
|
+
}
|
14
15
|
|
15
|
-
|
16
|
-
|
16
|
+
.error_description {
|
17
|
+
color: $error_color;
|
18
|
+
}
|
17
19
|
}
|
18
20
|
}
|
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
|
|
10
10
|
import ListItemStatus from '../ListItemStatus';
|
11
11
|
import Dashboard from '../../../Dashboard';
|
12
12
|
|
13
|
-
const ListItem = ({
|
13
|
+
const ListItem = ({ label, account }) => {
|
14
14
|
const [isExpanded, setIsExpanded] = useState(false);
|
15
15
|
return (
|
16
16
|
<AccordionItem>
|
@@ -25,23 +25,23 @@ const ListItem = ({ accountID, account }) => {
|
|
25
25
|
color="blue"
|
26
26
|
icon={<UserIcon />}
|
27
27
|
/>
|
28
|
-
{
|
28
|
+
{label}
|
29
29
|
</span>
|
30
|
-
<ListItemStatus key={`${
|
30
|
+
<ListItemStatus key={`${label}_status`} account={account} />
|
31
31
|
</AccordionToggle>
|
32
32
|
<AccordionContent isHidden={!isExpanded}>
|
33
|
-
<Dashboard accountID={
|
33
|
+
<Dashboard accountID={account.id} account={account} />
|
34
34
|
</AccordionContent>
|
35
35
|
</AccordionItem>
|
36
36
|
);
|
37
37
|
};
|
38
38
|
|
39
39
|
ListItem.propTypes = {
|
40
|
-
|
40
|
+
label: PropTypes.string.isRequired,
|
41
41
|
account: PropTypes.shape({
|
42
42
|
generate_report_status: PropTypes.string,
|
43
43
|
upload_report_status: PropTypes.string,
|
44
|
-
|
44
|
+
id: PropTypes.number,
|
45
45
|
}),
|
46
46
|
};
|
47
47
|
|
@@ -49,7 +49,7 @@ ListItem.defaultProps = {
|
|
49
49
|
account: {
|
50
50
|
generate_report_status: 'unknown',
|
51
51
|
upload_report_status: 'unknown',
|
52
|
-
|
52
|
+
id: 0,
|
53
53
|
},
|
54
54
|
};
|
55
55
|
|
@@ -19,17 +19,19 @@ exports[`ListItem rendering render with Props 1`] = `
|
|
19
19
|
}
|
20
20
|
variant="outline"
|
21
21
|
/>
|
22
|
-
|
22
|
+
test
|
23
23
|
</span>
|
24
24
|
<ListItemStatus
|
25
25
|
account={
|
26
26
|
Object {
|
27
|
-
"
|
28
|
-
|
29
|
-
|
27
|
+
"test": Object {
|
28
|
+
"generate_report_status": "unknown",
|
29
|
+
"id": 1,
|
30
|
+
"upload_report_status": "unknown",
|
31
|
+
},
|
30
32
|
}
|
31
33
|
}
|
32
|
-
key="
|
34
|
+
key="test_status"
|
33
35
|
/>
|
34
36
|
</AccordionToggle>
|
35
37
|
<AccordionContent
|
@@ -38,12 +40,13 @@ exports[`ListItem rendering render with Props 1`] = `
|
|
38
40
|
<Connect(Dashboard)
|
39
41
|
account={
|
40
42
|
Object {
|
41
|
-
"
|
42
|
-
|
43
|
-
|
43
|
+
"test": Object {
|
44
|
+
"generate_report_status": "unknown",
|
45
|
+
"id": 1,
|
46
|
+
"upload_report_status": "unknown",
|
47
|
+
},
|
44
48
|
}
|
45
49
|
}
|
46
|
-
accountID="1"
|
47
50
|
/>
|
48
51
|
</AccordionContent>
|
49
52
|
</AccordionItem>
|
data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListHelper.test.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import { filterAccounts } from '../AccountListHelper';
|
2
|
-
import { accounts
|
2
|
+
import { accounts } from '../AccountList.fixtures';
|
3
3
|
|
4
4
|
describe('AccountList helpers', () => {
|
5
5
|
it('account ids filter should return all accounts where label contains "test"', () => {
|
6
|
-
expect(filterAccounts(accounts,
|
6
|
+
expect(filterAccounts(accounts, 'AcCoUnT')).toEqual(accounts);
|
7
7
|
});
|
8
8
|
|
9
9
|
it('account ids filter should not match', () => {
|
10
|
-
expect(filterAccounts(accounts,
|
10
|
+
expect(filterAccounts(accounts, 'no_match')).toEqual({});
|
11
11
|
});
|
12
12
|
});
|
data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
CHANGED
@@ -13,14 +13,8 @@ import {
|
|
13
13
|
pollingProcessID,
|
14
14
|
accountID,
|
15
15
|
processStatusName,
|
16
|
-
autoUploadEnabled,
|
17
|
-
hostObfuscationEnabled,
|
18
|
-
ipsObfuscationEnabled,
|
19
16
|
pollingResponse,
|
20
17
|
} from '../AccountList.fixtures';
|
21
|
-
import { AUTO_UPLOAD_TOGGLE } from '../../AutoUploadSwitcher/AutoUploadSwitcherConstants';
|
22
|
-
import { HOST_OBFUSCATION_TOGGLE } from '../../HostObfuscationSwitcher/HostObfuscationSwitcherConstants';
|
23
|
-
import { IPS_OBFUSCATION_TOGGLE } from '../../IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants';
|
24
18
|
|
25
19
|
const fixtures = {
|
26
20
|
'should return the initial state': {},
|
@@ -58,30 +52,6 @@ const fixtures = {
|
|
58
52
|
},
|
59
53
|
},
|
60
54
|
},
|
61
|
-
'should handle AUTO_UPLOAD_TOGGLE': {
|
62
|
-
action: {
|
63
|
-
type: AUTO_UPLOAD_TOGGLE,
|
64
|
-
payload: {
|
65
|
-
autoUploadEnabled,
|
66
|
-
},
|
67
|
-
},
|
68
|
-
},
|
69
|
-
'should handle HOST_OBFUSCATION_TOGGLE': {
|
70
|
-
action: {
|
71
|
-
type: HOST_OBFUSCATION_TOGGLE,
|
72
|
-
payload: {
|
73
|
-
hostObfuscationEnabled,
|
74
|
-
},
|
75
|
-
},
|
76
|
-
},
|
77
|
-
'should handle IPS_OBFUSCATION_TOGGLE': {
|
78
|
-
action: {
|
79
|
-
type: IPS_OBFUSCATION_TOGGLE,
|
80
|
-
payload: {
|
81
|
-
ipsObfuscationEnabled,
|
82
|
-
},
|
83
|
-
},
|
84
|
-
},
|
85
55
|
};
|
86
56
|
|
87
57
|
describe('AccountList reducer', () =>
|
data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js
CHANGED
@@ -3,29 +3,14 @@ import {
|
|
3
3
|
selectAccountsList,
|
4
4
|
selectAccounts,
|
5
5
|
selectPollingProcessID,
|
6
|
-
selectAutoUploadEnabled,
|
7
|
-
selectHostObfuscationEnabled,
|
8
|
-
selectCloudToken,
|
9
|
-
selectExcludePackages,
|
10
6
|
} from '../AccountListSelectors';
|
11
|
-
import {
|
12
|
-
pollingProcessID,
|
13
|
-
accounts,
|
14
|
-
autoUploadEnabled,
|
15
|
-
hostObfuscationEnabled,
|
16
|
-
cloudToken,
|
17
|
-
excludePackages,
|
18
|
-
} from '../AccountList.fixtures';
|
7
|
+
import { pollingProcessID, accounts } from '../AccountList.fixtures';
|
19
8
|
import { rhCloudStateWrapper } from '../../../../ForemanRhCloudTestHelpers';
|
20
9
|
|
21
10
|
const state = rhCloudStateWrapper({
|
22
11
|
accountsList: {
|
23
12
|
accounts,
|
24
13
|
pollingProcessID,
|
25
|
-
autoUploadEnabled,
|
26
|
-
hostObfuscationEnabled,
|
27
|
-
cloudToken,
|
28
|
-
excludePackages,
|
29
14
|
},
|
30
15
|
});
|
31
16
|
|
@@ -34,13 +19,6 @@ const fixtures = {
|
|
34
19
|
'should return AccountList accounts': () => selectAccounts(state),
|
35
20
|
'should return AccountList pollingProcessID': () =>
|
36
21
|
selectPollingProcessID(state),
|
37
|
-
'should return AccountList autoUploadEnabled': () =>
|
38
|
-
selectAutoUploadEnabled(state),
|
39
|
-
'should return AccountList hostObfuscationEnabled': () =>
|
40
|
-
selectHostObfuscationEnabled(state),
|
41
|
-
'should return AccountList cloudToken': () => selectCloudToken(state),
|
42
|
-
'should return AccountList excludePackages': () =>
|
43
|
-
selectExcludePackages(state),
|
44
22
|
};
|
45
23
|
|
46
24
|
describe('AccountList selectors', () =>
|
@@ -8,34 +8,34 @@ exports[`AccountList rendering render with props 1`] = `
|
|
8
8
|
account={
|
9
9
|
Object {
|
10
10
|
"generate_report_status": "running",
|
11
|
-
"
|
11
|
+
"id": 1,
|
12
12
|
"upload_report_status": "running",
|
13
13
|
}
|
14
14
|
}
|
15
|
-
accountID="Account1"
|
16
15
|
key="0"
|
16
|
+
label="Account1"
|
17
17
|
/>
|
18
18
|
<ListItem
|
19
19
|
account={
|
20
20
|
Object {
|
21
21
|
"generate_report_status": "failure",
|
22
|
-
"
|
22
|
+
"id": 2,
|
23
23
|
"upload_report_status": "unknown",
|
24
24
|
}
|
25
25
|
}
|
26
|
-
accountID="Account2"
|
27
26
|
key="1"
|
27
|
+
label="Account2"
|
28
28
|
/>
|
29
29
|
<ListItem
|
30
30
|
account={
|
31
31
|
Object {
|
32
32
|
"generate_report_status": "running",
|
33
|
-
"
|
33
|
+
"id": 3,
|
34
34
|
"upload_report_status": "success",
|
35
35
|
}
|
36
36
|
}
|
37
|
-
accountID="Account3"
|
38
37
|
key="2"
|
38
|
+
label="Account3"
|
39
39
|
/>
|
40
40
|
</Accordion>
|
41
41
|
`;
|
@@ -14,25 +14,20 @@ Array [
|
|
14
14
|
"accounts": Object {
|
15
15
|
"Account1": Object {
|
16
16
|
"generate_report_status": "running",
|
17
|
-
"
|
17
|
+
"id": 1,
|
18
18
|
"upload_report_status": "running",
|
19
19
|
},
|
20
20
|
"Account2": Object {
|
21
21
|
"generate_report_status": "failure",
|
22
|
-
"
|
22
|
+
"id": 2,
|
23
23
|
"upload_report_status": "unknown",
|
24
24
|
},
|
25
25
|
"Account3": Object {
|
26
26
|
"generate_report_status": "running",
|
27
|
-
"
|
27
|
+
"id": 3,
|
28
28
|
"upload_report_status": "success",
|
29
29
|
},
|
30
30
|
},
|
31
|
-
"autoUploadEnabled": true,
|
32
|
-
"cloudToken": true,
|
33
|
-
"excludePackages": false,
|
34
|
-
"hostObfuscationEnabled": true,
|
35
|
-
"ipsObfuscationEnabled": true,
|
36
31
|
},
|
37
32
|
"type": "INVENTORY_ACCOUNT_STATUS_POLLING",
|
38
33
|
},
|
@@ -1,23 +1,5 @@
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
2
|
|
3
|
-
exports[`AccountList reducer should handle AUTO_UPLOAD_TOGGLE 1`] = `
|
4
|
-
Object {
|
5
|
-
"accounts": Object {},
|
6
|
-
"autoUploadEnabled": true,
|
7
|
-
"error": null,
|
8
|
-
"pollingProcessID": 0,
|
9
|
-
}
|
10
|
-
`;
|
11
|
-
|
12
|
-
exports[`AccountList reducer should handle HOST_OBFUSCATION_TOGGLE 1`] = `
|
13
|
-
Object {
|
14
|
-
"accounts": Object {},
|
15
|
-
"error": null,
|
16
|
-
"hostObfuscationEnabled": true,
|
17
|
-
"pollingProcessID": 0,
|
18
|
-
}
|
19
|
-
`;
|
20
|
-
|
21
3
|
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING 1`] = `
|
22
4
|
Object {
|
23
5
|
"CloudConnectorStatus": Object {
|
@@ -29,26 +11,21 @@ Object {
|
|
29
11
|
"accounts": Object {
|
30
12
|
"Account1": Object {
|
31
13
|
"generate_report_status": "running",
|
32
|
-
"
|
14
|
+
"id": 1,
|
33
15
|
"upload_report_status": "running",
|
34
16
|
},
|
35
17
|
"Account2": Object {
|
36
18
|
"generate_report_status": "failure",
|
37
|
-
"
|
19
|
+
"id": 2,
|
38
20
|
"upload_report_status": "unknown",
|
39
21
|
},
|
40
22
|
"Account3": Object {
|
41
23
|
"generate_report_status": "running",
|
42
|
-
"
|
24
|
+
"id": 3,
|
43
25
|
"upload_report_status": "success",
|
44
26
|
},
|
45
27
|
},
|
46
|
-
"autoUploadEnabled": true,
|
47
|
-
"cloudToken": true,
|
48
28
|
"error": null,
|
49
|
-
"excludePackages": false,
|
50
|
-
"hostObfuscationEnabled": true,
|
51
|
-
"ipsObfuscationEnabled": true,
|
52
29
|
"pollingProcessID": 0,
|
53
30
|
}
|
54
31
|
`;
|
@@ -89,15 +66,6 @@ Object {
|
|
89
66
|
}
|
90
67
|
`;
|
91
68
|
|
92
|
-
exports[`AccountList reducer should handle IPS_OBFUSCATION_TOGGLE 1`] = `
|
93
|
-
Object {
|
94
|
-
"accounts": Object {},
|
95
|
-
"error": null,
|
96
|
-
"ipsObfuscationEnabled": true,
|
97
|
-
"pollingProcessID": 0,
|
98
|
-
}
|
99
|
-
`;
|
100
|
-
|
101
69
|
exports[`AccountList reducer should return the initial state 1`] = `
|
102
70
|
Object {
|
103
71
|
"accounts": Object {},
|
@@ -4,30 +4,22 @@ exports[`AccountList selectors should return AccountList accounts 1`] = `
|
|
4
4
|
Object {
|
5
5
|
"Account1": Object {
|
6
6
|
"generate_report_status": "running",
|
7
|
-
"
|
7
|
+
"id": 1,
|
8
8
|
"upload_report_status": "running",
|
9
9
|
},
|
10
10
|
"Account2": Object {
|
11
11
|
"generate_report_status": "failure",
|
12
|
-
"
|
12
|
+
"id": 2,
|
13
13
|
"upload_report_status": "unknown",
|
14
14
|
},
|
15
15
|
"Account3": Object {
|
16
16
|
"generate_report_status": "running",
|
17
|
-
"
|
17
|
+
"id": 3,
|
18
18
|
"upload_report_status": "success",
|
19
19
|
},
|
20
20
|
}
|
21
21
|
`;
|
22
22
|
|
23
|
-
exports[`AccountList selectors should return AccountList autoUploadEnabled 1`] = `true`;
|
24
|
-
|
25
|
-
exports[`AccountList selectors should return AccountList cloudToken 1`] = `true`;
|
26
|
-
|
27
|
-
exports[`AccountList selectors should return AccountList excludePackages 1`] = `false`;
|
28
|
-
|
29
|
-
exports[`AccountList selectors should return AccountList hostObfuscationEnabled 1`] = `true`;
|
30
|
-
|
31
23
|
exports[`AccountList selectors should return AccountList pollingProcessID 1`] = `0`;
|
32
24
|
|
33
25
|
exports[`AccountList selectors should return AccountsList 1`] = `
|
@@ -35,24 +27,20 @@ Object {
|
|
35
27
|
"accounts": Object {
|
36
28
|
"Account1": Object {
|
37
29
|
"generate_report_status": "running",
|
38
|
-
"
|
30
|
+
"id": 1,
|
39
31
|
"upload_report_status": "running",
|
40
32
|
},
|
41
33
|
"Account2": Object {
|
42
34
|
"generate_report_status": "failure",
|
43
|
-
"
|
35
|
+
"id": 2,
|
44
36
|
"upload_report_status": "unknown",
|
45
37
|
},
|
46
38
|
"Account3": Object {
|
47
39
|
"generate_report_status": "running",
|
48
|
-
"
|
40
|
+
"id": 3,
|
49
41
|
"upload_report_status": "success",
|
50
42
|
},
|
51
43
|
},
|
52
|
-
"autoUploadEnabled": true,
|
53
|
-
"cloudToken": true,
|
54
|
-
"excludePackages": false,
|
55
|
-
"hostObfuscationEnabled": true,
|
56
44
|
"pollingProcessID": 0,
|
57
45
|
}
|
58
46
|
`;
|