foreman-tasks 12.0.0 → 12.1.0

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 (166) 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/models/foreman_tasks/task.rb +1 -1
  17. data/app/views/foreman_tasks/api/tasks/dependency_summary.json.rabl +1 -3
  18. data/app/views/foreman_tasks/api/tasks/show.json.rabl +4 -1
  19. data/config/routes.rb +3 -3
  20. data/foreman-tasks.gemspec +3 -1
  21. data/lib/foreman_tasks/engine.rb +1 -1
  22. data/lib/foreman_tasks/tasks/export_tasks.rake +1 -1
  23. data/lib/foreman_tasks/version.rb +1 -1
  24. data/locale/de/LC_MESSAGES/foreman_tasks.mo +0 -0
  25. data/locale/de/foreman_tasks.po +59 -23
  26. data/locale/en/LC_MESSAGES/foreman_tasks.mo +0 -0
  27. data/locale/en/foreman_tasks.po +56 -20
  28. data/locale/es/LC_MESSAGES/foreman_tasks.mo +0 -0
  29. data/locale/es/foreman_tasks.po +59 -23
  30. data/locale/foreman_tasks.pot +173 -100
  31. data/locale/fr/LC_MESSAGES/foreman_tasks.mo +0 -0
  32. data/locale/fr/foreman_tasks.po +61 -25
  33. data/locale/ja/LC_MESSAGES/foreman_tasks.mo +0 -0
  34. data/locale/ja/foreman_tasks.po +61 -25
  35. data/locale/ka/LC_MESSAGES/foreman_tasks.mo +0 -0
  36. data/locale/ka/foreman_tasks.po +60 -24
  37. data/locale/ko/LC_MESSAGES/foreman_tasks.mo +0 -0
  38. data/locale/ko/foreman_tasks.po +61 -25
  39. data/locale/pt_BR/LC_MESSAGES/foreman_tasks.mo +0 -0
  40. data/locale/pt_BR/foreman_tasks.po +59 -23
  41. data/locale/ru/LC_MESSAGES/foreman_tasks.mo +0 -0
  42. data/locale/ru/foreman_tasks.po +58 -22
  43. data/locale/zh_CN/LC_MESSAGES/foreman_tasks.mo +0 -0
  44. data/locale/zh_CN/foreman_tasks.po +61 -25
  45. data/locale/zh_TW/LC_MESSAGES/foreman_tasks.mo +0 -0
  46. data/locale/zh_TW/foreman_tasks.po +57 -21
  47. data/test/controllers/api/tasks_controller_test.rb +29 -3
  48. data/test/controllers/tasks_controller_test.rb +46 -2
  49. data/webpack/ForemanTasks/Components/TaskActions/TaskAction.test.js +8 -0
  50. data/webpack/ForemanTasks/Components/TaskActions/TaskActionHelpers.js +8 -2
  51. data/webpack/ForemanTasks/Components/TaskActions/TaskActionHelpers.test.js +25 -33
  52. data/webpack/ForemanTasks/Components/TaskActions/index.js +24 -3
  53. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +6 -6
  54. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +9 -0
  55. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +16 -11
  56. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/TasksTimeRow.js +2 -3
  57. data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksTimeRow/__snapshots__/TasksTimeRow.test.js.snap +4 -8
  58. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.js +2 -4
  59. data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.scss +0 -3
  60. data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboard.test.js.snap +2 -5
  61. data/webpack/ForemanTasks/Components/{common/ActionButtons/ActionButton.js → TasksTable/Components/CellActionButton.js} +36 -21
  62. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/index.test.js +32 -29
  63. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/createBulkTaskModal.js +14 -18
  64. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/createTaskModal.js +13 -15
  65. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/index.js +7 -7
  66. data/webpack/ForemanTasks/Components/TasksTable/TasksBulkActions.js +16 -23
  67. data/webpack/ForemanTasks/Components/TasksTable/TasksColumns.js +56 -0
  68. data/webpack/ForemanTasks/Components/TasksTable/TasksIndexPage.js +277 -3
  69. data/webpack/ForemanTasks/Components/TasksTable/TasksModals.js +96 -0
  70. data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +10 -18
  71. data/webpack/ForemanTasks/Components/TasksTable/TasksTableHelpers.js +3 -3
  72. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksBulkActions.test.js +130 -63
  73. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksIndexPage.test.js +315 -8
  74. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.fixtures.js +214 -41
  75. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableHelpers.test.js +20 -12
  76. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksBulkActions.test.js.snap +18 -35
  77. data/webpack/ForemanTasks/ForemanTasksReducers.js +0 -4
  78. data/webpack/Routes/routes.js +22 -0
  79. data/webpack/Routes/routes.test.js +95 -0
  80. data/webpack/global_index.js +10 -0
  81. data/webpack/index.js +0 -18
  82. data/webpack/test_setup.js +1 -0
  83. metadata +15 -89
  84. data/app/controllers/foreman_tasks/react_controller.rb +0 -17
  85. data/app/views/foreman_tasks/layouts/react.html.erb +0 -13
  86. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalSelectors.js +0 -30
  87. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js +0 -66
  88. data/webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/__snapshots__/ConfirmModalSelectors.test.js.snap +0 -33
  89. data/webpack/ForemanTasks/Components/TasksTable/Components/SelectAllAlert.js +0 -49
  90. data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionCell.js +0 -32
  91. data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionHeaderCell.js +0 -38
  92. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/SelectAllAlert.test.js +0 -29
  93. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionCell.test.js +0 -15
  94. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionHeaderCell.test.js +0 -15
  95. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/SelectAllAlert.test.js.snap +0 -81
  96. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionCell.test.js.snap +0 -14
  97. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionHeaderCell.test.js.snap +0 -15
  98. data/webpack/ForemanTasks/Components/TasksTable/SubTasksPage.js +0 -40
  99. data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +0 -163
  100. data/webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js +0 -108
  101. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +0 -234
  102. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.scss +0 -20
  103. data/webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js +0 -68
  104. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSchema.js +0 -85
  105. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSelectors.js +0 -63
  106. data/webpack/ForemanTasks/Components/TasksTable/__tests__/SubTasksPage.test.js +0 -20
  107. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.test.js +0 -9
  108. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActions.test.js +0 -65
  109. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTablePage.test.js +0 -35
  110. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableReducer.test.js +0 -87
  111. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap +0 -48
  112. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap +0 -39
  113. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTable.test.js.snap +0 -52
  114. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableActions.test.js.snap +0 -40
  115. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +0 -368
  116. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap +0 -116
  117. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionCellFormatter.test.js.snap +0 -15
  118. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionNameCellFormatter.test.js.snap +0 -10
  119. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/dateCellFormmatter.test.js.snap +0 -9
  120. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/durationCellFormmatter.test.js.snap +0 -18
  121. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionCellFormatter.test.js.snap +0 -12
  122. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionHeaderCellFormatter.test.js.snap +0 -11
  123. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionCellFormatter.test.js +0 -11
  124. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionNameCellFormatter.test.js +0 -8
  125. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/dateCellFormmatter.test.js +0 -7
  126. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/durationCellFormmatter.test.js +0 -12
  127. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionCellFormatter.test.js +0 -12
  128. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionHeaderCellFormatter.test.js +0 -12
  129. data/webpack/ForemanTasks/Components/TasksTable/formatters/actionCellFormatter.js +0 -19
  130. data/webpack/ForemanTasks/Components/TasksTable/formatters/actionNameCellFormatter.js +0 -9
  131. data/webpack/ForemanTasks/Components/TasksTable/formatters/dateCellFormmatter.js +0 -7
  132. data/webpack/ForemanTasks/Components/TasksTable/formatters/durationCellFormmatter.js +0 -7
  133. data/webpack/ForemanTasks/Components/TasksTable/formatters/index.js +0 -7
  134. data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionCellFormatter.js +0 -17
  135. data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionHeaderCellFormatter.js +0 -11
  136. data/webpack/ForemanTasks/Components/TasksTable/index.js +0 -42
  137. data/webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.test.js +0 -101
  138. data/webpack/ForemanTasks/Components/common/ActionButtons/__snapshots__/ActionButton.test.js.snap +0 -95
  139. data/webpack/ForemanTasks/ForemanTasks.js +0 -11
  140. data/webpack/ForemanTasks/ForemanTasks.test.js +0 -10
  141. data/webpack/ForemanTasks/Routes/ForemanTasksRouter.js +0 -14
  142. data/webpack/ForemanTasks/Routes/ForemanTasksRouter.test.js +0 -26
  143. data/webpack/ForemanTasks/Routes/ForemanTasksRoutes.js +0 -23
  144. data/webpack/ForemanTasks/Routes/ForemanTasksRoutes.test.js +0 -16
  145. data/webpack/ForemanTasks/Routes/__snapshots__/ForemanTasksRouter.test.js.snap +0 -16
  146. data/webpack/ForemanTasks/Routes/__snapshots__/ForemanTasksRoutes.test.js.snap +0 -37
  147. data/webpack/ForemanTasks/__snapshots__/ForemanTasks.test.js.snap +0 -7
  148. data/webpack/ForemanTasks/index.js +0 -1
  149. data/webpack/__mocks__/foremanReact/common/I18n.js +0 -7
  150. data/webpack/__mocks__/foremanReact/common/helpers.js +0 -6
  151. data/webpack/__mocks__/foremanReact/common/urlHelpers.js +0 -1
  152. data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +0 -2
  153. data/webpack/__mocks__/foremanReact/components/Pagination/index.js +0 -2
  154. data/webpack/__mocks__/foremanReact/components/ToastsList/index.js +0 -8
  155. data/webpack/__mocks__/foremanReact/components/common/ActionButtons/ActionButtons.js +0 -3
  156. data/webpack/__mocks__/foremanReact/components/common/MessageBox.js +0 -4
  157. data/webpack/__mocks__/foremanReact/components/common/dates/LongDateTime.js +0 -5
  158. data/webpack/__mocks__/foremanReact/components/common/dates/RelativeDateTime.js +0 -3
  159. data/webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js +0 -7
  160. data/webpack/__mocks__/foremanReact/components/common/table.js +0 -5
  161. data/webpack/__mocks__/foremanReact/constants.js +0 -24
  162. data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +0 -10
  163. data/webpack/__mocks__/foremanReact/redux/API/index.js +0 -10
  164. data/webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js +0 -5
  165. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js +0 -10
  166. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js +0 -5
