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,11 +0,0 @@
1
- .scheduled_run {
2
- font-size: 14px;
3
-
4
- p {
5
- margin: 0 0 -10px 0;
6
-
7
- .fa {
8
- margin-right: 5px;
9
- }
10
- }
11
- }
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid, DonutChart } from 'patternfly-react';
4
- import './statusChart.scss';
5
-
6
- const StatusChart = ({ completed }) => {
7
- const donutConfigData = {
8
- columns: [
9
- ['Completed', completed],
10
- ['Remain', 100 - completed],
11
- ],
12
- order: null,
13
- };
14
-
15
- const pfGetUtilizationDonutTooltipContents = d => {
16
- const {
17
- 0: { name, value },
18
- } = d;
19
- return `<span class="donut-tooltip-pf" style="white-space: nowrap;">${value}% ${name}</span>`;
20
- };
21
-
22
- const donutConfigTooltip = {
23
- contents: pfGetUtilizationDonutTooltipContents,
24
- };
25
-
26
- return (
27
- <Grid.Col sm={4}>
28
- <div className="status-chart">
29
- <DonutChart
30
- id="donunt-chart-1"
31
- size={{
32
- width: 210,
33
- height: 210,
34
- }}
35
- data={donutConfigData}
36
- tooltip={donutConfigTooltip}
37
- title={{
38
- type: 'percent',
39
- primary: `${completed}%`,
40
- secondary: 'Completed',
41
- }}
42
- />
43
- </div>
44
- </Grid.Col>
45
- );
46
- };
47
-
48
- StatusChart.propTypes = {
49
- completed: PropTypes.number,
50
- };
51
-
52
- StatusChart.defaultProps = {
53
- completed: 0,
54
- };
55
-
56
- export default StatusChart;
@@ -1,13 +0,0 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
-
3
- import StatusChart from '../StatusChart';
4
-
5
- const fixtures = {
6
- 'render without Props': {},
7
- /** fixtures, props for the component */
8
- };
9
-
10
- describe('StatusChart', () => {
11
- describe('rendering', () =>
12
- testComponentSnapshotsWithFixtures(StatusChart, fixtures));
13
- });
@@ -1,74 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`StatusChart rendering render without Props 1`] = `
4
- <Col
5
- bsClass="col"
6
- componentClass="div"
7
- sm={4}
8
- >
9
- <div
10
- className="status-chart"
11
- >
12
- <DonutChart
13
- className="donut-chart-pf"
14
- color={
15
- Object {
16
- "pattern": Array [
17
- "#0088ce",
18
- "#d1d1d1",
19
- ],
20
- }
21
- }
22
- data={
23
- Object {
24
- "columns": Array [
25
- Array [
26
- "Completed",
27
- 0,
28
- ],
29
- Array [
30
- "Remain",
31
- 100,
32
- ],
33
- ],
34
- "order": null,
35
- }
36
- }
37
- donut={
38
- Object {
39
- "label": Object {
40
- "show": false,
41
- },
42
- "title": undefined,
43
- "width": 11,
44
- }
45
- }
46
- id="donunt-chart-1"
47
- legend={
48
- Object {
49
- "show": false,
50
- }
51
- }
52
- size={
53
- Object {
54
- "height": 210,
55
- "width": 210,
56
- }
57
- }
58
- title={
59
- Object {
60
- "primary": "0%",
61
- "secondary": "Completed",
62
- "type": "percent",
63
- }
64
- }
65
- tooltip={
66
- Object {
67
- "contents": [Function],
68
- }
69
- }
70
- type="donut"
71
- />
72
- </div>
73
- </Col>
74
- `;
@@ -1 +0,0 @@
1
- export { default } from './StatusChart';
@@ -1,8 +0,0 @@
1
- .status-chart {
2
- display: flex;
3
- align-items: center;
4
- -webkit-justify-content: center;
5
- justify-content: center;
6
- margin: 10%;
7
- padding: 5%;
8
- }
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid } from 'patternfly-react';
4
- import Terminal from '../Terminal';
5
- import ScheduledRun from '../ScheduledRun';
6
- import './tabBody.scss';
7
-
8
- const TabBody = ({ exitCode, logs, error, scheduled }) => (
9
- <Grid.Row className="tab_body">
10
- <Terminal logs={logs} exitCode={exitCode} error={error} />
11
- <ScheduledRun date={scheduled} />
12
- </Grid.Row>
13
- );
14
-
15
- TabBody.propTypes = {
16
- exitCode: PropTypes.string,
17
- logs: PropTypes.oneOfType([
18
- PropTypes.arrayOf(PropTypes.string),
19
- PropTypes.string,
20
- ]),
21
- error: PropTypes.string,
22
- scheduled: PropTypes.string,
23
- };
24
-
25
- TabBody.defaultProps = {
26
- exitCode: '',
27
- logs: null,
28
- error: null,
29
- scheduled: null,
30
- };
31
- export default TabBody;
@@ -1,13 +0,0 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
-
3
- import TabBody from '../TabBody';
4
-
5
- const fixtures = {
6
- 'render without Props': {},
7
- /** fixtures, props for the component */
8
- };
9
-
10
- describe('TabBody', () => {
11
- describe('rendering', () =>
12
- testComponentSnapshotsWithFixtures(TabBody, fixtures));
13
- });
@@ -1,19 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`TabBody rendering render without Props 1`] = `
4
- <Row
5
- bsClass="row"
6
- className="tab_body"
7
- componentClass="div"
8
- >
9
- <Terminal
10
- autoScroll={true}
11
- error={null}
12
- exitCode=""
13
- logs={null}
14
- />
15
- <ScheduledRun
16
- date={null}
17
- />
18
- </Row>
19
- `;
@@ -1 +0,0 @@
1
- export { default } from './TabBody';
@@ -1,3 +0,0 @@
1
- .tab_body {
2
- margin-bottom: 0;
3
- }
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid } from 'patternfly-react';
4
- import './tabContainer.scss';
5
-
6
- const TabContainer = ({ children, className }) => (
7
- <div className={className}>
8
- <Grid>
9
- <Grid.Col>{children}</Grid.Col>
10
- </Grid>
11
- </div>
12
- );
13
-
14
- TabContainer.propTypes = {
15
- children: PropTypes.node,
16
- className: PropTypes.string,
17
- };
18
-
19
- TabContainer.defaultProps = {
20
- children: null,
21
- className: '',
22
- };
23
-
24
- export default TabContainer;
@@ -1,13 +0,0 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
-
3
- import TabContainer from '../TabContainer';
4
-
5
- const fixtures = {
6
- 'render without Props': {},
7
- /** fixtures, props for the component */
8
- };
9
-
10
- describe('TabContainer', () => {
11
- describe('rendering', () =>
12
- testComponentSnapshotsWithFixtures(TabContainer, fixtures));
13
- });
@@ -1,18 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`TabContainer rendering render without Props 1`] = `
4
- <div
5
- className=""
6
- >
7
- <Grid
8
- bsClass="container"
9
- componentClass="div"
10
- fluid={false}
11
- >
12
- <Col
13
- bsClass="col"
14
- componentClass="div"
15
- />
16
- </Grid>
17
- </div>
18
- `;
@@ -1 +0,0 @@
1
- export { default } from './TabContainer';
@@ -1,8 +0,0 @@
1
- .tab-content {
2
- padding: 20px;
3
- min-height: 0;
4
-
5
- .row {
6
- margin-bottom: 20px;
7
- }
8
- }
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid } from 'patternfly-react';
4
-
5
- const TabFooter = ({ children }) => (
6
- <Grid.Row>
7
- <div className="tab-footer">{children}</div>
8
- </Grid.Row>
9
- );
10
-
11
- TabFooter.propTypes = {
12
- children: PropTypes.node,
13
- };
14
-
15
- TabFooter.defaultProps = {
16
- children: null,
17
- };
18
-
19
- export default TabFooter;
@@ -1,13 +0,0 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
-
3
- import TabFooter from '../TabFooter';
4
-
5
- const fixtures = {
6
- 'render without Props': {},
7
- /** fixtures, props for the component */
8
- };
9
-
10
- describe('TabFooter', () => {
11
- describe('rendering', () =>
12
- testComponentSnapshotsWithFixtures(TabFooter, fixtures));
13
- });
@@ -1,12 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`TabFooter rendering render without Props 1`] = `
4
- <Row
5
- bsClass="row"
6
- componentClass="div"
7
- >
8
- <div
9
- className="tab-footer"
10
- />
11
- </Row>
12
- `;
@@ -1 +0,0 @@
1
- export { default } from './TabFooter';
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { noop, Grid, Button, Icon } from 'patternfly-react';
4
- import { sprintf, translate as __ } from 'foremanReact/common/I18n';
5
- import './tabHeader.scss';
6
-
7
- const TabHeader = ({ exitCode, onRestart, onDownload, toggleFullScreen }) => (
8
- <Grid.Row className="tab-header">
9
- <Grid.Col sm={6}>
10
- <p>{sprintf(__('Exit Code: %s'), exitCode)}</p>
11
- </Grid.Col>
12
- <Grid.Col sm={6}>
13
- <div className="tab-action-buttons">
14
- <Button bsStyle="primary" onClick={onRestart}>
15
- {__('Restart')}
16
- </Button>
17
- {onDownload ? (
18
- <Button onClick={onDownload}>
19
- {__('Download Report')} <Icon name="download" />
20
- </Button>
21
- ) : null}
22
- <Button onClick={toggleFullScreen}>
23
- {__('Full Screen')}
24
- <Icon name="arrows-alt" />
25
- </Button>
26
- </div>
27
- </Grid.Col>
28
- </Grid.Row>
29
- );
30
-
31
- TabHeader.propTypes = {
32
- onRestart: PropTypes.func,
33
- onDownload: PropTypes.func,
34
- exitCode: PropTypes.string,
35
- toggleFullScreen: PropTypes.func,
36
- };
37
-
38
- TabHeader.defaultProps = {
39
- onRestart: noop,
40
- exitCode: '',
41
- onDownload: null,
42
- toggleFullScreen: noop,
43
- };
44
-
45
- export default TabHeader;
@@ -1,13 +0,0 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
-
3
- import TabHeader from '../TabHeader';
4
-
5
- const fixtures = {
6
- 'render without Props': {},
7
- /** fixtures, props for the component */
8
- };
9
-
10
- describe('TabHeader', () => {
11
- describe('rendering', () =>
12
- testComponentSnapshotsWithFixtures(TabHeader, fixtures));
13
- });
@@ -1,53 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`TabHeader rendering render without Props 1`] = `
4
- <Row
5
- bsClass="row"
6
- className="tab-header"
7
- componentClass="div"
8
- >
9
- <Col
10
- bsClass="col"
11
- componentClass="div"
12
- sm={6}
13
- >
14
- <p>
15
- Exit Code:
16
- </p>
17
- </Col>
18
- <Col
19
- bsClass="col"
20
- componentClass="div"
21
- sm={6}
22
- >
23
- <div
24
- className="tab-action-buttons"
25
- >
26
- <Button
27
- active={false}
28
- block={false}
29
- bsClass="btn"
30
- bsStyle="primary"
31
- disabled={false}
32
- onClick={[Function]}
33
- >
34
- Restart
35
- </Button>
36
- <Button
37
- active={false}
38
- block={false}
39
- bsClass="btn"
40
- bsStyle="default"
41
- disabled={false}
42
- onClick={[Function]}
43
- >
44
- Full Screen
45
- <Icon
46
- name="arrows-alt"
47
- type="fa"
48
- />
49
- </Button>
50
- </div>
51
- </Col>
52
- </Row>
53
- `;
@@ -1 +0,0 @@
1
- export { default } from './TabHeader';
@@ -1,21 +0,0 @@
1
- .tab-header {
2
- h1 {
3
- margin-top: 0;
4
- }
5
-
6
- p {
7
- font-size: 16px;
8
- }
9
-
10
- .tab-action-buttons {
11
- float: right;
12
-
13
- button {
14
- margin-left: 5px;
15
-
16
- span {
17
- margin-left: 5px;
18
- }
19
- }
20
- }
21
- }
@@ -1,10 +0,0 @@
1
- export const logs = [
2
- 'Generating...',
3
- 'Hosts: 1000',
4
- 'writing host 1/1000',
5
- 'writing host 2/1000',
6
- ];
7
-
8
- export const exitCode = 'Running pid 1111111';
9
-
10
- export const props = { logs, exitCode };
@@ -1,112 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid, Spinner } from 'patternfly-react';
4
- import isEqual from 'lodash/isEqual';
5
- import './terminal.scss';
6
- import { isTerminalScrolledDown } from './TerminalHelper';
7
-
8
- class Terminal extends React.Component {
9
- constructor(props) {
10
- super(props);
11
- this.terminal = React.createRef();
12
- this.state = {
13
- didUserScroll: false,
14
- };
15
- }
16
-
17
- componentDidMount() {
18
- this.scrollBottom();
19
- }
20
-
21
- componentDidUpdate({ logs: prevLogs }) {
22
- const { logs: currentLogs, autoScroll } = this.props;
23
- const { didUserScroll } = this.state;
24
- if (autoScroll && !didUserScroll && !isEqual(prevLogs, currentLogs)) {
25
- this.scrollBottom();
26
- }
27
- }
28
-
29
- handleScroll = e => {
30
- const { scrollTop, scrollHeight, offsetHeight } = e.target;
31
- const didUserScroll = isTerminalScrolledDown(
32
- scrollHeight,
33
- scrollTop,
34
- offsetHeight,
35
- 100
36
- );
37
- this.setState({
38
- didUserScroll,
39
- });
40
- };
41
-
42
- scrollBottom = () => {
43
- const element = this.terminal.current;
44
- if (!element) {
45
- return;
46
- }
47
- const setHeightToBottom = () => {
48
- element.scrollTop = element.scrollHeight;
49
- };
50
- /** happens on tab switching when the terminal wasn't visible yet
51
- * and there was nothing to scroll, 250ms is enough to wait for the terminal to appear.
52
- */
53
- if (element.scrollHeight === 0) {
54
- setTimeout(setHeightToBottom, 250);
55
- } else {
56
- setHeightToBottom();
57
- }
58
- };
59
-
60
- render() {
61
- const { logs, error, exitCode } = this.props;
62
- let modifiedLogs = null;
63
- if (error !== null) {
64
- modifiedLogs = <p className="terminal_error">{error}</p>;
65
- } else if (Array.isArray(logs)) {
66
- modifiedLogs = logs.map((log, index) => <p key={index}>{log}</p>);
67
- } else {
68
- modifiedLogs = <p>{logs}</p>;
69
- }
70
- const exitCodeLowerCase = exitCode.toLowerCase();
71
- const loading =
72
- exitCodeLowerCase.indexOf('running') !== -1 ||
73
- exitCodeLowerCase.indexOf('restarting') !== -1;
74
- return (
75
- <Grid.Col sm={12}>
76
- <div
77
- className="terminal"
78
- ref={this.terminal}
79
- onScroll={this.handleScroll}
80
- >
81
- <Grid fluid>
82
- <Grid.Row>
83
- <Grid.Col sm={12}>
84
- {modifiedLogs}
85
- <Spinner loading={loading} inverse inline size="xs" />
86
- </Grid.Col>
87
- </Grid.Row>
88
- </Grid>
89
- </div>
90
- </Grid.Col>
91
- );
92
- }
93
- }
94
-
95
- Terminal.propTypes = {
96
- logs: PropTypes.oneOfType([
97
- PropTypes.arrayOf(PropTypes.string),
98
- PropTypes.string,
99
- ]),
100
- error: PropTypes.string,
101
- exitCode: PropTypes.string,
102
- autoScroll: PropTypes.bool,
103
- };
104
-
105
- Terminal.defaultProps = {
106
- logs: null,
107
- error: null,
108
- exitCode: '',
109
- autoScroll: true,
110
- };
111
-
112
- export default Terminal;
@@ -1,6 +0,0 @@
1
- export const isTerminalScrolledDown = (
2
- scrollHeight,
3
- scrollTop,
4
- terminalHeight,
5
- tolerance
6
- ) => scrollTop <= scrollHeight - terminalHeight - tolerance;