foreman-tasks 0.16.0 → 0.16.1

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/.babelrc +4 -1
  3. data/.eslintrc +4 -13
  4. data/app/assets/stylesheets/foreman_tasks/application.css.scss +0 -37
  5. data/app/controllers/foreman_tasks/api/tasks_controller.rb +9 -5
  6. data/app/controllers/foreman_tasks/tasks_controller.rb +23 -19
  7. data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +28 -29
  8. data/app/lib/actions/bulk_action.rb +1 -1
  9. data/app/models/foreman_tasks/task.rb +1 -1
  10. data/app/models/foreman_tasks/task/dynflow_task.rb +30 -0
  11. data/app/services/foreman_tasks/troubleshooting_help_generator.rb +4 -0
  12. data/app/views/foreman_tasks/api/tasks/details.json.rabl +18 -0
  13. data/app/views/foreman_tasks/layouts/react.html.erb +1 -1
  14. data/app/views/foreman_tasks/tasks/index.html.erb +3 -0
  15. data/app/views/foreman_tasks/tasks/show.html.erb +10 -134
  16. data/config/routes.rb +3 -0
  17. data/lib/foreman_tasks/engine.rb +1 -1
  18. data/lib/foreman_tasks/tasks/export_tasks.rake +1 -2
  19. data/lib/foreman_tasks/version.rb +1 -1
  20. data/package.json +6 -20
  21. data/test/controllers/tasks_controller_test.rb +11 -0
  22. data/test/helpers/foreman_tasks/foreman_tasks_helper_test.rb +39 -0
  23. data/test/unit/actions/bulk_action_test.rb +2 -0
  24. data/test/unit/task_test.rb +4 -0
  25. data/webpack/ForemanTasks/Components/TaskDetails/Components/Errors.js +60 -0
  26. data/webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js +46 -0
  27. data/webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js +73 -0
  28. data/webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js +55 -0
  29. data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +202 -0
  30. data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskHelper.js +38 -0
  31. data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +238 -0
  32. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Errors.test.js +36 -0
  33. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Locks.test.js +28 -0
  34. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Raw.test.js +27 -0
  35. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +29 -0
  36. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +18 -0
  37. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskHelper.test.js +77 -0
  38. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskInfo.test.js +60 -0
  39. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Errors.test.js.snap +77 -0
  40. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Locks.test.js.snap +108 -0
  41. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Raw.test.js.snap +174 -0
  42. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/RunningSteps.test.js.snap +62 -0
  43. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +282 -0
  44. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskHelper.test.js.snap +37 -0
  45. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +568 -0
  46. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +87 -0
  47. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.scss +63 -0
  48. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.stories.js +5 -0
  49. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +109 -0
  50. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js +18 -0
  51. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js +44 -0
  52. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +83 -0
  53. data/webpack/ForemanTasks/Components/TaskDetails/TasksDetailsHelper.js +1 -0
  54. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +12 -0
  55. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +20 -0
  56. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js +33 -0
  57. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +97 -0
  58. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +43 -0
  59. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap +26 -0
  60. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap +122 -0
  61. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +63 -0
  62. data/webpack/ForemanTasks/Components/TaskDetails/index.js +77 -0
  63. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.js +6 -1
  64. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/__snapshots__/PausedTasksCard.test.js.snap +2 -0
  65. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/RunningTasksCard/RunningTasksCard.js +6 -1
  66. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/RunningTasksCard/__snapshots__/RunningTasksCard.test.js.snap +2 -0
  67. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.js +3 -6
  68. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/ScheduledTasksCard.scss +0 -3
  69. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/ScheduledTasksCard/__snapshots__/ScheduledTasksCard.test.js.snap +3 -0
  70. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.js +2 -0
  71. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.scss +0 -4
  72. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCardHelper.js +3 -3
  73. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCard.test.js.snap +495 -54
  74. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.js +1 -0
  75. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutCard/TasksDonutCard.scss +6 -0
  76. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/TasksDonutChart/TasksDonutChart.scss +0 -3
  77. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.scss +1 -1
  78. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.scss +2 -2
  79. data/webpack/ForemanTasks/Components/common/ClickConfirmation/index.js +83 -0
  80. data/webpack/ForemanTasks/ForemanTasksReducers.js +2 -0
  81. data/webpack/__mocks__/foremanReact/common/I18n.js +2 -0
  82. data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +2 -0
  83. data/webpack/index.js +5 -0
  84. metadata +46 -9
  85. data/app/views/foreman_tasks/tasks/_details.html.erb +0 -195
  86. data/app/views/foreman_tasks/tasks/_errors.html.erb +0 -42
  87. data/app/views/foreman_tasks/tasks/_locks.html.erb +0 -19
  88. data/app/views/foreman_tasks/tasks/_raw.html.erb +0 -28
  89. data/app/views/foreman_tasks/tasks/_running_steps.html.erb +0 -40