@@ -5,7 +5,7 @@
5
5
  # Translators:
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: foreman-tasks 11.0.5\n"
8
+ "Project-Id-Version: foreman-tasks 12.0.0\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "PO-Revision-Date: 2016-02-12 14:04+0000\n"
11
11
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
@@ -23,9 +23,6 @@ msgstr "%(last)s 最后 %(time)s"
23
23
  msgid "%(older)s Older %(time)s"
24
24
  msgstr "%(older)s 较老 %(time)s"
25
25
 
26
- msgid "%s Selected Tasks"
27
- msgstr "%s 选择的任务"
28
-
29
26
  msgid "%s is not valid format of cron line"
30
27
  msgstr "%s 不是正确的 cron 行"
31
28
 
@@ -63,13 +60,13 @@ msgid "Action"
63
60
  msgstr "操作"
64
61
 
65
62
  msgid "Action with sub plans"
66
- msgstr ""
63
+ msgstr "有子计划的操作"
67
64
 
68
65
  msgid "Active"
69
66
  msgstr "活跃"
70
67
 
71
- msgid "Active Filters:"
72
- msgstr "活跃的过滤器:"
68
+ msgid "Active Filters"
69
+ msgstr ""
73
70
 
74
71
  msgid "Active or disabled recurring logic with purpose %s already exists"
