foreman-tasks 1.0.1 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -12
  3. data/.rubocop_todo.yml +34 -116
  4. data/README.md +2 -0
  5. data/app/controllers/foreman_tasks/api/recurring_logics_controller.rb +20 -1
  6. data/app/controllers/foreman_tasks/api/tasks_controller.rb +65 -10
  7. data/app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb +1 -1
  8. data/app/controllers/foreman_tasks/recurring_logics_controller.rb +19 -0
  9. data/app/controllers/foreman_tasks/tasks_controller.rb +9 -14
  10. data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +1 -3
  11. data/app/lib/actions/helpers/humanizer.rb +1 -3
  12. data/app/lib/actions/proxy_action.rb +33 -12
  13. data/app/lib/foreman_tasks/concerns/polling_action_extensions.rb +12 -0
  14. data/app/models/foreman_tasks/concerns/action_triggering.rb +1 -1
  15. data/app/models/foreman_tasks/recurring_logic.rb +1 -0
  16. data/app/models/foreman_tasks/remote_task.rb +1 -0
  17. data/app/models/foreman_tasks/task.rb +8 -0
  18. data/app/models/foreman_tasks/task/dynflow_task.rb +2 -1
  19. data/app/models/foreman_tasks/task/search.rb +11 -1
  20. data/app/models/setting/foreman_tasks.rb +7 -2
  21. data/app/services/foreman_tasks/troubleshooting_help_generator.rb +0 -4
  22. data/app/services/ui_notifications/tasks/task_bulk_cancel.rb +36 -0
  23. data/app/services/ui_notifications/tasks/task_bulk_resume.rb +38 -0
  24. data/app/services/ui_notifications/tasks/task_bulk_stop.rb +36 -0
  25. data/app/views/foreman_tasks/api/recurring_logics/base.json.rabl +2 -1
  26. data/app/views/foreman_tasks/api/tasks/details.json.rabl +1 -1
  27. data/app/views/foreman_tasks/api/tasks/show.json.rabl +1 -1
  28. data/app/views/foreman_tasks/recurring_logics/index.html.erb +30 -0
  29. data/app/views/foreman_tasks/tasks/show.html.erb +3 -0
  30. data/config/routes.rb +8 -0
  31. data/db/migrate/20200517215015_rename_bookmarks_controller.rb +35 -0
  32. data/db/migrate/20200519093217_drop_dynflow_allow_dangerous_actions_setting.foreman_tasks.rb +5 -0
  33. data/db/migrate/20200611090846_add_task_lock_index_on_resource_type_and_task_id.rb +9 -0
  34. data/db/seeds.d/30-notification_blueprints.rb +21 -0
  35. data/foreman-tasks.gemspec +5 -6
  36. data/gemfile.d/foreman-tasks.rb +1 -0
  37. data/lib/foreman_tasks/dynflow/console_authorizer.rb +2 -2
  38. data/lib/foreman_tasks/engine.rb +17 -19
  39. data/lib/foreman_tasks/tasks/cleanup.rake +1 -1
  40. data/lib/foreman_tasks/tasks/export_tasks.rake +2 -2
  41. data/lib/foreman_tasks/test_extensions.rb +1 -1
  42. data/lib/foreman_tasks/version.rb +1 -1
  43. data/locale/action_names.rb +2 -2
  44. data/locale/en/LC_MESSAGES/foreman_tasks.mo +0 -0
  45. data/locale/en/foreman_tasks.po +270 -54
  46. data/locale/foreman_tasks.pot +630 -292
  47. data/locale/fr/LC_MESSAGES/foreman_tasks.mo +0 -0
  48. data/locale/fr/foreman_tasks.po +817 -0
  49. data/locale/ja/LC_MESSAGES/foreman_tasks.mo +0 -0
  50. data/locale/ja/foreman_tasks.po +817 -0
  51. data/locale/zh_CN/LC_MESSAGES/foreman_tasks.mo +0 -0
  52. data/locale/zh_CN/foreman_tasks.po +816 -0
  53. data/package.json +1 -2
  54. data/script/rails +2 -2
  55. data/script/travis_run_js_tests.sh +2 -2
  56. data/test/factories/task_factory.rb +34 -2
  57. data/test/foreman_tasks_test_helper.rb +4 -0
  58. data/test/lib/concerns/polling_action_extensions_test.rb +34 -0
  59. data/test/unit/actions/action_with_sub_plans_test.rb +1 -1
  60. data/test/unit/task_test.rb +160 -74
  61. data/webpack/ForemanTasks/Components/TaskActions/TaskAction.test.js +60 -0
  62. data/webpack/ForemanTasks/Components/TaskActions/TaskActionHelpers.js +67 -0
  63. data/webpack/ForemanTasks/Components/TaskActions/TaskActionHelpers.test.js +46 -0
  64. data/webpack/ForemanTasks/Components/TaskActions/TaskActionsConstants.js +16 -0
  65. data/webpack/ForemanTasks/Components/TaskActions/UnlockModals.js +60 -0
  66. data/webpack/ForemanTasks/Components/TaskActions/UnlockModals.test.js +14 -0
  67. data/webpack/ForemanTasks/Components/TaskActions/__snapshots__/TaskAction.test.js.snap +233 -0
  68. data/webpack/ForemanTasks/Components/TaskActions/__snapshots__/UnlockModals.test.js.snap +25 -0
  69. data/webpack/ForemanTasks/Components/TaskActions/index.js +115 -0
  70. data/webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js +17 -3
  71. data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +132 -165
  72. data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +3 -12
  73. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +8 -1
  74. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +68 -3
  75. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskInfo.test.js +0 -1
  76. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/RunningSteps.test.js.snap +1 -1
  77. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +108 -75
  78. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +3 -9
  79. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +35 -5
  80. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +34 -14
  81. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js +3 -4
  82. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js +0 -6
  83. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +4 -10
  84. data/webpack/ForemanTasks/Components/TaskDetails/TasksDetailsHelper.js +6 -1
  85. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js +8 -0
  86. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +7 -1
  87. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +18 -2
  88. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +30 -13
  89. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +91 -0
  90. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +13 -4
  91. data/webpack/ForemanTasks/Components/TaskDetails/index.js +6 -8
  92. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardActions.js +1 -1
  93. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardConstants.js +5 -0
  94. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardHelper.js +3 -2
  95. data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js +2 -2
  96. data/webpack/ForemanTasks/Components/TasksTable/Components/ActionSelectButton.js +14 -1
  97. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModal.js +83 -0
  98. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalActions.js +106 -0
  99. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js +38 -0
  100. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalSelectors.js +45 -0
  101. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModal.test.js +36 -0
  102. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalActions.test.js +205 -0
  103. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalReducer.test.js +27 -0
  104. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js +54 -0
  105. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/__snapshots__/ConfirmModal.test.js.snap +41 -0
  106. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/__snapshots__/ConfirmModalReducer.test.js.snap +19 -0
  107. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/__snapshots__/ConfirmModalSelectors.test.js.snap +30 -0
  108. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/index.js +29 -0
  109. data/webpack/ForemanTasks/Components/TasksTable/Components/SelectAllAlert.js +43 -0
  110. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionSelectButton.test.js +1 -0
  111. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/SelectAllAlert.test.js +29 -0
  112. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionSelectButton.test.js.snap +11 -0
  113. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/SelectAllAlert.test.js.snap +75 -0
  114. data/webpack/ForemanTasks/Components/TasksTable/SubTasksPage.js +4 -1
  115. data/webpack/ForemanTasks/Components/TasksTable/TasksBulkActions.js +247 -0
  116. data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +37 -19
  117. data/webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js +56 -92
  118. data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +19 -11
  119. data/webpack/ForemanTasks/Components/TasksTable/TasksTableHelpers.js +4 -3
  120. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +64 -73
  121. data/webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js +21 -2
  122. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSchema.js +2 -2
  123. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSelectors.js +13 -4
  124. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksBulkActions.test.js +147 -0
  125. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.fixtures.js +3 -10
  126. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActions.test.js +46 -74
  127. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableHelpers.test.js +17 -1
  128. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTablePage.test.js +9 -1
  129. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableReducer.test.js +22 -1
  130. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap +4 -12
  131. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksBulkActions.test.js.snap +336 -0
  132. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap +3 -12
  133. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableActions.test.js.snap +22 -158
  134. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +56 -132
  135. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap +34 -0
  136. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionHeaderCellFormatter.test.js +1 -1
  137. data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionHeaderCellFormatter.js +2 -2
  138. data/webpack/ForemanTasks/Components/TasksTable/index.js +10 -4
  139. data/webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.js +47 -19
  140. data/webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.test.js +61 -14
  141. data/webpack/ForemanTasks/Components/common/ActionButtons/__snapshots__/ActionButton.test.js.snap +80 -21
  142. data/webpack/ForemanTasks/Components/common/ClickConfirmation/ClickConfirmation.scss +9 -0
  143. data/webpack/ForemanTasks/Components/common/ClickConfirmation/ClickConfirmation.test.js +44 -0
  144. data/webpack/ForemanTasks/Components/common/ClickConfirmation/__snapshots__/ClickConfirmation.test.js.snap +52 -0
  145. data/webpack/ForemanTasks/Components/common/ClickConfirmation/index.js +59 -66
  146. data/webpack/ForemanTasks/Components/common/ToastsHelpers/ToastTypesConstants.js +11 -0
  147. data/webpack/ForemanTasks/Components/common/ToastsHelpers/index.js +15 -0
  148. data/webpack/ForemanTasks/ForemanTasksReducers.js +2 -0
  149. data/webpack/ForemanTasks/Routes/ForemanTasksRoutes.test.js +2 -1
  150. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalHooks.js +2 -2
  151. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +17 -3
  152. data/webpack/__mocks__/foremanReact/components/common/ActionButtons/ActionButtons.js +3 -0
  153. data/webpack/__mocks__/foremanReact/{API.js → redux/API.js} +1 -1
  154. metadata +76 -27
  155. data/webpack/ForemanTasks/Components/TasksTable/Components/CancelConfirm.js +0 -53
  156. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmationModals.js +0 -56
  157. data/webpack/ForemanTasks/Components/TasksTable/Components/ResumeConfirm.js +0 -52
  158. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelConfirm.test.js +0 -26
  159. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ConfirmationModals.test.js +0 -24
  160. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ResumeConfirm.test.js +0 -26
  161. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelConfirm.test.js.snap +0 -65
  162. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ConfirmationModals.test.js.snap +0 -30
  163. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ResumeConfirm.test.js.snap +0 -63
  164. data/webpack/ForemanTasks/Components/common/ActionButtons/CancelButton.js +0 -23
  165. data/webpack/ForemanTasks/Components/common/ActionButtons/CancelButton.test.js +0 -26
  166. data/webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.js +0 -23
  167. data/webpack/ForemanTasks/Components/common/ActionButtons/ResumeButton.test.js +0 -27
  168. data/webpack/ForemanTasks/Components/common/ActionButtons/__snapshots__/CancelButton.test.js.snap +0 -15
  169. data/webpack/ForemanTasks/Components/common/ActionButtons/__snapshots__/ResumeButton.test.js.snap +0 -15
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
2
2
  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
