foreman-tasks 2.0.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/js_tests.yml +27 -0
  3. data/.github/workflows/ruby_tests.yml +74 -0
  4. data/.rubocop.yml +12 -4
  5. data/.rubocop_todo.yml +32 -25
  6. data/Gemfile +5 -0
  7. data/app/controllers/foreman_tasks/api/tasks_controller.rb +31 -58
  8. data/app/controllers/foreman_tasks/concerns/parameters/triggering.rb +1 -1
  9. data/app/controllers/foreman_tasks/recurring_logics_controller.rb +7 -0
  10. data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +3 -3
  11. data/app/models/foreman_tasks/recurring_logic.rb +4 -4
  12. data/app/models/foreman_tasks/task.rb +11 -0
  13. data/app/models/foreman_tasks/task/dynflow_task.rb +27 -33
  14. data/app/models/foreman_tasks/task/status_explicator.rb +1 -1
  15. data/app/models/foreman_tasks/triggering.rb +1 -1
  16. data/app/models/setting/foreman_tasks.rb +1 -1
  17. data/app/views/foreman_tasks/api/tasks/index.json.rabl +2 -0
  18. data/app/views/foreman_tasks/recurring_logics/index.html.erb +3 -1
  19. data/config/routes.rb +2 -1
  20. data/db/migrate/20200517215015_rename_bookmarks_controller.rb +2 -2
  21. data/db/seeds.d/30-notification_blueprints.rb +7 -7
  22. data/db/seeds.d/61-foreman_tasks_bookmarks.rb +1 -1
  23. data/lib/foreman_tasks/cleaner.rb +4 -6
  24. data/lib/foreman_tasks/dynflow/configuration.rb +1 -1
  25. data/lib/foreman_tasks/dynflow/persistence.rb +4 -6
  26. data/lib/foreman_tasks/engine.rb +2 -2
  27. data/lib/foreman_tasks/version.rb +1 -1
  28. data/package.json +0 -1
  29. data/test/controllers/api/recurring_logics_controller_test.rb +1 -1
  30. data/test/controllers/api/tasks_controller_test.rb +7 -7
  31. data/test/controllers/tasks_controller_test.rb +6 -6
  32. data/test/core/unit/runner_test.rb +20 -20
  33. data/test/core/unit/task_launcher_test.rb +8 -8
  34. data/test/helpers/foreman_tasks/foreman_tasks_helper_test.rb +7 -7
  35. data/test/helpers/foreman_tasks/tasks_helper_test.rb +3 -3
  36. data/test/lib/actions/middleware/keep_current_request_id_test.rb +3 -3
  37. data/test/support/history_tasks_builder.rb +1 -1
  38. data/test/tasks/generate_task_actions_test.rb +1 -1
  39. data/test/unit/actions/action_with_sub_plans_test.rb +2 -2
  40. data/test/unit/actions/bulk_action_test.rb +6 -6
  41. data/test/unit/actions/proxy_action_test.rb +20 -20
  42. data/test/unit/actions/recurring_action_test.rb +30 -32
  43. data/test/unit/cleaner_test.rb +24 -24
  44. data/test/unit/dashboard_table_filter_test.rb +5 -5
  45. data/test/unit/otp_manager_test.rb +2 -2
  46. data/test/unit/proxy_selector_test.rb +9 -9
  47. data/test/unit/recurring_logic_test.rb +32 -38
  48. data/test/unit/remote_task_test.rb +2 -2
  49. data/test/unit/task_groups_test.rb +4 -4
  50. data/test/unit/task_test.rb +18 -18
  51. data/test/unit/triggering_test.rb +8 -8
  52. data/test/unit/troubleshooting_help_generator_test.rb +6 -6
  53. data/test/unit/ui_notifications_test.rb +11 -11
  54. data/webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js +3 -3
  55. data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +8 -157
  56. data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js +168 -0
  57. data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +6 -7
  58. data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskSkeleton.js +48 -0
  59. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +1 -1
  60. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +12 -70
  61. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskButtons.test.js +95 -0
  62. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +78 -225
  63. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskButtons.test.js.snap +212 -0
  64. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +8 -4
  65. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +87 -70
  66. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +48 -125
  67. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js +3 -16
  68. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +55 -29
  69. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js +2 -2
  70. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +6 -0
  71. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +2 -18
  72. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +77 -27
  73. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +14 -101
  74. data/webpack/ForemanTasks/Components/TaskDetails/index.js +6 -3
  75. data/webpack/ForemanTasks/Components/common/urlHelpers.js +7 -0
  76. data/webpack/ForemanTasks/ForemanTasksReducers.js +0 -2
  77. data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
  78. data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +10 -0
  79. data/webpack/__mocks__/foremanReact/redux/API/index.js +10 -0
  80. data/webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js +5 -0
  81. metadata +17 -14
  82. data/.travis.yml +0 -7
  83. data/script/travis_run_js_tests.sh +0 -7
  84. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js +0 -38
  85. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js +0 -33
  86. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap +0 -26
  87. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap +0 -122
  88. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +0 -72
  89. data/webpack/__mocks__/foremanReact/redux/API.js +0 -7
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
3
3
  import { Grid, Row, Col, ProgressBar } from 'patternfly-react';
