foreman_inventory_upload 1.0.0.beta1 → 1.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/lib/foreman_inventory_upload/version.rb +1 -1
  3. data/package.json +124 -0
  4. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +34 -0
  5. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +72 -0
  6. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +18 -0
  7. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +65 -0
  8. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListConstants.js +9 -0
  9. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +0 -0
  10. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +55 -0
  11. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +8 -0
  12. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.fixtures.js +0 -0
  13. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +16 -0
  14. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js +0 -0
  15. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +13 -0
  16. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +26 -0
  17. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +7 -0
  18. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/index.js +1 -0
  19. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.fixtures.js +0 -0
  20. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +23 -0
  21. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorStateHelper.js +0 -0
  22. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +13 -0
  23. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +20 -0
  24. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +18 -0
  25. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/index.js +1 -0
  26. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +1 -0
  27. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +39 -0
  28. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItemHelper.js +0 -0
  29. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +13 -0
  30. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +48 -0
  31. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/index.js +1 -0
  32. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/listItem.scss +0 -0
  33. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.fixtures.js +6 -0
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.js +43 -0
  35. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatusHelper.js +29 -0
  36. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +14 -0
  37. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +78 -0
  38. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/index.js +1 -0
  39. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/listItemStatus.scss +16 -0
  40. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +13 -0
  41. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +20 -0
  42. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +14 -0
  43. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +60 -0
  44. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +26 -0
  45. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +41 -0
  46. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +47 -0
  47. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +66 -0
  48. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +40 -0
  49. data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +9 -0
  50. data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +30 -0
  51. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +50 -0
  52. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +146 -0
  53. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +19 -0
  54. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +87 -0
  55. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardConstants.js +9 -0
  56. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardHelper.js +0 -0
  57. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardReducer.js +68 -0
  58. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +17 -0
  59. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +25 -0
  60. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +39 -0
  61. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +16 -0
  62. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +64 -0
  63. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +45 -0
  64. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +36 -0
  65. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardActions.test.js.snap +76 -0
  66. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardReducer.test.js.snap +44 -0
  67. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap +42 -0
  68. data/webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss +0 -0
  69. data/webpack/ForemanInventoryUpload/Components/Dashboard/index.js +37 -0
  70. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
  71. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +22 -0
  72. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
  73. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +13 -0
  74. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +25 -0
  75. data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +3 -0
  76. data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +1 -0
  77. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js +0 -0
  78. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +50 -0
  79. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js +0 -0
  80. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +13 -0
  81. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +64 -0
  82. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +10 -0
  83. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js +1 -0
  84. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +10 -0
  85. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +83 -0
  86. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js +0 -0
  87. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +26 -0
  88. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +89 -0
  89. data/webpack/ForemanInventoryUpload/Components/NavContainer/index.js +1 -0
  90. data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +7 -0
  91. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +16 -0
  92. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +57 -0
  93. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js +0 -0
  94. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +14 -0
  95. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +45 -0
  96. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/index.js +1 -0
  97. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/reportGenerate.scss +0 -0
  98. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +18 -0
  99. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +57 -0
  100. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUploadHelper.js +0 -0
  101. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +14 -0
  102. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +45 -0
  103. data/webpack/ForemanInventoryUpload/Components/ReportUpload/index.js +1 -0
  104. data/webpack/ForemanInventoryUpload/Components/ReportUpload/reportUpload.scss +0 -0
  105. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +3 -0
  106. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +27 -0
  107. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js +0 -0
  108. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +14 -0
  109. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +25 -0
  110. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -0
  111. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +11 -0
  112. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js +0 -0
  113. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +53 -0
  114. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
  115. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +13 -0
  116. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +74 -0
  117. data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +1 -0
  118. data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +8 -0
  119. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js +0 -0
  120. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js +31 -0
  121. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js +0 -0
  122. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +13 -0
  123. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +19 -0
  124. data/webpack/ForemanInventoryUpload/Components/TabBody/index.js +1 -0
  125. data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +3 -0
  126. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
  127. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +24 -0
  128. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
  129. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +13 -0
  130. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +18 -0
  131. data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +1 -0
  132. data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +8 -0
  133. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
  134. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +19 -0
  135. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
  136. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +13 -0
  137. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +12 -0
  138. data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +1 -0
  139. data/webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss +0 -0
  140. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js +0 -0
  141. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +45 -0
  142. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js +0 -0
  143. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +13 -0
  144. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap +53 -0
  145. data/webpack/ForemanInventoryUpload/Components/TabHeader/index.js +1 -0
  146. data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +21 -0
  147. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js +10 -0
  148. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +112 -0
  149. data/webpack/ForemanInventoryUpload/Components/Terminal/TerminalHelper.js +6 -0
  150. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +35 -0
  151. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap +98 -0
  152. data/webpack/ForemanInventoryUpload/Components/Terminal/index.js +1 -0
  153. data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +31 -0
  154. data/webpack/ForemanInventoryUpload/Components/Tree/Tree.fixtures.js +3 -0
  155. data/webpack/ForemanInventoryUpload/Components/Tree/Tree.js +29 -0
  156. data/webpack/ForemanInventoryUpload/Components/Tree/TreeHelper.js +0 -0
  157. data/webpack/ForemanInventoryUpload/Components/Tree/__tests__/Tree.test.js +14 -0
  158. data/webpack/ForemanInventoryUpload/Components/Tree/__tests__/__snapshots__/Tree.test.js.snap +63 -0
  159. data/webpack/ForemanInventoryUpload/Components/Tree/index.js +1 -0
  160. data/webpack/ForemanInventoryUpload/Components/Tree/tree.scss +0 -0
  161. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +15 -0
  162. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +10 -0
  163. data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +12 -0
  164. data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +4 -0
  165. data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +16 -0
  166. data/webpack/ForemanInventoryUpload/index.js +1 -0
  167. data/webpack/__mocks__/foremanReact/API.js +7 -0
  168. data/webpack/__mocks__/foremanReact/common/I18n.js +5 -0
  169. data/webpack/__mocks__/foremanReact/common/helpers.js +3 -0
  170. data/webpack/index.js +18 -0
  171. data/webpack/stories/ForemanInventoryUploadReducers.js +3 -0
  172. data/webpack/stories/configureStore.js +15 -0
  173. data/webpack/stories/decorators/index.js +1 -0
  174. data/webpack/stories/decorators/withCardsDecorator.js +14 -0
  175. data/webpack/stories/index.js +10 -0
  176. data/webpack/stories/index.scss +7 -0
  177. data/webpack/test_setup.js +6 -0
  178. metadata +177 -2
