foreman-tasks 12.0.0 → 12.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby_tests.yml +1 -0
  3. data/app/assets/javascripts/foreman-tasks/locale/de/foreman_tasks.js +58 -22
  4. data/app/assets/javascripts/foreman-tasks/locale/en/foreman_tasks.js +56 -20
  5. data/app/assets/javascripts/foreman-tasks/locale/es/foreman_tasks.js +59 -23
  6. data/app/assets/javascripts/foreman-tasks/locale/fr/foreman_tasks.js +61 -25
  7. data/app/assets/javascripts/foreman-tasks/locale/ja/foreman_tasks.js +61 -25
  8. data/app/assets/javascripts/foreman-tasks/locale/ka/foreman_tasks.js +60 -24
  9. data/app/assets/javascripts/foreman-tasks/locale/ko/foreman_tasks.js +61 -25
  10. data/app/assets/javascripts/foreman-tasks/locale/pt_BR/foreman_tasks.js +59 -23
  11. data/app/assets/javascripts/foreman-tasks/locale/ru/foreman_tasks.js +58 -22
  12. data/app/assets/javascripts/foreman-tasks/locale/zh_CN/foreman_tasks.js +61 -25
  13. data/app/assets/javascripts/foreman-tasks/locale/zh_TW/foreman_tasks.js +57 -21
  14. data/app/controllers/foreman_tasks/api/tasks_controller.rb +4 -19
  15. data/app/controllers/foreman_tasks/tasks_controller.rb +4 -5
  16. data/app/lib/actions/helpers/lock.rb +0 -6
  17. data/app/lib/actions/middleware/keep_current_user.rb +6 -12
  18. data/app/models/foreman_tasks/task.rb +1 -1
  19. data/app/views/foreman_tasks/api/tasks/dependency_summary.json.rabl +1 -3
  20. data/app/views/foreman_tasks/api/tasks/show.json.rabl +4 -1
  21. data/config/routes.rb +3 -3
  22. data/foreman-tasks.gemspec +3 -1
  23. data/lib/foreman_tasks/engine.rb +1 -1
  24. data/lib/foreman_tasks/tasks/export_tasks.rake +1 -1
  25. data/lib/foreman_tasks/version.rb +1 -1
  26. data/locale/de/LC_MESSAGES/foreman_tasks.mo +0 -0
  27. data/locale/de/foreman_tasks.po +59 -23
  28. data/locale/en/LC_MESSAGES/foreman_tasks.mo +0 -0
  29. data/locale/en/foreman_tasks.po +56 -20
  30. data/locale/es/LC_MESSAGES/foreman_tasks.mo +0 -0
  31. data/locale/es/foreman_tasks.po +59 -23
  32. data/locale/foreman_tasks.pot +173 -100
  33. data/locale/fr/LC_MESSAGES/foreman_tasks.mo +0 -0
  34. data/locale/fr/foreman_tasks.po +61 -25
  35. data/locale/ja/LC_MESSAGES/foreman_tasks.mo +0 -0
  36. data/locale/ja/foreman_tasks.po +61 -25
  37. data/locale/ka/LC_MESSAGES/foreman_tasks.mo +0 -0
  38. data/locale/ka/foreman_tasks.po +60 -24
  39. data/locale/ko/LC_MESSAGES/foreman_tasks.mo +0 -0
  40. data/locale/ko/foreman_tasks.po +61 -25
  41. data/locale/pt_BR/LC_MESSAGES/foreman_tasks.mo +0 -0
  42. data/locale/pt_BR/foreman_tasks.po +59 -23
  43. data/locale/ru/LC_MESSAGES/foreman_tasks.mo +0 -0
  44. data/locale/ru/foreman_tasks.po +58 -22
  45. data/locale/zh_CN/LC_MESSAGES/foreman_tasks.mo +0 -0
  46. data/locale/zh_CN/foreman_tasks.po +61 -25
  47. data/locale/zh_TW/LC_MESSAGES/foreman_tasks.mo +0 -0
  48. data/locale/zh_TW/foreman_tasks.po +57 -21
  49. data/test/controllers/api/tasks_controller_test.rb +29 -3
  50. data/test/controllers/tasks_controller_test.rb +46 -2
  51. data/webpack/ForemanTasks/Components/TaskActions/TaskAction.test.js +8 -0
  52. data/webpack/ForemanTasks/Components/TaskActions/TaskActionHelpers.js +8 -2
  53. data/webpack/ForemanTasks/Components/TaskActions/TaskActionHelpers.test.js +25 -33
  54. data/webpack/ForemanTasks/Components/TaskActions/index.js +24 -3
  55. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +6 -6
  56. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +9 -0
  57. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +16 -11
  58. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/TasksTimeRow.js +2 -3
  59. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/__snapshots__/TasksTimeRow.test.js.snap +4 -8
  60. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.js +2 -4
  61. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.scss +0 -3
  62. data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboard.test.js.snap +2 -5
  63. data/webpack/ForemanTasks/Components/{common/ActionButtons/ActionButton.js → TasksTable/Components/CellActionButton.js} +36 -21
  64. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/index.test.js +32 -29
  65. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/createBulkTaskModal.js +14 -18
  66. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/createTaskModal.js +13 -15
  67. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/index.js +7 -7
  68. data/webpack/ForemanTasks/Components/TasksTable/TasksBulkActions.js +16 -23
  69. data/webpack/ForemanTasks/Components/TasksTable/TasksColumns.js +56 -0
  70. data/webpack/ForemanTasks/Components/TasksTable/TasksIndexPage.js +277 -3
  71. data/webpack/ForemanTasks/Components/TasksTable/TasksModals.js +96 -0
  72. data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +10 -18
  73. data/webpack/ForemanTasks/Components/TasksTable/TasksTableHelpers.js +3 -3
  74. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksBulkActions.test.js +130 -63
  75. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksIndexPage.test.js +315 -8
  76. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.fixtures.js +214 -41
  77. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableHelpers.test.js +20 -12
  78. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksBulkActions.test.js.snap +18 -35
  79. data/webpack/ForemanTasks/ForemanTasksReducers.js +0 -4
  80. data/webpack/Routes/routes.js +22 -0
  81. data/webpack/Routes/routes.test.js +95 -0
  82. data/webpack/global_index.js +10 -0
  83. data/webpack/index.js +0 -18
  84. data/webpack/test_setup.js +1 -0
  85. metadata +15 -89
  86. data/app/controllers/foreman_tasks/react_controller.rb +0 -17
  87. data/app/views/foreman_tasks/layouts/react.html.erb +0 -13
  88. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalSelectors.js +0 -30
  89. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js +0 -66
  90. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/__snapshots__/ConfirmModalSelectors.test.js.snap +0 -33
  91. data/webpack/ForemanTasks/Components/TasksTable/Components/SelectAllAlert.js +0 -49
  92. data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionCell.js +0 -32
  93. data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionHeaderCell.js +0 -38
  94. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/SelectAllAlert.test.js +0 -29
  95. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionCell.test.js +0 -15
  96. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionHeaderCell.test.js +0 -15
  97. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/SelectAllAlert.test.js.snap +0 -81
  98. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionCell.test.js.snap +0 -14
  99. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionHeaderCell.test.js.snap +0 -15
  100. data/webpack/ForemanTasks/Components/TasksTable/SubTasksPage.js +0 -40
  101. data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +0 -163
  102. data/webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js +0 -108
  103. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +0 -234
  104. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.scss +0 -20
  105. data/webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js +0 -68
  106. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSchema.js +0 -85
  107. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSelectors.js +0 -63
  108. data/webpack/ForemanTasks/Components/TasksTable/__tests__/SubTasksPage.test.js +0 -20
  109. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.test.js +0 -9
  110. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActions.test.js +0 -65
  111. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTablePage.test.js +0 -35
  112. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableReducer.test.js +0 -87
  113. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap +0 -48
  114. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap +0 -39
  115. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTable.test.js.snap +0 -52
  116. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableActions.test.js.snap +0 -40
  117. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +0 -368
  118. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap +0 -116
  119. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionCellFormatter.test.js.snap +0 -15
  120. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionNameCellFormatter.test.js.snap +0 -10
  121. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/dateCellFormmatter.test.js.snap +0 -9
  122. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/durationCellFormmatter.test.js.snap +0 -18
  123. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionCellFormatter.test.js.snap +0 -12
  124. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionHeaderCellFormatter.test.js.snap +0 -11
  125. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionCellFormatter.test.js +0 -11
  126. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionNameCellFormatter.test.js +0 -8
  127. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/dateCellFormmatter.test.js +0 -7
  128. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/durationCellFormmatter.test.js +0 -12
  129. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionCellFormatter.test.js +0 -12
  130. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionHeaderCellFormatter.test.js +0 -12
  131. data/webpack/ForemanTasks/Components/TasksTable/formatters/actionCellFormatter.js +0 -19
  132. data/webpack/ForemanTasks/Components/TasksTable/formatters/actionNameCellFormatter.js +0 -9
  133. data/webpack/ForemanTasks/Components/TasksTable/formatters/dateCellFormmatter.js +0 -7
  134. data/webpack/ForemanTasks/Components/TasksTable/formatters/durationCellFormmatter.js +0 -7
  135. data/webpack/ForemanTasks/Components/TasksTable/formatters/index.js +0 -7
  136. data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionCellFormatter.js +0 -17
  137. data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionHeaderCellFormatter.js +0 -11
  138. data/webpack/ForemanTasks/Components/TasksTable/index.js +0 -42
  139. data/webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.test.js +0 -101
  140. data/webpack/ForemanTasks/Components/common/ActionButtons/__snapshots__/ActionButton.test.js.snap +0 -95
  141. data/webpack/ForemanTasks/ForemanTasks.js +0 -11
  142. data/webpack/ForemanTasks/ForemanTasks.test.js +0 -10
  143. data/webpack/ForemanTasks/Routes/ForemanTasksRouter.js +0 -14
  144. data/webpack/ForemanTasks/Routes/ForemanTasksRouter.test.js +0 -26
  145. data/webpack/ForemanTasks/Routes/ForemanTasksRoutes.js +0 -23
  146. data/webpack/ForemanTasks/Routes/ForemanTasksRoutes.test.js +0 -16
  147. data/webpack/ForemanTasks/Routes/__snapshots__/ForemanTasksRouter.test.js.snap +0 -16
  148. data/webpack/ForemanTasks/Routes/__snapshots__/ForemanTasksRoutes.test.js.snap +0 -37
  149. data/webpack/ForemanTasks/__snapshots__/ForemanTasks.test.js.snap +0 -7
  150. data/webpack/ForemanTasks/index.js +0 -1
  151. data/webpack/__mocks__/foremanReact/common/I18n.js +0 -7
  152. data/webpack/__mocks__/foremanReact/common/helpers.js +0 -6
  153. data/webpack/__mocks__/foremanReact/common/urlHelpers.js +0 -1
  154. data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +0 -2
  155. data/webpack/__mocks__/foremanReact/components/Pagination/index.js +0 -2
  156. data/webpack/__mocks__/foremanReact/components/ToastsList/index.js +0 -8
  157. data/webpack/__mocks__/foremanReact/components/common/ActionButtons/ActionButtons.js +0 -3
  158. data/webpack/__mocks__/foremanReact/components/common/MessageBox.js +0 -4
  159. data/webpack/__mocks__/foremanReact/components/common/dates/LongDateTime.js +0 -5
  160. data/webpack/__mocks__/foremanReact/components/common/dates/RelativeDateTime.js +0 -3
  161. data/webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js +0 -7
  162. data/webpack/__mocks__/foremanReact/components/common/table.js +0 -5
  163. data/webpack/__mocks__/foremanReact/constants.js +0 -24
  164. data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +0 -10
  165. data/webpack/__mocks__/foremanReact/redux/API/index.js +0 -10
  166. data/webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js +0 -5
  167. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js +0 -10
  168. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js +0 -5
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_tasks": {
5
5
  "": {
6
- "Project-Id-Version": "foreman-tasks 11.0.5",
6
+ "Project-Id-Version": "foreman-tasks 12.0.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2016-02-12 14:04+0000",
9
9
  "Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
@@ -23,9 +23,6 @@
23
23
  "%(older)s Older %(time)s": [
24
24
  "%(older)s 较老 %(time)s"
25
25
  ],
26
- "%s Selected Tasks": [
27
- "%s 选择的任务"
28
- ],
29
26
  "%s is not valid format of cron line": [
30
27
  "%s 不是正确的 cron 行"
31
28
  ],
@@ -63,13 +60,13 @@
63
60
  "操作"
64
61
  ],
