foreman_inventory_upload 0.9.2 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +5 -5
  2. data/app/controllers/foreman_inventory_upload/reports_controller.rb +4 -3
  3. data/app/controllers/foreman_inventory_upload/statuses_controller.rb +41 -0
  4. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +3 -3
  5. data/app/views/scripts/uploader.sh.erb +12 -25
  6. data/config/routes.rb +5 -5
  7. data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +7 -4
  8. data/lib/foreman_inventory_upload/async/generate_report_job.rb +10 -18
  9. data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +17 -12
  10. data/lib/foreman_inventory_upload/async/upload_report_job.rb +17 -22
  11. data/lib/foreman_inventory_upload/engine.rb +0 -2
  12. data/lib/foreman_inventory_upload/generators/archived_report.rb +2 -2
  13. data/lib/foreman_inventory_upload/generators/queries.rb +10 -19
  14. data/lib/foreman_inventory_upload/generators/slice.rb +3 -24
  15. data/lib/foreman_inventory_upload/version.rb +1 -1
  16. data/lib/foreman_inventory_upload.rb +10 -15
  17. data/lib/tasks/foreman_inventory_upload_tasks.rake +1 -1
  18. data/lib/tasks/generator.rake +5 -19
  19. data/test/controllers/reports_controller_test.rb +3 -3
  20. data/test/controllers/{accounts_controller_test.rb → statuses_controller_test.rb} +7 -6
  21. data/test/controllers/uploads_controller_test.rb +3 -3
  22. data/test/unit/archived_report_generator_test.rb +3 -3
  23. data/test/unit/slice_generator_test.rb +0 -74
  24. metadata +41 -180
  25. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +0 -39
  26. data/package.json +0 -125
  27. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +0 -37
  28. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +0 -74
  29. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +0 -18
  30. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +0 -65
  31. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListConstants.js +0 -9
  32. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +0 -0
  33. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +0 -55
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +0 -8
  35. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.fixtures.js +0 -0
  36. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +0 -16
  37. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js +0 -0
  38. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +0 -13
  39. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +0 -26
  40. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +0 -7
  41. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/index.js +0 -1
  42. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.fixtures.js +0 -0
  43. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +0 -23
  44. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorStateHelper.js +0 -0
  45. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +0 -13
  46. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +0 -20
  47. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +0 -18
  48. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/index.js +0 -1
  49. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +0 -1
  50. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +0 -41
  51. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItemHelper.js +0 -0
  52. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +0 -13
  53. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +0 -50
  54. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/index.js +0 -1
  55. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/listItem.scss +0 -0
  56. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.fixtures.js +0 -7
  57. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.js +0 -43
  58. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatusHelper.js +0 -29
  59. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +0 -14
  60. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +0 -78
  61. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/index.js +0 -1
  62. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/listItemStatus.scss +0 -16
  63. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +0 -13
  64. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +0 -20
  65. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +0 -14
  66. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +0 -60
  67. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +0 -26
  68. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +0 -44
  69. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +0 -47
  70. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +0 -69
  71. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +0 -46
  72. data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +0 -9
  73. data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +0 -27
  74. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +0 -50
  75. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +0 -146
  76. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +0 -19
  77. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +0 -87
  78. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardConstants.js +0 -9
  79. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardHelper.js +0 -0
  80. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardReducer.js +0 -68
  81. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +0 -17
  82. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +0 -25
  83. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +0 -39
  84. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +0 -16
  85. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +0 -64
  86. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +0 -45
  87. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +0 -36
  88. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardActions.test.js.snap +0 -76
  89. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardReducer.test.js.snap +0 -44
  90. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap +0 -42
  91. data/webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss +0 -0
  92. data/webpack/ForemanInventoryUpload/Components/Dashboard/index.js +0 -34
  93. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
  94. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +0 -22
  95. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
  96. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +0 -13
  97. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +0 -25
  98. data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +0 -3
  99. data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +0 -1
  100. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js +0 -0
  101. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +0 -50
  102. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js +0 -0
  103. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +0 -13
  104. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +0 -64
  105. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +0 -10
  106. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js +0 -1
  107. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +0 -10
  108. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +0 -83
  109. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js +0 -0
  110. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +0 -26
  111. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +0 -89
  112. data/webpack/ForemanInventoryUpload/Components/NavContainer/index.js +0 -1
  113. data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +0 -7
  114. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +0 -16
  115. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +0 -57
  116. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js +0 -0
  117. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +0 -14
  118. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +0 -45
  119. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/index.js +0 -1
  120. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/reportGenerate.scss +0 -0
  121. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +0 -18
  122. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +0 -57
  123. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUploadHelper.js +0 -0
  124. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +0 -14
  125. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +0 -45
  126. data/webpack/ForemanInventoryUpload/Components/ReportUpload/index.js +0 -1
  127. data/webpack/ForemanInventoryUpload/Components/ReportUpload/reportUpload.scss +0 -0
  128. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +0 -3
  129. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +0 -27
  130. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js +0 -0
  131. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +0 -14
  132. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +0 -25
  133. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +0 -1
  134. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +0 -11
  135. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js +0 -0
  136. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +0 -56
  137. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
  138. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +0 -13
  139. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +0 -74
  140. data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +0 -1
  141. data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +0 -8
  142. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js +0 -0
  143. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js +0 -31
  144. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js +0 -0
  145. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +0 -13
  146. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +0 -19
  147. data/webpack/ForemanInventoryUpload/Components/TabBody/index.js +0 -1
  148. data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +0 -3
  149. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
  150. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +0 -24
  151. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
  152. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +0 -13
  153. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +0 -18
  154. data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +0 -1
  155. data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +0 -8
  156. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
  157. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +0 -19
  158. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
  159. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +0 -13
  160. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +0 -12
  161. data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +0 -1
  162. data/webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss +0 -0
  163. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js +0 -0
  164. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +0 -45
  165. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js +0 -0
  166. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +0 -13
  167. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap +0 -53
  168. data/webpack/ForemanInventoryUpload/Components/TabHeader/index.js +0 -1
  169. data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +0 -21
  170. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js +0 -10
  171. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +0 -112
  172. data/webpack/ForemanInventoryUpload/Components/Terminal/TerminalHelper.js +0 -6
  173. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +0 -35
  174. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap +0 -98
  175. data/webpack/ForemanInventoryUpload/Components/Terminal/index.js +0 -1
  176. data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +0 -31
  177. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +0 -15
  178. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +0 -10
  179. data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +0 -12
  180. data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +0 -4
  181. data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +0 -16
  182. data/webpack/ForemanInventoryUpload/index.js +0 -1
  183. data/webpack/__mocks__/foremanReact/API.js +0 -7
  184. data/webpack/__mocks__/foremanReact/common/I18n.js +0 -5
  185. data/webpack/__mocks__/foremanReact/common/helpers.js +0 -3
  186. data/webpack/index.js +0 -18
  187. data/webpack/stories/ForemanInventoryUploadReducers.js +0 -3
  188. data/webpack/stories/configureStore.js +0 -15
  189. data/webpack/stories/decorators/index.js +0 -1
  190. data/webpack/stories/decorators/withCardsDecorator.js +0 -14
  191. data/webpack/stories/index.js +0 -10
  192. data/webpack/stories/index.scss +0 -7
  193. data/webpack/test_setup.js +0 -6
