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
@@ -7,9 +7,21 @@ exports[`InventorySettings rendering render without Props 1`] = `
|
|
7
7
|
<h3>
|
8
8
|
Settings
|
9
9
|
</h3>
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
<AdvancedSetting
|
11
|
+
key="autoUploadEnabled"
|
12
|
+
setting="autoUploadEnabled"
|
13
|
+
/>
|
14
|
+
<AdvancedSetting
|
15
|
+
key="hostObfuscationEnabled"
|
16
|
+
setting="hostObfuscationEnabled"
|
17
|
+
/>
|
18
|
+
<AdvancedSetting
|
19
|
+
key="ipsObfuscationEnabled"
|
20
|
+
setting="ipsObfuscationEnabled"
|
21
|
+
/>
|
22
|
+
<AdvancedSetting
|
23
|
+
key="excludePackagesEnabled"
|
24
|
+
setting="excludePackagesEnabled"
|
25
|
+
/>
|
14
26
|
</div>
|
15
27
|
`;
|
@@ -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 +1,16 @@
|
|
1
|
-
|
1
|
+
import React, { useEffect } from 'react';
|
2
|
+
import { useDispatch } from 'react-redux';
|
3
|
+
import InventorySettings from './InventorySettings';
|
4
|
+
import { getSettings } from './InventorySettingsActions';
|
5
|
+
|
6
|
+
const ConnectedInventorySettings = () => {
|
7
|
+
const dispatch = useDispatch();
|
8
|
+
|
9
|
+
useEffect(() => {
|
10
|
+
dispatch(getSettings());
|
11
|
+
}, [dispatch]);
|
12
|
+
|
13
|
+
return <InventorySettings />;
|
14
|
+
};
|
15
|
+
|
16
|
+
export default ConnectedInventorySettings;
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/index.js
CHANGED
@@ -4,7 +4,7 @@ import { SettingsWarning } from './SettingsWarning';
|
|
4
4
|
import {
|
5
5
|
selectAutoUploadEnabled,
|
6
6
|
selectHostObfuscationEnabled,
|
7
|
-
} from '../../../
|
7
|
+
} from '../../../InventorySettings/InventorySettingsSelectors';
|
8
8
|
import { CONNECTOR_STATUS } from '../CloudConnectorButton/CloudConnectorConstants';
|
9
9
|
import { selectStatus } from '../CloudConnectorButton/CloudConnectorSelectors';
|
10
10
|
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js
CHANGED
@@ -6,7 +6,7 @@ import { foremanUrl } from '../../../../../../ForemanRhCloudHelpers';
|
|
6
6
|
import './modal.scss';
|
7
7
|
|
8
8
|
const SyncModal = ({ show, toggleModal }) => (
|
9
|
-
<Modal show={show} onHide={toggleModal} id="
|
9
|
+
<Modal show={show} onHide={toggleModal} id="inventory-sync-modal">
|
10
10
|
<Modal.Header>
|
11
11
|
<button
|
12
12
|
className="close"
|
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
|
|
4
4
|
import * as actions from './SyncButtonActions';
|
5
5
|
import reducer from './SyncButtonReducer';
|
6
6
|
import SyncButton from './SyncButton';
|
7
|
-
import { selectCloudToken } from '../../../
|
7
|
+
import { selectCloudToken } from '../../../InventorySettings/InventorySettingsSelectors';
|
8
8
|
import { selectStatus } from './SyncButtonSelectors';
|
9
9
|
|
10
10
|
// map state to props
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import { noop } from '
|
3
|
+
import { noop } from 'foremanReact/common/helpers';
|
4
4
|
import TabContainer from '../TabContainer';
|
5
5
|
import TabHeader from '../TabHeader';
|
6
6
|
import TabBody from '../TabBody';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import { noop } from '
|
3
|
+
import { noop } from 'foremanReact/common/helpers';
|
4
4
|
import TabContainer from '../TabContainer';
|
5
5
|
import TabHeader from '../TabHeader';
|
6
6
|
import TabBody from '../TabBody';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { connect } from 'react-redux';
|
2
2
|
|
3
3
|
import ScheduledRun from './ScheduledRun';
|
4
|
-
import { selectAutoUploadEnabled } from '../
|
4
|
+
import { selectAutoUploadEnabled } from '../InventorySettings/InventorySettingsSelectors';
|
5
5
|
|
6
6
|
// map state to props
|
7
7
|
const mapStateToProps = state => ({
|
@@ -1,11 +1,13 @@
|
|
1
|
-
.
|
2
|
-
|
1
|
+
.rh-cloud-inventory-page {
|
2
|
+
.scheduled_run {
|
3
|
+
font-size: 14px;
|
3
4
|
|
4
|
-
|
5
|
-
|
5
|
+
p {
|
6
|
+
margin: 0 0 -10px 0;
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
.fa {
|
9
|
+
margin-right: 5px;
|
10
|
+
}
|
9
11
|
}
|
10
12
|
}
|
11
13
|
}
|
@@ -1,8 +1,10 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
.rh-cloud-inventory-page {
|
2
|
+
.status-chart {
|
3
|
+
display: flex;
|
4
|
+
align-items: center;
|
5
|
+
-webkit-justify-content: center;
|
6
|
+
justify-content: center;
|
7
|
+
margin: 10%;
|
8
|
+
padding: 5%;
|
9
|
+
}
|
8
10
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import {
|
3
|
+
import { Grid, Button, Icon } from 'patternfly-react';
|
4
|
+
import { noop } from 'foremanReact/common/helpers';
|
4
5
|
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
|
5
6
|
import { isExitCodeLoading } from '../../ForemanInventoryHelpers';
|
6
7
|
import './tabHeader.scss';
|
@@ -1,20 +1,22 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
p {
|
7
|
-
font-size: 16px;
|
8
|
-
}
|
1
|
+
.rh-cloud-inventory-page {
|
2
|
+
.tab-header {
|
3
|
+
h1 {
|
4
|
+
margin-top: 0;
|
5
|
+
}
|
9
6
|
|
10
|
-
|
11
|
-
|
7
|
+
p {
|
8
|
+
font-size: 16px;
|
9
|
+
}
|
12
10
|
|
13
|
-
|
14
|
-
|
11
|
+
.tab-action-buttons {
|
12
|
+
float: right;
|
15
13
|
|
16
|
-
|
14
|
+
button {
|
17
15
|
margin-left: 5px;
|
16
|
+
|
17
|
+
span {
|
18
|
+
margin-left: 5px;
|
19
|
+
}
|
18
20
|
}
|
19
21
|
}
|
20
22
|
}
|
@@ -1,32 +1,34 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
.rh-cloud-inventory-page {
|
2
|
+
.terminal {
|
3
|
+
height: 200px;
|
4
|
+
background-color: #222;
|
5
|
+
padding: 10px 0;
|
6
|
+
margin-bottom: 20px;
|
7
|
+
overflow-y: scroll;
|
8
|
+
overflow-x: hidden;
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
p {
|
11
|
+
font-family: monospace;
|
12
|
+
font-size: 16px;
|
13
|
+
color: #22da26;
|
14
|
+
overflow-wrap: anywhere;
|
14
15
|
|
15
|
-
|
16
|
-
|
16
|
+
&.terminal_error {
|
17
|
+
color: #f00;
|
18
|
+
}
|
17
19
|
}
|
18
|
-
}
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
&::-webkit-scrollbar {
|
22
|
+
width: 12px;
|
23
|
+
height: 12px;
|
24
|
+
background: #aaa;
|
25
|
+
}
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
&::-webkit-scrollbar-thumb {
|
28
|
+
background: #222;
|
29
|
+
border-radius: 6px;
|
30
|
+
border: 3px solid transparent;
|
31
|
+
background-clip: content-box;
|
32
|
+
}
|
31
33
|
}
|
32
34
|
}
|
@@ -4,7 +4,7 @@ import AccountList from './Components/AccountList';
|
|
4
4
|
import PageHeader from './Components/PageHeader';
|
5
5
|
|
6
6
|
const ForemanInventoryUpload = () => (
|
7
|
-
<div className="rh-cloud-page">
|
7
|
+
<div className="rh-cloud-inventory-page">
|
8
8
|
<PageLayout searchable={false} beforeToolbarComponent={<PageHeader />}>
|
9
9
|
<AccountList />
|
10
10
|
</PageLayout>
|
@@ -7,16 +7,21 @@ import { translate as __ } from 'foremanReact/common/I18n';
|
|
7
7
|
import { foremanUrl } from '../../../ForemanRhCloudHelpers';
|
8
8
|
import Switcher from '../../../common/Switcher';
|
9
9
|
import AdvancedSettings from './components/AdvancedSettings';
|
10
|
+
import { settingsDict } from '../../Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants';
|
10
11
|
|
11
12
|
const InventoryAutoUploadSwitcher = ({
|
12
13
|
autoUploadEnabled,
|
13
|
-
|
14
|
-
|
14
|
+
setSetting,
|
15
|
+
getSettings,
|
15
16
|
}) => {
|
16
17
|
useEffect(() => {
|
17
|
-
|
18
|
-
}, [
|
19
|
-
|
18
|
+
getSettings();
|
19
|
+
}, [getSettings]);
|
20
|
+
const handleToggle = () =>
|
21
|
+
setSetting({
|
22
|
+
setting: settingsDict.autoUploadEnabled.name,
|
23
|
+
value: !autoUploadEnabled,
|
24
|
+
});
|
20
25
|
return (
|
21
26
|
<FormGroup>
|
22
27
|
<Grid>
|
@@ -30,7 +35,7 @@ const InventoryAutoUploadSwitcher = ({
|
|
30
35
|
'Enable automatic upload of your hosts inventory to the Red Hat cloud'
|
31
36
|
)}
|
32
37
|
isChecked={autoUploadEnabled}
|
33
|
-
onChange={
|
38
|
+
onChange={handleToggle}
|
34
39
|
labelCol={5}
|
35
40
|
/>
|
36
41
|
|
@@ -81,8 +86,8 @@ const InventoryAutoUploadSwitcher = ({
|
|
81
86
|
|
82
87
|
InventoryAutoUploadSwitcher.propTypes = {
|
83
88
|
autoUploadEnabled: PropTypes.bool,
|
84
|
-
|
85
|
-
|
89
|
+
setSetting: PropTypes.func.isRequired,
|
90
|
+
getSettings: PropTypes.func.isRequired,
|
86
91
|
};
|
87
92
|
|
88
93
|
InventoryAutoUploadSwitcher.defaultProps = {
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
2
|
-
import { noop } from '
|
2
|
+
import { noop } from 'foremanReact/common/helpers';
|
3
3
|
|
4
4
|
import InventoryAutoUpload from '../InventoryAutoUpload';
|
5
5
|
|
6
6
|
const fixtures = {
|
7
7
|
'render with props': {
|
8
8
|
autoUploadEnabled: true,
|
9
|
-
|
10
|
-
|
9
|
+
setSetting: noop,
|
10
|
+
getSettings: noop,
|
11
11
|
},
|
12
12
|
};
|
13
13
|
|