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.
- checksums.yaml +4 -4
- data/lib/foreman_inventory_upload/version.rb +1 -1
- data/package.json +124 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +34 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +72 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +65 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +55 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +8 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +23 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +39 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItemHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +48 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/listItem.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.fixtures.js +6 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.js +43 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatusHelper.js +29 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +78 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/listItemStatus.scss +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +60 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +41 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +47 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +66 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +40 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +30 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +146 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +87 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardReducer.js +68 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +17 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +25 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +39 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +64 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +45 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +36 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardActions.test.js.snap +76 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardReducer.test.js.snap +44 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap +42 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/index.js +37 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +22 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +64 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +10 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +83 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +89 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +57 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +45 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/reportGenerate.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +57 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUploadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +45 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/reportUpload.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +3 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +27 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +11 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +53 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +74 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js +31 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +24 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +12 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +45 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap +53 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +21 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +112 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/TerminalHelper.js +6 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +35 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap +98 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +31 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/Tree.fixtures.js +3 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/Tree.js +29 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/TreeHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/__tests__/Tree.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/__tests__/__snapshots__/Tree.test.js.snap +63 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/tree.scss +0 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +15 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +10 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +12 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +4 -0
- data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +16 -0
- data/webpack/ForemanInventoryUpload/index.js +1 -0
- data/webpack/__mocks__/foremanReact/API.js +7 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +5 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +3 -0
- data/webpack/index.js +18 -0
- data/webpack/stories/ForemanInventoryUploadReducers.js +3 -0
- data/webpack/stories/configureStore.js +15 -0
- data/webpack/stories/decorators/index.js +1 -0
- data/webpack/stories/decorators/withCardsDecorator.js +14 -0
- data/webpack/stories/index.js +10 -0
- data/webpack/stories/index.scss +7 -0
- data/webpack/test_setup.js +6 -0
- metadata +177 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 508f8a474c4a67d7631341c691fb1a564496715e
|
4
|
+
data.tar.gz: 85d87ab8f025d35844c81b6dea729b5d44efa30a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fa4aabde1ccf0f43e91b71a291fb983afbd72e71bc3142da3cbb9b828d9ba6bf87945a59a519aff300fda4718838f04fd4f83b14fa56cc9f82e5ee161d229f8
|
7
|
+
data.tar.gz: de3eb02026577bad92d735b25d3f7e342f6830f2920d1b6f8bad51a1d616102ae707f2db64d54917f315cd0b3935d8dc5aedabe399957877c99fa2925bc34748
|
data/package.json
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
{
|
2
|
+
"name": "foreman_inventory_upload",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "Inventory Upload =============",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"lint": "./node_modules/.bin/eslint -c .eslintrc webpack/",
|
8
|
+
"test": "node node_modules/.bin/jest --no-cache",
|
9
|
+
"test:watch": "node node_modules/.bin/jest --watchAll",
|
10
|
+
"test:current": "node node_modules/.bin/jest --watch",
|
11
|
+
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
12
|
+
"storybook": "start-storybook -p 6006",
|
13
|
+
"storybook:build": "node --max_old_space_size=2048 ./node_modules/.bin/build-storybook --config-dir .storybook --output-dir .storybook-dist",
|
14
|
+
"storybook:deploy": "surge --project .storybook-dist"
|
15
|
+
},
|
16
|
+
"repository": {
|
17
|
+
"type": "git",
|
18
|
+
"url": "git+https://github.com/theforeman/foreman_inventory_upload.git"
|
19
|
+
},
|
20
|
+
"bugs": {
|
21
|
+
"url": "http://projects.theforeman.org/projects/foreman_inventory_upload/issues"
|
22
|
+
},
|
23
|
+
"devDependencies": {
|
24
|
+
"@storybook/addon-actions": "^5.0.1",
|
25
|
+
"@storybook/addon-knobs": "^5.0.1",
|
26
|
+
"@storybook/react": "^5.0.1",
|
27
|
+
"babel-cli": "^6.10.1",
|
28
|
+
"babel-core": "^6.26.3",
|
29
|
+
"babel-eslint": "^8.2.3",
|
30
|
+
"babel-jest": "^23.6.0",
|
31
|
+
"babel-loader": "^7.1.1",
|
32
|
+
"babel-plugin-dynamic-import-node": "^2.0.0",
|
33
|
+
"babel-plugin-lodash": "^3.3.4",
|
34
|
+
"babel-plugin-module-resolver": "^3.2.0",
|
35
|
+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
36
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
37
|
+
"babel-plugin-transform-object-assign": "^6.8.0",
|
38
|
+
"babel-plugin-transform-object-rest-spread": "^6.8.0",
|
39
|
+
"babel-preset-env": "^1.7.0",
|
40
|
+
"babel-preset-react": "^6.5.0",
|
41
|
+
"coveralls": "^3.0.0",
|
42
|
+
"enzyme": "^3.4.0",
|
43
|
+
"enzyme-adapter-react-16": "^1.4.0",
|
44
|
+
"enzyme-to-json": "^3.2.1",
|
45
|
+
"eslint": "^4.10.0",
|
46
|
+
"eslint-import-resolver-babel-module": "^4.0.0",
|
47
|
+
"eslint-plugin-patternfly-react": "0.2.0",
|
48
|
+
"identity-obj-proxy": "^3.0.0",
|
49
|
+
"jed": "^1.1.1",
|
50
|
+
"jest-cli": "^23.6.0",
|
51
|
+
"jest-prop-type-error": "^1.1.0",
|
52
|
+
"node-sass": "^4.5.0",
|
53
|
+
"patternfly": "^3.58.0",
|
54
|
+
"prettier": "^1.13.5",
|
55
|
+
"raf": "^3.4.0",
|
56
|
+
"react-animated-tree": "^1.0.10",
|
57
|
+
"react-redux-test-utils": "^0.1.1",
|
58
|
+
"react-remarkable": "^1.1.3",
|
59
|
+
"sass-loader": "^6.0.7",
|
60
|
+
"stylelint": "^9.3.0",
|
61
|
+
"stylelint-config-standard": "^18.0.0",
|
62
|
+
"surge": "^0.20.3"
|
63
|
+
},
|
64
|
+
"dependencies": {
|
65
|
+
"babel-polyfill": "^6.26.0",
|
66
|
+
"classnames": "^2.2.5",
|
67
|
+
"lodash": "^4.17.10",
|
68
|
+
"patternfly-react": "^2.19.1",
|
69
|
+
"prop-types": "^15.6.0",
|
70
|
+
"react": "^16.4.0",
|
71
|
+
"react-dom": "^16.4.0",
|
72
|
+
"react-intl": "^2.8.0",
|
73
|
+
"react-redux": "^5.0.6",
|
74
|
+
"redux": "^3.6.0",
|
75
|
+
"redux-thunk": "^2.2.0",
|
76
|
+
"reselect": "^3.0.1",
|
77
|
+
"seamless-immutable": "^7.1.2",
|
78
|
+
"urijs": "^1.18.10",
|
79
|
+
"uuid": "^3.0.1"
|
80
|
+
},
|
81
|
+
"jest": {
|
82
|
+
"automock": true,
|
83
|
+
"verbose": true,
|
84
|
+
"testMatch": [
|
85
|
+
"**/*.test.js"
|
86
|
+
],
|
87
|
+
"testURL": "http://localhost/",
|
88
|
+
"collectCoverage": true,
|
89
|
+
"collectCoverageFrom": [
|
90
|
+
"webpack/**/*.js",
|
91
|
+
"!webpack/index.js",
|
92
|
+
"!webpack/test_setup.js",
|
93
|
+
"!webpack/**/bundle*",
|
94
|
+
"!webpack/stories/**",
|
95
|
+
"!webpack/**/*stories.js"
|
96
|
+
],
|
97
|
+
"coverageReporters": [
|
98
|
+
"lcov"
|
99
|
+
],
|
100
|
+
"unmockedModulePathPatterns": [
|
101
|
+
"webpack/",
|
102
|
+
"react",
|
103
|
+
"node_modules/"
|
104
|
+
],
|
105
|
+
"moduleNameMapper": {
|
106
|
+
"^.+\\.(png|gif|css|scss)$": "identity-obj-proxy"
|
107
|
+
},
|
108
|
+
"globals": {
|
109
|
+
"__testing__": true
|
110
|
+
},
|
111
|
+
"transform": {
|
112
|
+
"^.+\\.js$": "babel-jest"
|
113
|
+
},
|
114
|
+
"moduleDirectories": [
|
115
|
+
"node_modules",
|
116
|
+
"webpack"
|
117
|
+
],
|
118
|
+
"setupFiles": [
|
119
|
+
"raf/polyfill",
|
120
|
+
"jest-prop-type-error",
|
121
|
+
"./webpack/test_setup.js"
|
122
|
+
]
|
123
|
+
}
|
124
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { noop } from 'patternfly-react';
|
2
|
+
|
3
|
+
export const API_SUCCESS_RESPONSE = {
|
4
|
+
Account1: {
|
5
|
+
upload_report_status: 'running',
|
6
|
+
generate_report_status: 'running',
|
7
|
+
},
|
8
|
+
Account2: {
|
9
|
+
upload_report_status: 'unknown',
|
10
|
+
generate_report_status: 'failure',
|
11
|
+
},
|
12
|
+
Account3: {
|
13
|
+
upload_report_status: 'success',
|
14
|
+
generate_report_status: 'running',
|
15
|
+
},
|
16
|
+
};
|
17
|
+
|
18
|
+
export const statuses = API_SUCCESS_RESPONSE;
|
19
|
+
|
20
|
+
export const pollingProcessID = 0;
|
21
|
+
|
22
|
+
export const error = 'some-error';
|
23
|
+
|
24
|
+
export const accountID = 'user@redhat.com';
|
25
|
+
|
26
|
+
export const processStatusName = 'upload_report_status';
|
27
|
+
|
28
|
+
export const props = {
|
29
|
+
statuses,
|
30
|
+
fetchAccountsStatus: noop,
|
31
|
+
startAccountStatusPolling: noop,
|
32
|
+
stopAccountStatusPolling: noop,
|
33
|
+
pollingProcessID,
|
34
|
+
};
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import React, { Component } from 'react';
|
2
|
+
import { ListView, noop } from 'patternfly-react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import ListItem from './Components/ListItem';
|
5
|
+
import EmptyState from './Components/EmptyState';
|
6
|
+
import ErrorState from './Components/ErrorState';
|
7
|
+
import './accountList.scss';
|
8
|
+
|
9
|
+
class AccountList extends Component {
|
10
|
+
componentDidMount() {
|
11
|
+
const { fetchAccountsStatus, startAccountStatusPolling } = this.props;
|
12
|
+
fetchAccountsStatus();
|
13
|
+
const pollingProcessID = setInterval(fetchAccountsStatus, 5000);
|
14
|
+
startAccountStatusPolling(pollingProcessID);
|
15
|
+
}
|
16
|
+
|
17
|
+
componentWillUnmount() {
|
18
|
+
const { stopAccountStatusPolling, pollingProcessID } = this.props;
|
19
|
+
stopAccountStatusPolling(pollingProcessID);
|
20
|
+
}
|
21
|
+
|
22
|
+
render() {
|
23
|
+
const { statuses, error } = this.props;
|
24
|
+
const accountNames = Object.keys(statuses);
|
25
|
+
|
26
|
+
if (error) {
|
27
|
+
return <ErrorState error={error} />;
|
28
|
+
}
|
29
|
+
|
30
|
+
if (accountNames.length === 0) {
|
31
|
+
return <EmptyState />;
|
32
|
+
}
|
33
|
+
const items = accountNames.map((name, index) => {
|
34
|
+
const status = statuses[name];
|
35
|
+
return (
|
36
|
+
<ListItem
|
37
|
+
key={index}
|
38
|
+
name={name}
|
39
|
+
statuses={status}
|
40
|
+
initExpanded={index === 0}
|
41
|
+
/>
|
42
|
+
);
|
43
|
+
});
|
44
|
+
return <ListView className="account_list">{items}</ListView>;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
AccountList.propTypes = {
|
49
|
+
fetchAccountsStatus: PropTypes.func,
|
50
|
+
startAccountStatusPolling: PropTypes.func,
|
51
|
+
stopAccountStatusPolling: PropTypes.func,
|
52
|
+
pollingProcessID: PropTypes.number,
|
53
|
+
statuses: PropTypes.shape({
|
54
|
+
generate_report_status: PropTypes.string,
|
55
|
+
upload_report_status: PropTypes.string,
|
56
|
+
}),
|
57
|
+
error: PropTypes.string,
|
58
|
+
};
|
59
|
+
|
60
|
+
AccountList.defaultProps = {
|
61
|
+
fetchAccountsStatus: noop,
|
62
|
+
startAccountStatusPolling: noop,
|
63
|
+
stopAccountStatusPolling: noop,
|
64
|
+
pollingProcessID: 0,
|
65
|
+
statuses: {
|
66
|
+
generate_report_status: 'unknown',
|
67
|
+
upload_report_status: 'unknown',
|
68
|
+
},
|
69
|
+
error: '',
|
70
|
+
};
|
71
|
+
|
72
|
+
export default AccountList;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { storiesOf } from '@storybook/react';
|
3
|
+
import { withKnobs } from '@storybook/addon-knobs';
|
4
|
+
import { Provider } from 'react-redux';
|
5
|
+
import configureStore from '../../../stories/configureStore';
|
6
|
+
import AccountList from './AccountList';
|
7
|
+
|
8
|
+
const store = configureStore();
|
9
|
+
|
10
|
+
storiesOf('Account list', module)
|
11
|
+
.addDecorator(withKnobs)
|
12
|
+
.add('Account list', () => (
|
13
|
+
<div style={{ margin: '20px' }}>
|
14
|
+
<Provider store={store}>
|
15
|
+
<AccountList />
|
16
|
+
</Provider>
|
17
|
+
</div>
|
18
|
+
));
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import API from 'foremanReact/API';
|
2
|
+
import {
|
3
|
+
INVENTORY_ACCOUNT_STATUS_POLLING,
|
4
|
+
INVENTORY_ACCOUNT_STATUS_POLLING_ERROR,
|
5
|
+
INVENTORY_ACCOUNT_STATUS_POLLING_START,
|
6
|
+
INVENTORY_ACCOUNT_STATUS_POLLING_STOP,
|
7
|
+
INVENTORY_PROCESS_RESTART,
|
8
|
+
} from './AccountListConstants';
|
9
|
+
|
10
|
+
export const fetchAccountsStatus = () => async dispatch => {
|
11
|
+
try {
|
12
|
+
const {
|
13
|
+
data: { statuses },
|
14
|
+
} = await API.get('statuses');
|
15
|
+
dispatch({
|
16
|
+
type: INVENTORY_ACCOUNT_STATUS_POLLING,
|
17
|
+
payload: {
|
18
|
+
statuses,
|
19
|
+
},
|
20
|
+
});
|
21
|
+
} catch (error) {
|
22
|
+
dispatch({
|
23
|
+
type: INVENTORY_ACCOUNT_STATUS_POLLING_ERROR,
|
24
|
+
payload: {
|
25
|
+
error: error.message,
|
26
|
+
},
|
27
|
+
});
|
28
|
+
}
|
29
|
+
};
|
30
|
+
|
31
|
+
export const startAccountStatusPolling = pollingProcessID => ({
|
32
|
+
type: INVENTORY_ACCOUNT_STATUS_POLLING_START,
|
33
|
+
payload: {
|
34
|
+
pollingProcessID,
|
35
|
+
},
|
36
|
+
});
|
37
|
+
|
38
|
+
export const stopAccountStatusPolling = pollingProcessID => dispatch => {
|
39
|
+
clearInterval(pollingProcessID);
|
40
|
+
dispatch({
|
41
|
+
type: INVENTORY_ACCOUNT_STATUS_POLLING_STOP,
|
42
|
+
});
|
43
|
+
};
|
44
|
+
|
45
|
+
export const restartProcess = (accountID, activeTab) => dispatch => {
|
46
|
+
let processController = null;
|
47
|
+
let processStatusName = null;
|
48
|
+
|
49
|
+
if (activeTab === 'uploading') {
|
50
|
+
processController = 'uploads';
|
51
|
+
processStatusName = 'upload_report_status';
|
52
|
+
} else {
|
53
|
+
processController = 'reports';
|
54
|
+
processStatusName = 'generate_report_status';
|
55
|
+
}
|
56
|
+
|
57
|
+
API.post(`${accountID}/${processController}`);
|
58
|
+
dispatch({
|
59
|
+
type: INVENTORY_PROCESS_RESTART,
|
60
|
+
payload: {
|
61
|
+
accountID,
|
62
|
+
processStatusName,
|
63
|
+
},
|
64
|
+
});
|
65
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export const INVENTORY_ACCOUNT_STATUS_POLLING =
|
2
|
+
'INVENTORY_ACCOUNT_STATUS_POLLING';
|
3
|
+
export const INVENTORY_ACCOUNT_STATUS_POLLING_ERROR =
|
4
|
+
'INVENTORY_ACCOUNT_STATUS_POLLING_ERROR';
|
5
|
+
export const INVENTORY_ACCOUNT_STATUS_POLLING_START =
|
6
|
+
'INVENTORY_ACCOUNT_STATUS_POLLING_START';
|
7
|
+
export const INVENTORY_ACCOUNT_STATUS_POLLING_STOP =
|
8
|
+
'INVENTORY_ACCOUNT_STATUS_POLLING_STOP';
|
9
|
+
export const INVENTORY_PROCESS_RESTART = 'INVENTORY_PROCESS_RESTART';
|
File without changes
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import Immutable from 'seamless-immutable';
|
2
|
+
import {
|
3
|
+
INVENTORY_ACCOUNT_STATUS_POLLING,
|
4
|
+
INVENTORY_ACCOUNT_STATUS_POLLING_ERROR,
|
5
|
+
INVENTORY_ACCOUNT_STATUS_POLLING_START,
|
6
|
+
INVENTORY_PROCESS_RESTART,
|
7
|
+
} from './AccountListConstants';
|
8
|
+
|
9
|
+
const initialState = Immutable({
|
10
|
+
statuses: {},
|
11
|
+
pollingProcessID: 0,
|
12
|
+
error: null,
|
13
|
+
});
|
14
|
+
|
15
|
+
export default (state = initialState, action) => {
|
16
|
+
const {
|
17
|
+
payload: {
|
18
|
+
pollingProcessID,
|
19
|
+
error,
|
20
|
+
statuses,
|
21
|
+
accountID,
|
22
|
+
processStatusName,
|
23
|
+
} = {},
|
24
|
+
} = action;
|
25
|
+
|
26
|
+
switch (action.type) {
|
27
|
+
case INVENTORY_ACCOUNT_STATUS_POLLING:
|
28
|
+
return state.merge({
|
29
|
+
...state,
|
30
|
+
statuses,
|
31
|
+
error: null,
|
32
|
+
});
|
33
|
+
case INVENTORY_ACCOUNT_STATUS_POLLING_ERROR:
|
34
|
+
return state.merge({
|
35
|
+
...state,
|
36
|
+
statuses: {},
|
37
|
+
error,
|
38
|
+
});
|
39
|
+
case INVENTORY_ACCOUNT_STATUS_POLLING_START:
|
40
|
+
return state.merge({
|
41
|
+
...state,
|
42
|
+
pollingProcessID,
|
43
|
+
});
|
44
|
+
case INVENTORY_PROCESS_RESTART:
|
45
|
+
return state.setIn(['statuses'], {
|
46
|
+
...state.statuses,
|
47
|
+
[accountID]: {
|
48
|
+
...state.statuses[accountID],
|
49
|
+
[processStatusName]: 'Restarting...',
|
50
|
+
},
|
51
|
+
});
|
52
|
+
default:
|
53
|
+
return state;
|
54
|
+
}
|
55
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { selectForemanInventoryUpload } from '../../ForemanInventoryUploadSelectors';
|
2
|
+
|
3
|
+
export const selectAccountsList = state =>
|
4
|
+
selectForemanInventoryUpload(state).accountsList;
|
5
|
+
export const selectStatuses = state => selectAccountsList(state).statuses;
|
6
|
+
export const selectPollingProcessID = state =>
|
7
|
+
selectAccountsList(state).pollingProcessID;
|
8
|
+
export const selectError = state => selectAccountsList(state).error;
|
File without changes
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { EmptyState, Spinner } from 'patternfly-react';
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
+
import './emptyState.scss';
|
5
|
+
|
6
|
+
const inventoryEmptyState = () => (
|
7
|
+
<EmptyState>
|
8
|
+
<Spinner loading inline size="lg" />
|
9
|
+
<EmptyState.Title>
|
10
|
+
{__('Fetching data about your accounts')}
|
11
|
+
</EmptyState.Title>
|
12
|
+
<EmptyState.Info>{__('Loading')}...</EmptyState.Info>
|
13
|
+
</EmptyState>
|
14
|
+
);
|
15
|
+
|
16
|
+
export default inventoryEmptyState;
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js
ADDED
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import EmptyState from '../EmptyState';
|
4
|
+
|
5
|
+
const fixtures = {
|
6
|
+
'render without Props': {},
|
7
|
+
/** fixtures, props for the component */
|
8
|
+
};
|
9
|
+
|
10
|
+
describe('EmptyState', () => {
|
11
|
+
describe('rendering', () =>
|
12
|
+
testComponentSnapshotsWithFixtures(EmptyState, fixtures));
|
13
|
+
});
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`EmptyState rendering render without Props 1`] = `
|
4
|
+
<EmptyState
|
5
|
+
className=""
|
6
|
+
>
|
7
|
+
<Spinner
|
8
|
+
className=""
|
9
|
+
inline={true}
|
10
|
+
inverse={false}
|
11
|
+
loading={true}
|
12
|
+
size="lg"
|
13
|
+
/>
|
14
|
+
<EmptyStateTitle
|
15
|
+
className=""
|
16
|
+
>
|
17
|
+
Fetching data about your accounts
|
18
|
+
</EmptyStateTitle>
|
19
|
+
<EmptyStateInfo
|
20
|
+
className=""
|
21
|
+
>
|
22
|
+
Loading
|
23
|
+
...
|
24
|
+
</EmptyStateInfo>
|
25
|
+
</EmptyState>
|
26
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './EmptyState';
|
File without changes
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Icon } from 'patternfly-react';
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
5
|
+
import './errorState.scss';
|
6
|
+
|
7
|
+
const ErrorState = ({ error }) => (
|
8
|
+
<div className="error_state">
|
9
|
+
<Icon className="error_icon" name="times" size="2x" />
|
10
|
+
<p>{__('Encountered an error while trying to access the server:')}</p>
|
11
|
+
<p className="error_description">{error}</p>
|
12
|
+
</div>
|
13
|
+
);
|
14
|
+
|
15
|
+
ErrorState.propTypes = {
|
16
|
+
error: PropTypes.string,
|
17
|
+
};
|
18
|
+
|
19
|
+
ErrorState.defaultProps = {
|
20
|
+
error: '',
|
21
|
+
};
|
22
|
+
|
23
|
+
export default ErrorState;
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorStateHelper.js
ADDED
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import ErrorState from '../ErrorState';
|
4
|
+
|
5
|
+
const fixtures = {
|
6
|
+
'render without Props': {},
|
7
|
+
/** fixtures, props for the component */
|
8
|
+
};
|
9
|
+
|
10
|
+
describe('ErrorState', () => {
|
11
|
+
describe('rendering', () =>
|
12
|
+
testComponentSnapshotsWithFixtures(ErrorState, fixtures));
|
13
|
+
});
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ErrorState rendering render without Props 1`] = `
|
4
|
+
<div
|
5
|
+
className="error_state"
|
6
|
+
>
|
7
|
+
<Icon
|
8
|
+
className="error_icon"
|
9
|
+
name="times"
|
10
|
+
size="2x"
|
11
|
+
type="fa"
|
12
|
+
/>
|
13
|
+
<p>
|
14
|
+
Encountered an error while trying to access the server:
|
15
|
+
</p>
|
16
|
+
<p
|
17
|
+
className="error_description"
|
18
|
+
/>
|
19
|
+
</div>
|
20
|
+
`;
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
$error_color: #d10d0d;
|
2
|
+
|
3
|
+
.error_state {
|
4
|
+
margin-top: 100px;
|
5
|
+
text-align: center;
|
6
|
+
font-weight: bold;
|
7
|
+
font-size: 16px;
|
8
|
+
|
9
|
+
.error_icon {
|
10
|
+
color: $error_color;
|
11
|
+
margin-right: 15px;
|
12
|
+
margin-bottom: 10px;
|
13
|
+
}
|
14
|
+
|
15
|
+
.error_description {
|
16
|
+
color: $error_color;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './ErrorState';
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export const props = { name: 'some-name' };
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ListView } from 'patternfly-react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import ListItemStatus from '../ListItemStatus';
|
5
|
+
import Dashboard from '../../../Dashboard';
|
6
|
+
|
7
|
+
const ListItem = ({ name, statuses, initExpanded }) => (
|
8
|
+
<ListView.Item
|
9
|
+
leftContent={<ListView.Icon name="user" />}
|
10
|
+
heading={name}
|
11
|
+
additionalInfo={[
|
12
|
+
<ListItemStatus key={`${name}_status`} statuses={statuses} />,
|
13
|
+
]}
|
14
|
+
stacked
|
15
|
+
hideCloseIcon
|
16
|
+
initExpanded={initExpanded}
|
17
|
+
>
|
18
|
+
<Dashboard accountID={name} statuses={statuses} />
|
19
|
+
</ListView.Item>
|
20
|
+
);
|
21
|
+
|
22
|
+
ListItem.propTypes = {
|
23
|
+
name: PropTypes.string.isRequired,
|
24
|
+
statuses: PropTypes.shape({
|
25
|
+
generate_report_status: PropTypes.string,
|
26
|
+
upload_report_status: PropTypes.string,
|
27
|
+
}),
|
28
|
+
initExpanded: PropTypes.bool,
|
29
|
+
};
|
30
|
+
|
31
|
+
ListItem.defaultProps = {
|
32
|
+
statuses: {
|
33
|
+
generate_report_status: 'unknown',
|
34
|
+
upload_report_status: 'unknown',
|
35
|
+
},
|
36
|
+
initExpanded: false,
|
37
|
+
};
|
38
|
+
|
39
|
+
export default ListItem;
|
data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItemHelper.js
ADDED
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import ListItem from '../ListItem';
|
4
|
+
import { props } from '../ListItem.fixtures';
|
5
|
+
|
6
|
+
const fixtures = {
|
7
|
+
'render with Props': props,
|
8
|
+
};
|
9
|
+
|
10
|
+
describe('ListItem', () => {
|
11
|
+
describe('rendering', () =>
|
12
|
+
testComponentSnapshotsWithFixtures(ListItem, fixtures));
|
13
|
+
});
|