75
72
  msgstr "带有目的 %s 的活跃或禁用的周期性逻辑已存在"
@@ -99,6 +96,9 @@ msgstr "返回到任务"
99
96
  msgid "Backtrace"
100
97
  msgstr "回溯"
101
98
 
99
+ msgid "Blocks"
100
+ msgstr ""
101
+
102
102
  msgid "Bulk action"
103
103
  msgstr "批量操作"
104
104
 
@@ -108,6 +108,12 @@ msgstr "取消"
108
108
  msgid "Cancel Selected"
109
109
  msgstr "取消选择"
110
110
 
111
+ msgid "Cancel Selected Tasks"
112
+ msgstr ""
113
+
114
+ msgid "Cancel Task"
115
+ msgstr ""
116
+
111
117
  msgid "Cancel enforced: the task might be still running on the proxy"
112
118
  msgstr "强制取消:任务可能仍在代理服务器上运行"
113
119
 
@@ -117,9 +123,6 @@ msgstr "取消重复逻辑"
117
123
  msgid "Cancel selected cancellable tasks"
118
124
  msgstr "取消所选的可取消的任务"
119
125
 
120
- msgid "Cancel selected tasks"
121
- msgstr "取消选择的任务"
122
-
123
126
  msgid "Cancel specific tasks by ID"
124
127
  msgstr "根据 ID 取消特定任务"
125
128
 
@@ -153,9 +156,6 @@ msgstr "将请求 id %{request_id} 改为保存的 id %%{saved_id}"
153
156
  msgid "Check for long running tasks"
154
157
  msgstr "检查长时间运行的任务"
155
158
 
156
- msgid "Clear All Filters"
157
- msgstr "清除所有过滤器"
158
-
159
159
  msgid "Clear Cancelled"
160
160
  msgstr "清除取消"
161
161
 
@@ -198,6 +198,12 @@ msgstr "通过搜索查询删除重复逻辑"
198
198
  msgid "Deliver notifications about long running tasks"
199
199
  msgstr "提供有关长时间运行的任务的通知"
200
200
 
201
+ msgid "Dependencies"
202
+ msgstr ""
203
+
204
+ msgid "Depends on"
205
+ msgstr ""
206
+
201
207
  msgid "Details"
202
208
  msgstr "详情"
203
209
 
@@ -276,12 +282,15 @@ msgstr "强制取消"
276
282
  msgid "Force Cancel Selected"
277
283
  msgstr "强制取消选择"
278
284
 