65
62
  "Action with sub plans": [
66
- ""
63
+ "有子计划的操作"
67
64
  ],
68
65
  "Active": [
69
66
  "活跃"
70
67
  ],
71
- "Active Filters:": [
72
- "活跃的过滤器:"
68
+ "Active Filters": [
69
+ ""
73
70
  ],
74
71
  "Active or disabled recurring logic with purpose %s already exists": [
75
72
  "带有目的 %s 的活跃或禁用的周期性逻辑已存在"
@@ -98,6 +95,9 @@
98
95
  "Backtrace": [
99
96
  "回溯"
100
97
  ],
98
+ "Blocks": [
99
+ ""
100
+ ],
101
101
  "Bulk action": [
102
102
  "批量操作"
103
103
  ],
@@ -107,6 +107,12 @@
107
107
  "Cancel Selected": [
108
108
  "取消选择"
109
109
  ],
110
+ "Cancel Selected Tasks": [
111
+ ""
112
+ ],
113
+ "Cancel Task": [
114
+ ""
115
+ ],
110
116
  "Cancel enforced: the task might be still running on the proxy": [
111
117
  "强制取消:任务可能仍在代理服务器上运行"
112
118
  ],
@@ -116,9 +122,6 @@
116
122
  "Cancel selected cancellable tasks": [
117
123
  "取消所选的可取消的任务"
118
124
  ],
119
- "Cancel selected tasks": [
120
- "取消选择的任务"
121
- ],
122
125
  "Cancel specific tasks by ID": [
123
126
  "根据 ID 取消特定任务"
124
127
  ],
@@ -152,9 +155,6 @@
152
155
  "Check for long running tasks": [
153
156
  "检查长时间运行的任务"
154
157
  ],
155
- "Clear All Filters": [
156
- "清除所有过滤器"
157
- ],
158
158
  "Clear Cancelled": [
159
159
  "清除取消"
160
160
  ],
@@ -197,6 +197,12 @@
197
197
  "Deliver notifications about long running tasks": [
198
198
  "提供有关长时间运行的任务的通知"
199
199
  ],
200
+ "Dependencies": [
201
+ ""
202
+ ],
203
+ "Depends on": [
204
+ ""
205
+ ],
200
206
  "Details": [
201
207
  "详情"
202
208
  ],
@@ -275,12 +281,15 @@
275
281
  "Force Cancel Selected": [
276
282
  "强制取消选择"
277
283
  ],
278
- "Force Cancel selected tasks": [
279
- "强制取消选择的任务"
280
- ],
281
284
  "Force Unlock": [
282
285
  "强制解除锁定"
283
286
  ],
287
+ "Force Unlock Selected Tasks": [
288
+ ""
289
+ ],
290
+ "Force Unlock Task": [
291
+ ""
292
+ ],
284
293
  "Foreman Tasks": [
285
294
  "Foreman 任务"
286
295
  ],
@@ -315,7 +324,7 @@
315
324
  "输入"
316
325
  ],
317
326
  "Invalid URL": [
318
- ""
327
+ "无效 URL"
319
328
  ],
320
329
  "Iteration limit": [
321
330
  "重述限制"
@@ -395,6 +404,9 @@
395
404
  "No. of Tasks": [
396
405
  "任务号"
397
406
  ],
407
+ "None": [
408
+ ""
409
+ ],
398
410
  "Not all the selected tasks can be cancelled": [
399
411
  "并非所有选定的任务都可以取消"
400
412
  ],
@@ -518,12 +530,15 @@
518
530
  "Resume Selected": [
519
531
  "恢复选择"
520
532
  ],
533
+ "Resume Selected Tasks": [
534
+ ""
535
+ ],
536
+ "Resume Task": [
537
+ ""
538
+ ],
521
539
  "Resume all paused error tasks": [
522
540
  "恢复所有暂停的错误任务"
523
541
  ],
524
- "Resume selected tasks": [
525
- "恢复选择的任务"
526
- ],
527
542
  "Resume specific tasks by ID": [
528
543
  "根据 ID 恢复特定任务"
529
544
  ],
@@ -557,9 +572,6 @@
557
572
  "See %{link} for more details on how to resolve the issue": [
558
573
  "有关如何解决此问题的更多详细信息,请参见%{link}"
559
574
  ],
560
- "Select Action": [
561
- "选择操作"
562
- ],
563
575
  "Select all {count} tasks": [
564
576
  "选择所有 {count} 任务"
565
577
  ],
@@ -617,6 +629,9 @@
617
629
  "Stopped": [
618
630
  "停止"
619
631
  ],
632
+ "Stopped tasks by result": [
633
+ ""
634
+ ],
620
635
  "Sub tasks": [
621
636
  "子任务"
622
637
  ],
@@ -650,6 +665,9 @@
650
665
  "Task count": [
651
666
  "任务计数"
652
667
  ],
668
+ "Task dependencies": [
669
+ ""
670
+ ],
653
671
  "Task group common": [
654
672
  "任务组一般事项"
655
673
  ],
@@ -701,8 +719,26 @@
701
719
  "This action will delete all cancelled recurring logics. Please note that this action can't be reversed.": [
702
720
  "此操作将删除所有取消的重复逻辑。请注意,此操作无法撤消。"
703
721
  ],
704
- "This will %(action)s %(number)s task(s), putting them in the %(state)s state. Are you sure?": [
705
- "这将 %(action)s %(number)s 任务,把它们置于 %(state)s 状态。确定吗?"
722
+ "This task may have dependencies on other tasks or may be blocking other tasks from executing. Dependencies are established through task chaining relationships.": [
723
+ ""
724
+ ],
725
+ "This will cancel %(number)s task(s), putting them in the stopped state. Are you sure?": [
726
+ ""
727
+ ],
728
+ "This will cancel task \\\\\\\"%(taskName)s\\\\\\\", putting it in the stopped state. Are you sure?": [
729
+ ""
730
+ ],
731
+ "This will force unlock %(number)s task(s). This may cause harm and should be used with caution. Are you sure?": [
732
+ ""
733
+ ],
734
+ "This will force unlock task \\\\\\\"%(taskName)s\\\\\\\". This may cause harm and should be used with caution. Are you sure?": [
735
+ ""
736
+ ],
737
+ "This will resume %(number)s task(s), putting them in the running state. Are you sure?": [
738
+ ""
739
+ ],
740
+ "This will resume task \\\\\\\"%(taskName)s\\\\\\\", putting it in the running state. Are you sure?": [
741
+ ""
706
742
  ],
707
743
  "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.": [
708
744
  "这将解锁任务正在针对其运行的资源。请注意,这可能会导致状态不一致,应该谨慎使用,然后再确保任务无法恢复。"
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_tasks": {
5
5
  "": {
6
- "Project-Id-Version": "foreman-tasks 11.0.5",
6
+ "Project-Id-Version": "foreman-tasks 12.0.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2016-02-12 14:04+0000",
9
9
  "Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
@@ -23,9 +23,6 @@
23
23
  "%(older)s Older %(time)s": [
24
24
  ""
25
25
  ],
26
- "%s Selected Tasks": [
27
- ""
28
- ],
29
26
  "%s is not valid format of cron line": [
30
27
  "%s 不是 cron 行的正確格式"
31
28
  ],
@@ -68,7 +65,7 @@
68
65
  "Active": [
69
66
  "啟用中"
70
67
  ],
71
- "Active Filters:": [
68
+ "Active Filters": [
72
69
  ""
73
70
  ],
74
71
  "Active or disabled recurring logic with purpose %s already exists": [
@@ -98,6 +95,9 @@
98
95
  "Backtrace": [
99
96
  "追蹤"
100
97
  ],
98
+ "Blocks": [
99
+ ""
100
+ ],
101
101
  "Bulk action": [
102
102
  "批次動作"
103
103
  ],
@@ -107,6 +107,12 @@
107
107
  "Cancel Selected": [
108
108
  ""
109
109
  ],
110
+ "Cancel Selected Tasks": [
111
+ ""
112
+ ],
113
+ "Cancel Task": [
114
+ ""
115
+ ],
110
116
  "Cancel enforced: the task might be still running on the proxy": [
111
117
  "強制取消:任務可能還在代理伺服器上執行"
112
118
  ],
@@ -116,9 +122,6 @@
116
122
  "Cancel selected cancellable tasks": [
117
123
  ""
118
124
  ],
119
- "Cancel selected tasks": [
120
- ""
121
- ],
122
125
  "Cancel specific tasks by ID": [
123
126
  ""
124
127
  ],
@@ -152,9 +155,6 @@
152
155
  "Check for long running tasks": [
153
156
  ""
154
157
  ],
155
- "Clear All Filters": [
156
- ""
157
- ],
158
158
  "Clear Cancelled": [
159
159
  ""
160
160
  ],
@@ -197,6 +197,12 @@
197
197
  "Deliver notifications about long running tasks": [
198
198
  ""
199
199
  ],
200
+ "Dependencies": [
201
+ ""
202
+ ],
203
+ "Depends on": [
204
+ ""
205
+ ],
200
206
  "Details": [
201
207
  "詳細資訊"
202
208
  ],
@@ -275,12 +281,15 @@
275
281
  "Force Cancel Selected": [
276
282
  ""
277
283
  ],
278
- "Force Cancel selected tasks": [
279
- ""
280
- ],
281
284
  "Force Unlock": [
282
285
  "強制解除鎖定"
283
286
  ],
287
+ "Force Unlock Selected Tasks": [
288
+ ""
289
+ ],
290
+ "Force Unlock Task": [
291
+ ""
292
+ ],
284
293
  "Foreman Tasks": [
285
294
  ""
286
295
  ],
@@ -395,6 +404,9 @@
395
404
  "No. of Tasks": [
396
405
  "任務編號"
397
406
  ],
407
+ "None": [
408
+ ""
409
+ ],
398
410
  "Not all the selected tasks can be cancelled": [
399
411
  ""
400
412
  ],
@@ -518,12 +530,15 @@
518
530
  "Resume Selected": [
519
531
  ""
520
532
  ],
521
- "Resume all paused error tasks": [
522
- "繼續所有處於暫停狀態的錯誤任務"
533
+ "Resume Selected Tasks": [
534
+ ""
523
535
  ],
524
- "Resume selected tasks": [
536
+ "Resume Task": [
525
537
  ""
526
538
  ],
539
+ "Resume all paused error tasks": [
540
+ "繼續所有處於暫停狀態的錯誤任務"
541
+ ],
527
542
  "Resume specific tasks by ID": [
528
543
  "透過 ID 繼續特定任務"
529
544
  ],
@@ -557,9 +572,6 @@
557
572
  "See %{link} for more details on how to resolve the issue": [
558
573
  ""
559
574
  ],
560
- "Select Action": [
561
- "選擇動作"
562
- ],
563
575
  "Select all {count} tasks": [
564
576
  ""
565
577
  ],
@@ -617,6 +629,9 @@
617
629
  "Stopped": [
618
630
  ""
619
631
  ],
632
+ "Stopped tasks by result": [
633
+ ""
634
+ ],
620
635
  "Sub tasks": [
621
636
  "子任務"
622
637
  ],
@@ -650,6 +665,9 @@
650
665
  "Task count": [
651
666
  "工作數量"
652
667
  ],
668
+ "Task dependencies": [
669
+ ""
670
+ ],
653
671
  "Task group common": [
654
672
  "任務群組的一般事項"
655
673
  ],
@@ -702,7 +720,25 @@
702
720
  "This action will delete all cancelled recurring logics. Please note that this action can't be reversed.": [
703
721
  ""
704
722
  ],
705
- "This will %(action)s %(number)s task(s), putting them in the %(state)s state. Are you sure?": [
723
+ "This task may have dependencies on other tasks or may be blocking other tasks from executing. Dependencies are established through task chaining relationships.": [
724
+ ""
725
+ ],
726
+ "This will cancel %(number)s task(s), putting them in the stopped state. Are you sure?": [
727
+ ""
728
+ ],
729
+ "This will cancel task \\\\\\\"%(taskName)s\\\\\\\", putting it in the stopped state. Are you sure?": [
730
+ ""
731
+ ],
732
+ "This will force unlock %(number)s task(s). This may cause harm and should be used with caution. Are you sure?": [
733
+ ""
734
+ ],
735
+ "This will force unlock task \\\\\\\"%(taskName)s\\\\\\\". This may cause harm and should be used with caution. Are you sure?": [
736
+ ""
737
+ ],
738
+ "This will resume %(number)s task(s), putting them in the running state. Are you sure?": [
739
+ ""
740
+ ],
741
+ "This will resume task \\\\\\\"%(taskName)s\\\\\\\", putting it in the running state. Are you sure?": [
706
742
  ""
707
743
  ],
708
744
  "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.": [
@@ -179,24 +179,12 @@ module ForemanTasks
179
179
  param :parent_task_id, :identifier, desc: 'UUID of the task'
180
180
  param_group :search_and_pagination, ::Api::V2::BaseController
181
181
  def index
182
- if params[:sort_by] || params[:sort_order]
183
- Foreman::Deprecation.api_deprecation_warning(
184
- "The sort params sort_by and sort_order are deprecated.
185
- Please use the order param instead as one string 'order=started_at desc'"
186
- )
187
-
188
- ordering_params = {
189
- sort_by: params[:sort_by] || 'started_at',
190
- sort_order: params[:sort_order] || 'DESC',
191
- }
192
- params[:order] = "#{ordering_params[:sort_by]} #{ordering_params[:sort_order]}"
193
- end
194
182
  params[:order] ||= 'started_at DESC'
195
- @tasks = resource_scope_for_index.order(params[:order].to_s)
183
+ @tasks = resource_scope_for_index
196
184
  end
197
185
 
198
186
  def search_options
199
- [search_query, {}]
187
+ [search_query, { :order => params[:order] }]
200
188
  end
201
189
 
202
190
  def_param_group :callback_target do
@@ -320,19 +308,16 @@ module ForemanTasks
320
308
  end
321
309
 
322
310
  def find_task
323
- @task = resource_scope.with_duration.find(params[:id])
311
+ @task = resource_scope.select_duration.find(params[:id])
324
312
  end
325
313
 
326
314
  def resource_scope(_options = {})
327
315
  scope = ForemanTasks::Task.authorized("#{action_permission}_foreman_tasks")
328
316
  scope = scope.where(:parent_task_id => params[:parent_task_id]) if params[:parent_task_id]
317
+ scope = scope.select_duration if params[:action] == 'index'
329
318
  scope
330
319
  end
331
320
 
332
- def resource_scope_for_index(*args)
333
- super.with_duration.distinct
334
- end
335
-
336
321
  def controller_permission
337
322
  'foreman_tasks'
338
323
  end
@@ -4,7 +4,7 @@ module ForemanTasks
4
4
  include Foreman::Controller::CsvResponder
5
5
  include ForemanTasks::FindTasksCommon
6
6
 
7
- before_action :find_dynflow_task, only: [:unlock, :force_unlock, :cancel, :cancel_step, :resume]
7
+ before_action :find_dynflow_task, only: [:unlock, :force_unlock, :cancel, :abort, :cancel_step, :resume]
8
8
 
9
9
  def show
10
10
  @task = resource_base.find(params[:id])
@@ -51,11 +51,10 @@ module ForemanTasks
51
51
 
52
52
  def abort
53
53
  if @dynflow_task.abort
54
- flash[:info] = _('Trying to abort the task')
54
+ render json: { statusText: 'OK' }
55
55
  else
56
- flash[:warning] = _('The task cannot be aborted at the moment.')
56
+ render json: {}, status: :bad_request
57
57
  end
58
- redirect_back(:fallback_location => foreman_tasks_task_path(@dynflow_task))
59
58
  end
60
59
 
61
60
  def resume
@@ -98,7 +97,7 @@ module ForemanTasks
98
97
  private
99
98
 
100
99
  def respond_with_tasks(scope)
101
- @tasks = filter(scope, paginate: false).with_duration
100
+ @tasks = filter(scope, paginate: false).select_duration
102
101
  csv_response(@tasks, [:id, :action, :state, :result, 'started_at.in_time_zone', 'ended_at.in_time_zone', :duration, :username], ['Id', 'Action', 'State', 'Result', 'Started At', 'Ended At', 'Duration', 'User'])
103
102
  end
104
103
 
@@ -13,12 +13,6 @@ module Actions
13
13
  end
14
14
  end
15
15
 
16
- # @see Lock.lock!
17
- def lock!(resource, *_lock_names)
18
- Foreman::Deprecation.deprecation_warning('2.4', 'locking in foreman-tasks was reworked, please use a combination of exclusive_lock! and link! instead.')
19
- exclusive_lock!(resource)
20
- end
21
-
22
16
  # @see Lock.link!
23
17
  def link!(resource)
24
18
  phase! Dynflow::Action::Plan
@@ -12,26 +12,20 @@ module Actions
12
12
  end
13
13
 
14
14
  def run(*args)
15
- restore_curent_user { pass(*args) }
15
+ restore_current_user { pass(*args) }
16
16
  end
17
17
 
18
18
  def finalize
19
- current_id = User.current.try(:id)
20
- saved_id = action.input[:current_user_id]
21
- if User.current && saved_id && current_id != saved_id
22
- Foreman::Deprecation.deprecation_warning('2.5', 'relying on per-step setting of current user in finalize phase')
23
- end
24
-
25
- restore_curent_user { pass }
19
+ restore_current_user { pass }
26
20
  end
27
21
 
28
22
  def finalize_phase(execution_plan, *args)
29
- restore_curent_user(execution_plan.entry_action) { pass(execution_plan, *args) }
23
+ restore_current_user(execution_plan.entry_action) { pass(execution_plan, *args) }
30
24
  end
31
25
 
32
26
  # Run all execution plan lifecycle hooks as the original user
33
27
  def hook(*args)
34
- restore_curent_user { pass(*args) }
28
+ restore_current_user { pass(*args) }
35
29
  end
36
30
 
37
31
  private
@@ -40,7 +34,7 @@ module Actions
40
34
  if User.current || action.input[:current_user_id].nil?
41
35
  yield
42
36
  else
43
- restore_curent_user { yield }
37
+ restore_current_user { yield }
44
38
  end
45
39
  end
46
40
 
@@ -48,7 +42,7 @@ module Actions
48
42
  action.input[:current_user_id] = User.current.try(:id)
49
43
  end
50
44
 
51
- def restore_curent_user(action = self.action)
45
+ def restore_current_user(action = self.action)
52
46
  old_user = User.current
53
47
  User.current = User.unscoped.find(action.input[:current_user_id]) if action.input[:current_user_id].present?
54
48
  yield
@@ -78,7 +78,7 @@ module ForemanTasks
78
78
  :"foreman_tasks_links.resource_type" => resource.class.name)
79
79
  end)
80
80
  scope :for_action_types, (->(action_types) { where('foreman_tasks_tasks.label IN (?)', Array(action_types)) })
81
- scope :with_duration, -> { select("foreman_tasks_tasks.*, coalesce(ended_at, current_timestamp) - coalesce(coalesce(started_at, ended_at), current_timestamp) as duration") }
81
+ virtual_column_scope :select_duration, -> { select("foreman_tasks_tasks.*, coalesce(ended_at, current_timestamp) - coalesce(coalesce(started_at, ended_at), current_timestamp) as duration") }
82
82
 
83
83
  apipie :class, "A class representing #{model_name.human} object" do
84
84
  name 'Task'
@@ -1,4 +1,2 @@
1
- object @task
2
-
3
1
  attributes :id, :action, :state, :result
4
- node(:humanized) { @task.humanized[:action] }
2
+ node(:humanized, &:to_label)
@@ -3,6 +3,9 @@ object @task if @task
3
3
  extends 'api/v2/layouts/permissions'
4
4
 
5
5
  attributes :id, :label, :pending, :action
6
- attributes :username, :started_at, :ended_at, :duration, :state, :result, :progress
6
+ attributes :username, :started_at, :ended_at, :state, :result, :progress
7
+
8
+ # A workaround for https://github.com/ruby/json/issues/957
9
+ node(:duration) { |t| t.duration&.in_seconds&.to_s if t.respond_to?(:duration) }
7
10
  attributes :input, :output, :humanized, :cli_example, :start_at
8
11
  node(:available_actions) { |t| { cancellable: t.execution_plan&.cancellable?, resumable: t.resumable? } }
data/config/routes.rb CHANGED
@@ -34,9 +34,9 @@ Foreman::Application.routes.draw do
34
34
  end
35
35
  resources :tasks, :only => [:index], constraints: ->(req) { req.format == :csv }
36
36
 
37
- match '/tasks' => 'react#index', :via => [:get]
38
- match '/tasks/:id/sub_tasks' => 'react#index', :via => [:get]
39
- match '/ex_tasks/:id' => 'react#index', :via => [:get]
37
+ match '/tasks', to: '/react#index', via: :get
38
+ match '/tasks/:id/sub_tasks', to: '/react#index', via: :get
39
+ match '/ex_tasks/:id', to: '/react#index', via: :get
40
40
 
41
41
  namespace :api do
42
42
  resources :recurring_logics, :only => [:index, :show, :update] do
@@ -23,10 +23,12 @@ same resource. It also optionally provides Dynflow infrastructure for using it f
23
23
  file.end_with?("test.rake") || file == '.packit.yaml'
24
24
  end
25
25
 
26
+ s.required_ruby_version = '>= 3.0', '< 4'
27
+
26
28
  s.test_files = `git ls-files test`.split("\n")
27
29
  s.extra_rdoc_files = Dir['README*', 'LICENSE']
28
30
 
29
- s.add_dependency "dynflow", '>= 1.9.0'
31
+ s.add_dependency "dynflow", '>= 2.0.0'
30
32
  s.add_dependency 'fugit', '~> 1.8'
31
33
  s.add_dependency "get_process_mem" # for memory polling
32
34
  s.add_dependency "sinatra" # for Dynflow web console
@@ -21,6 +21,7 @@ module ForemanTasks
21
21
 
22
22
  Foreman::Plugin.register :"foreman-tasks" do
23
23
  requires_foreman '>= 3.19'
24
+ register_global_js_file 'global'
24
25
  divider :top_menu, :parent => :monitor_menu, :last => true, :caption => N_('Foreman Tasks')
25
26
  menu :top_menu, :tasks,
26
27
  :url_hash => { :controller => 'foreman_tasks/tasks', :action => :index },
@@ -36,7 +37,6 @@ module ForemanTasks
36
37
 
37
38
  security_block :foreman_tasks do |_map|
38
39
  permission :view_foreman_tasks, { :'foreman_tasks/tasks' => [:auto_complete_search, :sub_tasks, :index, :summary, :summary_sub_tasks, :show],
39
- :'foreman_tasks/react' => [:index],
40
40
  :'foreman_tasks/api/tasks' => [:bulk_search, :show, :index, :summary, :summary_sub_tasks, :details, :sub_tasks] }, :resource_type => 'ForemanTasks::Task'
41
41
  permission :edit_foreman_tasks, { :'foreman_tasks/tasks' => [:resume, :unlock, :force_unlock, :cancel_step, :cancel, :abort],
42
42
  :'foreman_tasks/api/tasks' => [:bulk_resume, :bulk_cancel, :bulk_stop] }, :resource_type => 'ForemanTasks::Task'
@@ -324,7 +324,7 @@ namespace :foreman_tasks do
324
324
  format = ENV['TASK_FORMAT'] || 'html'
325
325
  export_filename = ENV['TASK_FILE'] || generate_filename(format)
326
326
 
327
- task_scope = ForemanTasks::Task.search_for(filter).with_duration.order(:started_at => :desc)
327
+ task_scope = ForemanTasks::Task.search_for(filter).select_duration.order(:started_at => :desc)
328
328
  id_scope = task_scope.group(:id, :started_at)
329
329
 
330
330
  puts _("Exporting all tasks matching filter #{filter}")
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = '12.0.0'.freeze
2
+ VERSION = '12.1.1'.freeze
3
3
  end
Binary file