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,14 +0,0 @@
|
|
1
|
-
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
-
import { noop } from 'patternfly-react';
|
3
|
-
|
4
|
-
import AutoUploadSwitcher from '../AutoUploadSwitcher';
|
5
|
-
|
6
|
-
const fixtures = {
|
7
|
-
'render with props': { autoUploadEnabled: true, handleToggle: noop },
|
8
|
-
/** fixtures, props for the component */
|
9
|
-
};
|
10
|
-
|
11
|
-
describe('AutoUploadSwitcher', () => {
|
12
|
-
describe('rendering', () =>
|
13
|
-
testComponentSnapshotsWithFixtures(AutoUploadSwitcher, fixtures));
|
14
|
-
});
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { testActionSnapshotWithFixtures } from 'react-redux-test-utils';
|
2
|
-
import API from 'foremanReact/API';
|
3
|
-
import { handleToggle } from '../AutoUploadSwitcherActions';
|
4
|
-
import { handleToggleResponse } from '../AutoUploadSwitcher.fixtures';
|
5
|
-
|
6
|
-
jest.mock('foremanReact/API');
|
7
|
-
API.post.mockImplementation(async () => handleToggleResponse);
|
8
|
-
|
9
|
-
const fixtures = {
|
10
|
-
'should handleToggle': () => handleToggle(),
|
11
|
-
};
|
12
|
-
|
13
|
-
describe('AutoUploadSwitcher actions', () =>
|
14
|
-
testActionSnapshotWithFixtures(fixtures));
|
@@ -1,38 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`AutoUploadSwitcher rendering render with props 1`] = `
|
4
|
-
<div
|
5
|
-
className="auto_upload_switcher"
|
6
|
-
>
|
7
|
-
<Switch
|
8
|
-
animate={true}
|
9
|
-
baseClass="bootstrap-switch"
|
10
|
-
bsSize={null}
|
11
|
-
defaultValue={true}
|
12
|
-
disabled={false}
|
13
|
-
handleWidth="auto"
|
14
|
-
inverse={false}
|
15
|
-
labelText=" "
|
16
|
-
labelWidth="auto"
|
17
|
-
offColor="default"
|
18
|
-
offText="OFF"
|
19
|
-
onChange={[Function]}
|
20
|
-
onColor="primary"
|
21
|
-
onText="ON"
|
22
|
-
readonly={false}
|
23
|
-
size="mini"
|
24
|
-
tristate={false}
|
25
|
-
value={true}
|
26
|
-
wrapperClass="wrapper"
|
27
|
-
/>
|
28
|
-
<FieldLevelHelp
|
29
|
-
buttonClass=""
|
30
|
-
content="Enable automatic upload of your host inventory to the Red Hat cloud"
|
31
|
-
placement="top"
|
32
|
-
rootClose={true}
|
33
|
-
/>
|
34
|
-
<span>
|
35
|
-
Allow Auto Upload
|
36
|
-
</span>
|
37
|
-
</div>
|
38
|
-
`;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`AutoUploadSwitcher actions should handleToggle 1`] = `
|
4
|
-
Array [
|
5
|
-
Array [
|
6
|
-
Object {
|
7
|
-
"payload": Object {
|
8
|
-
"autoUploadEnabled": true,
|
9
|
-
},
|
10
|
-
"type": "AUTO_UPLOAD_TOGGLE",
|
11
|
-
},
|
12
|
-
],
|
13
|
-
]
|
14
|
-
`;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { bindActionCreators } from 'redux';
|
2
|
-
import { connect } from 'react-redux';
|
3
|
-
|
4
|
-
import * as actions from './AutoUploadSwitcherActions';
|
5
|
-
import AutoUploadSwitcher from './AutoUploadSwitcher';
|
6
|
-
import { selectAutoUploadEnabled } from '../AccountList/AccountListSelectors';
|
7
|
-
|
8
|
-
// map state to props
|
9
|
-
const mapStateToProps = state => ({
|
10
|
-
autoUploadEnabled: selectAutoUploadEnabled(state),
|
11
|
-
});
|
12
|
-
|
13
|
-
// map action dispatchers to props
|
14
|
-
const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
|
15
|
-
|
16
|
-
// export connected component
|
17
|
-
export default connect(mapStateToProps, mapDispatchToProps)(AutoUploadSwitcher);
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Grid } from 'patternfly-react';
|
3
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
-
import AutoUploadSwitcher from '../AutoUploadSwitcher';
|
5
|
-
|
6
|
-
const PageHeader = () => (
|
7
|
-
<React.Fragment>
|
8
|
-
<Grid.Row>
|
9
|
-
<Grid.Col xs={12}>
|
10
|
-
<h1>{__('Red Hat Inventory Uploads')}</h1>
|
11
|
-
</Grid.Col>
|
12
|
-
</Grid.Row>
|
13
|
-
<Grid.Row>
|
14
|
-
<Grid.Col xs={4} xsOffset={8}>
|
15
|
-
<AutoUploadSwitcher />
|
16
|
-
</Grid.Col>
|
17
|
-
</Grid.Row>
|
18
|
-
</React.Fragment>
|
19
|
-
);
|
20
|
-
|
21
|
-
export default PageHeader;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
-
|
3
|
-
import PageHeader from '../PageHeader';
|
4
|
-
|
5
|
-
const fixtures = {
|
6
|
-
'render without Props': {},
|
7
|
-
/** fixtures, props for the component */
|
8
|
-
};
|
9
|
-
|
10
|
-
describe('PageHeader', () => {
|
11
|
-
describe('rendering', () =>
|
12
|
-
testComponentSnapshotsWithFixtures(PageHeader, fixtures));
|
13
|
-
});
|
@@ -1,33 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`PageHeader rendering render without Props 1`] = `
|
4
|
-
<Fragment>
|
5
|
-
<Row
|
6
|
-
bsClass="row"
|
7
|
-
componentClass="div"
|
8
|
-
>
|
9
|
-
<Col
|
10
|
-
bsClass="col"
|
11
|
-
componentClass="div"
|
12
|
-
xs={12}
|
13
|
-
>
|
14
|
-
<h1>
|
15
|
-
Red Hat Inventory Uploads
|
16
|
-
</h1>
|
17
|
-
</Col>
|
18
|
-
</Row>
|
19
|
-
<Row
|
20
|
-
bsClass="row"
|
21
|
-
componentClass="div"
|
22
|
-
>
|
23
|
-
<Col
|
24
|
-
bsClass="col"
|
25
|
-
componentClass="div"
|
26
|
-
xs={4}
|
27
|
-
xsOffset={8}
|
28
|
-
>
|
29
|
-
<Connect(AutoUploadSwitcher) />
|
30
|
-
</Col>
|
31
|
-
</Row>
|
32
|
-
</Fragment>
|
33
|
-
`;
|
@@ -1 +0,0 @@
|
|
1
|
-
export { default } from './PageHeader';
|
@@ -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
|
-
);
|
data/webpack/stories/index.js
DELETED
data/webpack/stories/index.scss
DELETED
@@ -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';
|