279
- msgid "Force Cancel selected tasks"
280
- msgstr "强制取消选择的任务"
281
-
282
285
  msgid "Force Unlock"
283
286
  msgstr "强制解除锁定"
284
287
 
288
+ msgid "Force Unlock Selected Tasks"
289
+ msgstr ""
290
+
291
+ msgid "Force Unlock Task"
292
+ msgstr ""
293
+
285
294
  msgid "Foreman Tasks"
286
295
  msgstr "Foreman 任务"
287
296
 
@@ -316,7 +325,7 @@ msgid "Input"
316
325
  msgstr "输入"
317
326
 
318
327
  msgid "Invalid URL"
319
- msgstr ""
328
+ msgstr "无效 URL"
320
329
 
321
330
  msgid "Iteration limit"
322
331
  msgstr "重述限制"
@@ -396,6 +405,9 @@ msgstr "无法启动任何任务"
396
405
  msgid "No. of Tasks"
397
406
  msgstr "任务号"
398
407
 
408
+ msgid "None"
409
+ msgstr ""
410
+
399
411
  msgid "Not all the selected tasks can be cancelled"
400
412
  msgstr "并非所有选定的任务都可以取消"
401
413
 
@@ -520,12 +532,15 @@ msgstr "恢复"
520
532
  msgid "Resume Selected"
521
533
  msgstr "恢复选择"
522
534
 
535
+ msgid "Resume Selected Tasks"
536
+ msgstr ""
537
+
538
+ msgid "Resume Task"
539
+ msgstr ""
540
+
523
541
  msgid "Resume all paused error tasks"
524
542
  msgstr "恢复所有暂停的错误任务"
525
543
 
526
- msgid "Resume selected tasks"
527
- msgstr "恢复选择的任务"
528
-
529
544
  msgid "Resume specific tasks by ID"
530
545
  msgstr "根据 ID 恢复特定任务"
531
546
 
@@ -559,9 +574,6 @@ msgstr "搜索查询"
559
574
  msgid "See %{link} for more details on how to resolve the issue"
560
575
  msgstr "有关如何解决此问题的更多详细信息,请参见%{link}"
561
576
 
562
- msgid "Select Action"
563
- msgstr "选择操作"
564
-
565
577
  msgid "Select all {count} tasks"
566
578
  msgstr "选择所有 {count} 任务"
567
579
 
@@ -619,6 +631,9 @@ msgstr "停止与搜索字符串匹配的任务"
619
631
  msgid "Stopped"
620
632
  msgstr "停止"
621
633
 
634
+ msgid "Stopped tasks by result"
635
+ msgstr ""
636
+
622
637
  msgid "Sub tasks"
623
638
  msgstr "子任务"
624
639
 
@@ -652,6 +667,9 @@ msgstr "任务无法取消"
652
667
  msgid "Task count"
653
668
  msgstr "任务计数"
654
669
 
670
+ msgid "Task dependencies"
671
+ msgstr ""
672
+
655
673
  msgid "Task group common"
656
674
  msgstr "任务组一般事项"
657
675
 
@@ -704,8 +722,26 @@ msgstr[0] "系统中有%{count}个暂停的任务需要注意"
704
722
  msgid "This action will delete all cancelled recurring logics. Please note that this action can't be reversed."
705
723
  msgstr "此操作将删除所有取消的重复逻辑。请注意,此操作无法撤消。"
706
724
 
707
- msgid "This will %(action)s %(number)s task(s), putting them in the %(state)s state. Are you sure?"
708
- msgstr "这将 %(action)s %(number)s 任务,把它们置于 %(state)s 状态。确定吗?"
725
+ msgid "This task may have dependencies on other tasks or may be blocking other tasks from executing. Dependencies are established through task chaining relationships."
726
+ msgstr ""
727
+
728
+ msgid "This will cancel %(number)s task(s), putting them in the stopped state. Are you sure?"
729
+ msgstr ""
730
+
731
+ msgid "This will cancel task \\\"%(taskName)s\\\", putting it in the stopped state. Are you sure?"
732
+ msgstr ""
733
+
734
+ msgid "This will force unlock %(number)s task(s). This may cause harm and should be used with caution. Are you sure?"
735
+ msgstr ""
736
+
737
+ msgid "This will force unlock task \\\"%(taskName)s\\\". This may cause harm and should be used with caution. Are you sure?"
738
+ msgstr ""
739
+
740
+ msgid "This will resume %(number)s task(s), putting them in the running state. Are you sure?"
741
+ msgstr ""
742
+
743
+ msgid "This will resume task \\\"%(taskName)s\\\", putting it in the running state. Are you sure?"
744
+ msgstr ""
709
745
 
710
746
  msgid "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."
711
747
  msgstr "这将解锁任务正在针对其运行的资源。请注意,这可能会导致状态不一致,应该谨慎使用,然后再确保任务无法恢复。"
