foreman-tasks 0.17.6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.babelrc.js +3 -0
- data/.storybook/webpack.config.js +47 -26
- data/.travis.yml +2 -2
- data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +1 -1
- data/app/services/foreman_tasks/troubleshooting_help_generator.rb +4 -0
- data/lib/foreman_tasks/engine.rb +1 -1
- data/lib/foreman_tasks/version.rb +1 -1
- data/package.json +11 -18
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +8 -2
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +6 -6
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +2 -2
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +1 -1
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +5 -4
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +2 -2
- data/webpack/test_setup.js +2 -1
- metadata +3 -3
- data/.babelrc +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb59b3cde7c9b2cf5ffb6164584597ee6cf50ff827567ab3ac650446f9bc6b24
|
|
4
|
+
data.tar.gz: 0c98300b211d4949b800fd2c2ee5b64f33a3dbb12bfe8bbb0284a6922eb2c422
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ddb084939964bfdada51a988c183e9c3cd2187c87b39c20e22eae9c4b254c8e5a45bf0d96462db545119fd9e5c1b1c910c96a306e01c74bfcdd3214275ea5959
|
|
7
|
+
data.tar.gz: 46470595733a1b94473b63f73d7e3d554176e15e8c005e9173aea05b28a10334fba5cad1f22e3f6038f3fd8ff3b87c563bea85b3e74b29ec02514e9af7c10fb7
|
data/.babelrc.js
ADDED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const babelOptions = require('../.babelrc.js');
|
|
1
2
|
let path = require('path');
|
|
2
3
|
|
|
3
4
|
module.exports = {
|
|
@@ -7,22 +8,11 @@ module.exports = {
|
|
|
7
8
|
test: /\.js$/,
|
|
8
9
|
exclude: /node_modules/,
|
|
9
10
|
loader: 'babel-loader',
|
|
10
|
-
options:
|
|
11
|
-
presets: [
|
|
12
|
-
path.join(__dirname, '..', 'node_modules/babel-preset-react'),
|
|
13
|
-
path.join(__dirname, '..', 'node_modules/babel-preset-env')
|
|
14
|
-
],
|
|
15
|
-
plugins: [
|
|
16
|
-
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-class-properties'),
|
|
17
|
-
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-rest-spread'),
|
|
18
|
-
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-assign'),
|
|
19
|
-
path.join(__dirname, '..', 'node_modules/babel-plugin-syntax-dynamic-import')
|
|
20
|
-
]
|
|
21
|
-
}
|
|
11
|
+
options: babelOptions,
|
|
22
12
|
},
|
|
23
13
|
{
|
|
24
14
|
test: /(\.png|\.gif)$/,
|
|
25
|
-
loader: 'url-loader?limit=32767'
|
|
15
|
+
loader: 'url-loader?limit=32767',
|
|
26
16
|
},
|
|
27
17
|
{
|
|
28
18
|
test: /\.css$/,
|
|
@@ -30,30 +20,61 @@ module.exports = {
|
|
|
30
20
|
},
|
|
31
21
|
{
|
|
32
22
|
test: /\.scss$/,
|
|
33
|
-
loaders: [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
loaders: [
|
|
24
|
+
'style-loader',
|
|
25
|
+
'css-loader',
|
|
26
|
+
{
|
|
27
|
+
loader: 'sass-loader',
|
|
28
|
+
options: {
|
|
29
|
+
includePaths: [
|
|
30
|
+
// teach webpack to resolve patternfly dependencies
|
|
31
|
+
path.resolve(
|
|
32
|
+
__dirname,
|
|
33
|
+
'..',
|
|
34
|
+
'node_modules',
|
|
35
|
+
'patternfly',
|
|
36
|
+
'dist',
|
|
37
|
+
'sass'
|
|
38
|
+
),
|
|
39
|
+
path.resolve(
|
|
40
|
+
__dirname,
|
|
41
|
+
'..',
|
|
42
|
+
'node_modules',
|
|
43
|
+
'bootstrap-sass',
|
|
44
|
+
'assets',
|
|
45
|
+
'stylesheets'
|
|
46
|
+
),
|
|
47
|
+
path.resolve(
|
|
48
|
+
__dirname,
|
|
49
|
+
'..',
|
|
50
|
+
'node_modules',
|
|
51
|
+
'font-awesome-sass',
|
|
52
|
+
'assets',
|
|
53
|
+
'stylesheets'
|
|
54
|
+
),
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
44
59
|
},
|
|
45
60
|
{
|
|
46
61
|
test: /\.md$/,
|
|
47
|
-
loaders: ['raw-loader']
|
|
62
|
+
loaders: ['raw-loader'],
|
|
48
63
|
},
|
|
49
64
|
{
|
|
50
65
|
test: /(\.ttf|\.woff|\.woff2|\.eot|\.svg|\.jpg)$/,
|
|
51
|
-
loaders: ['url-loader']
|
|
66
|
+
loaders: ['url-loader'],
|
|
52
67
|
},
|
|
53
68
|
],
|
|
54
69
|
},
|
|
55
70
|
|
|
56
71
|
resolve: {
|
|
72
|
+
alias: {
|
|
73
|
+
foremanReact: path.join(
|
|
74
|
+
__dirname,
|
|
75
|
+
'../../foreman/webpack/assets/javascripts/react_app'
|
|
76
|
+
),
|
|
77
|
+
},
|
|
57
78
|
modules: [
|
|
58
79
|
path.join(__dirname, '..', 'webpack'),
|
|
59
80
|
path.join(__dirname, '..', 'node_modules'),
|
data/.travis.yml
CHANGED
|
@@ -28,7 +28,7 @@ module ForemanTasks
|
|
|
28
28
|
def troubleshooting_info_text
|
|
29
29
|
return if @task.state != 'paused' || @task.main_action.nil?
|
|
30
30
|
helper = TroubleshootingHelpGenerator.new(@task.main_action)
|
|
31
|
-
helper.
|
|
31
|
+
helper.generate_text
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def username_link_task(owner, username)
|
|
@@ -44,6 +44,10 @@ module ForemanTasks
|
|
|
44
44
|
# rubocop:enable Rails/OutputSafety
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
def generate_text
|
|
48
|
+
(description + link_descriptions_html).join("\n")
|
|
49
|
+
end
|
|
50
|
+
|
|
47
51
|
def link_descriptions_html
|
|
48
52
|
links.map do |link|
|
|
49
53
|
link.description % { link: %(<a href="%{href}">%{title}</a>) % link.to_h }
|
data/lib/foreman_tasks/engine.rb
CHANGED
|
@@ -34,7 +34,7 @@ module ForemanTasks
|
|
|
34
34
|
|
|
35
35
|
initializer 'foreman_tasks.register_plugin', :before => :finisher_hook do |_app|
|
|
36
36
|
Foreman::Plugin.register :"foreman-tasks" do
|
|
37
|
-
requires_foreman '>= 1.
|
|
37
|
+
requires_foreman '>= 1.25.0'
|
|
38
38
|
divider :top_menu, :parent => :monitor_menu, :last => true, :caption => N_('Foreman Tasks')
|
|
39
39
|
menu :top_menu, :tasks,
|
|
40
40
|
:url_hash => { :controller => 'foreman_tasks/tasks', :action => :index },
|
data/package.json
CHANGED
|
@@ -22,40 +22,32 @@
|
|
|
22
22
|
"url": "http://projects.theforeman.org/projects/foreman-tasks/issues"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@theforeman/vendor": "^
|
|
25
|
+
"@theforeman/vendor": "^3.3.2",
|
|
26
26
|
"c3": "^0.4.11",
|
|
27
27
|
"humanize-duration": "^3.20.1",
|
|
28
|
-
"react-html-parser": "^2.0.2",
|
|
29
28
|
"react-intl": "^2.8.0"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
31
|
+
"@babel/core": "^7.7.0",
|
|
32
32
|
"@storybook/addon-actions": "^5.0.1",
|
|
33
33
|
"@storybook/addon-knobs": "^5.0.1",
|
|
34
34
|
"@storybook/react": "^5.0.1",
|
|
35
|
-
"@theforeman/
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"babel-eslint": "^
|
|
39
|
-
"babel-jest": "^
|
|
40
|
-
"babel-loader": "^
|
|
41
|
-
"babel-plugin-dynamic-import-node": "^2.0.0",
|
|
42
|
-
"babel-plugin-module-resolver": "^3.2.0",
|
|
43
|
-
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
|
44
|
-
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
45
|
-
"babel-plugin-transform-object-assign": "^6.8.0",
|
|
46
|
-
"babel-plugin-transform-object-rest-spread": "^6.8.0",
|
|
47
|
-
"babel-preset-env": "^1.7.0",
|
|
48
|
-
"babel-preset-react": "^6.5.0",
|
|
35
|
+
"@theforeman/env": "^3.3.2",
|
|
36
|
+
"@theforeman/builder": "^3.3.2",
|
|
37
|
+
"@theforeman/vendor-dev": "^3.3.2",
|
|
38
|
+
"babel-eslint": "^10.0.3",
|
|
39
|
+
"babel-jest": "^24.9.0",
|
|
40
|
+
"babel-loader": "^8.0.0",
|
|
49
41
|
"coveralls": "^3.0.0",
|
|
50
42
|
"enzyme": "^3.4.0",
|
|
51
43
|
"enzyme-adapter-react-16": "^1.4.0",
|
|
52
44
|
"enzyme-to-json": "^3.2.1",
|
|
53
45
|
"eslint": "^4.10.0",
|
|
54
|
-
"eslint-import-resolver-babel-module": "^
|
|
46
|
+
"eslint-import-resolver-babel-module": "^5.1.0",
|
|
55
47
|
"eslint-plugin-patternfly-react": "0.2.0",
|
|
56
48
|
"identity-obj-proxy": "^3.0.0",
|
|
57
49
|
"jed": "^1.1.1",
|
|
58
|
-
"jest-cli": "^
|
|
50
|
+
"jest-cli": "^24.9.0",
|
|
59
51
|
"jest-prop-type-error": "^1.1.0",
|
|
60
52
|
"node-sass": "^4.5.0",
|
|
61
53
|
"patternfly": "^3.58.0",
|
|
@@ -96,6 +88,7 @@
|
|
|
96
88
|
"^.+\\.js$": "babel-jest"
|
|
97
89
|
},
|
|
98
90
|
"moduleDirectories": [
|
|
91
|
+
"node_modules/@theforeman/vendor-core/node_modules",
|
|
99
92
|
"node_modules",
|
|
100
93
|
"webpack"
|
|
101
94
|
],
|
|
@@ -4,7 +4,6 @@ import { Grid, Row, Col, ProgressBar } from 'patternfly-react';
|
|
|
4
4
|
import { translate as __ } from 'foremanReact/common/I18n';
|
|
5
5
|
import EllipsisWithTooltip from 'react-ellipsis-with-tooltip';
|
|
6
6
|
import RelativeDateTime from 'foremanReact/components/common/dates/RelativeDateTime';
|
|
7
|
-
import ReactHtmlParser from 'react-html-parser';
|
|
8
7
|
|
|
9
8
|
class TaskInfo extends Component {
|
|
10
9
|
isDelayed = () => {
|
|
@@ -174,7 +173,14 @@ class TaskInfo extends Component {
|
|
|
174
173
|
<b>{__('Troubleshooting')}</b>
|
|
175
174
|
</span>
|
|
176
175
|
</p>
|
|
177
|
-
<p>
|
|
176
|
+
<p>
|
|
177
|
+
{help.split('\n').map((item, i) => (
|
|
178
|
+
<React.Fragment key={i}>
|
|
179
|
+
{item}
|
|
180
|
+
<br />
|
|
181
|
+
</React.Fragment>
|
|
182
|
+
))}
|
|
183
|
+
</p>
|
|
178
184
|
</Col>
|
|
179
185
|
</Row>
|
|
180
186
|
)}
|
|
@@ -56,7 +56,7 @@ exports[`TaskInfo rendering render with Props 1`] = `
|
|
|
56
56
|
md={3}
|
|
57
57
|
sm={6}
|
|
58
58
|
>
|
|
59
|
-
<
|
|
59
|
+
<_default
|
|
60
60
|
date="2019-06-17 16:04:09 +0300"
|
|
61
61
|
defaultValue="N/A"
|
|
62
62
|
/>
|
|
@@ -115,7 +115,7 @@ exports[`TaskInfo rendering render with Props 1`] = `
|
|
|
115
115
|
md={3}
|
|
116
116
|
sm={6}
|
|
117
117
|
>
|
|
118
|
-
<
|
|
118
|
+
<_default
|
|
119
119
|
date="2019-06-17 16:04:09 +0300"
|
|
120
120
|
defaultValue="N/A"
|
|
121
121
|
/>
|
|
@@ -168,7 +168,7 @@ exports[`TaskInfo rendering render with Props 1`] = `
|
|
|
168
168
|
md={3}
|
|
169
169
|
sm={6}
|
|
170
170
|
>
|
|
171
|
-
<
|
|
171
|
+
<_default
|
|
172
172
|
date={null}
|
|
173
173
|
defaultValue="N/A"
|
|
174
174
|
/>
|
|
@@ -359,7 +359,7 @@ exports[`TaskInfo rendering render without Props 1`] = `
|
|
|
359
359
|
md={3}
|
|
360
360
|
sm={6}
|
|
361
361
|
>
|
|
362
|
-
<
|
|
362
|
+
<_default
|
|
363
363
|
date=""
|
|
364
364
|
defaultValue="N/A"
|
|
365
365
|
/>
|
|
@@ -418,7 +418,7 @@ exports[`TaskInfo rendering render without Props 1`] = `
|
|
|
418
418
|
md={3}
|
|
419
419
|
sm={6}
|
|
420
420
|
>
|
|
421
|
-
<
|
|
421
|
+
<_default
|
|
422
422
|
date=""
|
|
423
423
|
defaultValue="N/A"
|
|
424
424
|
/>
|
|
@@ -469,7 +469,7 @@ exports[`TaskInfo rendering render without Props 1`] = `
|
|
|
469
469
|
md={3}
|
|
470
470
|
sm={6}
|
|
471
471
|
>
|
|
472
|
-
<
|
|
472
|
+
<_default
|
|
473
473
|
date=""
|
|
474
474
|
defaultValue="N/A"
|
|
475
475
|
/>
|
|
@@ -66,10 +66,10 @@ export const fetchTaskDetails = (
|
|
|
66
66
|
id,
|
|
67
67
|
timeoutId,
|
|
68
68
|
refetchTaskDetailsAction
|
|
69
|
-
) => dispatch => {
|
|
69
|
+
) => async dispatch => {
|
|
70
70
|
showLoading();
|
|
71
71
|
dispatch(startRequest());
|
|
72
|
-
getTasksDetails(id, dispatch, timeoutId, refetchTaskDetailsAction);
|
|
72
|
+
await getTasksDetails(id, dispatch, timeoutId, refetchTaskDetailsAction);
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const getTasksDetails = async (
|
|
@@ -30,7 +30,7 @@ export const selectErrors = state => {
|
|
|
30
30
|
|
|
31
31
|
export const selectProgress = state =>
|
|
32
32
|
selectTaskDetails(state).progress
|
|
33
|
-
?
|
|
33
|
+
? selectTaskDetails(state).progress.toFixed(4) * 100
|
|
34
34
|
: 0;
|
|
35
35
|
|
|
36
36
|
export const selectUsername = state =>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { getControllerSearchProps } from 'foremanReact/constants';
|
|
2
2
|
|
|
3
3
|
export const TASKS_TABLE_ID = 'TASKS_TABLE';
|
|
4
|
+
export const TASKS_CONTROLLER = 'tasks';
|
|
5
|
+
export const TASKS_SUCCESS = 'TASKS_SUCCESS';
|
|
6
|
+
export const TASKS_REQUEST = 'TASKS_REQUEST';
|
|
7
|
+
export const TASKS_FAILURE = 'TASKS_FAILURE';
|
|
4
8
|
export const SELECT_ROWS = 'SELECT_ROWS';
|
|
5
9
|
export const UNSELECT_ROWS = 'UNSELECT_ROWS';
|
|
6
10
|
export const UNSELECT_ALL_ROWS = 'UNSELECT_ALL_ROWS';
|
|
@@ -9,7 +13,4 @@ export const RESUME = 'RESUME';
|
|
|
9
13
|
export const CLOSED = 'CLOSED';
|
|
10
14
|
|
|
11
15
|
export const TASKS_TABLE_SELECTED_MODAL = 'TASKS_TABLE_SELECTED_MODAL';
|
|
12
|
-
export const TASKS_SEARCH_PROPS =
|
|
13
|
-
...getControllerSearchProps('tasks'),
|
|
14
|
-
controller: 'foreman_tasks/tasks'
|
|
15
|
-
};
|
|
16
|
+
export const TASKS_SEARCH_PROPS = getControllerSearchProps('tasks');
|
data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap
CHANGED
|
@@ -13,7 +13,7 @@ exports[`TasksTablePage rendering render with Breadcrubs 1`] = `
|
|
|
13
13
|
/>
|
|
14
14
|
<PageLayout
|
|
15
15
|
beforeToolbarComponent={
|
|
16
|
-
<
|
|
16
|
+
<UNDEFINED
|
|
17
17
|
history={
|
|
18
18
|
Object {
|
|
19
19
|
"location": Object {
|
|
@@ -137,7 +137,7 @@ exports[`TasksTablePage rendering render with minimal props 1`] = `
|
|
|
137
137
|
/>
|
|
138
138
|
<PageLayout
|
|
139
139
|
beforeToolbarComponent={
|
|
140
|
-
<
|
|
140
|
+
<UNDEFINED
|
|
141
141
|
history={
|
|
142
142
|
Object {
|
|
143
143
|
"location": Object {
|
data/webpack/test_setup.js
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman-tasks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Nečas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-12-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: foreman-tasks-core
|
|
@@ -107,7 +107,7 @@ extra_rdoc_files:
|
|
|
107
107
|
- README.md
|
|
108
108
|
- LICENSE
|
|
109
109
|
files:
|
|
110
|
-
- ".babelrc"
|
|
110
|
+
- ".babelrc.js"
|
|
111
111
|
- ".eslintrc"
|
|
112
112
|
- ".gitignore"
|
|
113
113
|
- ".prettierrc"
|
data/.babelrc
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
"env",
|
|
4
|
-
"react"
|
|
5
|
-
],
|
|
6
|
-
"plugins": [
|
|
7
|
-
["module-resolver", {
|
|
8
|
-
"alias": {
|
|
9
|
-
"root": ["./"],
|
|
10
|
-
"foremanReact": "../foreman/webpack/assets/javascripts/react_app"
|
|
11
|
-
}
|
|
12
|
-
}],
|
|
13
|
-
"transform-class-properties",
|
|
14
|
-
"transform-object-rest-spread",
|
|
15
|
-
"transform-object-assign",
|
|
16
|
-
"syntax-dynamic-import"
|
|
17
|
-
],
|
|
18
|
-
"env": {
|
|
19
|
-
"test": {
|
|
20
|
-
"presets": ["@theforeman/vendor-dev/babel.preset.js"],
|
|
21
|
-
"plugins": [
|
|
22
|
-
["module-resolver", {
|
|
23
|
-
"alias": {
|
|
24
|
-
"root": ["./"],
|
|
25
|
-
"foremanReact": "./webpack/__mocks__/foremanReact"
|
|
26
|
-
}
|
|
27
|
-
}],
|
|
28
|
-
"dynamic-import-node"
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
"storybook": {
|
|
32
|
-
"presets": ["@theforeman/vendor-dev/babel.preset.js"]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|