foreman_rh_cloud 0.9.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +1 -0
  3. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +14 -7
  4. data/app/models/setting/rh_cloud.rb +13 -0
  5. data/config/routes.rb +1 -0
  6. data/lib/foreman_inventory_upload.rb +12 -0
  7. data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +8 -0
  8. data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +10 -5
  9. data/lib/foreman_inventory_upload/async/upload_report_job.rb +1 -5
  10. data/lib/foreman_inventory_upload/generators/archived_report.rb +6 -3
  11. data/lib/foreman_inventory_upload/generators/queries.rb +1 -0
  12. data/lib/foreman_inventory_upload/generators/slice.rb +20 -4
  13. data/lib/foreman_inventory_upload/scripts/uploader.sh.erb +1 -0
  14. data/lib/foreman_rh_cloud/engine.rb +5 -1
  15. data/lib/foreman_rh_cloud/version.rb +1 -1
  16. data/package.json +20 -100
  17. data/test/controllers/accounts_controller_test.rb +8 -3
  18. data/test/controllers/uploads_controller_test.rb +13 -0
  19. data/test/factories/inventory_upload_factories.rb +13 -13
  20. data/test/unit/slice_generator_test.rb +47 -4
  21. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +2 -0
  22. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +5 -14
  23. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +2 -1
  24. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +8 -0
  25. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +2 -0
  26. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +1 -1
  27. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +1 -1
  28. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +1 -1
  29. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +1 -1
  30. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +1 -1
  31. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +1 -1
  32. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +1 -1
  33. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +12 -1
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +10 -2
  35. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +10 -0
  36. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +5 -2
  37. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +1 -0
  38. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js +32 -0
  39. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +27 -0
  40. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js +2 -0
  41. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +14 -0
  42. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +14 -0
  43. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap +38 -0
  44. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap +14 -0
  45. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/autoUploadSwitcher.scss +3 -0
  46. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js +17 -0
  47. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +13 -9
  48. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +5 -15
  49. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +1 -2
  50. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +15 -2
  51. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +3 -2
  52. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +1 -1
  53. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +1 -1
  54. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +1 -1
  55. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +1 -1
  56. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +5 -2
  57. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +1 -2
  58. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +1 -1
  59. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +21 -0
  60. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +13 -0
  61. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +33 -0
  62. data/webpack/ForemanInventoryUpload/Components/PageHeader/index.js +1 -0
  63. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +1 -1
  64. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +1 -1
  65. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +1 -0
  66. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +4 -2
  67. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +1 -2
  68. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +0 -2
  69. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +12 -1
  70. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +1 -1
  71. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +1 -1
  72. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +1 -1
  73. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +1 -1
  74. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +1 -1
  75. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +1 -1
  76. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +1 -1
  77. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +1 -2
  78. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +5 -4
  79. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +1 -1
  80. data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +6 -5
  81. metadata +49 -13
  82. data/webpack/stories/ForemanInventoryUploadReducers.js +0 -3
  83. data/webpack/stories/configureStore.js +0 -15
  84. data/webpack/stories/decorators/index.js +0 -1
  85. data/webpack/stories/decorators/withCardsDecorator.js +0 -14
  86. data/webpack/stories/index.js +0 -10
  87. data/webpack/stories/index.scss +0 -7
  88. data/webpack/test_setup.js +0 -6