@@ -5,7 +5,7 @@
5
5
  # Translators:
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: foreman-tasks 11.0.5\n"
8
+ "Project-Id-Version: foreman-tasks 12.0.0\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "PO-Revision-Date: 2016-02-12 14:04+0000\n"
11
11
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
@@ -23,9 +23,6 @@ msgstr ""
23
23
  msgid "%(older)s Older %(time)s"
24
24
  msgstr ""
25
25
 
26
- msgid "%s Selected Tasks"
27
- msgstr ""
28
-
29
26
  msgid "%s is not valid format of cron line"
30
27
  msgstr "%s 不是 cron 行的正確格式"
31
28
 
@@ -68,7 +65,7 @@ msgstr ""
68
65
  msgid "Active"
69
66
  msgstr "啟用中"
70
67
 
71
- msgid "Active Filters:"
68
+ msgid "Active Filters"
72
69
  msgstr ""
73
70
 
74
71
  msgid "Active or disabled recurring logic with purpose %s already exists"
@@ -99,6 +96,9 @@ msgstr ""
99
96
  msgid "Backtrace"
100
97
  msgstr "追蹤"
101
98
 
99
+ msgid "Blocks"
100
+ msgstr ""
101
+
102
102
  msgid "Bulk action"
103
103
  msgstr "批次動作"
104
104
 
@@ -108,6 +108,12 @@ msgstr "取消"
108
108
  msgid "Cancel Selected"
109
109
  msgstr ""
110
110
 
111
+ msgid "Cancel Selected Tasks"
112
+ msgstr ""
113
+
114
+ msgid "Cancel Task"
115
+ msgstr ""
116
+
111
117
  msgid "Cancel enforced: the task might be still running on the proxy"
112
118
  msgstr "強制取消:任務可能還在代理伺服器上執行"
113
119
 
@@ -117,9 +123,6 @@ msgstr "取消週期邏輯"
117
123
  msgid "Cancel selected cancellable tasks"
118
124
  msgstr ""
119
125
 
120
- msgid "Cancel selected tasks"
121
- msgstr ""
122
-
123
126
  msgid "Cancel specific tasks by ID"
124
127
  msgstr ""
125
128
 
@@ -153,9 +156,6 @@ msgstr ""
153
156
  msgid "Check for long running tasks"
154
157
  msgstr ""
155
158
 
156
- msgid "Clear All Filters"
157
- msgstr ""
158
-
159
159
  msgid "Clear Cancelled"
160
160
  msgstr ""
161
161
 
@@ -198,6 +198,12 @@ msgstr ""
198
198
  msgid "Deliver notifications about long running tasks"
199
199
  msgstr ""
200
200
 
201
+ msgid "Dependencies"
202
+ msgstr ""
203
+
204
+ msgid "Depends on"
205
+ msgstr ""
206
+
201
207
  msgid "Details"
202
208
  msgstr "詳細資訊"
203
209
 
@@ -276,12 +282,15 @@ msgstr ""
276
282
  msgid "Force Cancel Selected"
277
283
  msgstr ""
278
284
 
279
- msgid "Force Cancel selected tasks"
280
- msgstr ""
281
-
282
285
  msgid "Force Unlock"
283
286
  msgstr "強制解除鎖定"
284
287
 
288
+ msgid "Force Unlock Selected Tasks"
289
+ msgstr ""
290
+
291
+ msgid "Force Unlock Task"
292
+ msgstr ""
293
+
285
294
  msgid "Foreman Tasks"
286
295
  msgstr ""
287
296
 
@@ -396,6 +405,9 @@ msgstr ""
396
405
  msgid "No. of Tasks"
397
406
  msgstr "任務編號"
398
407
 
408
+ msgid "None"
409
+ msgstr ""
410
+
399
411
  msgid "Not all the selected tasks can be cancelled"
400
412
  msgstr ""
401
413
 
@@ -520,12 +532,15 @@ msgstr "繼續"
520
532
  msgid "Resume Selected"
521
533
  msgstr ""
522
534
 
523
- msgid "Resume all paused error tasks"
524
- msgstr "繼續所有處於暫停狀態的錯誤任務"
535
+ msgid "Resume Selected Tasks"
536
+ msgstr ""
525
537
 
526
- msgid "Resume selected tasks"
538
+ msgid "Resume Task"
527
539
  msgstr ""
528
540
 
541
+ msgid "Resume all paused error tasks"
542
+ msgstr "繼續所有處於暫停狀態的錯誤任務"
543
+
529
544
  msgid "Resume specific tasks by ID"
530
545
  msgstr "透過 ID 繼續特定任務"
531
546
 
@@ -559,9 +574,6 @@ msgstr "搜尋查詢"
559
574
  msgid "See %{link} for more details on how to resolve the issue"
560
575
  msgstr ""
