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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +0 -1
  3. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +7 -14
  4. data/config/routes.rb +0 -1
  5. data/lib/foreman_inventory_upload.rb +0 -12
  6. data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +0 -8
  7. data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +10 -5
  8. data/lib/foreman_inventory_upload/async/upload_report_job.rb +1 -5
  9. data/lib/foreman_inventory_upload/generators/archived_report.rb +3 -6
  10. data/lib/foreman_inventory_upload/generators/queries.rb +0 -1
  11. data/lib/foreman_inventory_upload/generators/slice.rb +4 -20
  12. data/lib/foreman_inventory_upload/scripts/uploader.sh.erb +1 -0
  13. data/lib/foreman_rh_cloud/engine.rb +1 -5
  14. data/lib/foreman_rh_cloud/version.rb +1 -1
  15. data/package.json +20 -100
  16. data/test/controllers/accounts_controller_test.rb +3 -8
  17. data/test/controllers/uploads_controller_test.rb +0 -13
  18. data/test/unit/slice_generator_test.rb +2 -45
  19. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +0 -2
  20. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +5 -14
  21. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +1 -2
  22. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +0 -8
  23. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +0 -2
  24. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +1 -1
  25. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +1 -1
  26. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +1 -1
  27. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +1 -1
  28. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +1 -1
  29. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +1 -1
  30. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +1 -1
  31. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +1 -12
  32. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +2 -10
  33. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +0 -10
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +2 -5
  35. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +13 -9
  36. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +5 -15
  37. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +1 -2
  38. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +15 -2
  39. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +2 -3
  40. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +1 -1
  41. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +1 -1
  42. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +1 -1
  43. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +1 -1
  44. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +5 -2
  45. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +1 -2
  46. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +1 -1
  47. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +1 -1
  48. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +1 -1
  49. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +0 -1
  50. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +2 -4
  51. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +2 -1
  52. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +2 -0
  53. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -12
  54. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +1 -1
  55. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +1 -1
  56. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +1 -1
  57. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +1 -1
  58. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +1 -1
  59. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +1 -1
  60. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +1 -1
  61. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +1 -2
  62. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +4 -5
  63. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +1 -1
  64. data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +5 -6
  65. metadata +34 -28
  66. data/app/models/setting/rh_cloud.rb +0 -18
  67. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +0 -1
  68. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js +0 -32
  69. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +0 -27
  70. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js +0 -2
  71. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +0 -14
  72. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +0 -14
  73. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap +0 -38
  74. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap +0 -14
  75. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/autoUploadSwitcher.scss +0 -3
  76. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js +0 -17
  77. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +0 -21
  78. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +0 -13
  79. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +0 -33
  80. data/webpack/ForemanInventoryUpload/Components/PageHeader/index.js +0 -1
  81. data/webpack/stories/ForemanInventoryUploadReducers.js +0 -3
  82. data/webpack/stories/configureStore.js +0 -15
  83. data/webpack/stories/decorators/index.js +0 -1
  84. data/webpack/stories/decorators/withCardsDecorator.js +0 -14
  85. data/webpack/stories/index.js +0 -10
  86. data/webpack/stories/index.scss +0 -7
  87. data/webpack/test_setup.js +0 -6
@@ -1,4 +1,4 @@
1
- import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testReducerSnapshotWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import {
4
4
  INVENTORY_POLLING_START,
@@ -1,4 +1,4 @@
1
- import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
2
2
  import {
3
3
  selectDashboard,
4
4
  selectPollingProcessID,
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import FileDownload from '../FileDownload';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import FullScreenModal from '../FullScreenModal';
4
4
 
@@ -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: jest.fn,
7
- onClick: jest.fn,
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 'enzyme';
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
 
@@ -45,7 +45,7 @@ exports[`NavContainer rendering render with Props 1`] = `
45
45
  eventKey={0}
46
46
  key="0"
47
47
  >
48
- <bound fn />
48
+ <component />
49
49
  </TabPane>
50
50
  </TabContent>
51
51
  <FullScreenModal
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ReportGenerate from '../ReportGenerate';
4
4
  import { props } from '../ReportGenerate.fixtures';
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ReportUpload from '../ReportUpload';
4
4
  import { props } from '../ReportUpload.fixtures';
@@ -1,4 +1,3 @@
1
1
  export const props = {
2
2
  date: '2019-08-21T16:14:16.520+03:00',
3
- autoUploadEnabled: true,
4
3
  };
@@ -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, autoUploadEnabled }) =>
9
- autoUploadEnabled && date ? (
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 'react-redux-test-utils';
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
 
@@ -21,3 +21,5 @@ exports[`ScheduledRun rendering render with Props 1`] = `
21
21
  </p>
22
22
  </Col>
23
23
  `;
24
+
25
+ exports[`ScheduledRun rendering render without Props 1`] = `""`;
@@ -1,12 +1 @@
1
- import { connect } from 'react-redux';
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,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import StatusChart from '../StatusChart';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabBody from '../TabBody';
4
4
 
@@ -12,7 +12,7 @@ exports[`TabBody rendering render without Props 1`] = `
12
12
  exitCode=""
13
13
  logs={null}
14
14
  />
15
- <Connect(ScheduledRun)
15
+ <ScheduledRun
16
16
  date={null}
17
17
  />
18
18
  </Row>
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabContainer from '../TabContainer';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabFooter from '../TabFooter';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabHeader from '../TabHeader';
4
4
 
@@ -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/isEqual';
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 'react-redux-test-utils';
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 { Grid } from 'patternfly-react';
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
- <Grid fluid className="inventory-upload">
10
- <PageHeader />
8
+ <div className="inventory-upload">
9
+ <h1>{__('Red Hat Inventory Uploads')}</h1>
11
10
  <AccountList />
12
- </Grid>
11
+ </div>
13
12
  </IntlProvider>
14
13
  );
15
14
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ForemanInventoryUpload from './ForemanInventoryUpload';
4
4
 
@@ -4,14 +4,13 @@ exports[`ForemanInventoryUpload render without Props 1`] = `
4
4
  <IntlProvider
5
5
  locale="en-US"
6
6
  >
7
- <Grid
8
- bsClass="container"
7
+ <div
9
8
  className="inventory-upload"
10
- componentClass="div"
11
- fluid={true}
12
9
  >
13
- <PageHeader />
10
+ <h1>
11
+ Red Hat Inventory Uploads
12
+ </h1>
14
13
  <Connect(AccountList) />
15
- </Grid>
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.9.5
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-04-07 00:00:00.000000000 Z
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.54.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.54.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
@@ -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;
@@ -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
- };