@@ -39,6 +39,7 @@ const TasksDonutCard = ({
39
39
  'selected-tasks-card':
40
40
  focusedOn !== TASKS_DONUT_CHART_FOCUSED_ON_OPTIONS.NORMAL &&
41
41
  focusedOn !== TASKS_DONUT_CHART_FOCUSED_ON_OPTIONS.NONE,
42
+ 'not-focused': focusedOn === TASKS_DONUT_CHART_FOCUSED_ON_OPTIONS.NONE,
42
43
  })}
43
44
  {...props}
44
45
  >
@@ -1,4 +1,10 @@
1
1
  .tasks-donut-card {
2
+ &.not-focused {
3
+ .card-pf-title,
4
+ .card-pf-body {
5
+ opacity: 0.6;
6
+ }
7
+ }
2
8
  .card-pf-title {
3
9
  text-align: center;
4
10
  font-size: 180%;
@@ -1,7 +1,4 @@
1
1
  .tasks-donut-chart {
2
- .c3.not-focused {
3
- opacity: 0.3;
4
- }
5
2
  .c3-chart-arcs-title {
6
3
  cursor: pointer;
7
4
 
@@ -1,4 +1,4 @@
1
- @import '~patternfly/dist/sass/patternfly/_color-variables.scss';
1
+ @import '~@theforeman/vendor/scss/variables';
2
2
 
3
3
  .tasks-labels-row {
4
4
  margin: 0;
@@ -1,5 +1,5 @@
1
- @import '~bootstrap-sass/assets/stylesheets/bootstrap/_variables';
2
- @import '~bootstrap-sass/assets/stylesheets/bootstrap/_mixins';
1
+ @import '~@theforeman/vendor/scss/variables';
2
+ @import '~@theforeman/vendor/scss/mixins';
3
3
 
4
4
  @mixin create-tasks-dashboard-column($columns: 12, $screen-min: 0, $gutter: $grid-gutter-width) {
5
5
  @media (min-width: $screen-min) {
@@ -0,0 +1,83 @@
1
+ import { Modal, Button } from 'patternfly-react';
2
+ import PropTypes from 'prop-types';
3
+ import React from 'react';
4
+ import { translate as __ } from 'foremanReact/common/I18n';
5
+
6
+ export class ClickConfirmation extends React.Component {
7
+ state = { disableConfirm: true };
8
+ render() {
9
+ const { disableConfirm } = this.state;
10
+ const {
11
+ title,
12
+ body,
13
+ confirmationMessage,
14
+ confirmAction,
15
+ path,
16
+ confirmType,
17
+ closeModal,
18
+ showModal,
19
+ } = this.props;
20
+ const icon = confirmType === 'warning' ? confirmType : 'exclamation';
21
+ return (
22
+ <Modal show={showModal} onHide={closeModal}>
23
+ <Modal.Header>
24
+ <Button
25
+ className="close"
26
+ onClick={closeModal}
27
+ aria-hidden="true"
28
+ aria-label="Close"
29
+ >
30
+ &times;
31
+ </Button>
32
+ <Modal.Title>
33
+ <span className={`glyphicon glyphicon-${icon}-sign`} />
34
+ {` ${title}`}
35
+ </Modal.Title>
36
+ </Modal.Header>
37
+ <Modal.Body>
38
+ {body}
39
+ <div>
40
+ <input
41
+ onChange={e => {
42
+ this.setState({
43
+ disableConfirm: !e.target.checked,
44
+ });
45
+ }}
46
+ type="checkbox"
47
+ />
48
+ {` ${confirmationMessage}`}
49
+ </div>
50
+ </Modal.Body>
51
+ <Modal.Footer>
52
+ <Button onClick={closeModal}>{__('Cancel')}</Button>
53
+ <Button
54
+ href={path}
55
+ data-method="post"
56
+ bsStyle={confirmType}
57
+ disabled={disableConfirm}
58
+ >
59
+ {confirmAction}
60
+ </Button>
61
+ </Modal.Footer>
62
+ </Modal>
63
+ );
64
+ }
65
+ }
66
+
67
+ ClickConfirmation.propTypes = {
68
+ showModal: PropTypes.bool,
69
+ title: PropTypes.string.isRequired,
70
+ body: PropTypes.string.isRequired,
71
+ confirmationMessage: PropTypes.string.isRequired,
72
+ confirmAction: PropTypes.string.isRequired,
73
+ path: PropTypes.string.isRequired,
74
+ confirmType: PropTypes.oneOf(['warning', 'danger']),
75
+ closeModal: PropTypes.func.isRequired,
76
+ };
77
+
78
+ ClickConfirmation.defaultProps = {
79
+ showModal: false,
80
+ confirmType: 'warning',
81
+ };
82
+
83
+ export default ClickConfirmation;
@@ -1,9 +1,11 @@
1
1
  import { combineReducers } from 'redux';
2
2
  import { reducers as tasksDashboardReducers } from './Components/TasksDashboard';
3
+ import { reducers as taskDetailsReducers } from './Components/TaskDetails';
3
4
 
4
5
  const reducers = {
5
6
  foremanTasks: combineReducers({
6
7
  ...tasksDashboardReducers,
8
+ ...taskDetailsReducers,
7
9
  }),
8
10
  };
9
11
 
@@ -3,3 +3,5 @@ export { sprintf } from 'jed';
3
3
  export const translate = s => s;
4
4
 
5
5
  export const ngettext = s => s;
6
+
7
+ export const documentLocale = () => 'en';
@@ -0,0 +1,2 @@
1
+ export const showLoading = () => null;
2
+ export const hideLoading = () => null;
@@ -6,6 +6,7 @@ import { registerReducer } from 'foremanReact/common/MountingService';
6
6
  import reducers from './ForemanTasks/ForemanTasksReducers';
7
7
  import ForemanTasks from './ForemanTasks';
8
8
  import TasksDashboard from './ForemanTasks/Components/TasksDashboard';
9
+ import TaskDetails from './ForemanTasks/Components/TaskDetails';
9
10
 
10
11
  // register reducers
11
12
  Object.entries(reducers).forEach(([key, reducer]) =>
@@ -21,3 +22,7 @@ componentRegistry.register({
21
22
  name: 'TasksDashboard',
22
23
  type: TasksDashboard,
23
24
  });
25
+ componentRegistry.register({
26
+ name: 'TaskDetails',
27
+ type: TaskDetails,
28
+ });
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.16.0
4
+ version: 0.16.1
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: 2019-07-16 00:00:00.000000000 Z
11
+ date: 2019-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks-core
@@ -193,6 +193,7 @@ files:
193
193
  - app/views/foreman_tasks/api/recurring_logics/main.json.rabl
194
194
  - app/views/foreman_tasks/api/recurring_logics/show.json.rabl
195
195
  - app/views/foreman_tasks/api/recurring_logics/update.json.rabl
196
+ - app/views/foreman_tasks/api/tasks/details.json.rabl
196
197
  - app/views/foreman_tasks/api/tasks/show.json.rabl
197
198
  - app/views/foreman_tasks/layouts/react.html.erb
198
199
  - app/views/foreman_tasks/recurring_logics/_tab_related.html.erb
@@ -202,11 +203,6 @@ files:
202
203
  - app/views/foreman_tasks/task_groups/_detail.html.erb
203
204
  - app/views/foreman_tasks/task_groups/_tab_related.html.erb
204
205
  - app/views/foreman_tasks/task_groups/recurring_logic_task_groups/_recurring_logic_task_group.html.erb
205
- - app/views/foreman_tasks/tasks/_details.html.erb
206
- - app/views/foreman_tasks/tasks/_errors.html.erb
207
- - app/views/foreman_tasks/tasks/_locks.html.erb
208
- - app/views/foreman_tasks/tasks/_raw.html.erb
209
- - app/views/foreman_tasks/tasks/_running_steps.html.erb
210
206
  - app/views/foreman_tasks/tasks/dashboard/_latest_tasks_in_error_warning.html.erb
211
207
  - app/views/foreman_tasks/tasks/dashboard/_tasks_status.html.erb
212
208
  - app/views/foreman_tasks/tasks/index.html.erb
@@ -281,6 +277,7 @@ files:
281
277
  - test/factories/triggering_factory.rb
282
278
  - test/foreman_tasks_core_test_helper.rb
283
279
  - test/foreman_tasks_test_helper.rb
280
+ - test/helpers/foreman_tasks/foreman_tasks_helper_test.rb
284
281
  - test/helpers/foreman_tasks/tasks_helper_test.rb
285
282
  - test/lib/actions/middleware/keep_current_request_id_test.rb
286
283
  - test/lib/actions/middleware/keep_current_taxonomies_test.rb
@@ -313,6 +310,44 @@ files:
313
310
  - test/unit/troubleshooting_help_generator_test.rb
314
311
  - test/unit/ui_notifications_test.rb
315
312
  - webpack/ForemanTasks/Components/Chart/Chart.js
313
+ - webpack/ForemanTasks/Components/TaskDetails/Components/Errors.js
314
+ - webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
315
+ - webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
316
+ - webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js
317
+ - webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
318
+ - webpack/ForemanTasks/Components/TaskDetails/Components/TaskHelper.js
319
+ - webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js
320
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Errors.test.js
321
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Locks.test.js
322
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Raw.test.js
323
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js
324
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js
325
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskHelper.test.js
326
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskInfo.test.js
327
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Errors.test.js.snap
328
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Locks.test.js.snap
329
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Raw.test.js.snap
330
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/RunningSteps.test.js.snap
331
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap
332
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskHelper.test.js.snap
333
+ - webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap
334
+ - webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js
335
+ - webpack/ForemanTasks/Components/TaskDetails/TaskDetails.scss
336
+ - webpack/ForemanTasks/Components/TaskDetails/TaskDetails.stories.js
337
+ - webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js
338
+ - webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js
339
+ - webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js
340
+ - webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js
341
+ - webpack/ForemanTasks/Components/TaskDetails/TasksDetailsHelper.js
342
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js
343
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js
344
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js
345
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap
346
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap
347
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap
348
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap
349
+ - webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js
350
+ - webpack/ForemanTasks/Components/TaskDetails/index.js
316
351
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.js
317
352
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.stories.js
318
353
  - webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.test.js
@@ -382,6 +417,7 @@ files:
382
417
  - webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboardActions.test.js.snap
383
418
  - webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboardReducer.test.js.snap
384
419
  - webpack/ForemanTasks/Components/TasksDashboard/index.js
420
+ - webpack/ForemanTasks/Components/common/ClickConfirmation/index.js
385
421
  - webpack/ForemanTasks/ForemanTasks.js
386
422
  - webpack/ForemanTasks/ForemanTasks.test.js
387
423
  - webpack/ForemanTasks/ForemanTasksReducers.js
@@ -407,6 +443,7 @@ files:
407
443
  - webpack/__mocks__/foremanReact/API.js
408
444
  - webpack/__mocks__/foremanReact/common/I18n.js
409
445
  - webpack/__mocks__/foremanReact/common/helpers.js
446
+ - webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js
410
447
  - webpack/index.js
411
448
  - webpack/stories/decorators/index.js
412
449
  - webpack/stories/decorators/withCardsDecorator.js
@@ -431,8 +468,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
431
468
  - !ruby/object:Gem::Version
432
469
  version: '0'
433
470
  requirements: []
434
- rubyforge_project:
435
- rubygems_version: 2.7.3
471
+ rubygems_version: 3.0.3
436
472
  signing_key:
437
473
  specification_version: 4
438
474
  summary: Foreman plugin for showing tasks information for resources and users
@@ -449,6 +485,7 @@ test_files:
449
485
  - test/factories/triggering_factory.rb
450
486
  - test/foreman_tasks_core_test_helper.rb
451
487
  - test/foreman_tasks_test_helper.rb
488
+ - test/helpers/foreman_tasks/foreman_tasks_helper_test.rb
452
489
  - test/helpers/foreman_tasks/tasks_helper_test.rb
453
490
  - test/lib/actions/middleware/keep_current_request_id_test.rb
454
491
  - test/lib/actions/middleware/keep_current_taxonomies_test.rb
@@ -1,195 +0,0 @@
1
- <p>
2
- <%= link_to(_('Auto Reload'), '', class: %w(btn btn-sm btn-default reload-button hidden)) %>
3
- <% if authorized_for(:permission => :edit_foreman_tasks, :auth_object => @task) %>
4
- <%= link_to(_('Dynflow console'),
5
- format((defined?(Rails) ? request.script_name : '') + '/foreman_tasks/dynflow/%s', @task.external_id),
6
- class: %w(btn btn-sm btn-default), target: '_blank') if Setting['dynflow_enable_console'] %>
7
-
8
- <%= link_to(_('Resume'),
9
- resume_foreman_tasks_task_path(@task),
10
- class: ['btn', 'btn-sm', 'btn-primary', ('disabled' unless @task.resumable?)].compact,
11
- method: :post) %>
12
- <%= link_to(_('Cancel'),
13
- cancel_foreman_tasks_task_path(@task),
14
- class: ['btn', 'btn-sm', 'btn-primary', ('disabled' unless @task.cancellable?)].compact,
15
- method: :post) %>
16
- <% if @task.parent_task %>
17
- <%= link_to(_("Parent task"), foreman_tasks_task_path(@task.parent_task), class: ['btn', 'btn-sm', 'btn-default']) %>
18
- <% end %>
19
- <% if @task.sub_tasks.any? %>
20
- <%= link_to(_("Sub tasks"), sub_tasks_foreman_tasks_task_path(@task), class: ['btn', 'btn-sm', 'btn-default']) %>
21
- <% end %>
22
- <% if Setting['dynflow_allow_dangerous_actions'] %>
23
- <%= link_to(_('Unlock'),
24
- '',
25
- class: ['btn', 'btn-sm', 'btn-warning', 'reload-button-stop', ('disabled' unless @task.state == 'paused')].compact,
26
- :'data-toggle' => "modal",
27
- :'data-target' => "#unlock_modal") %>
28
-
29
- <%= link_to(_('Force Unlock'),
30
- '',
31
- class: ['btn', 'btn-sm', 'btn-danger', 'reload-button-stop', ('disabled' if @task.state == 'stopped')].compact,
32
- :'data-toggle' => "modal",
33
- :'data-target' => "#force_unlock_modal") %>
34
- <% end %>
35
- <% end %>
36
- </p>
37
-
38
- <div class="modal fade" id="unlock_modal" tabindex="-1" role="dialog" aria-labelledby="Deploy" aria-hidden="true">
39
- <div class="modal-dialog">
40
- <div class="modal-content">
41
- <div class="modal-header">
42
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
43
- <h2 class="modal-title" id="deploy_modal_label">
44
- <span class="glyphicon glyphicon-warning-sign"></span>
45
- <%= _("Unlock") %>
46
- </h2>
47
- </div>
48
- <div class="modal-body">
49
- <%= _("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.") %>
50
- <div>
51
- <input class="disable-unlock" type="checkbox"/>
52
- <%= _("I understand that this may cause harm and have working database backups of all backend services.") %>
53
- </div>
54
- </div>
55
- <div class="modal-footer">
56
- <button type="button" class="btn btn-default" data-dismiss="modal"><%= _("Cancel") %></button>
57
- <%= link_to(_("Unlock"), unlock_foreman_tasks_task_path(@task), method: :post, class: 'btn btn-warning modal-submit disabled') %>
58
- </div>
59
- </div>
60
- </div>
61
- </div>
62
-
63
- <div class="modal fade" id="force_unlock_modal" tabindex="-1" role="dialog" aria-labelledby="Deploy" aria-hidden="true">
64
- <div class="modal-dialog">
65
- <div class="modal-content">
66
- <div class="modal-header">
67
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
68
- <h2 class="modal-title" id="deploy_modal_label">
69
- <span class="glyphicon glyphicon-exclamation-sign"></span>
70
- <%= _("Force Unlock") %>
71
- </h2>
72
- </div>
73
- <div class="modal-body">
74
- <%= _("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") %>
75
- <div>
76
- <input class="disable-unlock" type="checkbox"/>
77
- <%= _("I understand that this may cause harm and have working database backups of all backend services.") %>
78
- </div>
79
- </div>
80
- <div class="modal-footer">
81
- <button type="button" class="btn btn-default" data-dismiss="modal"><%= _("Cancel") %></button>
82
- <%= link_to(_("Force Unlock"), force_unlock_foreman_tasks_task_path(@task), method: :post, class: 'btn btn-danger modal-submit disabled') %>
83
- </div>
84
- </div>
85
- </div>
86
- </div>
87
-
88
- <div class="row">
89
- <div class="col-md-6">
90
- <div>
91
- <span class="param-name list-group-item-heading"><%= _("Name") %>:</span>
92
- <% task_label = format_task_input(@task) %>
93
- <span class="param-value" data-original-title="<%= task_label %>" rel="twipsy"> <%= truncate(task_label, :length => 50) %></span>
94
- </div>
95
- <div>
96
- <span class="param-name list-group-item-heading"><%= _("Result") %>:</span>
97
- <span class="param-value">
98
- <% if @task.state != 'stopped' %>
99
- <%= content_tag(:i, '&nbsp;'.html_safe, :class => 'task-status pficon-help') %>
100
- <% else %>
101
- <%= content_tag(:i, '&nbsp;'.html_safe, :class => task_result_icon_class(@task)) + content_tag(:span, @task.result) %>
102
- <% end %>
103
- </span>
104
- </div>
105
- <div>
106
- <span class="param-name list-group-item-heading"><%= _("Triggered by") %>:</span>
107
- <span class="param-value">
108
- <% if @task.owner.present? && @task.username != User::ANONYMOUS_API_ADMIN && @task.username != User::ANONYMOUS_ADMIN %>
109
- <%= link_to_if_authorized(@task.username, hash_for_edit_user_path(@task.owner)) %>
110
- <% else %>
111
- <%= @task.username %>
112
- <% end %>
113
- </span>
114
- </div>
115
- <div>
116
- <span class="param-name list-group-item-heading"><%= _("Execution type") %>:</span>
117
- <span class="param-value"><%= _(@task.execution_type) %> <%= _("(Disabled)") if @task.frozen %></span>
118
- </div>
119
- </div>
120
-
121
- <div class="col-md-6">
122
- <div>
123
- <span class="param-name list-group-item-heading"><%= _("Start at") %>:</span>
124
- <span class="param-value"><%= @task.start_at.nil? ? '-' : time_in_words_span(@task.start_at) %></span>
125
- </div>
126
- <div>
127
- <span class="param-name list-group-item-heading"><%= _("Started at") %>:</span>
128
- <span class="param-value"><%= time_in_words_span @task.started_at.try(:in_time_zone) %></span>
129
- </div>
130
- <div>
131
- <span class="param-name list-group-item-heading"><%= _("Ended at") %>:</span>
132
- <span class="param-value"><%= time_in_words_span @task.ended_at.try(:in_time_zone) %></span>
133
- </div>
134
- <div>
135
- <span class="param-name list-group-item-heading"><%= _("Start before") %>:</span>
136
- <span class="param-value"><%= @task.start_before.nil? ? '-' : time_in_words_span(@task.start_before) %></span>
137
- </div>
138
- </div>
139
- </div>
140
-
141
- <br />
142
-
143
- <div class="row">
144
- <div class="col-xs-12">
145
- <% progress = 100 * @task.progress %>
146
- <% progress_class = if @task.state == 'running'
147
- nil
148
- else
149
- case @task.result
150
- when 'success'
151
- 'progress-bar-success'
152
- when 'error'
153
- 'progress-bar-danger'
154
- when 'warning'
155
- 'progress-bar-warning'
156
- else
157
- nil
158
- end
159
- end %>
160
-
161
- <div class="progress-description <%= 'active' if @task.state == 'running' %>">
162
- <span class="list-group-item-heading">State:</span> <%= @task.state %>
163
- </div>
164
- <div class="progress progress-striped progress-label-top-right">
165
- <div class="progress-bar <%= progress_class %>"
166
- role="progressbar"
167
- aria-valuenow="<%= progress %>"
168
- aria-valuemin="0"
169
- aria-valuemax="100"
170
- style="width: <%= progress %>%;">
171
- <span><%= progress.round %>% Complete</span>
172
- </div>
173
- </div>
174
- </div>
175
- </div>
176
-
177
- <%= troubleshooting_info %>
178
-
179
- <% unless @task.humanized[:output].blank? %>
180
- <div>
181
- <span class="param-name list-group-item-heading"><%= _("Output") %>:</span>
182
- <span class="param-value">
183
- <pre><%= @task.humanized[:output] %></pre>
184
- </span>
185
- </div>
186
- <% end %>
187
-
188
- <% unless @task.humanized[:errors].blank? %>
189
- <div>
190
- <span class="param-name"><b><%= _("Errors") %>:</b></span>
191
- <span class="param-value">
192
- <pre><%=Array(@task.humanized[:errors]).join("\n") %></pre>
193
- </span>
194
- </div>
195
- <% end %>