561
576
 
562
- msgid "Select Action"
563
- msgstr "選擇動作"
564
-
565
577
  msgid "Select all {count} tasks"
566
578
  msgstr ""
567
579
 
@@ -619,6 +631,9 @@ msgstr ""
619
631
  msgid "Stopped"
620
632
  msgstr ""
621
633
 
634
+ msgid "Stopped tasks by result"
635
+ msgstr ""
636
+
622
637
  msgid "Sub tasks"
623
638
  msgstr "子任務"
624
639
 
@@ -652,6 +667,9 @@ msgstr ""
652
667
  msgid "Task count"
653
668
  msgstr "工作數量"
654
669
 
670
+ msgid "Task dependencies"
671
+ msgstr ""
672
+
655
673
  msgid "Task group common"
656
674
  msgstr "任務群組的一般事項"
657
675
 
@@ -705,7 +723,25 @@ msgstr[1] ""
705
723
  msgid "This action will delete all cancelled recurring logics. Please note that this action can't be reversed."
706
724
  msgstr ""
707
725
 
708
- msgid "This will %(action)s %(number)s task(s), putting them in the %(state)s state. Are you sure?"
726
+ msgid "This task may have dependencies on other tasks or may be blocking other tasks from executing. Dependencies are established through task chaining relationships."
727
+ msgstr ""
728
+
729
+ msgid "This will cancel %(number)s task(s), putting them in the stopped state. Are you sure?"
730
+ msgstr ""
731
+
732
+ msgid "This will cancel task \\\"%(taskName)s\\\", putting it in the stopped state. Are you sure?"
733
+ msgstr ""
734
+
735
+ msgid "This will force unlock %(number)s task(s). This may cause harm and should be used with caution. Are you sure?"
736
+ msgstr ""
737
+
738
+ msgid "This will force unlock task \\\"%(taskName)s\\\". This may cause harm and should be used with caution. Are you sure?"
739
+ msgstr ""
740
+
741
+ msgid "This will resume %(number)s task(s), putting them in the running state. Are you sure?"
742
+ msgstr ""
743
+
744
+ msgid "This will resume task \\\"%(taskName)s\\\", putting it in the running state. Are you sure?"
709
745
  msgstr ""
710
746
 
711
747
  msgid "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."
@@ -37,7 +37,7 @@ module ForemanTasks
37
37
  end
38
38
 
39
39
  it 'supports ordering by duration' do
40
- get :index, params: { :sort_by => 'duration' }
40
+ get :index, params: { :order => 'duration' }
41
41
  assert_response :success
42
42
  data = JSON.parse(response.body)
43
43
  assert_equal 'duration', data.dig('sort', 'by')
@@ -104,7 +104,7 @@ module ForemanTasks
104
104
  end
105
105
 
106
106
  it 'shows duration column' do
107
- task = ForemanTasks::Task.with_duration.find(FactoryBot.create(:dynflow_task).id)
107
+ task = ForemanTasks::Task.select_duration.find(FactoryBot.create(:dynflow_task).id)
108
108
  get :show, params: { id: task.id }, session: set_session_user
109
109
  assert_response :success
110
110
  data = JSON.parse(response.body)
@@ -114,7 +114,7 @@ module ForemanTasks
114
114
 
115
115
  describe 'GET /api/tasks/index' do
116
116
  it 'shows duration column' do
117
- task = ForemanTasks::Task.with_duration.find(FactoryBot.create(:dynflow_task).id)
117
+ task = ForemanTasks::Task.select_duration.find(FactoryBot.create(:dynflow_task).id)
118
118
  get :index, session: set_session_user
119
119
  assert_response :success
120
120
  data = JSON.parse(response.body)
@@ -203,6 +203,32 @@ module ForemanTasks
203
203
  end
204
204
  end
205
205
 
206
+ describe 'GET /api/tasks/:id/details' do
207
+ it 'shows task dependencies with correct task names' do
208
+ # Tests https://projects.theforeman.org/issues/39130
209
+ dependency_task = FactoryBot.create(:dynflow_task, :user_create_task, label: 'Actions::User::Create')
210
+ blocking_task = FactoryBot.create(:dynflow_task, :user_create_task, label: 'Actions::User::Create')
211
+
212
+ ForemanTasks.dynflow.world.persistence.stubs(:find_execution_plan_dependencies)
213
+ .with(dependency_task.execution_plan.id)
214
+ .returns([])
215
+ ForemanTasks.dynflow.world.persistence.stubs(:find_blocked_execution_plans)
216
+ .with(dependency_task.execution_plan.id)
217
+ .returns([blocking_task.external_id])
218
+
219
+ get :details, params: { id: dependency_task.id }
220
+ assert_response :success
221
+
222
+ data = JSON.parse(response.body)
223
+ assert_kind_of Array, data['blocks']
224
+ assert_equal 1, data['blocks'].length
225
+
226
+ blocking_task_data = data['blocks'].first
227
+ assert_equal blocking_task.id, blocking_task_data['id']
228
+ assert_equal blocking_task.to_label, blocking_task_data['humanized']
229
+ end
230
+ end
231
+
206
232
  describe 'POST /api/tasks/bulk_stop' do
