foreman-tasks 7.1.1 → 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/.github/workflows/js_tests.yml +3 -1
- data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +2 -2
- data/app/models/foreman_tasks/recurring_logic.rb +8 -0
- data/app/models/foreman_tasks/task/dynflow_task.rb +10 -5
- 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/db/migrate/20211123170430_tasks_settings_to_dsl_category.rb +1 -1
- data/lib/foreman_tasks/engine.rb +3 -0
- data/lib/foreman_tasks/version.rb +1 -1
- data/locale/de/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/de/foreman_tasks.po +1 -1
- data/locale/en/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/en/foreman_tasks.po +1 -1
- data/locale/es/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/es/foreman_tasks.po +1 -1
- data/locale/foreman_tasks.pot +3 -3
- data/locale/fr/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/fr/foreman_tasks.po +68 -66
- data/locale/ja/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/ja/foreman_tasks.po +67 -68
- data/locale/ka/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/ka/foreman_tasks.po +3 -3
- data/locale/ko/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/ko/foreman_tasks.po +1 -1
- data/locale/pt_BR/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/pt_BR/foreman_tasks.po +15 -15
- data/locale/ru/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/ru/foreman_tasks.po +1 -1
- data/locale/zh_CN/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/zh_CN/foreman_tasks.po +155 -156
- data/locale/zh_TW/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/zh_TW/foreman_tasks.po +1 -1
- data/test/unit/task_test.rb +5 -8
- 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
Binary file
|
data/test/unit/task_test.rb
CHANGED
@@ -182,17 +182,14 @@ class TasksTest < ActiveSupport::TestCase
|
|
182
182
|
end
|
183
183
|
|
184
184
|
describe 'consistency check' do
|
185
|
-
let(:consistent_task) { FactoryBot.create(:dynflow_task, :sync_with_dynflow => true) }
|
186
|
-
let(:inconsistent_task) { FactoryBot.create(:dynflow_task, :inconsistent_dynflow_task) }
|
187
|
-
|
188
185
|
it 'ensures the tasks marked as running are really running in Dynflow' do
|
189
|
-
|
190
|
-
|
186
|
+
task = ForemanTasks.sync_task(Support::DummyDynflowAction)
|
187
|
+
task.update(:state => 'running') # Updating state updates the timestamp
|
188
|
+
task.update(:state_updated_at => Time.zone.now - 5.minutes)
|
191
189
|
|
192
190
|
ForemanTasks::Task::DynflowTask.consistency_check
|
193
|
-
|
194
|
-
_(
|
195
|
-
_(inconsistent_task.reload.state).must_equal 'planned'
|
191
|
+
task.reload
|
192
|
+
_(task.state).must_equal 'stopped'
|
196
193
|
end
|
197
194
|
end
|
198
195
|
|
@@ -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.
|
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: 2023-01
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|