@@ -1,64 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`FullScreenModal rendering render without Props 1`] = `
4
- <Modal
5
- animation={true}
6
- autoFocus={true}
7
- backdrop={true}
8
- bsClass="modal"
9
- dialogComponentClass={[Function]}
10
- enforceFocus={true}
11
- keyboard={true}
12
- manager={
13
- ModalManager {
14
- "add": [Function],
15
- "containers": Array [],
16
- "data": Array [],
17
- "handleContainerOverflow": true,
18
- "hideSiblingNodes": true,
19
- "isTopModal": [Function],
20
- "modals": Array [],
21
- "remove": [Function],
22
- }
23
- }
24
- onHide={[Function]}
25
- renderBackdrop={[Function]}
26
- restoreFocus={true}
27
- show={false}
28
- >
29
- <ModalHeader
30
- bsClass="modal-header"
31
- closeButton={false}
32
- closeLabel="Close"
33
- >
34
- <button
35
- aria-hidden="true"
36
- aria-label="Close"
37
- className="close"
38
- onClick={[Function]}
39
- >
40
- <Icon
41
- name="close"
42
- type="pf"
43
- />
44
- </button>
45
- <ModalTitle
46
- bsClass="modal-title"
47
- componentClass="h4"
48
- >
49
- Full Screen
50
- </ModalTitle>
51
- </ModalHeader>
52
- <ModalBody
53
- bsClass="modal-body"
54
- componentClass="div"
55
- >
56
- <Terminal
57
- autoScroll={false}
58
- error={null}
59
- exitCode=""
60
- logs={null}
61
- />
62
- </ModalBody>
63
- </Modal>
64
- `;
@@ -1,10 +0,0 @@
1
- .modal-dialog {
2
- width: 95%;
3
-
4
- .modal-body,
5
- .terminal {
6
- height: -webkit-fill-available;
7
- height: -moz-available;
8
- height: fill-available;
9
- }
10
- }
@@ -1 +0,0 @@
1
- export { default } from './FullScreenModal';
@@ -1,10 +0,0 @@
1
- export const props = {
2
- items: [
3
- {
4
- icon: 'some-icon',
5
- name: 'some-name',
6
- component: jest.fn,
7
- onClick: jest.fn,
8
- },
9
- ],
10
- };
@@ -1,83 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {
4
- TabContainer,
5
- Nav,
6
- NavItem,
7
- TabContent,
8
- TabPane,
9
- Icon,
10
- noop,
11
- } from 'patternfly-react';
12
- import './navContainer.scss';
13
- import FullScreenModal from '../FullScreenModal';
14
-
15
- const NavContainer = ({
16
- items,
17
- showFullScreen,
18
- toggleFullScreen,
19
- terminalProps,
20
- }) => {
21
- const navItems = items.map((item, index) => {
22
- const { name, icon, onClick } = item;
23
- return (
24
- <NavItem
25
- key={index}
26
- eventKey={index}
27
- onClick={onClick}
28
- className="nav_item"
29
- >
30
- <Icon name={icon} size="2x" />
31
- <p>{name}</p>
32
- </NavItem>
33
- );
34
- });
35
- const tabComponents = items.map(({ component: Component, props }, index) => (
36
- <TabPane key={index} eventKey={index}>
37
- <Component {...props} />
38
- </TabPane>
39
- ));
40
- return (
41
- <TabContainer id="basic-tabs-pf" defaultActiveKey={0}>
42
- <div className="dashboard">
43
- <Nav bsClass="nav nav-tabs nav-tabs-pf">{navItems}</Nav>
44
- <TabContent animation>{tabComponents}</TabContent>
45
- <FullScreenModal
46
- showFullScreen={showFullScreen}
47
- toggleFullScreen={toggleFullScreen}
48
- terminalProps={terminalProps}
49
- />
50
- </div>
51
- </TabContainer>
52
- );
53
- };
54
-
55
- NavContainer.propTypes = {
56
- items: PropTypes.arrayOf(
57
- PropTypes.shape({
58
- icon: PropTypes.string,
59
- name: PropTypes.string,
60
- component: PropTypes.func,
61
- onClick: PropTypes.func,
62
- })
63
- ),
64
- showFullScreen: PropTypes.bool,
65
- toggleFullScreen: PropTypes.func,
66
- terminalProps: PropTypes.shape({
67
- exitCode: PropTypes.string,
68
- logs: PropTypes.oneOfType([
69
- PropTypes.arrayOf(PropTypes.string),
70
- PropTypes.string,
71
- ]),
72
- error: PropTypes.string,
73
- }),
74
- };
75
-
76
- NavContainer.defaultProps = {
77
- items: [],
78
- showFullScreen: false,
79
- toggleFullScreen: noop,
80
- terminalProps: {},
81
- };
82
-
83
- export default NavContainer;
@@ -1,26 +0,0 @@
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
- });
@@ -1,89 +0,0 @@
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
- `;
@@ -1 +0,0 @@
1
- export { default } from './NavContainer';
@@ -1,7 +0,0 @@
1
- .dashboard {
2
- .nav_item {
3
- font-size: 12px;
4
- text-align: center;
5
- width: 130px;
6
- }
7
- }
@@ -1,16 +0,0 @@
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
- };
@@ -1,57 +0,0 @@
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;
@@ -1,14 +0,0 @@
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
- });
@@ -1,45 +0,0 @@
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
- `;
@@ -1 +0,0 @@
1
- export { default } from './ReportGenerate';
@@ -1,18 +0,0 @@
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
- };
@@ -1,57 +0,0 @@
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
- restartProcess,
15
- error,
16
- toggleFullScreen,
17
- }) => (
18
- <TabContainer className="report-upload">
19
- <TabHeader
20
- exitCode={exitCode}
21
- onRestart={restartProcess}
22
- onDownload={downloadReports}
23
- toggleFullScreen={toggleFullScreen}
24
- />
25
- <TabBody
26
- exitCode={exitCode}
27
- logs={logs}
28
- completed={completed}
29
- error={error}
30
- />
31
- </TabContainer>
32
- );
33
-
34
- ReportUpload.propTypes = {
35
- exitCode: PropTypes.string,
36
- logs: PropTypes.oneOfType([
37
- PropTypes.arrayOf(PropTypes.string),
38
- PropTypes.string,
39
- ]),
40
- completed: PropTypes.number,
41
- restartProcess: PropTypes.func,
42
- downloadReports: PropTypes.func,
43
- error: PropTypes.string,
44
- toggleFullScreen: PropTypes.func,
45
- };
46
-
47
- ReportUpload.defaultProps = {
48
- exitCode: '',
49
- logs: null,
50
- completed: 0,
51
- restartProcess: noop,
52
- downloadReports: noop,
53
- error: null,
54
- toggleFullScreen: noop,
55
- };
56
-
57
- export default ReportUpload;
@@ -1,14 +0,0 @@
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
- });
@@ -1,45 +0,0 @@
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={[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={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={[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
- `;
@@ -1 +0,0 @@
1
- export { default } from './ReportUpload';
@@ -1,3 +0,0 @@
1
- export const props = {
2
- date: '2019-08-21T16:14:16.520+03:00',
3
- };
@@ -1,27 +0,0 @@
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;
@@ -1,14 +0,0 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
-
3
- import ScheduledRun from '../ScheduledRun';
4
- import { props } from '../ScheduledRun.fixtures';
5
-
6
- const fixtures = {
7
- 'render without Props': {},
8
- 'render with Props': props,
9
- };
10
-
11
- describe('ScheduledRun', () => {
12
- describe('rendering', () =>
13
- testComponentSnapshotsWithFixtures(ScheduledRun, fixtures));
14
- });
@@ -1,25 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`ScheduledRun rendering render with Props 1`] = `
4
- <Col
5
- bsClass="col"
6
- className="scheduled_run"
7
- componentClass="div"
8
- sm={12}
9
- >
10
- <p>
11
- <Icon
12
- name="calendar"
13
- type="fa"
14
- />
15
- Next run:
16
- <FormattedRelative
17
- updateInterval={10000}
18
- value="2019-08-21T16:14:16.520+03:00"
19
- />
20
- .
21
- </p>
22
- </Col>
23
- `;
24
-
25
- exports[`ScheduledRun rendering render without Props 1`] = `""`;
@@ -1 +0,0 @@
1
- export { default } from './ScheduledRun';