- import EllipsisWithTooltip from 'react-ellipsis-with-tooltip';
6
5
  import RelativeDateTime from 'foremanReact/components/common/dates/RelativeDateTime';
6
+ import ReactHtmlParser from 'react-html-parser';
7
7
 
8
8
  class TaskInfo extends Component {
9
9
  isDelayed = () => {
@@ -69,9 +69,7 @@ class TaskInfo extends Component {
69
69
  [
70
70
  {
71
71
  title: 'Name',
72
- value: (
73
- <EllipsisWithTooltip>{action || __('N/A')}</EllipsisWithTooltip>
74
- ),
72
+ value: action || __('N/A'),
75
73
  },
76
74
  {
77
75
  title: 'Start at',
@@ -173,14 +171,7 @@ class TaskInfo extends Component {
173
171
  <b>{__('Troubleshooting')}</b>
174
172
  </span>
175
173
  </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>
174
+ <p>{ReactHtmlParser(help)}</p>
184
175
  </Col>
185
176
  </Row>
186
177
  )}
@@ -2,9 +2,16 @@ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import RunningSteps from '../RunningSteps';
4
4
 
5
+ const minProps = {
6
+ id: 'task-id1',
7
+ taskReload: true,
8
+ cancelStep: jest.fn(),
9
+ taskProgressToggle: jest.fn(),
10
+ };
5
11
  const fixtures = {
6
- 'render without Props': {},
12
+ 'render with min Props': minProps,
7
13
  'render with Props': {
14
+ ...minProps,
8
15
  executionPlan: {
9
16
  state: 'paused',
10
17
  cancellable: false,
@@ -1,6 +1,15 @@
1
- import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
-
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';
3
8
  import Task from '../Task';
9
+ import {
10
+ UNLOCK_MODAL,
11
+ FORCE_UNLOCK_MODAL,
12
+ } from '../../../TaskActions/TaskActionsConstants';
4
13
 
5
14
  const fixtures = {
6
15
  'render without Props': { id: 'test' },
@@ -8,11 +17,67 @@ const fixtures = {
8
17
  id: 'test',
9
18
  state: 'paused',
10
19
  hasSubTasks: true,
11
- allowDangerousActions: true,
20
+ dynflowEnableConsole: true,
21
+ parentTask: 'parent-id',
22
+ taskReload: true,
12
23
  },
13
24
  };
14
25
 
15
26
  describe('Task', () => {
16
27
  describe('rendering', () =>
17
28
  testComponentSnapshotsWithFixtures(Task, fixtures));
29
+ describe('click test', () => {
30
+ const setModalOpen = jest.fn();
31
+ useForemanModal.mockImplementation(id => ({
32
+ setModalOpen: () => setModalOpen(id),
33
+ }));
34
+ const cancelTaskRequest = jest.fn();
35
+ const resumeTaskRequest = jest.fn();
36
+ const taskProgressToggle = jest.fn();
37
+ const id = 'some-id';
38
+ const action = 'some-action';
39
+ const props = {
40
+ taskReload: false,
41
+ id,
42
+ action,
43
+ cancelTaskRequest,
44
+ resumeTaskRequest,
45
+ taskProgressToggle,
46
+ };
47
+ afterEach(() => {
48
+ jest.clearAllMocks();
49
+ });
50
+ it('reload', () => {
51
+ const component = mount(<Task {...props} />);
52
+ const reloadButton = component.find('.reload-button').at(0);
53
+ reloadButton.simulate('click');
54
+ expect(taskProgressToggle).toBeCalled();
55
+ });
56
+ it('resume', () => {
57
+ const component = shallow(<Task {...props} />);
58
+ const resumeButton = component.find('.resume-button').at(0);
59
+ resumeButton.props().onClick();
60
+ expect(taskProgressToggle).toBeCalled();
61
+ expect(resumeTaskRequest).toBeCalledWith(id, action);
62
+ });
63
+ it('cancel', () => {
64
+ const component = shallow(<Task {...props} />);
65
+ const cancelButton = component.find('.cancel-button').at(0);
66
+ cancelButton.props().onClick();
67
+ expect(taskProgressToggle).toBeCalled();
68
+ expect(cancelTaskRequest).toBeCalledWith(id, action);
69
+ });
70
+ it('unlock', () => {
71
+ const component = shallow(<Task {...props} />);
72
+ const unlockButton = component.find('.unlock-button').at(0);
73
+ unlockButton.props().onClick();
74
+ expect(setModalOpen).toBeCalledWith({ id: UNLOCK_MODAL });
75
+ });
76
+ it('focrce unlock', () => {
77
+ const component = shallow(<Task {...props} />);
78
+ const forceUnlockButton = component.find('.force-unlock-button').at(0);
79
+ forceUnlockButton.props().onClick();
80
+ expect(setModalOpen).toBeCalledWith({ id: FORCE_UNLOCK_MODAL });
81
+ });
82
+ });
18
83
  });
@@ -41,7 +41,6 @@ const fixtures = {
41
41
  help:
42
42
  "A paused task represents a process that has not finished properly. Any task in paused state can lead to potential inconsistency and needs to be resolved.\nThe recommended approach is to investigate the error messages below and in 'errors' tab, address the primary cause of the issue and resume the task.",
43
43
  hasSubTasks: false,
44
- allowDangerousActions: false,
45
44
  locks: [
46
45
  {
47
46
  name: 'task_owner',
@@ -55,7 +55,7 @@ exports[`RunningSteps rendering render with Props 1`] = `
55
55
  </div>
56
56
  `;
57
57
 
58
- exports[`RunningSteps rendering render without Props 1`] = `
58
+ exports[`RunningSteps rendering render with min Props 1`] = `
59
59
  <span>
60
60
  No running steps
61
61
  </span>
@@ -2,25 +2,14 @@
2
2
 
3
3
  exports[`Task rendering render with some Props 1`] = `
4
4
  <Fragment>
5
- <ClickConfirmation
6
- body="This will unlock the resources that the task is running against. Please note that this might lead to inconsistent state and should be used with caution, after making sure that the task can't be resumed."
7
- closeModal={[Function]}
8
- confirmAction="Unlock"
9
- confirmType="warning"
10
- confirmationMessage="I understand that this may cause harm and have working database backups of all backend services."
11
- path="/foreman_tasks/tasks/test/unlock"
12
- showModal={false}
13
- title="Unlock"
5
+ <UnlockModal
6
+ id="unlockModal"
7
+ onClick={[Function]}
14
8
  />
15
- <ClickConfirmation
16
- body="Resources will be unlocked and will not prevent other tasks from being run. As the task might be still running, it should be avoided to use this unless you are really sure the task got stuck"
17
- closeModal={[Function]}
18
- confirmAction="Force Unlock"
19
- confirmType="danger"
20
- confirmationMessage="I understand that this may cause harm and have working database backups of all backend services."
21
- path="/foreman_tasks/tasks/test/force_unlock"
22
- showModal={false}
23
- title="Force Unlock"
9
+ <ForceUnlockModal
10
+ id="forceUnlockModal"
11
+ onClick={[Function]}
12
+ selectedRowsLen={1}
24
13
  />
25
14
  <Grid
26
15
  bsClass="container"
@@ -44,13 +33,11 @@ exports[`Task rendering render with some Props 1`] = `
44
33
  bsStyle="default"
45
34
  className="reload-button"
46
35
  disabled={false}
47
- hidden={false}
48
- onClick={[Function]}
49
36
  >
50
37
  <span
51
- className="glyphicon glyphicon-refresh "
38
+ className="glyphicon glyphicon-refresh spin"
52
39
  />
53
- Start auto-reloading
40
+ Stop auto-reloading
54
41
  </Button>
55
42
  <Button
56
43
  active={false}
@@ -58,29 +45,57 @@ exports[`Task rendering render with some Props 1`] = `
58
45
  bsClass="btn"
59
46
  bsSize="small"
60
47
  bsStyle="default"
48
+ className="dynflow-button"
61
49
  disabled={false}
62
50
  href="/foreman_tasks/dynflow/"
51
+ rel="noopener noreferrer"
52
+ target="_blank"
63
53
  >
64
54
  Dynflow console
65
55
  </Button>
66
- <ResumeButton
56
+ <Button
57
+ active={false}
58
+ block={false}
59
+ bsClass="btn"
60
+ bsSize="small"
61
+ bsStyle="default"
62
+ className="resume-button"
67
63
  disabled={true}
68
- id="test"
69
- name=""
70
64
  onClick={[Function]}
71
- />
72
- <CancelButton
65
+ >
66
+ Resume
67
+ </Button>
68
+ <Button
69
+ active={false}
70
+ block={false}
71
+ bsClass="btn"
72
+ bsSize="small"
73
+ bsStyle="default"
74
+ className="cancel-button"
73
75
  disabled={true}
74
- id="test"
75
- name=""
76
76
  onClick={[Function]}
77
- />
77
+ >
78
+ Cancel
79
+ </Button>
80
+ <Button
81
+ active={false}
82
+ block={false}
83
+ bsClass="btn"
84
+ bsSize="small"
85
+ bsStyle="default"
86
+ className="parent-button"
87
+ disabled={false}
88
+ href="/foreman_tasks/tasks/parent-id"
89
+ >
90
+ Parent task
91
+ </Button>
78
92
  <Button
79
93
  active={false}
80
94
  block={false}
81
95
  bsClass="btn"
82
96
  bsSize="small"
83
97
  bsStyle="default"
98
+ className="subtask-button"
84
99
  disabled={false}
85
100
  href="/foreman_tasks/tasks/test/sub_tasks"
86
101
  >
@@ -92,8 +107,9 @@ exports[`Task rendering render with some Props 1`] = `
92
107
  bsClass="btn"
93
108
  bsSize="small"
94
109
  bsStyle="default"
110
+ className="unlock-button"
95
111
  disabled={false}
96
- onClick={[Function]}
112
+ onClick={[MockFunction]}
97
113
  >
98
114
  Unlock
99
115
  </Button>
@@ -103,8 +119,9 @@ exports[`Task rendering render with some Props 1`] = `
103
119
  bsClass="btn"
104
120
  bsSize="small"
105
121
  bsStyle="default"
122
+ className="force-unlock-button"
106
123
  disabled={false}
107
- onClick={[Function]}
124
+ onClick={[MockFunction]}
108
125
  >
109
126
  Force Unlock
110
127
  </Button>
@@ -112,9 +129,9 @@ exports[`Task rendering render with some Props 1`] = `
112
129
  </Row>
113
130
  <TaskInfo
114
131
  action=""
115
- allowDangerousActions={true}
116
132
  cancelTaskRequest={[Function]}
117
133
  cancellable={false}
134
+ dynflowEnableConsole={true}
118
135
  endedAt=""
119
136
  error={Array []}
120
137
  externalId=""
@@ -122,24 +139,19 @@ exports[`Task rendering render with some Props 1`] = `
122
139
  help=""
123
140
  id="test"
124
141
  output=""
125
- parentTask=""
142
+ parentTask="parent-id"
126
143
  progress={0}
127
144
  refetchTaskDetails={[Function]}
128
145
  result="error"
129
146
  resumable={false}
130
147
  resumeTaskRequest={[Function]}
131
- showForceUnlockModal={false}
132
- showUnlockModal={false}
133
148
  startAt=""
134
149
  startBefore=""
135
150
  startedAt=""
136
151
  state="paused"
137
- taskReload={false}
138
- taskReloadStart={[Function]}
152
+ taskReload={true}
139
153
  taskReloadStop={[Function]}
140
154
  timeoutId={null}
141
- toggleForceUnlockModal={[Function]}
142
- toggleUnlockModal={[Function]}
143
155
  username=""
144
156
  usernamePath=""
145
157
  />
@@ -149,25 +161,14 @@ exports[`Task rendering render with some Props 1`] = `
149
161
 
150
162
  exports[`Task rendering render without Props 1`] = `
151
163
  <Fragment>
152
- <ClickConfirmation
153
- body="This will unlock the resources that the task is running against. Please note that this might lead to inconsistent state and should be used with caution, after making sure that the task can't be resumed."
154
- closeModal={[Function]}
155
- confirmAction="Unlock"
156
- confirmType="warning"
157
- confirmationMessage="I understand that this may cause harm and have working database backups of all backend services."
158
- path="/foreman_tasks/tasks/test/unlock"
159
- showModal={false}
160
- title="Unlock"
164
+ <UnlockModal
165
+ id="unlockModal"
166
+ onClick={[Function]}
161
167
  />
162
- <ClickConfirmation
163
- body="Resources will be unlocked and will not prevent other tasks from being run. As the task might be still running, it should be avoided to use this unless you are really sure the task got stuck"
164
- closeModal={[Function]}
165
- confirmAction="Force Unlock"
166
- confirmType="danger"
167
- confirmationMessage="I understand that this may cause harm and have working database backups of all backend services."
168
- path="/foreman_tasks/tasks/test/force_unlock"
169
- showModal={false}
170
- title="Force Unlock"
168
+ <ForceUnlockModal
169
+ id="forceUnlockModal"
170
+ onClick={[Function]}
171
+ selectedRowsLen={1}
171
172
  />
172
173
  <Grid
173
174
  bsClass="container"
@@ -191,8 +192,6 @@ exports[`Task rendering render without Props 1`] = `
191
192
  bsStyle="default"
192
193
  className="reload-button"
193
194
  disabled={false}
194
- hidden={true}
195
- onClick={[Function]}
196
195
  >
197
196
  <span
198
197
  className="glyphicon glyphicon-refresh "
@@ -205,30 +204,69 @@ exports[`Task rendering render without Props 1`] = `
205
204
  bsClass="btn"
206
205
  bsSize="small"
207
206
  bsStyle="default"
208
- disabled={false}
207
+ className="dynflow-button"
208
+ disabled={true}
209
209
  href="/foreman_tasks/dynflow/"
210
+ rel="noopener noreferrer"
211
+ target="_blank"
210
212
  >
211
213
  Dynflow console
212
214
  </Button>
213
- <ResumeButton
215
+ <Button
216
+ active={false}
217
+ block={false}
218
+ bsClass="btn"
219
+ bsSize="small"
220
+ bsStyle="default"
221
+ className="resume-button"
214
222
  disabled={true}
215
- id="test"
216
- name=""
217
223
  onClick={[Function]}
218
- />
219
- <CancelButton
224
+ >
225
+ Resume
226
+ </Button>
227
+ <Button
228
+ active={false}
229
+ block={false}
230
+ bsClass="btn"
231
+ bsSize="small"
232
+ bsStyle="default"
233
+ className="cancel-button"
220
234
  disabled={true}
221
- id="test"
222
- name=""
223
235
  onClick={[Function]}
224
- />
236
+ >
237
+ Cancel
238
+ </Button>
239
+ <Button
240
+ active={false}
241
+ block={false}
242
+ bsClass="btn"
243
+ bsSize="small"
244
+ bsStyle="default"
245
+ className="unlock-button"
246
+ disabled={true}
247
+ onClick={[MockFunction]}
248
+ >
249
+ Unlock
250
+ </Button>
251
+ <Button
252
+ active={false}
253
+ block={false}
254
+ bsClass="btn"
255
+ bsSize="small"
256
+ bsStyle="default"
257
+ className="force-unlock-button"
258
+ disabled={false}
259
+ onClick={[MockFunction]}
260
+ >
261
+ Force Unlock
262
+ </Button>
225
263
  </Col>
226
264
  </Row>
227
265
  <TaskInfo
228
266
  action=""
229
- allowDangerousActions={false}
230
267
  cancelTaskRequest={[Function]}
231
268
  cancellable={false}
269
+ dynflowEnableConsole={false}
232
270
  endedAt=""
233
271
  error={Array []}
234
272
  externalId=""
@@ -242,18 +280,13 @@ exports[`Task rendering render without Props 1`] = `
242
280
  result="error"
243
281
  resumable={false}
244
282
  resumeTaskRequest={[Function]}
245
- showForceUnlockModal={false}
246
- showUnlockModal={false}
247
283
  startAt=""
248
284
  startBefore=""
249
285
  startedAt=""
250
286
  state=""
251
287
  taskReload={false}
252
- taskReloadStart={[Function]}
253
288
  taskReloadStop={[Function]}
254
289
  timeoutId={null}
255
- toggleForceUnlockModal={[Function]}
256
- toggleUnlockModal={[Function]}
257
290
  username=""
258
291
  usernamePath=""
259
292
  />