foreman_rh_cloud 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +619 -0
- data/README.md +38 -0
- data/Rakefile +47 -0
- data/app/controllers/foreman_inventory_upload/accounts_controller.rb +39 -0
- data/app/controllers/foreman_inventory_upload/react_controller.rb +7 -0
- data/app/controllers/foreman_inventory_upload/reports_controller.rb +30 -0
- data/app/controllers/foreman_inventory_upload/uploads_controller.rb +31 -0
- data/app/helpers/foreman_inventory_upload_helper.rb +13 -0
- data/app/views/foreman_inventory_upload/layouts/react.html.erb +16 -0
- data/config/routes.rb +10 -0
- data/lib/foreman_inventory_upload.rb +51 -0
- data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +19 -0
- data/lib/foreman_inventory_upload/async/generate_report_job.rb +37 -0
- data/lib/foreman_inventory_upload/async/progress_output.rb +61 -0
- data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +47 -0
- data/lib/foreman_inventory_upload/async/shell_process.rb +36 -0
- data/lib/foreman_inventory_upload/async/upload_report_job.rb +58 -0
- data/lib/foreman_inventory_upload/generators/archived_report.rb +53 -0
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +18 -0
- data/lib/foreman_inventory_upload/generators/json_stream.rb +55 -0
- data/lib/foreman_inventory_upload/generators/metadata.rb +36 -0
- data/lib/foreman_inventory_upload/generators/queries.rb +61 -0
- data/lib/foreman_inventory_upload/generators/slice.rb +147 -0
- data/lib/foreman_inventory_upload/scripts/uploader.sh.erb +44 -0
- data/lib/foreman_rh_cloud.rb +4 -0
- data/lib/foreman_rh_cloud/engine.rb +62 -0
- data/lib/foreman_rh_cloud/version.rb +3 -0
- data/lib/tasks/foreman_rh_cloud_tasks.rake +37 -0
- data/lib/tasks/generator.rake +29 -0
- data/locale/Makefile +60 -0
- data/locale/en/foreman_rh_cloud.po +19 -0
- data/locale/foreman_rh_cloud.pot +19 -0
- data/locale/gemspec.rb +2 -0
- data/package.json +125 -0
- data/test/controllers/accounts_controller_test.rb +25 -0
- data/test/controllers/reports_controller_test.rb +21 -0
- data/test/controllers/uploads_controller_test.rb +21 -0
- data/test/factories/inventory_upload_factories.rb +88 -0
- data/test/test_plugin_helper.rb +26 -0
- data/test/unit/archived_report_generator_test.rb +61 -0
- data/test/unit/metadata_generator_test.rb +40 -0
- data/test/unit/shell_process_job_test.rb +27 -0
- data/test/unit/slice_generator_test.rb +177 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +37 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +74 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +65 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +55 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +8 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +23 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +41 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItemHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +50 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/listItem.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.fixtures.js +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.js +43 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatusHelper.js +29 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +78 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/listItemStatus.scss +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +60 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +44 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +47 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +69 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +46 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +27 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +145 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +87 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardReducer.js +68 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +17 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +25 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +39 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +64 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +45 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +35 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardActions.test.js.snap +76 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardReducer.test.js.snap +44 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap +42 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/index.js +34 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +22 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +64 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +18 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +83 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +89 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +57 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +45 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/reportGenerate.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +53 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUploadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +45 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/reportUpload.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +3 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +27 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +11 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +56 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +74 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js +31 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +24 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +12 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +47 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap +43 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +21 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +112 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/TerminalHelper.js +6 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +35 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap +98 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +31 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +15 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +10 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +12 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +4 -0
- data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +16 -0
- data/webpack/ForemanInventoryUpload/index.js +1 -0
- data/webpack/__mocks__/foremanReact/API.js +7 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +5 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +3 -0
- data/webpack/index.js +18 -0
- data/webpack/stories/ForemanInventoryUploadReducers.js +3 -0
- data/webpack/stories/configureStore.js +15 -0
- data/webpack/stories/decorators/index.js +1 -0
- data/webpack/stories/decorators/withCardsDecorator.js +14 -0
- data/webpack/stories/index.js +10 -0
- data/webpack/stories/index.scss +7 -0
- data/webpack/test_setup.js +6 -0
- metadata +318 -0
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { mount } from 'enzyme';
|
3
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
4
|
+
import NavContainer from '../NavContainer';
|
5
|
+
import { props } from '../NavContainer.fixtures';
|
6
|
+
|
7
|
+
const fixtures = {
|
8
|
+
'render without Props': {},
|
9
|
+
'render with Props': props,
|
10
|
+
};
|
11
|
+
|
12
|
+
describe('NavContainer', () => {
|
13
|
+
describe('rendering', () =>
|
14
|
+
testComponentSnapshotsWithFixtures(NavContainer, fixtures));
|
15
|
+
|
16
|
+
it('click should call onTabClick prop', () => {
|
17
|
+
const onTabClick = jest.fn();
|
18
|
+
const modifiedProps = {
|
19
|
+
...props,
|
20
|
+
};
|
21
|
+
modifiedProps.items[0].onClick = onTabClick;
|
22
|
+
const wrapper = mount(<NavContainer {...modifiedProps} />);
|
23
|
+
wrapper.find('NavItem a').simulate('click');
|
24
|
+
expect(onTabClick).toBeCalled();
|
25
|
+
});
|
26
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`NavContainer rendering render with Props 1`] = `
|
4
|
+
<ForwardRef
|
5
|
+
defaultActiveKey={0}
|
6
|
+
id="basic-tabs-pf"
|
7
|
+
>
|
8
|
+
<div
|
9
|
+
className="dashboard"
|
10
|
+
>
|
11
|
+
<Nav
|
12
|
+
bsClass="nav nav-tabs nav-tabs-pf"
|
13
|
+
justified={false}
|
14
|
+
pullLeft={false}
|
15
|
+
pullRight={false}
|
16
|
+
stacked={false}
|
17
|
+
>
|
18
|
+
<NavItem
|
19
|
+
active={false}
|
20
|
+
className="nav_item"
|
21
|
+
disabled={false}
|
22
|
+
eventKey={0}
|
23
|
+
key="0"
|
24
|
+
onClick={[Function]}
|
25
|
+
>
|
26
|
+
<Icon
|
27
|
+
name="some-icon"
|
28
|
+
size="2x"
|
29
|
+
type="fa"
|
30
|
+
/>
|
31
|
+
<p>
|
32
|
+
some-name
|
33
|
+
</p>
|
34
|
+
</NavItem>
|
35
|
+
</Nav>
|
36
|
+
<TabContent
|
37
|
+
animation={true}
|
38
|
+
bsClass="tab"
|
39
|
+
componentClass="div"
|
40
|
+
mountOnEnter={false}
|
41
|
+
unmountOnExit={false}
|
42
|
+
>
|
43
|
+
<TabPane
|
44
|
+
bsClass="tab-pane"
|
45
|
+
eventKey={0}
|
46
|
+
key="0"
|
47
|
+
>
|
48
|
+
<bound fn />
|
49
|
+
</TabPane>
|
50
|
+
</TabContent>
|
51
|
+
<FullScreenModal
|
52
|
+
showFullScreen={false}
|
53
|
+
terminalProps={Object {}}
|
54
|
+
toggleFullScreen={[Function]}
|
55
|
+
/>
|
56
|
+
</div>
|
57
|
+
</ForwardRef>
|
58
|
+
`;
|
59
|
+
|
60
|
+
exports[`NavContainer rendering render without Props 1`] = `
|
61
|
+
<ForwardRef
|
62
|
+
defaultActiveKey={0}
|
63
|
+
id="basic-tabs-pf"
|
64
|
+
>
|
65
|
+
<div
|
66
|
+
className="dashboard"
|
67
|
+
>
|
68
|
+
<Nav
|
69
|
+
bsClass="nav nav-tabs nav-tabs-pf"
|
70
|
+
justified={false}
|
71
|
+
pullLeft={false}
|
72
|
+
pullRight={false}
|
73
|
+
stacked={false}
|
74
|
+
/>
|
75
|
+
<TabContent
|
76
|
+
animation={true}
|
77
|
+
bsClass="tab"
|
78
|
+
componentClass="div"
|
79
|
+
mountOnEnter={false}
|
80
|
+
unmountOnExit={false}
|
81
|
+
/>
|
82
|
+
<FullScreenModal
|
83
|
+
showFullScreen={false}
|
84
|
+
terminalProps={Object {}}
|
85
|
+
toggleFullScreen={[Function]}
|
86
|
+
/>
|
87
|
+
</div>
|
88
|
+
</ForwardRef>
|
89
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './NavContainer';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { noop } from 'patternfly-react';
|
2
|
+
|
3
|
+
export const exitCode = 'exit 0';
|
4
|
+
export const logs = ['No running process'];
|
5
|
+
export const completed = 0;
|
6
|
+
export const restartProcess = noop;
|
7
|
+
export const error = null;
|
8
|
+
export const scheduled = '2019-08-21T16:14:16.520+03:00';
|
9
|
+
export const props = {
|
10
|
+
exitCode,
|
11
|
+
logs,
|
12
|
+
completed,
|
13
|
+
restartProcess,
|
14
|
+
error,
|
15
|
+
scheduled,
|
16
|
+
};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { noop } from 'patternfly-react';
|
4
|
+
import TabContainer from '../TabContainer';
|
5
|
+
import TabHeader from '../TabHeader';
|
6
|
+
import TabBody from '../TabBody';
|
7
|
+
import './reportGenerate.scss';
|
8
|
+
|
9
|
+
const ReportGenerate = ({
|
10
|
+
exitCode,
|
11
|
+
logs,
|
12
|
+
completed,
|
13
|
+
error,
|
14
|
+
restartProcess,
|
15
|
+
toggleFullScreen,
|
16
|
+
scheduled,
|
17
|
+
}) => (
|
18
|
+
<TabContainer className="report-generate">
|
19
|
+
<TabHeader
|
20
|
+
exitCode={exitCode}
|
21
|
+
onRestart={restartProcess}
|
22
|
+
toggleFullScreen={toggleFullScreen}
|
23
|
+
/>
|
24
|
+
<TabBody
|
25
|
+
exitCode={exitCode}
|
26
|
+
logs={logs}
|
27
|
+
completed={completed}
|
28
|
+
error={error}
|
29
|
+
scheduled={scheduled}
|
30
|
+
/>
|
31
|
+
</TabContainer>
|
32
|
+
);
|
33
|
+
|
34
|
+
ReportGenerate.propTypes = {
|
35
|
+
exitCode: PropTypes.string,
|
36
|
+
logs: PropTypes.oneOfType([
|
37
|
+
PropTypes.arrayOf(PropTypes.string),
|
38
|
+
PropTypes.string,
|
39
|
+
]),
|
40
|
+
completed: PropTypes.number,
|
41
|
+
error: PropTypes.string,
|
42
|
+
restartProcess: PropTypes.func,
|
43
|
+
toggleFullScreen: PropTypes.func,
|
44
|
+
scheduled: PropTypes.string,
|
45
|
+
};
|
46
|
+
|
47
|
+
ReportGenerate.defaultProps = {
|
48
|
+
exitCode: '',
|
49
|
+
logs: null,
|
50
|
+
completed: 0,
|
51
|
+
error: null,
|
52
|
+
restartProcess: noop,
|
53
|
+
toggleFullScreen: noop,
|
54
|
+
scheduled: null,
|
55
|
+
};
|
56
|
+
|
57
|
+
export default ReportGenerate;
|
File without changes
|
data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import ReportGenerate from '../ReportGenerate';
|
4
|
+
import { props } from '../ReportGenerate.fixtures';
|
5
|
+
|
6
|
+
const fixtures = {
|
7
|
+
'render without Props': {},
|
8
|
+
'render with Props': props,
|
9
|
+
};
|
10
|
+
|
11
|
+
describe('ReportGenerate', () => {
|
12
|
+
describe('rendering', () =>
|
13
|
+
testComponentSnapshotsWithFixtures(ReportGenerate, fixtures));
|
14
|
+
});
|
@@ -0,0 +1,45 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ReportGenerate rendering render with Props 1`] = `
|
4
|
+
<TabContainer
|
5
|
+
className="report-generate"
|
6
|
+
>
|
7
|
+
<TabHeader
|
8
|
+
exitCode="exit 0"
|
9
|
+
onDownload={null}
|
10
|
+
onRestart={[Function]}
|
11
|
+
toggleFullScreen={[Function]}
|
12
|
+
/>
|
13
|
+
<TabBody
|
14
|
+
completed={0}
|
15
|
+
error={null}
|
16
|
+
exitCode="exit 0"
|
17
|
+
logs={
|
18
|
+
Array [
|
19
|
+
"No running process",
|
20
|
+
]
|
21
|
+
}
|
22
|
+
scheduled="2019-08-21T16:14:16.520+03:00"
|
23
|
+
/>
|
24
|
+
</TabContainer>
|
25
|
+
`;
|
26
|
+
|
27
|
+
exports[`ReportGenerate rendering render without Props 1`] = `
|
28
|
+
<TabContainer
|
29
|
+
className="report-generate"
|
30
|
+
>
|
31
|
+
<TabHeader
|
32
|
+
exitCode=""
|
33
|
+
onDownload={null}
|
34
|
+
onRestart={[Function]}
|
35
|
+
toggleFullScreen={[Function]}
|
36
|
+
/>
|
37
|
+
<TabBody
|
38
|
+
completed={0}
|
39
|
+
error={null}
|
40
|
+
exitCode=""
|
41
|
+
logs={null}
|
42
|
+
scheduled={null}
|
43
|
+
/>
|
44
|
+
</TabContainer>
|
45
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './ReportGenerate';
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { noop } from 'patternfly-react';
|
2
|
+
|
3
|
+
export const files = ['some-file'];
|
4
|
+
export const exitCode = 'exit 0';
|
5
|
+
export const logs = ['No running process'];
|
6
|
+
export const completed = 0;
|
7
|
+
export const restartProcess = noop;
|
8
|
+
export const downloadReports = noop;
|
9
|
+
export const error = null;
|
10
|
+
export const props = {
|
11
|
+
files,
|
12
|
+
exitCode,
|
13
|
+
logs,
|
14
|
+
completed,
|
15
|
+
restartProcess,
|
16
|
+
downloadReports,
|
17
|
+
error,
|
18
|
+
};
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { noop } from 'patternfly-react';
|
4
|
+
import TabContainer from '../TabContainer';
|
5
|
+
import TabHeader from '../TabHeader';
|
6
|
+
import TabBody from '../TabBody';
|
7
|
+
import './reportUpload.scss';
|
8
|
+
|
9
|
+
const ReportUpload = ({
|
10
|
+
exitCode,
|
11
|
+
logs,
|
12
|
+
completed,
|
13
|
+
downloadReports,
|
14
|
+
error,
|
15
|
+
toggleFullScreen,
|
16
|
+
}) => (
|
17
|
+
<TabContainer className="report-upload">
|
18
|
+
<TabHeader
|
19
|
+
exitCode={exitCode}
|
20
|
+
onDownload={downloadReports}
|
21
|
+
toggleFullScreen={toggleFullScreen}
|
22
|
+
/>
|
23
|
+
<TabBody
|
24
|
+
exitCode={exitCode}
|
25
|
+
logs={logs}
|
26
|
+
completed={completed}
|
27
|
+
error={error}
|
28
|
+
/>
|
29
|
+
</TabContainer>
|
30
|
+
);
|
31
|
+
|
32
|
+
ReportUpload.propTypes = {
|
33
|
+
exitCode: PropTypes.string,
|
34
|
+
logs: PropTypes.oneOfType([
|
35
|
+
PropTypes.arrayOf(PropTypes.string),
|
36
|
+
PropTypes.string,
|
37
|
+
]),
|
38
|
+
completed: PropTypes.number,
|
39
|
+
downloadReports: PropTypes.func,
|
40
|
+
error: PropTypes.string,
|
41
|
+
toggleFullScreen: PropTypes.func,
|
42
|
+
};
|
43
|
+
|
44
|
+
ReportUpload.defaultProps = {
|
45
|
+
exitCode: '',
|
46
|
+
logs: null,
|
47
|
+
completed: 0,
|
48
|
+
downloadReports: noop,
|
49
|
+
error: null,
|
50
|
+
toggleFullScreen: noop,
|
51
|
+
};
|
52
|
+
|
53
|
+
export default ReportUpload;
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import ReportUpload from '../ReportUpload';
|
4
|
+
import { props } from '../ReportUpload.fixtures';
|
5
|
+
|
6
|
+
const fixtures = {
|
7
|
+
'render without Props': {},
|
8
|
+
'render with Props': props,
|
9
|
+
};
|
10
|
+
|
11
|
+
describe('ReportUpload', () => {
|
12
|
+
describe('rendering', () =>
|
13
|
+
testComponentSnapshotsWithFixtures(ReportUpload, fixtures));
|
14
|
+
});
|
@@ -0,0 +1,45 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ReportUpload rendering render with Props 1`] = `
|
4
|
+
<TabContainer
|
5
|
+
className="report-upload"
|
6
|
+
>
|
7
|
+
<TabHeader
|
8
|
+
exitCode="exit 0"
|
9
|
+
onDownload={[Function]}
|
10
|
+
onRestart={null}
|
11
|
+
toggleFullScreen={[Function]}
|
12
|
+
/>
|
13
|
+
<TabBody
|
14
|
+
completed={0}
|
15
|
+
error={null}
|
16
|
+
exitCode="exit 0"
|
17
|
+
logs={
|
18
|
+
Array [
|
19
|
+
"No running process",
|
20
|
+
]
|
21
|
+
}
|
22
|
+
scheduled={null}
|
23
|
+
/>
|
24
|
+
</TabContainer>
|
25
|
+
`;
|
26
|
+
|
27
|
+
exports[`ReportUpload rendering render without Props 1`] = `
|
28
|
+
<TabContainer
|
29
|
+
className="report-upload"
|
30
|
+
>
|
31
|
+
<TabHeader
|
32
|
+
exitCode=""
|
33
|
+
onDownload={[Function]}
|
34
|
+
onRestart={null}
|
35
|
+
toggleFullScreen={[Function]}
|
36
|
+
/>
|
37
|
+
<TabBody
|
38
|
+
completed={0}
|
39
|
+
error={null}
|
40
|
+
exitCode=""
|
41
|
+
logs={null}
|
42
|
+
scheduled={null}
|
43
|
+
/>
|
44
|
+
</TabContainer>
|
45
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './ReportUpload';
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Icon, Grid } from 'patternfly-react';
|
4
|
+
import { FormattedRelative } from 'react-intl';
|
5
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
6
|
+
import './scheduledRun.scss';
|
7
|
+
|
8
|
+
const ScheduledRun = ({ date }) =>
|
9
|
+
date ? (
|
10
|
+
<Grid.Col sm={12} className="scheduled_run">
|
11
|
+
<p>
|
12
|
+
<Icon name="calendar" />
|
13
|
+
{__('Next run: ')}
|
14
|
+
<FormattedRelative value={date} />.
|
15
|
+
</p>
|
16
|
+
</Grid.Col>
|
17
|
+
) : null;
|
18
|
+
|
19
|
+
ScheduledRun.propTypes = {
|
20
|
+
date: PropTypes.string,
|
21
|
+
};
|
22
|
+
|
23
|
+
ScheduledRun.defaultProps = {
|
24
|
+
date: null,
|
25
|
+
};
|
26
|
+
|
27
|
+
export default ScheduledRun;
|