foreman-tasks 7.2.0 → 7.2.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.
- checksums.yaml +4 -4
- data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +2 -2
- data/app/lib/actions/middleware/watch_delegated_proxy_sub_tasks.rb +1 -1
- data/app/models/foreman_tasks/recurring_logic.rb +8 -0
- data/app/views/foreman_tasks/api/recurring_logics/base.json.rabl +6 -1
- data/app/views/foreman_tasks/recurring_logics/index.html.erb +1 -1
- data/config/routes.rb +0 -1
- data/db/migrate/20211123170430_tasks_settings_to_dsl_category.rb +1 -1
- data/lib/foreman_tasks/version.rb +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskButtons.test.js.snap +2 -2
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +2 -2
- data/webpack/ForemanTasks/Components/TasksTable/Components/SelectAllAlert.js +9 -3
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/SelectAllAlert.test.js.snap +23 -17
- data/webpack/ForemanTasks/Components/TasksTable/TasksBulkActions.js +3 -3
- data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +2 -2
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTable.test.js.snap +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84fbe8d91ad4109b2f32bed34ca474da3274062d1413572f22da460ba84fae2e
|
4
|
+
data.tar.gz: 6176aacd201d2652ffdec31de70a37f34f3cdee4213fcabbea5206692fa3737c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fe679d1b7eef698c3ec42e4d31590cc674e556a91cdd490c4da01aa7ba61988c9a1c1f730972a9d55829b09550fe4235e7192157b976aa71398558a632bae70
|
7
|
+
data.tar.gz: 581e0a7c39164915da8f19505745f6b7c98cbe4dbdbc088073e6fc7d6224b4fb209443ac48a566e008c59ee0e7b53a351b70808efa72d2ffa6fa7c0cd79f0521
|
@@ -52,8 +52,8 @@ module ForemanTasks
|
|
52
52
|
default = '-'
|
53
53
|
return default if recurring_logic.done? || recurring_logic.disabled?
|
54
54
|
|
55
|
-
|
56
|
-
|
55
|
+
upcoming_task = recurring_logic.next_task
|
56
|
+
upcoming_task ? upcoming_task.start_at : default
|
57
57
|
end
|
58
58
|
|
59
59
|
def time_f(f, attr, field_options = {}, time_options = {}, html_options = {})
|
@@ -51,7 +51,7 @@ module Actions
|
|
51
51
|
|
52
52
|
def notify(event, tasks)
|
53
53
|
tasks.each do |task|
|
54
|
-
action.plan_event(event, execution_plan_id: task.execution_plan_id, step_id: task.step_id)
|
54
|
+
action.plan_event(event, execution_plan_id: task.execution_plan_id, step_id: task.step_id, optional: true)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -29,6 +29,14 @@ module ForemanTasks
|
|
29
29
|
%w[active disabled finished cancelled failed]
|
30
30
|
end
|
31
31
|
|
32
|
+
def last_task
|
33
|
+
tasks.order(:started_at).where.not(started_at: nil).last
|
34
|
+
end
|
35
|
+
|
36
|
+
def next_task
|
37
|
+
tasks.order(:start_at).where(started_at: nil).last
|
38
|
+
end
|
39
|
+
|
32
40
|
def enabled=(value)
|
33
41
|
task = tasks.find_by(:state => :scheduled)
|
34
42
|
if task
|
@@ -1,4 +1,9 @@
|
|
1
1
|
object @recurring_logic
|
2
2
|
|
3
3
|
attributes :id, :cron_line, :end_time, :iteration, :task_group_id, :state,
|
4
|
-
:max_iteration
|
4
|
+
:max_iteration, :purpose
|
5
|
+
|
6
|
+
node(:task_count) { |rl| rl.tasks.count }
|
7
|
+
node(:action) { |rl| rl.tasks.first.try(:action) }
|
8
|
+
node(:last_occurence) { |rl| rl.last_task&.started_at }
|
9
|
+
node(:next_occurence) { |rl| rl.next_task&.start_at }
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<td><%= recurring_logic.cron_line %></td>
|
57
57
|
<td><%= link_to(recurring_logic.tasks.count, foreman_tasks_tasks_url(:search => "task_group.id = #{recurring_logic.task_group.id}")) %></td>
|
58
58
|
<td><%= format_task_input(recurring_logic.tasks.first) %></td>
|
59
|
-
<td><%= recurring_logic.
|
59
|
+
<td><%= recurring_logic.last_task.try(:started_at) || "-" %></td>
|
60
60
|
<td><%= recurring_logic_next_occurrence recurring_logic %></td>
|
61
61
|
<td><%= recurring_logic.iteration %></td>
|
62
62
|
<td><%= format_recurring_logic_limit recurring_logic.max_iteration %></td>
|
data/config/routes.rb
CHANGED
@@ -72,7 +72,6 @@ Foreman::Application.routes.draw do
|
|
72
72
|
require 'sidekiq/web'
|
73
73
|
redis_url = ENV['DYNFLOW_REDIS_URL'] || SETTINGS.dig(:dynflow, :redis_url)
|
74
74
|
Sidekiq.redis = { url: redis_url }
|
75
|
-
Sidekiq::Web.set :sessions, false
|
76
75
|
mount Sidekiq::Web => '/sidekiq', :constraints => ForemanTasks::Dynflow::SidekiqConsoleConstraint.new
|
77
76
|
end
|
78
77
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class TasksSettingsToDslCategory < ActiveRecord::Migration[6.0]
|
2
2
|
def up
|
3
|
-
Setting.where(category: 'Setting::ForemanTasks').update_all(category: 'Setting')
|
3
|
+
Setting.where(category: 'Setting::ForemanTasks').update_all(category: 'Setting') if column_exists?(:settings, :category)
|
4
4
|
end
|
5
5
|
end
|
@@ -48,7 +48,7 @@ export const TaskButtons = ({
|
|
48
48
|
<span
|
49
49
|
className={`glyphicon glyphicon-refresh ${taskReload ? 'spin' : ''}`}
|
50
50
|
/>
|
51
|
-
{
|
51
|
+
{taskReload ? __('Stop auto-reloading') : __('Start auto-reloading')}
|
52
52
|
</Button>
|
53
53
|
<Button
|
54
54
|
className="dynflow-button"
|
@@ -19,7 +19,7 @@ exports[`Task rendering render with minimal Props 1`] = `
|
|
19
19
|
<span
|
20
20
|
className="glyphicon glyphicon-refresh "
|
21
21
|
/>
|
22
|
-
Start
|
22
|
+
Start auto-reloading
|
23
23
|
</Button>
|
24
24
|
<Button
|
25
25
|
active={false}
|
@@ -118,7 +118,7 @@ exports[`Task rendering render with some Props 1`] = `
|
|
118
118
|
<span
|
119
119
|
className="glyphicon glyphicon-refresh spin"
|
120
120
|
/>
|
121
|
-
Stop
|
121
|
+
Stop auto-reloading
|
122
122
|
</Button>
|
123
123
|
<Button
|
124
124
|
active={false}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useEffect } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Tab, Tabs } from 'patternfly-react';
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
+
import { translate as __, sprintf } from 'foremanReact/common/I18n';
|
5
5
|
import { STATUS } from 'foremanReact/constants';
|
6
6
|
import MessageBox from 'foremanReact/components/common/MessageBox';
|
7
7
|
import Task from './Components/Task';
|
@@ -49,7 +49,7 @@ const TaskDetails = ({
|
|
49
49
|
<MessageBox
|
50
50
|
key="task-details-error"
|
51
51
|
icontype="error-circle-o"
|
52
|
-
msg={__(
|
52
|
+
msg={sprintf(__('Could not receive data: %s'), APIerror?.message)}
|
53
53
|
/>
|
54
54
|
);
|
55
55
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { FormattedMessage } from 'react-intl';
|
1
2
|
import React from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
import { Alert, Button } from 'patternfly-react';
|
@@ -17,14 +18,19 @@ export const SelectAllAlert = ({
|
|
17
18
|
Math.min(itemCount, perPage)
|
18
19
|
)}
|
19
20
|
<Button bsStyle="link" onClick={selectAllRows}>
|
20
|
-
|
21
|
-
|
21
|
+
<FormattedMessage
|
22
|
+
id="select-all-tasks"
|
23
|
+
values={{
|
24
|
+
count: <b>{itemCount}</b>,
|
25
|
+
}}
|
26
|
+
defaultMessage={__('Select all {count} tasks')}
|
27
|
+
/>
|
22
28
|
</Button>
|
23
29
|
</React.Fragment>
|
24
30
|
);
|
25
31
|
const undoSelectText = (
|
26
32
|
<React.Fragment>
|
27
|
-
{sprintf(__(
|
33
|
+
{sprintf(__('All %s tasks are selected.'), itemCount)}
|
28
34
|
<Button bsStyle="link" onClick={unselectAllRows}>
|
29
35
|
{__('Undo selection')}
|
30
36
|
</Button>
|
@@ -6,7 +6,7 @@ exports[`SelectAllAlert renders SelectAllAlert with all rows selected 1`] = `
|
|
6
6
|
onDismiss={null}
|
7
7
|
type="info"
|
8
8
|
>
|
9
|
-
All 7 tasks are selected.
|
9
|
+
All 7 tasks are selected.
|
10
10
|
<Button
|
11
11
|
active={false}
|
12
12
|
block={false}
|
@@ -35,14 +35,17 @@ exports[`SelectAllAlert renders SelectAllAlert with perPage > itemCout 1`] = `
|
|
35
35
|
disabled={false}
|
36
36
|
onClick={[MockFunction]}
|
37
37
|
>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
<FormattedMessage
|
39
|
+
defaultMessage="Select all {count} tasks"
|
40
|
+
id="select-all-tasks"
|
41
|
+
values={
|
42
|
+
Object {
|
43
|
+
"count": <b>
|
44
|
+
7
|
45
|
+
</b>,
|
46
|
+
}
|
47
|
+
}
|
48
|
+
/>
|
46
49
|
</Button>
|
47
50
|
</Alert>
|
48
51
|
`;
|
@@ -62,14 +65,17 @@ exports[`SelectAllAlert renders SelectAllAlert without all rows selected 1`] = `
|
|
62
65
|
disabled={false}
|
63
66
|
onClick={[MockFunction]}
|
64
67
|
>
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
<FormattedMessage
|
69
|
+
defaultMessage="Select all {count} tasks"
|
70
|
+
id="select-all-tasks"
|
71
|
+
values={
|
72
|
+
Object {
|
73
|
+
"count": <b>
|
74
|
+
7
|
75
|
+
</b>,
|
76
|
+
}
|
77
|
+
}
|
78
|
+
/>
|
73
79
|
</Button>
|
74
80
|
</Alert>
|
75
81
|
`;
|
@@ -53,7 +53,7 @@ const handleErrorResume = (error, dispatch) => {
|
|
53
53
|
dispatch({ type: TASKS_RESUME_FAILURE, error });
|
54
54
|
dispatch(
|
55
55
|
addToast(
|
56
|
-
errorToastData(`${__(
|
56
|
+
errorToastData(`${__('Cannot resume tasks at the moment')} ${error}`)
|
57
57
|
)
|
58
58
|
);
|
59
59
|
};
|
@@ -112,7 +112,7 @@ const handleErrorCancel = (error, dispatch) => {
|
|
112
112
|
dispatch({ type: TASKS_CANCEL_FAILURE, error });
|
113
113
|
dispatch(
|
114
114
|
addToast(
|
115
|
-
errorToastData(`${__(
|
115
|
+
errorToastData(`${__('Cannot cancel tasks at the moment')} ${error}`)
|
116
116
|
)
|
117
117
|
);
|
118
118
|
};
|
@@ -175,7 +175,7 @@ const handleErrorForceCancel = (error, dispatch) => {
|
|
175
175
|
dispatch(
|
176
176
|
addToast(
|
177
177
|
errorToastData(
|
178
|
-
`${__(
|
178
|
+
`${__('Cannot force cancel tasks at the moment')} ${error}`
|
179
179
|
)
|
180
180
|
)
|
181
181
|
);
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import { Table } from 'foremanReact/components/common/table';
|
4
4
|
import { STATUS } from 'foremanReact/constants';
|
5
5
|
import MessageBox from 'foremanReact/components/common/MessageBox';
|
6
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
6
|
+
import { translate as __, sprintf } from 'foremanReact/common/I18n';
|
7
7
|
import Pagination from 'foremanReact/components/Pagination';
|
8
8
|
import { getURIQuery } from 'foremanReact/common/helpers';
|
9
9
|
import createTasksTableSchema from './TasksTableSchema';
|
@@ -68,7 +68,7 @@ const TasksTable = ({
|
|
68
68
|
<MessageBox
|
69
69
|
key="tasks-table-error"
|
70
70
|
icontype="error-circle-o"
|
71
|
-
msg={__(
|
71
|
+
msg={sprintf(__('Could not receive data: %s'), error?.message)}
|
72
72
|
/>
|
73
73
|
);
|
74
74
|
}
|
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: 7.2.
|
4
|
+
version: 7.2.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:
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|