4
4
  import { translate as __ } from 'foremanReact/common/I18n';
5
5
  import RelativeDateTime from 'foremanReact/components/common/dates/RelativeDateTime';
6
- import ReactHtmlParser from 'react-html-parser';
7
6
 
8
7
  class TaskInfo extends Component {
9
8
  isDelayed = () => {
@@ -59,7 +58,7 @@ class TaskInfo extends Component {
59
58
  state,
60
59
  help,
61
60
  output,
62
- error,
61
+ errors,
63
62
  progress,
64
63
  username,
65
64
  usernamePath,
@@ -171,7 +170,7 @@ class TaskInfo extends Component {
171
170
  <b>{__('Troubleshooting')}</b>
172
171
  </span>
173
172
  </p>
174
- <p>{ReactHtmlParser(help)}</p>
173
+ <p dangerouslySetInnerHTML={{ __html: help }} />
175
174
  </Col>
176
175
  </Row>
177
176
  )}
@@ -187,7 +186,7 @@ class TaskInfo extends Component {
187
186
  </Col>
188
187
  </Row>
189
188
  )}
190
- {error && error.length > 0 && (
189
+ {errors && errors.length > 0 && (
191
190
  <Row>
192
191
  <Col xs={12}>
193
192
  <div>
@@ -195,7 +194,7 @@ class TaskInfo extends Component {
195
194
  <b>{__('Errors:')}</b>
196
195
  </span>
197
196
  </div>
198
- <pre>{error}</pre>
197
+ <pre>{errors}</pre>
199
198
  </Col>
200
199
  </Row>
201
200
  )}
@@ -213,7 +212,7 @@ TaskInfo.propTypes = {
213
212
  startedAt: PropTypes.string,
214
213
  state: PropTypes.string,
215
214
  help: PropTypes.string,
216
- error: PropTypes.array,
215
+ errors: PropTypes.array,
217
216
  progress: PropTypes.number,
218
217
  username: PropTypes.string,
219
218
  usernamePath: PropTypes.string,
@@ -232,7 +231,7 @@ TaskInfo.defaultProps = {
232
231
  startedAt: '',
233
232
  state: '',
234
233
  help: '',
235
- error: [],
234
+ errors: [],
236
235
  progress: 0,
237
236
  username: '',
238
237
  usernamePath: '',
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import Skeleton from 'react-loading-skeleton';
3
+ import { Grid, Row, Col } from 'patternfly-react';
4
+
5
+ export const TaskSkeleton = () => {
6
+ const details = [1, 2, 3, 4, 5, 6];
7
+ return (
8
+ <Grid>
9
+ <br />
10
+ <Row>
11
+ <Col>
12
+ <Skeleton />
13
+ </Col>
14
+ </Row>
15
+ {details.map((items, key) => (
16
+ <Row key={key}>
17
+ <Col md={2} sm={6}>
18
+ <Skeleton />
19
+ </Col>
20
+ <Col md={5} sm={6}>
21
+ <Skeleton />
22
+ </Col>
23
+ <Col md={2} sm={6}>
24
+ <Skeleton />
25
+ </Col>
26
+ <Col md={3} sm={6}>
27
+ <Skeleton />
28
+ </Col>
29
+ </Row>
30
+ ))}
31
+ <br />
32
+ <Row>
33
+ <Col xs={6}>
34
+ <div className="progress-description">
35
+ <Skeleton />
36
+ </div>
37
+ </Col>
38
+ <Col xs={3} xsOffset={3} className="progress-label-top-right">
39
+ <Skeleton />
40
+ </Col>
41
+ <Col xs={12}>
42
+ <Skeleton />
43
+ </Col>
44
+ </Row>
45
+ <br />
46
+ </Grid>
47
+ );
48
+ };
@@ -6,7 +6,7 @@ const minProps = {
6
6
  id: 'task-id1',
7
7
  taskReload: true,
8
8
  cancelStep: jest.fn(),
9
- taskProgressToggle: jest.fn(),
9
+ taskReloadStart: jest.fn(),
10
10
  };
11
11
  const fixtures = {
12
12
  'render with min Props': minProps,
@@ -1,18 +1,13 @@
1
- import React from 'react';
2
- import {
3
- testComponentSnapshotsWithFixtures,
4
- mount,
5
- shallow,
6
- } from '@theforeman/test';
7
- import { useForemanModal } from 'foremanReact/components/ForemanModal/ForemanModalHooks';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
+ import { STATUS } from 'foremanReact/constants';
8
3
  import Task from '../Task';
9
- import {
10
- UNLOCK_MODAL,
11
- FORCE_UNLOCK_MODAL,
12
- } from '../../../TaskActions/TaskActionsConstants';
13
4
 
14
5
  const fixtures = {
15
- 'render without Props': { id: 'test' },
6
+ 'render with minimal Props': {
7
+ id: 'test',
8
+ taskReloadStart: jest.fn(),
9
+ taskProgressToggle: jest.fn(),
10
+ },
16
11
  'render with some Props': {
17
12
  id: 'test',
18
13
  state: 'paused',
@@ -21,64 +16,11 @@ const fixtures = {
21
16
  parentTask: 'parent-id',
22
17
  taskReload: true,
23
18
  canEdit: true,
19
+ status: STATUS.RESOLVED,
20
+ taskProgressToggle: jest.fn(),
21
+ taskReloadStart: jest.fn(),
24
22
  },
25
23
  };
26
24
 
27
- describe('Task', () => {
28
- describe('rendering', () =>
29
- testComponentSnapshotsWithFixtures(Task, fixtures));
30
- describe('click test', () => {
31
- const setModalOpen = jest.fn();
32
- useForemanModal.mockImplementation(id => ({
33
- setModalOpen: () => setModalOpen(id),
34
- }));
35
- const cancelTaskRequest = jest.fn();
36
- const resumeTaskRequest = jest.fn();
37
- const taskProgressToggle = jest.fn();
38
- const id = 'some-id';
39
- const action = 'some-action';
40
- const props = {
41
- taskReload: false,
42
- id,
43
- action,
44
- cancelTaskRequest,
45
- resumeTaskRequest,
46
- taskProgressToggle,
47
- };
48
- afterEach(() => {
49
- jest.clearAllMocks();
50
- });
51
- it('reload', () => {
52
- const component = mount(<Task {...props} />);
53
- const reloadButton = component.find('.reload-button').at(0);
54
- reloadButton.simulate('click');
55
- expect(taskProgressToggle).toBeCalled();
56
- });
57
- it('resume', () => {
58
- const component = shallow(<Task {...props} />);
59
- const resumeButton = component.find('.resume-button').at(0);
60
- resumeButton.props().onClick();
61
- expect(taskProgressToggle).toBeCalled();
62
- expect(resumeTaskRequest).toBeCalledWith(id, action);
63
- });
64
- it('cancel', () => {
65
- const component = shallow(<Task {...props} />);
66
- const cancelButton = component.find('.cancel-button').at(0);
67
- cancelButton.props().onClick();
68
- expect(taskProgressToggle).toBeCalled();
69
- expect(cancelTaskRequest).toBeCalledWith(id, action);
70
- });
71
- it('unlock', () => {
72
- const component = shallow(<Task {...props} />);
73
- const unlockButton = component.find('.unlock-button').at(0);
74
- unlockButton.props().onClick();
75
- expect(setModalOpen).toBeCalledWith({ id: UNLOCK_MODAL });
76
- });
77
- it('focrce unlock', () => {
78
- const component = shallow(<Task {...props} />);
79
- const forceUnlockButton = component.find('.force-unlock-button').at(0);
80
- forceUnlockButton.props().onClick();
81
- expect(setModalOpen).toBeCalledWith({ id: FORCE_UNLOCK_MODAL });
82
- });
83
- });
84
- });
25
+ describe('Task rendering', () =>
26
+ testComponentSnapshotsWithFixtures(Task, fixtures));
@@ -0,0 +1,95 @@
1
+ import React from 'react';
2
+ import {
3
+ testComponentSnapshotsWithFixtures,
4
+ mount,
5
+ shallow,
6
+ } from '@theforeman/test';
7
+ import { useForemanModal } from 'foremanReact/components/ForemanModal/ForemanModalHooks';
8
+ import { STATUS } from 'foremanReact/constants';
9
+ import { TaskButtons } from '../TaskButtons';
10
+ import {
11
+ UNLOCK_MODAL,
12
+ FORCE_UNLOCK_MODAL,
13
+ } from '../../../TaskActions/TaskActionsConstants';
14
+
15
+ const fixtures = {
16
+ 'render with minimal Props': {
17
+ id: 'test',
18
+ taskReloadStart: jest.fn(),
19
+ taskProgressToggle: jest.fn(),
20
+ },
21
+ 'render with some Props': {
22
+ id: 'test',
23
+ state: 'paused',
24
+ hasSubTasks: true,
25
+ dynflowEnableConsole: true,
26
+ parentTask: 'parent-id',
27
+ taskReload: true,
28
+ canEdit: true,
29
+ status: STATUS.RESOLVED,
30
+ taskReloadStart: jest.fn(),
31
+ taskProgressToggle: jest.fn(),
32
+ },
33
+ };
34
+
35
+ describe('Task', () => {
36
+ describe('rendering', () =>
37
+ testComponentSnapshotsWithFixtures(TaskButtons, fixtures));
38
+ describe('click test', () => {
39
+ const setModalOpen = jest.fn();
40
+ useForemanModal.mockImplementation(id => ({
41
+ setModalOpen: () => setModalOpen(id),
42
+ }));
43
+ const cancelTaskRequest = jest.fn();
44
+ const resumeTaskRequest = jest.fn();
45
+ const taskProgressToggle = jest.fn();
46
+ const taskReloadStart = jest.fn();
47
+ const id = 'some-id';
48
+ const action = 'some-action';
49
+ const props = {
50
+ taskReload: false,
51
+ id,
52
+ action,
53
+ cancelTaskRequest,
54
+ resumeTaskRequest,
55
+ taskProgressToggle,
56
+ taskReloadStart,
57
+ status: STATUS.RESOLVED,
58
+ };
59
+ afterEach(() => {
60
+ jest.clearAllMocks();
61
+ });
62
+ it('reload', () => {
63
+ const component = mount(<TaskButtons {...props} />);
64
+ const reloadButton = component.find('.reload-button').at(0);
65
+ reloadButton.simulate('click');
66
+ expect(taskProgressToggle).toBeCalled();
67
+ });
68
+ it('resume', () => {
69
+ const component = shallow(<TaskButtons {...props} />);
70
+ const resumeButton = component.find('.resume-button').at(0);
71
+ resumeButton.props().onClick();
72
+ expect(taskReloadStart).toBeCalled();
73
+ expect(resumeTaskRequest).toBeCalledWith(id, action);
74
+ });
75
+ it('cancel', () => {
76
+ const component = shallow(<TaskButtons {...props} />);
77
+ const cancelButton = component.find('.cancel-button').at(0);
78
+ cancelButton.props().onClick();
79
+ expect(taskReloadStart).toBeCalled();
80
+ expect(cancelTaskRequest).toBeCalledWith(id, action);
81
+ });
82
+ it('unlock', () => {
83
+ const component = shallow(<TaskButtons {...props} />);
84
+ const unlockButton = component.find('.unlock-button').at(0);
85
+ unlockButton.props().onClick();
86
+ expect(setModalOpen).toBeCalledWith({ id: UNLOCK_MODAL });
87
+ });
88
+ it('focrce unlock', () => {
89
+ const component = shallow(<TaskButtons {...props} />);
90
+ const forceUnlockButton = component.find('.force-unlock-button').at(0);
91
+ forceUnlockButton.props().onClick();
92
+ expect(setModalOpen).toBeCalledWith({ id: FORCE_UNLOCK_MODAL });
93
+ });
94
+ });
95
+ });
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Task rendering render with some Props 1`] = `
3
+ exports[`Task rendering render with minimal Props 1`] = `
4
4
  <Fragment>
5
5
  <UnlockModal
6
6
  id="unlockModal"
@@ -20,141 +20,60 @@ exports[`Task rendering render with some Props 1`] = `
20
20
  bsClass="row"
21
21
  componentClass="div"
22
22
  >
23
- <Col
24
- bsClass="col"
25
- componentClass="div"
26
- xs={12}
27
- >
28
- <Button
29
- active={false}
30
- block={false}
31
- bsClass="btn"
32
- bsSize="small"
33
- bsStyle="default"
34
- className="reload-button"
35
- disabled={false}
36
- >
37
- <span
38
- className="glyphicon glyphicon-refresh spin"
39
- />
40
- Stop auto-reloading
41
- </Button>
42
- <Button
43
- active={false}
44
- block={false}
45
- bsClass="btn"
46
- bsSize="small"
47
- bsStyle="default"
48
- className="dynflow-button"
49
- disabled={false}
50
- href="/foreman_tasks/dynflow/"
51
- rel="noopener noreferrer"
52
- target="_blank"
53
- >
54
- <span>
55
- Dynflow console
56
- </span>
57
- </Button>
58
- <Button
59
- active={false}
60
- block={false}
61
- bsClass="btn"
62
- bsSize="small"
63
- bsStyle="default"
64
- className="resume-button"
65
- disabled={true}
66
- onClick={[Function]}
67
- >
68
- Resume
69
- </Button>
70
- <Button
71
- active={false}
72
- block={false}
73
- bsClass="btn"
74
- bsSize="small"
75
- bsStyle="default"
76
- className="cancel-button"
77
- disabled={true}
78
- onClick={[Function]}
79
- >
80
- Cancel
81
- </Button>
82
- <Button
83
- active={false}
84
- block={false}
85
- bsClass="btn"
86
- bsSize="small"
87
- bsStyle="default"
88
- className="parent-button"
89
- disabled={false}
90
- href="/foreman_tasks/tasks/parent-id"
91
- >
92
- Parent task
93
- </Button>
94
- <Button
95
- active={false}
96
- block={false}
97
- bsClass="btn"
98
- bsSize="small"
99
- bsStyle="default"
100
- className="subtask-button"
101
- disabled={false}
102
- href="/foreman_tasks/tasks/test/sub_tasks"
103
- >
104
- Sub tasks
105
- </Button>
106
- <Button
107
- active={false}
108
- block={false}
109
- bsClass="btn"
110
- bsSize="small"
111
- bsStyle="default"
112
- className="unlock-button"
113
- disabled={false}
114
- onClick={[MockFunction]}
115
- >
116
- Unlock
117
- </Button>
118
- <Button
119
- active={false}
120
- block={false}
121
- bsClass="btn"
122
- bsSize="small"
123
- bsStyle="default"
124
- className="force-unlock-button"
125
- disabled={false}
126
- onClick={[MockFunction]}
127
- >
128
- Force Unlock
129
- </Button>
130
- </Col>
23
+ <TaskButtons
24
+ action=""
25
+ canEdit={false}
26
+ cancelTaskRequest={[Function]}
27
+ cancellable={false}
28
+ dynflowEnableConsole={false}
29
+ endedAt=""
30
+ errors={Array []}
31
+ externalId=""
32
+ hasSubTasks={false}
33
+ help=""
34
+ id="test"
35
+ output=""
36
+ parentTask=""
37
+ progress={0}
38
+ result="error"
39
+ resumable={false}
40
+ resumeTaskRequest={[Function]}
41
+ startAt=""
42
+ startBefore=""
43
+ startedAt=""
44
+ state=""
45
+ taskProgressToggle={[MockFunction]}
46
+ taskReload={false}
47
+ taskReloadStart={[MockFunction]}
48
+ username=""
49
+ usernamePath=""
50
+ />
131
51
  </Row>
132
52
  <TaskInfo
133
53
  action=""
134
- canEdit={true}
54
+ canEdit={false}
135
55
  cancelTaskRequest={[Function]}
136
56
  cancellable={false}
137
- dynflowEnableConsole={true}
57
+ dynflowEnableConsole={false}
138
58
  endedAt=""
139
- error={Array []}
59
+ errors={Array []}
140
60
  externalId=""
141
- hasSubTasks={true}
61
+ hasSubTasks={false}
142
62
  help=""
143
63
  id="test"
144
64
  output=""
145
- parentTask="parent-id"
65
+ parentTask=""
146
66
  progress={0}
147
- refetchTaskDetails={[Function]}
148
67
  result="error"
149
68
  resumable={false}
150
69
  resumeTaskRequest={[Function]}
151
70
  startAt=""
152
71
  startBefore=""
153
72
  startedAt=""
154
- state="paused"
155
- taskReload={true}
156
- taskReloadStop={[Function]}
157
- timeoutId={null}
73
+ state=""
74
+ taskProgressToggle={[MockFunction]}
75
+ taskReload={false}
76
+ taskReloadStart={[MockFunction]}
158
77
  username=""
159
78
  usernamePath=""
160
79
  />
@@ -162,7 +81,7 @@ exports[`Task rendering render with some Props 1`] = `
162
81
  </Fragment>
163
82
  `;
164
83
 
165
- exports[`Task rendering render without Props 1`] = `
84
+ exports[`Task rendering render with some Props 1`] = `
166
85
  <Fragment>
167
86
  <UnlockModal
168
87
  id="unlockModal"
@@ -182,128 +101,62 @@ exports[`Task rendering render without Props 1`] = `
182
101
  bsClass="row"
183
102
  componentClass="div"
184
103
  >
185
- <Col
186
- bsClass="col"
187
- componentClass="div"
188
- xs={12}
189
- >
190
- <Button
191
- active={false}
192
- block={false}
193
- bsClass="btn"
194
- bsSize="small"
195
- bsStyle="default"
196
- className="reload-button"
197
- disabled={false}
198
- >
199
- <span
200
- className="glyphicon glyphicon-refresh "
201
- />
202
- Start auto-reloading
203
- </Button>
204
- <Button
205
- active={false}
206
- block={false}
207
- bsClass="btn"
208
- bsSize="small"
209
- bsStyle="default"
210
- className="dynflow-button"
211
- disabled={true}
212
- href="/foreman_tasks/dynflow/"
213
- rel="noopener noreferrer"
214
- target="_blank"
215
- >
216
- <span
217
- data-original-title="dynflow_enable_console Setting is off"
218
- title="dynflow_enable_console Setting is off"
219
- >
220
- Dynflow console
221
- </span>
222
- </Button>
223
- <Button
224
- active={false}
225
- block={false}
226
- bsClass="btn"
227
- bsSize="small"
228
- bsStyle="default"
229
- className="resume-button"
230
- data-original-title="You do not have permission"
231
- disabled={true}
232
- onClick={[Function]}
233
- title="You do not have permission"
234
- >
235
- Resume
236
- </Button>
237
- <Button
238
- active={false}
239
- block={false}
240
- bsClass="btn"
241
- bsSize="small"
242
- bsStyle="default"
243
- className="cancel-button"
244
- data-original-title="You do not have permission"
245
- disabled={true}
246
- onClick={[Function]}
247
- title="You do not have permission"
248
- >
249
- Cancel
250
- </Button>
251
- <Button
252
- active={false}
253
- block={false}
254
- bsClass="btn"
255
- bsSize="small"
256
- bsStyle="default"
257
- className="unlock-button"
258
- data-original-title="You do not have permission"
259
- disabled={true}
260
- onClick={[MockFunction]}
261
- title="You do not have permission"
262
- >
263
- Unlock
264
- </Button>
265
- <Button
266
- active={false}
267
- block={false}
268
- bsClass="btn"
269
- bsSize="small"
270
- bsStyle="default"
271
- className="force-unlock-button"
272
- data-original-title="You do not have permission"
273
- disabled={true}
274
- onClick={[MockFunction]}
275
- title="You do not have permission"
276
- >
277
- Force Unlock
278
- </Button>
279
- </Col>
104
+ <TaskButtons
105
+ action=""
106
+ canEdit={true}
107
+ cancelTaskRequest={[Function]}
108
+ cancellable={false}
109
+ dynflowEnableConsole={true}
110
+ endedAt=""
111
+ errors={Array []}
112
+ externalId=""
113
+ hasSubTasks={true}
114
+ help=""
115
+ id="test"
116
+ output=""
117
+ parentTask="parent-id"
118
+ progress={0}
119
+ result="error"
120
+ resumable={false}
121
+ resumeTaskRequest={[Function]}
122
+ startAt=""
123
+ startBefore=""
124
+ startedAt=""
125
+ state="paused"
126
+ status="RESOLVED"
127
+ taskProgressToggle={[MockFunction]}
128
+ taskReload={true}
129
+ taskReloadStart={[MockFunction]}
130
+ username=""
131
+ usernamePath=""
132
+ />
280
133
  </Row>
281
134
  <TaskInfo
282
135
  action=""
283
- canEdit={false}
136
+ canEdit={true}
284
137
  cancelTaskRequest={[Function]}
285
138
  cancellable={false}
286
- dynflowEnableConsole={false}
139
+ dynflowEnableConsole={true}
287
140
  endedAt=""
288
- error={Array []}
141
+ errors={Array []}
289
142
  externalId=""
290
- hasSubTasks={false}
143
+ hasSubTasks={true}
291
144
  help=""
292
145
  id="test"
293
146
  output=""
294
- parentTask=""
147
+ parentTask="parent-id"
295
148
  progress={0}
296
- refetchTaskDetails={[Function]}
297
149
  result="error"
298
150
  resumable={false}
299
151
  resumeTaskRequest={[Function]}
300
152
  startAt=""
301
153
  startBefore=""
302
154
  startedAt=""
303
- state=""
304
- taskReload={false}
305
- taskReloadStop={[Function]}
306
- timeoutId={null}
155
+ state="paused"
156
+ status="RESOLVED"
157
+ taskProgressToggle={[MockFunction]}
158
+ taskReload={true}
159
+ taskReloadStart={[MockFunction]}
307
160
  username=""
308
161
  usernamePath=""
309
162
  />