@@ -1 +1,12 @@
1
- export { default } from './ScheduledRun';
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,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
- <ScheduledRun
15
+ <Connect(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,14 +1,15 @@
1
1
  import React from 'react';
2
2
  import { IntlProvider } from 'react-intl';
3
- import { translate as __ } from 'foremanReact/common/I18n';
3
+ import { Grid } from 'patternfly-react';
4
4
  import AccountList from './Components/AccountList';
5
+ import PageHeader from './Components/PageHeader';
5
6
 
6
7
  const ForemanInventoryUpload = () => (
7
8
  <IntlProvider locale={navigator.language}>
8
- <div className="inventory-upload">
9
- <h1>{__('Red Hat Inventory Uploads')}</h1>
9
+ <Grid fluid className="inventory-upload">
10
+ <PageHeader />
10
11
  <AccountList />
11
- </div>
12
+ </Grid>
12
13
  </IntlProvider>
13
14
  );
14
15
 
@@ -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,13 +4,14 @@ exports[`ForemanInventoryUpload render without Props 1`] = `
4
4
  <IntlProvider
5
5
  locale="en-US"
6
6
  >
7
- <div
7
+ <Grid
8
+ bsClass="container"
8
9
  className="inventory-upload"
10
+ componentClass="div"
11
+ fluid={true}
9
12
  >
10
- <h1>
11
- Red Hat Inventory Uploads
12
- </h1>
13
+ <PageHeader />
13
14
  <Connect(AccountList) />
14
- </div>
15
+ </Grid>
15
16
  </IntlProvider>
16
17
  `;
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.4
4
+ version: 2.0.5
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-03-09 00:00:00.000000000 Z
11
+ date: 2020-04-07 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,6 +109,7 @@ 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
112
+ - app/models/setting/rh_cloud.rb
84
113
  - app/views/foreman_inventory_upload/layouts/react.html.erb
85
114
  - config/routes.rb
86
115
  - lib/foreman_inventory_upload.rb
@@ -163,6 +192,16 @@ files:
163
192
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap
164
193
  - webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss
165
194
  - webpack/ForemanInventoryUpload/Components/AccountList/index.js
195
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js
196
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js
197
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js
198
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js
199
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js
200
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
201
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap
202
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap
203
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/autoUploadSwitcher.scss
204
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js
166
205
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js
167
206
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js
168
207
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js
@@ -203,6 +242,10 @@ files:
203
242
  - webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap
204
243
  - webpack/ForemanInventoryUpload/Components/NavContainer/index.js
205
244
  - webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss
245
+ - webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js
246
+ - webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js
247
+ - webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap
248
+ - webpack/ForemanInventoryUpload/Components/PageHeader/index.js
206
249
  - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js
207
250
  - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js
208
251
  - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js
@@ -276,13 +319,6 @@ files:
276
319
  - webpack/__mocks__/foremanReact/common/I18n.js
277
320
  - webpack/__mocks__/foremanReact/common/helpers.js
278
321
  - webpack/index.js
279
- - webpack/stories/ForemanInventoryUploadReducers.js
280
- - webpack/stories/configureStore.js
281
- - webpack/stories/decorators/index.js
282
- - webpack/stories/decorators/withCardsDecorator.js
283
- - webpack/stories/index.js
284
- - webpack/stories/index.scss
285
- - webpack/test_setup.js
286
322
  homepage: https://github.com/theforeman/foreman_rh_cloud
287
323
  licenses:
288
324
  - GPL-3.0
@@ -1,3 +0,0 @@
1
- import reducers from '../ForemanInventoryUpload/ForemanInventoryUploadReducers';
2
-
3
- export default reducers.ForemanInventoryUpload;
@@ -1,15 +0,0 @@
1
- import { applyMiddleware, compose, createStore } from 'redux';
2
- import thunkMiddleware from 'redux-thunk';
3
- import rootReducer from './ForemanInventoryUploadReducers';
4
-
5
- export default function configureStore(preloadedState) {
6
- const middlewares = [thunkMiddleware];
7
- const middlewareEnhancer = applyMiddleware(...middlewares);
8
-
9
- const enhancers = [middlewareEnhancer];
10
- const composedEnhancers = compose(...enhancers);
11
-
12
- const store = createStore(rootReducer, preloadedState, composedEnhancers);
13
-
14
- return store;
15
- }
@@ -1 +0,0 @@
1
- export * from './withCardsDecorator';
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
-
3
- export const withCardsDecorator = storyFn => (
4
- <div
5
- style={{
6
- width: '100%',
7
- height: '100vh',
8
- backgroundColor: '#F5F5F5',
9
- padding: '50px',
10
- }}
11
- >
12
- <div style={{ width: '300px', margin: 'auto' }}>{storyFn()}</div>
13
- </div>
14
- );
@@ -1,10 +0,0 @@
1
- import { configure } from '@storybook/react';
2
- import './index.scss';
3
-
4
- const req = require.context('../', true, /.stories.js$/);
5
-
6
- function loadStories() {
7
- req.keys().forEach(filename => req(filename));
8
- }
9
-
10
- configure(loadStories, module);
@@ -1,7 +0,0 @@
1
- $img-path: '~patternfly/dist/img/';
2
- $font-path: '~patternfly/dist/fonts/';
3
- $icon-font-path: '~patternfly/dist/fonts/';
4
-
5
- @import '~patternfly/dist/sass/patternfly';
6
- @import '~patternfly-react/dist/sass/patternfly-react';
7
- @import '~font-awesome-sass/assets/stylesheets/_font-awesome';
@@ -1,6 +0,0 @@
1
- import 'babel-polyfill';
2
-
3
- import { configure } from 'enzyme';
4
- import Adapter from 'enzyme-adapter-react-16';
5
-
6
- configure({ adapter: new Adapter() });