207
233
  it 'requires search or task_ids parameter' do
208
234
  post :bulk_stop
@@ -93,7 +93,7 @@ module ForemanTasks
93
93
 
94
94
  describe 'index' do
95
95
  it 'shows duration column' do
96
- task = ForemanTasks::Task.with_duration.find(FactoryBot.create(:some_task).id)
96
+ task = ForemanTasks::Task.select_duration.find(FactoryBot.create(:some_task).id)
97
97
  get(:index, params: {}, session: set_session_user)
98
98
  assert_response :success
99
99
  row = CSV.parse(response.body, headers: true).first
@@ -122,7 +122,7 @@ module ForemanTasks
122
122
 
123
123
  it 'shows duration column' do
124
124
  parent = ForemanTasks::Task.find(FactoryBot.create(:some_task).id)
125
- child = ForemanTasks::Task.with_duration.find(FactoryBot.create(:some_task).id)
125
+ child = ForemanTasks::Task.select_duration.find(FactoryBot.create(:some_task).id)
126
126
  child.parent_task_id = parent.id
127
127
  child.save!
128
128
  get(:sub_tasks, params: { id: parent.id }, session: set_session_user)
@@ -168,6 +168,50 @@ module ForemanTasks
168
168
  end
169
169
  end
170
170
  end
171
+
172
+ describe 'cancel' do
173
+ it 'finds the dynflow task and cancels it' do
174
+ task = FactoryBot.create(:dynflow_task)
175
+ ForemanTasks::Task::DynflowTask.any_instance.stubs(:cancel).returns(true)
176
+
177
+ post(:cancel, params: { id: task.id }, session: set_session_user)
178
+
179
+ assert_response :success
180
+ data = JSON.parse(response.body)
181
+ assert_equal 'OK', data['statusText']
182
+ end
183
+
184
+ it 'returns bad request when task cannot be cancelled' do
185
+ task = FactoryBot.create(:dynflow_task)
186
+ ForemanTasks::Task::DynflowTask.any_instance.stubs(:cancel).returns(false)
187
+
188
+ post(:cancel, params: { id: task.id }, session: set_session_user)
189
+
190
+ assert_response :bad_request
191
+ end
192
+ end
193
+
194
+ describe 'abort' do
195
+ it 'finds the dynflow task and aborts it' do
196
+ task = FactoryBot.create(:dynflow_task)
197
+ ForemanTasks::Task::DynflowTask.any_instance.stubs(:abort).returns(true)
198
+
199
+ post(:abort, params: { id: task.id }, session: set_session_user)
200
+
201
+ assert_response :success
202
+ data = JSON.parse(response.body)
203
+ assert_equal 'OK', data['statusText']
204
+ end
205
+
206
+ it 'returns bad request when the task cannot be aborted' do
207
+ task = FactoryBot.create(:dynflow_task)
208
+ ForemanTasks::Task::DynflowTask.any_instance.stubs(:abort).returns(false)
209
+
210
+ post(:abort, params: { id: task.id }, session: set_session_user)
211
+
212
+ assert_response :bad_request
213
+ end
214
+ end
171
215
  end
172
216
  end
173
217
  end
@@ -12,6 +12,14 @@ jest.mock('foremanReact/components/common/table', () => ({
12
12
  }));
13
13
 
14
14
  jest.mock('foremanReact/redux/API');
15
+ jest.mock('foremanReact/components/ToastsList', () => ({
16
+ addToast: toast => ({
17
+ type: 'TOASTS_ADD',
18
+ payload: {
19
+ message: toast,
20
+ },
21
+ }),
22
+ }));
15
23
 
16
24
  const task = ['some-id', 'some-name'];
17
25
 
@@ -1,5 +1,6 @@
1
1
  import { translate as __, sprintf } from 'foremanReact/common/I18n';
2
2
  import { addToast } from 'foremanReact/components/ToastsList';
3
+ import { getURIQuery } from 'foremanReact/common/helpers';
3
4
  import { TASKS_DASHBOARD_JS_QUERY_MODES } from '../TasksDashboard/TasksDashboardConstants';
4
5
  import { timeToHoursNumber } from '../TasksDashboard/TasksDashboardHelper';