@@ -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';
@@ -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,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 './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;
@@ -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={[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
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './ReportUpload';
@@ -0,0 +1,3 @@
1
+ export const props = {
2
+ date: '2019-08-21T16:14:16.520+03:00',
3
+ };
@@ -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;
@@ -0,0 +1,14 @@
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
+ });
@@ -0,0 +1,25 @@
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`] = `""`;
@@ -0,0 +1 @@
1
+ export { default } from './ScheduledRun';
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,53 @@
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: [['Completed', completed], ['Remain', 100 - completed]],
9
+ order: null,
10
+ };
11
+
12
+ const pfGetUtilizationDonutTooltipContents = d => {
13
+ const {
14
+ 0: { name, value },
15
+ } = d;
16
+ return `<span class="donut-tooltip-pf" style="white-space: nowrap;">${value}% ${name}</span>`;
17
+ };
18
+
19
+ const donutConfigTooltip = {
20
+ contents: pfGetUtilizationDonutTooltipContents,
21
+ };
22
+
23
+ return (
24
+ <Grid.Col sm={4}>
25
+ <div className="status-chart">
26
+ <DonutChart
27
+ id="donunt-chart-1"
28
+ size={{
29
+ width: 210,
30
+ height: 210,
31
+ }}
32
+ data={donutConfigData}
33
+ tooltip={donutConfigTooltip}
34
+ title={{
35
+ type: 'percent',
36
+ primary: `${completed}%`,
37
+ secondary: 'Completed',
38
+ }}
39
+ />
40
+ </div>
41
+ </Grid.Col>
42
+ );
43
+ };
44
+
45
+ StatusChart.propTypes = {
46
+ completed: PropTypes.number,
47
+ };
48
+
49
+ StatusChart.defaultProps = {
50
+ completed: 0,
51
+ };
52
+
53
+ export default StatusChart;
@@ -0,0 +1,13 @@
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
+ });
@@ -0,0 +1,74 @@
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
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './StatusChart';
@@ -0,0 +1,8 @@
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
+ }
@@ -0,0 +1,31 @@
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;
@@ -0,0 +1,13 @@
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
+ });
@@ -0,0 +1,19 @@
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
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './TabBody';
@@ -0,0 +1,3 @@
1
+ .tab_body {
2
+ margin-bottom: 0;
3
+ }
@@ -0,0 +1,24 @@
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;
@@ -0,0 +1,13 @@
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
+ });
@@ -0,0 +1,18 @@
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
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './TabContainer';
@@ -0,0 +1,8 @@
1
+ .tab-content {
2
+ padding: 20px;
3
+ min-height: 0;
4
+
5
+ .row {
6
+ margin-bottom: 20px;
7
+ }
8
+ }
@@ -0,0 +1,19 @@
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;
@@ -0,0 +1,13 @@
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
+ });
@@ -0,0 +1,12 @@
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
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './TabFooter';