foreman_inventory_upload 0.0.1.dev1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +1 -1
- data/app/controllers/foreman_inventory_upload/accounts_controller.rb +39 -0
- data/app/controllers/foreman_inventory_upload/reports_controller.rb +13 -6
- data/app/controllers/foreman_inventory_upload/uploads_controller.rb +4 -4
- data/app/helpers/foreman_inventory_upload_helper.rb +1 -1
- data/app/views/scripts/uploader.sh.erb +21 -10
- data/config/routes.rb +5 -5
- data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +19 -0
- data/lib/foreman_inventory_upload/async/generate_report_job.rb +13 -9
- data/lib/foreman_inventory_upload/async/progress_output.rb +1 -1
- data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +12 -17
- data/lib/foreman_inventory_upload/async/shell_process.rb +2 -1
- data/lib/foreman_inventory_upload/async/upload_report_job.rb +22 -17
- data/lib/foreman_inventory_upload/engine.rb +11 -1
- data/lib/foreman_inventory_upload/generators/archived_report.rb +2 -2
- data/lib/foreman_inventory_upload/generators/queries.rb +20 -11
- data/lib/foreman_inventory_upload/generators/slice.rb +26 -5
- data/lib/foreman_inventory_upload/version.rb +1 -1
- data/lib/foreman_inventory_upload.rb +15 -10
- data/lib/tasks/generator.rake +19 -5
- data/package.json +125 -0
- data/test/controllers/{statuses_controller_test.rb → accounts_controller_test.rb} +6 -7
- data/test/controllers/reports_controller_test.rb +3 -3
- data/test/controllers/uploads_controller_test.rb +3 -3
- data/test/unit/archived_report_generator_test.rb +4 -4
- data/test/unit/slice_generator_test.rb +75 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +37 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +74 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +65 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +55 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +8 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +23 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +41 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItemHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +50 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/listItem.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.fixtures.js +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.js +43 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatusHelper.js +29 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +78 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/listItemStatus.scss +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +60 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +44 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +47 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +69 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +46 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +27 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +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 +34 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +22 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +64 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +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 +56 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +74 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js +31 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +24 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +12 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +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/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 +205 -9
- data/app/controllers/foreman_inventory_upload/statuses_controller.rb +0 -41
data/package.json
ADDED
@@ -0,0 +1,125 @@
|
|
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
|
+
"optionalDependencies": {
|
24
|
+
"babel-plugin-module-resolver": "^3.2.0"
|
25
|
+
},
|
26
|
+
"devDependencies": {
|
27
|
+
"@storybook/addon-actions": "^5.0.1",
|
28
|
+
"@storybook/addon-knobs": "^5.0.1",
|
29
|
+
"@storybook/react": "^5.0.1",
|
30
|
+
"babel-cli": "^6.10.1",
|
31
|
+
"babel-core": "^6.26.3",
|
32
|
+
"babel-eslint": "^8.2.3",
|
33
|
+
"babel-jest": "^23.6.0",
|
34
|
+
"babel-loader": "^7.1.1",
|
35
|
+
"babel-plugin-dynamic-import-node": "^2.0.0",
|
36
|
+
"babel-plugin-lodash": "^3.3.4",
|
37
|
+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
38
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
39
|
+
"babel-plugin-transform-object-assign": "^6.8.0",
|
40
|
+
"babel-plugin-transform-object-rest-spread": "^6.8.0",
|
41
|
+
"babel-preset-env": "^1.7.0",
|
42
|
+
"babel-preset-react": "^6.5.0",
|
43
|
+
"coveralls": "^3.0.0",
|
44
|
+
"enzyme": "^3.4.0",
|
45
|
+
"enzyme-adapter-react-16": "^1.4.0",
|
46
|
+
"enzyme-to-json": "^3.2.1",
|
47
|
+
"eslint": "^4.10.0",
|
48
|
+
"eslint-import-resolver-babel-module": "^4.0.0",
|
49
|
+
"eslint-plugin-patternfly-react": "0.2.0",
|
50
|
+
"identity-obj-proxy": "^3.0.0",
|
51
|
+
"jed": "^1.1.1",
|
52
|
+
"jest-cli": "^23.6.0",
|
53
|
+
"jest-prop-type-error": "^1.1.0",
|
54
|
+
"node-sass": "^4.5.0",
|
55
|
+
"patternfly": "^3.58.0",
|
56
|
+
"prettier": "^1.13.5",
|
57
|
+
"raf": "^3.4.0",
|
58
|
+
"react-redux-test-utils": "^0.1.1",
|
59
|
+
"react-remarkable": "^1.1.3",
|
60
|
+
"sass-loader": "^6.0.7",
|
61
|
+
"stylelint": "^9.3.0",
|
62
|
+
"stylelint-config-standard": "^18.0.0",
|
63
|
+
"surge": "^0.20.3"
|
64
|
+
},
|
65
|
+
"dependencies": {
|
66
|
+
"babel-polyfill": "^6.26.0",
|
67
|
+
"classnames": "^2.2.5",
|
68
|
+
"lodash": "^4.17.10",
|
69
|
+
"patternfly-react": "^2.19.1",
|
70
|
+
"prop-types": "^15.6.0",
|
71
|
+
"react": "^16.4.0",
|
72
|
+
"react-dom": "^16.4.0",
|
73
|
+
"react-intl": "^2.8.0",
|
74
|
+
"react-redux": "^5.0.6",
|
75
|
+
"redux": "^3.6.0",
|
76
|
+
"redux-thunk": "^2.2.0",
|
77
|
+
"reselect": "^3.0.1",
|
78
|
+
"seamless-immutable": "^7.1.2",
|
79
|
+
"urijs": "^1.18.10",
|
80
|
+
"uuid": "^3.0.1"
|
81
|
+
},
|
82
|
+
"jest": {
|
83
|
+
"automock": true,
|
84
|
+
"verbose": true,
|
85
|
+
"testMatch": [
|
86
|
+
"**/*.test.js"
|
87
|
+
],
|
88
|
+
"testURL": "http://localhost/",
|
89
|
+
"collectCoverage": true,
|
90
|
+
"collectCoverageFrom": [
|
91
|
+
"webpack/**/*.js",
|
92
|
+
"!webpack/index.js",
|
93
|
+
"!webpack/test_setup.js",
|
94
|
+
"!webpack/**/bundle*",
|
95
|
+
"!webpack/stories/**",
|
96
|
+
"!webpack/**/*stories.js"
|
97
|
+
],
|
98
|
+
"coverageReporters": [
|
99
|
+
"lcov"
|
100
|
+
],
|
101
|
+
"unmockedModulePathPatterns": [
|
102
|
+
"webpack/",
|
103
|
+
"react",
|
104
|
+
"node_modules/"
|
105
|
+
],
|
106
|
+
"moduleNameMapper": {
|
107
|
+
"^.+\\.(png|gif|css|scss)$": "identity-obj-proxy"
|
108
|
+
},
|
109
|
+
"globals": {
|
110
|
+
"__testing__": true
|
111
|
+
},
|
112
|
+
"transform": {
|
113
|
+
"^.+\\.js$": "babel-jest"
|
114
|
+
},
|
115
|
+
"moduleDirectories": [
|
116
|
+
"node_modules",
|
117
|
+
"webpack"
|
118
|
+
],
|
119
|
+
"setupFiles": [
|
120
|
+
"raf/polyfill",
|
121
|
+
"jest-prop-type-error",
|
122
|
+
"./webpack/test_setup.js"
|
123
|
+
]
|
124
|
+
}
|
125
|
+
}
|
@@ -1,25 +1,24 @@
|
|
1
1
|
require 'test_plugin_helper'
|
2
2
|
|
3
|
-
class
|
4
|
-
tests ForemanInventoryUpload::
|
3
|
+
class AccountsControllerTest < ActionController::TestCase
|
4
|
+
tests ForemanInventoryUpload::AccountsController
|
5
5
|
|
6
6
|
include FolderIsolation
|
7
7
|
|
8
8
|
test 'Returns statuses for each process type' do
|
9
|
-
|
10
|
-
configuration.save!
|
9
|
+
test_org = FactoryBot.create(:organization)
|
11
10
|
|
12
|
-
generate_label = ForemanInventoryUpload::Async::GenerateReportJob.output_label(
|
11
|
+
generate_label = ForemanInventoryUpload::Async::GenerateReportJob.output_label(test_org.id)
|
13
12
|
generate_output = ForemanInventoryUpload::Async::ProgressOutput.register(generate_label)
|
14
13
|
generate_output.status = 'generate_status_test'
|
15
|
-
upload_label = ForemanInventoryUpload::Async::UploadReportJob.output_label(
|
14
|
+
upload_label = ForemanInventoryUpload::Async::UploadReportJob.output_label(test_org.id)
|
16
15
|
upload_output = ForemanInventoryUpload::Async::ProgressOutput.register(upload_label)
|
17
16
|
upload_output.status = 'upload_status_test'
|
18
17
|
|
19
18
|
get :index, session: set_session_user
|
20
19
|
|
21
20
|
assert_response :success
|
22
|
-
actual = JSON.parse(response.body)['
|
21
|
+
actual = JSON.parse(response.body)['accounts'][test_org.id.to_s]
|
23
22
|
assert_equal 'generate_status_test', actual['generate_report_status']
|
24
23
|
assert_equal 'upload_status_test', actual['upload_report_status']
|
25
24
|
end
|
@@ -5,14 +5,14 @@ class ReportsControllerTest < ActionController::TestCase
|
|
5
5
|
|
6
6
|
test 'Returns latest report generation status' do
|
7
7
|
progress_output = mock('progress_output')
|
8
|
-
|
8
|
+
test_org = FactoryBot.create(:organization)
|
9
9
|
ForemanInventoryUpload::Async::ProgressOutput
|
10
10
|
.expects(:get)
|
11
|
-
.with(ForemanInventoryUpload::Async::GenerateReportJob.output_label(
|
11
|
+
.with(ForemanInventoryUpload::Async::GenerateReportJob.output_label(test_org.id))
|
12
12
|
.returns(progress_output)
|
13
13
|
progress_output.expects(:full_output).returns('test output')
|
14
14
|
|
15
|
-
get :last, params: {
|
15
|
+
get :last, params: { organization_id: test_org.id }, session: set_session_user
|
16
16
|
|
17
17
|
assert_response :success
|
18
18
|
actual = JSON.parse(response.body)
|
@@ -5,14 +5,14 @@ class UploadsControllerTest < ActionController::TestCase
|
|
5
5
|
|
6
6
|
test 'Returns latest upload status' do
|
7
7
|
progress_output = mock('progress_output')
|
8
|
-
|
8
|
+
test_org = FactoryBot.create(:organization)
|
9
9
|
ForemanInventoryUpload::Async::ProgressOutput
|
10
10
|
.expects(:get)
|
11
|
-
.with(ForemanInventoryUpload::Async::UploadReportJob.output_label(
|
11
|
+
.with(ForemanInventoryUpload::Async::UploadReportJob.output_label(test_org.id))
|
12
12
|
.returns(progress_output)
|
13
13
|
progress_output.expects(:full_output).returns('test output')
|
14
14
|
|
15
|
-
get :last, params: {
|
15
|
+
get :last, params: { organization_id: test_org.id }, session: set_session_user
|
16
16
|
|
17
17
|
assert_response :success
|
18
18
|
actual = JSON.parse(response.body)
|
@@ -32,7 +32,7 @@ class ArchivedReportGeneratorTest < ActiveSupport::TestCase
|
|
32
32
|
'dmi::bios::relase_date',
|
33
33
|
'distribution::name',
|
34
34
|
'uname::release',
|
35
|
-
'lscpu::flags'
|
35
|
+
'lscpu::flags',
|
36
36
|
]
|
37
37
|
end
|
38
38
|
|
@@ -46,13 +46,13 @@ class ArchivedReportGeneratorTest < ActiveSupport::TestCase
|
|
46
46
|
|
47
47
|
test 'generates a report for a single host' do
|
48
48
|
batches = Host.where(id: @host.id).in_batches
|
49
|
-
|
49
|
+
test_org = FactoryBot.create(:organization)
|
50
50
|
|
51
|
-
ForemanInventoryUpload::Generators::Queries.expects(:
|
51
|
+
ForemanInventoryUpload::Generators::Queries.expects(:for_org).with(test_org.id).returns(batches)
|
52
52
|
Dir.mktmpdir do |tmpdir|
|
53
53
|
target = File.join(tmpdir, 'test.tar.gz')
|
54
54
|
generator = ForemanInventoryUpload::Generators::ArchivedReport.new(target, Logger.new(STDOUT))
|
55
|
-
generator.render(
|
55
|
+
generator.render(organization: test_org.id)
|
56
56
|
|
57
57
|
files = Dir["#{tmpdir}/*"]
|
58
58
|
assert_equal "#{tmpdir}/test.tar.gz", files.first
|
@@ -32,7 +32,7 @@ class ReportGeneratorTest < ActiveSupport::TestCase
|
|
32
32
|
'dmi::bios::relase_date',
|
33
33
|
'distribution::name',
|
34
34
|
'uname::release',
|
35
|
-
'lscpu::flags'
|
35
|
+
'lscpu::flags',
|
36
36
|
]
|
37
37
|
end
|
38
38
|
|
@@ -57,4 +57,78 @@ class ReportGeneratorTest < ActiveSupport::TestCase
|
|
57
57
|
assert_equal @host.fqdn, actual_host['fqdn']
|
58
58
|
assert_equal '1234', actual_host['account']
|
59
59
|
end
|
60
|
+
|
61
|
+
test 'generates a report with satellite facts' do
|
62
|
+
Foreman.expects(:instance_id).returns('satellite-id')
|
63
|
+
batch = Host.where(id: @host.id).in_batches.first
|
64
|
+
generator = ForemanInventoryUpload::Generators::Slice.new(batch, [], 'slice-123')
|
65
|
+
|
66
|
+
json_str = generator.render
|
67
|
+
actual = JSON.parse(json_str.join("\n"))
|
68
|
+
|
69
|
+
facts = actual['hosts'].first['facts'].first
|
70
|
+
assert_equal 'satellite', facts['namespace']
|
71
|
+
satellite_facts = facts['facts']
|
72
|
+
assert_equal 'satellite-id', satellite_facts['satellite_instance_id']
|
73
|
+
assert_equal @host.organization_id, satellite_facts['organization_id']
|
74
|
+
|
75
|
+
version = satellite_facts['satellite_version']
|
76
|
+
if defined?(ForemanThemeSatellite)
|
77
|
+
assert_equal ForemanThemeSatellite::SATELLITE_VERSION, version
|
78
|
+
else
|
79
|
+
assert_nil version
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
test 'generates a report for a host with hypervisor' do
|
84
|
+
hypervisor_host = FactoryBot.create(
|
85
|
+
:host,
|
86
|
+
:with_subscription,
|
87
|
+
:with_content,
|
88
|
+
content_view: @host.content_view,
|
89
|
+
lifecycle_environment: @host.lifecycle_environment,
|
90
|
+
organization: @host.organization
|
91
|
+
)
|
92
|
+
|
93
|
+
@host.subscription_facet.hypervisor_host = hypervisor_host
|
94
|
+
@host.save!
|
95
|
+
|
96
|
+
batch = Host.where(id: @host.id).in_batches.first
|
97
|
+
generator = ForemanInventoryUpload::Generators::Slice.new(batch, [], 'slice_123')
|
98
|
+
|
99
|
+
json_str = generator.render
|
100
|
+
actual = JSON.parse(json_str.join("\n"))
|
101
|
+
|
102
|
+
assert_equal 'slice_123', actual['report_slice_id']
|
103
|
+
assert_not_nil(actual_host = actual['hosts'].first)
|
104
|
+
assert_equal @host.name, actual_host['display_name']
|
105
|
+
assert_equal @host.fqdn, actual_host['fqdn']
|
106
|
+
assert_not_nil(host_facts = actual_host['facts']&.first)
|
107
|
+
assert_equal 'satellite', host_facts['namespace']
|
108
|
+
assert_not_nil(fact_values = host_facts['facts'])
|
109
|
+
assert_equal hypervisor_host.name, fact_values['virtual_host_name']
|
110
|
+
assert_equal hypervisor_host.subscription_facet.uuid, fact_values['virtual_host_uuid']
|
111
|
+
end
|
112
|
+
|
113
|
+
test 'generates a report with system purpose' do
|
114
|
+
@host.subscription_facet.purpose_usage = 'test_usage'
|
115
|
+
@host.subscription_facet.purpose_role = 'test_role'
|
116
|
+
@host.subscription_facet.save!
|
117
|
+
|
118
|
+
batch = Host.where(id: @host.id).in_batches.first
|
119
|
+
generator = ForemanInventoryUpload::Generators::Slice.new(batch, [], 'slice_123')
|
120
|
+
|
121
|
+
json_str = generator.render
|
122
|
+
actual = JSON.parse(json_str.join("\n"))
|
123
|
+
|
124
|
+
assert_equal 'slice_123', actual['report_slice_id']
|
125
|
+
assert_not_nil(actual_host = actual['hosts'].first)
|
126
|
+
assert_equal @host.name, actual_host['display_name']
|
127
|
+
assert_equal @host.fqdn, actual_host['fqdn']
|
128
|
+
assert_not_nil(host_facts = actual_host['facts']&.first)
|
129
|
+
assert_equal 'satellite', host_facts['namespace']
|
130
|
+
assert_not_nil(fact_values = host_facts['facts'])
|
131
|
+
assert_equal 'test_usage', fact_values['system_purpose_usage']
|
132
|
+
assert_equal 'test_role', fact_values['system_purpose_role']
|
133
|
+
end
|
60
134
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { noop } from 'patternfly-react';
|
2
|
+
|
3
|
+
export const API_SUCCESS_RESPONSE = {
|
4
|
+
Account1: {
|
5
|
+
label: 'test_org1',
|
6
|
+
upload_report_status: 'running',
|
7
|
+
generate_report_status: 'running',
|
8
|
+
},
|
9
|
+
Account2: {
|
10
|
+
label: 'test_org2',
|
11
|
+
upload_report_status: 'unknown',
|
12
|
+
generate_report_status: 'failure',
|
13
|
+
},
|
14
|
+
Account3: {
|
15
|
+
label: 'test_org3',
|
16
|
+
upload_report_status: 'success',
|
17
|
+
generate_report_status: 'running',
|
18
|
+
},
|
19
|
+
};
|
20
|
+
|
21
|
+
export const accounts = API_SUCCESS_RESPONSE;
|
22
|
+
|
23
|
+
export const pollingProcessID = 0;
|
24
|
+
|
25
|
+
export const error = 'some-error';
|
26
|
+
|
27
|
+
export const accountID = 'user@redhat.com';
|
28
|
+
|
29
|
+
export const processStatusName = 'upload_report_status';
|
30
|
+
|
31
|
+
export const props = {
|
32
|
+
accounts,
|
33
|
+
fetchAccountsStatus: noop,
|
34
|
+
startAccountStatusPolling: noop,
|
35
|
+
stopAccountStatusPolling: noop,
|
36
|
+
pollingProcessID,
|
37
|
+
};
|
@@ -0,0 +1,74 @@
|
|
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 { accounts, error } = this.props;
|
24
|
+
const accountIds = Object.keys(accounts);
|
25
|
+
|
26
|
+
if (error) {
|
27
|
+
return <ErrorState error={error} />;
|
28
|
+
}
|
29
|
+
|
30
|
+
if (accountIds.length === 0) {
|
31
|
+
return <EmptyState />;
|
32
|
+
}
|
33
|
+
const items = accountIds.map((accountID, index) => {
|
34
|
+
const account = accounts[accountID];
|
35
|
+
return (
|
36
|
+
<ListItem
|
37
|
+
key={index}
|
38
|
+
accountID={accountID}
|
39
|
+
account={account}
|
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
|
+
account: PropTypes.shape({
|
54
|
+
generate_report_status: PropTypes.string,
|
55
|
+
upload_report_status: PropTypes.string,
|
56
|
+
}),
|
57
|
+
accounts: PropTypes.object,
|
58
|
+
error: PropTypes.string,
|
59
|
+
};
|
60
|
+
|
61
|
+
AccountList.defaultProps = {
|
62
|
+
fetchAccountsStatus: noop,
|
63
|
+
startAccountStatusPolling: noop,
|
64
|
+
stopAccountStatusPolling: noop,
|
65
|
+
pollingProcessID: 0,
|
66
|
+
account: {
|
67
|
+
generate_report_status: 'unknown',
|
68
|
+
upload_report_status: 'unknown',
|
69
|
+
},
|
70
|
+
accounts: {},
|
71
|
+
error: '',
|
72
|
+
};
|
73
|
+
|
74
|
+
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: { accounts },
|
14
|
+
} = await API.get('accounts');
|
15
|
+
dispatch({
|
16
|
+
type: INVENTORY_ACCOUNT_STATUS_POLLING,
|
17
|
+
payload: {
|
18
|
+
accounts,
|
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
|
+
accounts: {},
|
11
|
+
pollingProcessID: 0,
|
12
|
+
error: null,
|
13
|
+
});
|
14
|
+
|
15
|
+
export default (state = initialState, action) => {
|
16
|
+
const {
|
17
|
+
payload: {
|
18
|
+
pollingProcessID,
|
19
|
+
error,
|
20
|
+
accounts,
|
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
|
+
accounts,
|
31
|
+
error: null,
|
32
|
+
});
|
33
|
+
case INVENTORY_ACCOUNT_STATUS_POLLING_ERROR:
|
34
|
+
return state.merge({
|
35
|
+
...state,
|
36
|
+
accounts: {},
|
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(['accounts'], {
|
46
|
+
...state.accounts,
|
47
|
+
[accountID]: {
|
48
|
+
...state.accounts[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 selectAccounts = state => selectAccountsList(state).accounts;
|
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
|