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
@@ -1,42 +0,0 @@
1
- <% if @task.is_a? ForemanTasks::Task::DynflowTask %>
2
- <div>
3
- <% failed_steps = @task.failed_steps %>
4
- <% if @task.execution_plan.nil? %>
5
- <div class="alert alert-danger">
6
- <%= _("Execution plan data not available ") %>
7
- </div>
8
- <% elsif failed_steps.empty? %>
9
- <div class="alert alert-success">
10
- <%= _("No errors") %>
11
- </div>
12
- <% else %>
13
- <% failed_steps.each do |step| %>
14
- <div class="alert alert-danger">
15
- <% action = step.action(@task.execution_plan) %>
16
- <span class="param-name"><%= _("Action") %>:</span>
17
- <span class="param-value">
18
- <pre><%= action.class %></pre>
19
- </span>
20
- <span class="param-name"><%= _("Input") %>:</span>
21
- <span class="param-value">
22
- <pre><%= action.input.pretty_inspect %></pre>
23
- </span>
24
- <span class="param-name"><%= _("Output") %>:</span>
25
- <span class="param-value">
26
- <pre><%= action.output.pretty_inspect %></pre>
27
- </span>
28
- <% if step.error %>
29
- <span class="param-name"><%= _("Exception") %>:</span>
30
- <span class="param-value">
31
- <pre><%= step.error.exception_class %>: <%= step.error.message %></pre>
32
- </span>
33
- <span class="param-name"><%= _("Backtrace") %>:</span>
34
- <span class="param-value">
35
- <pre><%= step.error.backtrace.join("\n") %></pre>
36
- </span>
37
- <% end %>
38
- </div>
39
- <% end %>
40
- <% end %>
41
- </div>
42
- <% end %>
@@ -1,19 +0,0 @@
1
- <%= alert(:close => false, :class => 'alert-info', :header => '',
2
- :text => _("You can find resource locks on this page. Exclusive lock marked with locked icon means that no other task can use locked resource while this task is running. Non-exclusive lock marked with unlocked icon means other tasks can access the resource freely, it is only used to indicate the relation of this task with the resource")) %>
3
-
4
- <div class="container-fluid container-cards-pf">
5
- <div class="row row-cards-pf">
6
- <% @task.locks.each do |lock| %>
7
- <div class="col-xs-6 col-sm-4 col-md-4">
8
- <div class="card-pf card-pf-accented card-pf-aggregate-status">
9
- <h2 class="card-pf-title">
10
- <span class="fa <%= lock.exclusive ? 'fa-lock' : 'fa-unlock-alt' %>"></span> <%= lock.name %>
11
- </h2>
12
- <div class="card-pf-body">
13
- <%= format('%s id:%s', lock.resource_type, lock.resource_id) %><br>
14
- </div>
15
- </div>
16
- </div>
17
- <% end %>
18
- </div>
19
- </div>
@@ -1,28 +0,0 @@
1
- <div>
2
- <span class="param-name list-group-item-heading"><%= _("Id") %>:</span>
3
- <span class="param-value"><%= @task.id %></span>
4
- </div>
5
- <div>
6
- <span class="param-name list-group-item-heading"><%= _("Label") %>:</span>
7
- <span class="param-value"><%= @task.label %></span>
8
- </div>
9
- <div>
10
- <span class="param-name list-group-item-heading"><%= _("Duration") %>:</span>
11
- <span class="param-value"><%= duration_in_words_span(@task.started_at, @task.ended_at || Time.now.utc) %></span>
12
- </div>
13
- <div>
14
- <span class="param-name list-group-item-heading"><%= _("Raw input") %>:</span>
15
- <span class="param-value">
16
- <pre><%= @task.input.pretty_inspect %></pre>
17
- </span>
18
- </div>
19
- <div>
20
- <span class="param-name list-group-item-heading"><%= _("Raw output") %>:</span>
21
- <span class="param-value">
22
- <pre><%= @task.output.pretty_inspect %></pre>
23
- </span>
24
- </div>
25
- <div>
26
- <span class="param-name list-group-item-heading"><%= _("External Id") %>:</span>
27
- <span class="param-value"><%= @task.external_id %></span>
28
- </div>
@@ -1,40 +0,0 @@
1
- <% if @task.is_a? ForemanTasks::Task::DynflowTask %>
2
- <div>
3
- <% running_steps = @task.running_steps %>
4
- <% if running_steps.empty? %>
5
- <%= _("No running steps") %>
6
- <% else %>
7
- <% running_steps.each do |step| %>
8
- <% action = step.action(@task.execution_plan) %>
9
- <div class="alert alert-warning">
10
- <p>
11
- <% if @task.cancellable_action?(action) %>
12
- <%= link_to(_('Cancel'),
13
- cancel_step_foreman_tasks_task_path(@task, :step_id => step.id),
14
- class: ['btn', 'btn-sm', 'btn-primary'].compact,
15
- method: :post) %>
16
- <% end %>
17
- </p>
18
- <p>
19
- <span class="param-name"><%= _("Action") %>:</span>
20
- <span class="param-value">
21
- <pre><%= action.class %></pre>
22
- </span>
23
- <p>
24
- <span class="param-name"><%= _("State") %>:</span>
25
- <span class="param-value"><%= action.humanized_state %></span>
26
- </p>
27
- <span class="param-name"><%= _("Input") %>:</span>
28
- <span class="param-value">
29
- <pre><%= action.input.pretty_inspect %></pre>
30
- </span>
31
- <span class="param-name"><%= _("Output") %>:</span>
32
- <span class="param-value">
33
- <pre><%= action.output.pretty_inspect %></pre>
34
- </span>
35
- </div>
36
- <% end %>
37
- </p>
38
- <% end %>
39
- </div>
40
- <% end %>