5
6
  import {
@@ -8,7 +9,12 @@ import {
8
9
  warningToastData,
9
10
  } from '../common/ToastsHelpers';
10
11
 
11
- export const convertDashboardQuery = query => {
12
+ const getTasksQuery = () => {
13
+ const url = window.location.pathname + window.location.search;
14
+ return getURIQuery(url);
15
+ };
16
+
17
+ export const convertDashboardQuery = () => {
12
18
  const {
13
19
  time_mode: timeMode,
14
20
  time_horizon: timeHorizon,
@@ -16,7 +22,7 @@ export const convertDashboardQuery = query => {
16
22
  result,
17
23
  search,
18
24
  ...rest
19
- } = query;
25
+ } = getTasksQuery();
20
26
 
21
27
  const hours = timeToHoursNumber(timeHorizon);
22
28
  const timestamp = new Date(new Date() - hours * 60 * 60 * 1000);
@@ -1,14 +1,19 @@
1
1
  import { convertDashboardQuery } from './TaskActionHelpers';
2
- import {
3
- TASKS_DASHBOARD_JS_QUERY_MODES,
4
- TASKS_DASHBOARD_AVAILABLE_TIMES,
5
- } from '../TasksDashboard/TasksDashboardConstants';
6
2
 
7
3
  let realDate;
8
4
 
9
5
  describe('convertDashboardQuery', () => {
6
+ const mockLocation = query => {
7
+ global.window = Object.create(window);
8
+ Object.defineProperty(window, 'location', {
9
+ value: {
10
+ pathname: '/foreman_tasks/tasks',
11
+ search: query,
12
+ },
13
+ writable: true,
14
+ });
15
+ };
10
16
  it('convertDashboardQuery should work with full query', () => {
11
- // Setup
12
17
  const currentDate = new Date('2020-05-08T11:01:58.135Z');
13
18
  realDate = Date;
14
19
  global.Date = class extends Date {
@@ -20,48 +25,35 @@ describe('convertDashboardQuery', () => {
20
25
  return currentDate;
21
26
  }
22
27
  };
23
- const query = {
24
- time_mode: TASKS_DASHBOARD_JS_QUERY_MODES.RECENT,
25
- time_horizon: TASKS_DASHBOARD_AVAILABLE_TIMES.WEEK,
26
- state: 'stopped',
27
- result: 'error',
28
- search: 'action~job',
29
- };
30
- const expected =
31
- '(state=stopped) and (result=error) and (action~job) and (state_updated_at>2020-05-01T11:01:58.135Z or null? state_updated_at)';
28
+ mockLocation('?state=stopped&result=error&search=action~job');
29
+ const expected = '(state=stopped) and (result=error) and (action~job)';
32
30
 
33
- expect(convertDashboardQuery(query)).toEqual({ search: expected });
31
+ expect(convertDashboardQuery()).toEqual({ search: expected });
34
32
 
35
- const query2 = {
36
- ...query,
37
- time_mode: TASKS_DASHBOARD_JS_QUERY_MODES.OLDER,
38
- };
39
- const expected2 =
40
- '(state=stopped) and (result=error) and (action~job) and (state_updated_at<=2020-05-01T11:01:58.135Z)';
41
- expect(convertDashboardQuery(query2)).toEqual({ search: expected2 });
42
- // Cleanup
33
+ mockLocation('?state=stopped&result=error&search=action~job');
34
+ const expected2 = '(state=stopped) and (result=error) and (action~job)';
35
+ expect(convertDashboardQuery()).toEqual({ search: expected2 });
43
36
  global.Date = realDate;
44
37
  });
45
38
  it('convertDashboardQuery should work with only search query', () => {
46
- const query = {
47
- search: 'action~job',
48
- };
49
- expect(convertDashboardQuery(query)).toEqual({ search: '(action~job)' });
39
+ mockLocation('?search=action~job');
40
+ expect(convertDashboardQuery()).toEqual({ search: '(action~job)' });
50
41
  });
51
42
  it('convertDashboardQuery should work with no query', () => {
52
- const query = {};
53
- expect(convertDashboardQuery(query)).toEqual({});
43
+ mockLocation('');
44
+ expect(convertDashboardQuery()).toEqual({});
54
45
  });
55
46
  it('convertDashboardQuery should not override unknown keys', () => {
56
- const query = { weather: 'nice', search: 'okay', number: 7 };
57
- expect(convertDashboardQuery(query)).toEqual({
47
+ const query = { weather: 'nice', search: 'okay', number: '7' };
48
+ mockLocation('?weather=nice&search=okay&number=7');
49
+ expect(convertDashboardQuery()).toEqual({
58
50
  ...query,
59
51
  search: '(okay)',
60
52
  });
61
53
  });
62
54
  it('convertDashboardQuery should expand other result', () => {
63
- const query = { result: 'other' };
64
- expect(convertDashboardQuery(query)).toEqual({
55
+ mockLocation('?result=other');
56
+ expect(convertDashboardQuery()).toEqual({
65
57
  search: '(result ^ (pending, cancelled))',
66
58
  });
67
59
  });