foreman_rh_cloud 0.9.5 → 2.0.4
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 +0 -1
- data/app/controllers/foreman_inventory_upload/uploads_controller.rb +7 -14
- data/config/routes.rb +0 -1
- data/lib/foreman_inventory_upload.rb +0 -12
- data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +0 -8
- data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +10 -5
- data/lib/foreman_inventory_upload/async/upload_report_job.rb +1 -5
- data/lib/foreman_inventory_upload/generators/archived_report.rb +3 -6
- data/lib/foreman_inventory_upload/generators/queries.rb +0 -1
- data/lib/foreman_inventory_upload/generators/slice.rb +4 -20
- data/lib/foreman_inventory_upload/scripts/uploader.sh.erb +1 -0
- data/lib/foreman_rh_cloud/engine.rb +1 -5
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +20 -100
- data/test/controllers/accounts_controller_test.rb +3 -8
- data/test/controllers/uploads_controller_test.rb +0 -13
- data/test/unit/slice_generator_test.rb +2 -45
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +5 -14
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +1 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +0 -8
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +1 -12
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +2 -10
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +0 -10
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +2 -5
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +13 -9
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +5 -15
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +1 -2
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +15 -2
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +2 -3
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +5 -2
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +1 -2
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +1 -1
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +2 -4
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +2 -1
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +2 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -12
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +1 -2
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +4 -5
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +1 -1
- data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +5 -6
- metadata +34 -28
- data/app/models/setting/rh_cloud.rb +0 -18
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js +0 -32
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +0 -27
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +0 -14
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap +0 -38
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap +0 -14
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/autoUploadSwitcher.scss +0 -3
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js +0 -17
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +0 -21
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +0 -13
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +0 -33
- data/webpack/ForemanInventoryUpload/Components/PageHeader/index.js +0 -1
- data/webpack/stories/ForemanInventoryUploadReducers.js +0 -3
- data/webpack/stories/configureStore.js +0 -15
- data/webpack/stories/decorators/index.js +0 -1
- data/webpack/stories/decorators/withCardsDecorator.js +0 -14
- data/webpack/stories/index.js +0 -10
- data/webpack/stories/index.scss +0 -7
- data/webpack/test_setup.js +0 -6
@@ -1,10 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { noop } from 'patternfly-react';
|
3
|
+
|
1
4
|
export const props = {
|
2
5
|
items: [
|
3
6
|
{
|
4
7
|
icon: 'some-icon',
|
5
8
|
name: 'some-name',
|
6
|
-
component:
|
7
|
-
onClick:
|
9
|
+
component: () => <p>test</p>,
|
10
|
+
onClick: noop,
|
8
11
|
},
|
9
12
|
],
|
10
13
|
};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { mount } from '
|
3
|
-
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
import { mount, testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
4
3
|
import NavContainer from '../NavContainer';
|
5
4
|
import { props } from '../NavContainer.fixtures';
|
6
5
|
|
@@ -5,8 +5,8 @@ import { FormattedRelative } from 'react-intl';
|
|
5
5
|
import { translate as __ } from 'foremanReact/common/I18n';
|
6
6
|
import './scheduledRun.scss';
|
7
7
|
|
8
|
-
const ScheduledRun = ({ date
|
9
|
-
|
8
|
+
const ScheduledRun = ({ date }) =>
|
9
|
+
date ? (
|
10
10
|
<Grid.Col sm={12} className="scheduled_run">
|
11
11
|
<p>
|
12
12
|
<Icon name="calendar" />
|
@@ -18,12 +18,10 @@ const ScheduledRun = ({ date, autoUploadEnabled }) =>
|
|
18
18
|
|
19
19
|
ScheduledRun.propTypes = {
|
20
20
|
date: PropTypes.string,
|
21
|
-
autoUploadEnabled: PropTypes.bool,
|
22
21
|
};
|
23
22
|
|
24
23
|
ScheduledRun.defaultProps = {
|
25
24
|
date: null,
|
26
|
-
autoUploadEnabled: true,
|
27
25
|
};
|
28
26
|
|
29
27
|
export default ScheduledRun;
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { testComponentSnapshotsWithFixtures } from '
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
2
2
|
|
3
3
|
import ScheduledRun from '../ScheduledRun';
|
4
4
|
import { props } from '../ScheduledRun.fixtures';
|
5
5
|
|
6
6
|
const fixtures = {
|
7
|
+
'render without Props': {},
|
7
8
|
'render with Props': props,
|
8
9
|
};
|
9
10
|
|
@@ -1,12 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import ScheduledRun from './ScheduledRun';
|
4
|
-
import { selectAutoUploadEnabled } from '../AccountList/AccountListSelectors';
|
5
|
-
|
6
|
-
// map state to props
|
7
|
-
const mapStateToProps = state => ({
|
8
|
-
autoUploadEnabled: selectAutoUploadEnabled(state),
|
9
|
-
});
|
10
|
-
|
11
|
-
// export connected component
|
12
|
-
export default connect(mapStateToProps)(ScheduledRun);
|
1
|
+
export { default } from './ScheduledRun';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Grid, Spinner } from 'patternfly-react';
|
4
|
-
import isEqual from 'lodash
|
4
|
+
import { isEqual } from 'lodash';
|
5
5
|
import './terminal.scss';
|
6
6
|
import { isTerminalScrolledDown } from './TerminalHelper';
|
7
7
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { testComponentSnapshotsWithFixtures } from '
|
3
|
-
import { mount } from 'enzyme';
|
2
|
+
import { mount, testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
4
3
|
import Terminal from '../Terminal';
|
5
4
|
import { props, logs } from '../Terminal.fixtures';
|
6
5
|
|
@@ -1,15 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IntlProvider } from 'react-intl';
|
3
|
-
import {
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
4
|
import AccountList from './Components/AccountList';
|
5
|
-
import PageHeader from './Components/PageHeader';
|
6
5
|
|
7
6
|
const ForemanInventoryUpload = () => (
|
8
7
|
<IntlProvider locale={navigator.language}>
|
9
|
-
<
|
10
|
-
<
|
8
|
+
<div className="inventory-upload">
|
9
|
+
<h1>{__('Red Hat Inventory Uploads')}</h1>
|
11
10
|
<AccountList />
|
12
|
-
</
|
11
|
+
</div>
|
13
12
|
</IntlProvider>
|
14
13
|
);
|
15
14
|
|
@@ -4,14 +4,13 @@ exports[`ForemanInventoryUpload render without Props 1`] = `
|
|
4
4
|
<IntlProvider
|
5
5
|
locale="en-US"
|
6
6
|
>
|
7
|
-
<
|
8
|
-
bsClass="container"
|
7
|
+
<div
|
9
8
|
className="inventory-upload"
|
10
|
-
componentClass="div"
|
11
|
-
fluid={true}
|
12
9
|
>
|
13
|
-
<
|
10
|
+
<h1>
|
11
|
+
Red Hat Inventory Uploads
|
12
|
+
</h1>
|
14
13
|
<Connect(AccountList) />
|
15
|
-
</
|
14
|
+
</div>
|
16
15
|
</IntlProvider>
|
17
16
|
`;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_rh_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Red Hat Cloud team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -56,16 +56,44 @@ dependencies:
|
|
56
56
|
name: rubocop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-performance
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
60
81
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- - "
|
94
|
+
- - ">="
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0
|
96
|
+
version: '0'
|
69
97
|
description: Foreman plugin that process & upload data to Red Hat Cloud
|
70
98
|
email:
|
71
99
|
- rlavi@redhat.com, sshtein@redhat.com
|
@@ -81,7 +109,6 @@ files:
|
|
81
109
|
- app/controllers/foreman_inventory_upload/reports_controller.rb
|
82
110
|
- app/controllers/foreman_inventory_upload/uploads_controller.rb
|
83
111
|
- app/helpers/foreman_inventory_upload_helper.rb
|
84
|
-
- app/models/setting/rh_cloud.rb
|
85
112
|
- app/views/foreman_inventory_upload/layouts/react.html.erb
|
86
113
|
- config/routes.rb
|
87
114
|
- lib/foreman_inventory_upload.rb
|
@@ -164,16 +191,6 @@ files:
|
|
164
191
|
- webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap
|
165
192
|
- webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss
|
166
193
|
- webpack/ForemanInventoryUpload/Components/AccountList/index.js
|
167
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js
|
168
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js
|
169
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js
|
170
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js
|
171
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js
|
172
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
|
173
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap
|
174
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap
|
175
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/autoUploadSwitcher.scss
|
176
|
-
- webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js
|
177
194
|
- webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js
|
178
195
|
- webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js
|
179
196
|
- webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js
|
@@ -214,10 +231,6 @@ files:
|
|
214
231
|
- webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap
|
215
232
|
- webpack/ForemanInventoryUpload/Components/NavContainer/index.js
|
216
233
|
- webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss
|
217
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js
|
218
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js
|
219
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap
|
220
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/index.js
|
221
234
|
- webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js
|
222
235
|
- webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js
|
223
236
|
- webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js
|
@@ -291,13 +304,6 @@ files:
|
|
291
304
|
- webpack/__mocks__/foremanReact/common/I18n.js
|
292
305
|
- webpack/__mocks__/foremanReact/common/helpers.js
|
293
306
|
- webpack/index.js
|
294
|
-
- webpack/stories/ForemanInventoryUploadReducers.js
|
295
|
-
- webpack/stories/configureStore.js
|
296
|
-
- webpack/stories/decorators/index.js
|
297
|
-
- webpack/stories/decorators/withCardsDecorator.js
|
298
|
-
- webpack/stories/index.js
|
299
|
-
- webpack/stories/index.scss
|
300
|
-
- webpack/test_setup.js
|
301
307
|
homepage: https://github.com/theforeman/foreman_rh_cloud
|
302
308
|
licenses:
|
303
309
|
- GPL-3.0
|
@@ -1,18 +0,0 @@
|
|
1
|
-
class Setting::RhCloud < Setting
|
2
|
-
def self.load_defaults
|
3
|
-
return unless ActiveRecord::Base.connection.table_exists?('settings')
|
4
|
-
return unless super
|
5
|
-
|
6
|
-
transaction do
|
7
|
-
[
|
8
|
-
set('allow_auto_inventory_upload', N_('Allow automatic upload of the host inventory to the Red Hat cloud'), true),
|
9
|
-
].each { |s| create! s.update(:category => 'Setting::RhCloud')}
|
10
|
-
end
|
11
|
-
|
12
|
-
true
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.humanized_category
|
16
|
-
N_('RH Cloud')
|
17
|
-
end
|
18
|
-
end
|
data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export const handleToggleResponse = { data: { autoUploadEnabled: true } };
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import { Switch, FieldLevelHelp } from 'patternfly-react';
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
5
|
-
import './autoUploadSwitcher.scss';
|
6
|
-
|
7
|
-
const AutoUploadSwitcher = ({ autoUploadEnabled, handleToggle }) => (
|
8
|
-
<div className="auto_upload_switcher">
|
9
|
-
<Switch
|
10
|
-
size="mini"
|
11
|
-
value={autoUploadEnabled}
|
12
|
-
onChange={() => handleToggle(autoUploadEnabled)}
|
13
|
-
/>
|
14
|
-
<FieldLevelHelp
|
15
|
-
content={__(
|
16
|
-
'Enable automatic upload of your host inventory to the Red Hat cloud'
|
17
|
-
)}
|
18
|
-
/>
|
19
|
-
<span>Allow Auto Upload</span>
|
20
|
-
</div>
|
21
|
-
);
|
22
|
-
|
23
|
-
AutoUploadSwitcher.propTypes = {
|
24
|
-
autoUploadEnabled: PropTypes.bool,
|
25
|
-
handleToggle: PropTypes.func.isRequired,
|
26
|
-
};
|
27
|
-
|
28
|
-
AutoUploadSwitcher.defaultProps = {
|
29
|
-
autoUploadEnabled: true,
|
30
|
-
};
|
31
|
-
|
32
|
-
export default AutoUploadSwitcher;
|
data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import API from 'foremanReact/API';
|
2
|
-
import {
|
3
|
-
AUTO_UPLOAD_TOGGLE,
|
4
|
-
AUTO_UPLOAD_TOGGLE_ERROR,
|
5
|
-
} from './AutoUploadSwitcherConstants';
|
6
|
-
|
7
|
-
export const handleToggle = currentAutoUploadEnabled => async dispatch => {
|
8
|
-
const toggledAutoUploadEnabled = !currentAutoUploadEnabled;
|
9
|
-
try {
|
10
|
-
const {
|
11
|
-
data: { autoUploadEnabled },
|
12
|
-
} = await API.post('auto_upload', { value: toggledAutoUploadEnabled });
|
13
|
-
dispatch({
|
14
|
-
type: AUTO_UPLOAD_TOGGLE,
|
15
|
-
payload: {
|
16
|
-
autoUploadEnabled,
|
17
|
-
},
|
18
|
-
});
|
19
|
-
} catch (error) {
|
20
|
-
dispatch({
|
21
|
-
type: AUTO_UPLOAD_TOGGLE_ERROR,
|
22
|
-
payload: {
|
23
|
-
error: error.message,
|
24
|
-
},
|
25
|
-
});
|
26
|
-
}
|
27
|
-
};
|