foreman-tasks 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_tasks/tasks_controller.rb +6 -3
- data/app/models/foreman_tasks/task/dynflow_task.rb +1 -0
- data/db/migrate/20200611090846_add_task_lock_index_on_resource_type_and_task_id.rb +9 -0
- data/lib/foreman_tasks/engine.rb +0 -5
- data/lib/foreman_tasks/version.rb +1 -1
- data/locale/en/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/en/foreman_tasks.po +50 -20
- data/locale/foreman_tasks.pot +173 -126
- data/locale/fr/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/fr/foreman_tasks.po +817 -0
- data/locale/ja/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/ja/foreman_tasks.po +817 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_tasks.mo +0 -0
- data/locale/zh_CN/foreman_tasks.po +816 -0
- data/webpack/ForemanTasks/Components/TaskActions/TaskAction.test.js +2 -2
- data/webpack/ForemanTasks/Components/TaskActions/index.js +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js +17 -3
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +3 -18
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +8 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +5 -5
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/RunningSteps.test.js.snap +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +4 -4
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +35 -5
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +36 -1
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js +4 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js +8 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +2 -1
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +18 -2
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +27 -6
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +91 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +9 -4
- data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardActions.js +1 -1
- data/webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js +2 -2
- data/webpack/ForemanTasks/Components/TasksTable/TasksBulkActions.js +1 -1
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksBulkActions.test.js +2 -2
- data/webpack/__mocks__/foremanReact/{API.js → redux/API.js} +1 -1
- metadata +12 -4
@@ -1,5 +1,96 @@
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
2
|
|
3
|
+
exports[`TaskDetails - Actions should cancelStep and fail 1`] = `
|
4
|
+
Array [
|
5
|
+
Array [
|
6
|
+
Object {
|
7
|
+
"type": "TASK_STEP_CANCEL_REQUEST",
|
8
|
+
},
|
9
|
+
],
|
10
|
+
Array [
|
11
|
+
Object {
|
12
|
+
"payload": Object {
|
13
|
+
"message": Object {
|
14
|
+
"message": "Trying to cancel step step-id",
|
15
|
+
"type": "info",
|
16
|
+
},
|
17
|
+
},
|
18
|
+
"type": "TOASTS_ADD",
|
19
|
+
},
|
20
|
+
],
|
21
|
+
Array [
|
22
|
+
Object {
|
23
|
+
"payload": [Error: Network Error],
|
24
|
+
"type": "TASK_STEP_CANCEL_FAILURE",
|
25
|
+
},
|
26
|
+
],
|
27
|
+
Array [
|
28
|
+
Object {
|
29
|
+
"payload": Object {
|
30
|
+
"message": Object {
|
31
|
+
"message": "Could not cancel step. Error: step-id undefined",
|
32
|
+
"type": "error",
|
33
|
+
},
|
34
|
+
},
|
35
|
+
"type": "TOASTS_ADD",
|
36
|
+
},
|
37
|
+
],
|
38
|
+
]
|
39
|
+
`;
|
40
|
+
|
41
|
+
exports[`TaskDetails - Actions should cancelStep and success 1`] = `
|
42
|
+
Array [
|
43
|
+
Array [
|
44
|
+
Object {
|
45
|
+
"type": "TASK_STEP_CANCEL_REQUEST",
|
46
|
+
},
|
47
|
+
],
|
48
|
+
Array [
|
49
|
+
Object {
|
50
|
+
"payload": Object {
|
51
|
+
"message": Object {
|
52
|
+
"message": "Trying to cancel step step-id",
|
53
|
+
"type": "info",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
"type": "TOASTS_ADD",
|
57
|
+
},
|
58
|
+
],
|
59
|
+
Array [
|
60
|
+
Object {
|
61
|
+
"type": "TASK_STEP_CANCEL_SUCCESS",
|
62
|
+
},
|
63
|
+
],
|
64
|
+
Array [
|
65
|
+
Object {
|
66
|
+
"payload": Object {
|
67
|
+
"message": Object {
|
68
|
+
"message": "step-id {__('Step Canceled')}",
|
69
|
+
"type": "success",
|
70
|
+
},
|
71
|
+
},
|
72
|
+
"type": "TOASTS_ADD",
|
73
|
+
},
|
74
|
+
],
|
75
|
+
]
|
76
|
+
`;
|
77
|
+
|
78
|
+
exports[`TaskDetails - Actions should fetch-task-details and fail 1`] = `
|
79
|
+
Array [
|
80
|
+
Array [
|
81
|
+
Object {
|
82
|
+
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST",
|
83
|
+
},
|
84
|
+
],
|
85
|
+
Array [
|
86
|
+
Object {
|
87
|
+
"payload": [Error: Network Error],
|
88
|
+
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_FAILURE",
|
89
|
+
},
|
90
|
+
],
|
91
|
+
]
|
92
|
+
`;
|
93
|
+
|
3
94
|
exports[`TaskDetails - Actions should fetch-task-details and success 1`] = `
|
4
95
|
Array [
|
5
96
|
Array [
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
|
3
|
-
import API from 'foremanReact/API';
|
3
|
+
import { API } from 'foremanReact/redux/API';
|
4
4
|
import { IntegrationTestHelper } from '@theforeman/test';
|
5
5
|
|
6
6
|
import TaskDetails, { reducers } from '../index';
|
7
7
|
import { selectForemanTasks } from '../../../ForemanTasksSelectors';
|
8
|
+
import { minProps } from './TaskDetails.fixtures';
|
8
9
|
|
9
10
|
jest.mock('../../../ForemanTasksSelectors');
|
10
|
-
jest.mock('foremanReact/API');
|
11
|
+
jest.mock('foremanReact/redux/API');
|
11
12
|
selectForemanTasks.mockImplementation(state => state);
|
12
13
|
describe('TaskDetails integration test', () => {
|
13
14
|
beforeEach(() => {
|
@@ -26,7 +27,9 @@ describe('TaskDetails integration test', () => {
|
|
26
27
|
API.get.mockImplementationOnce();
|
27
28
|
const integrationTestHelper = new IntegrationTestHelper(reducers);
|
28
29
|
|
29
|
-
const component = integrationTestHelper.mount(
|
30
|
+
const component = integrationTestHelper.mount(
|
31
|
+
<TaskDetails {...minProps} id="test" />
|
32
|
+
);
|
30
33
|
integrationTestHelper.takeStoreSnapshot('initial state');
|
31
34
|
|
32
35
|
const reloadButton = component.find('.reload-button').at(0);
|
@@ -50,7 +53,9 @@ describe('TaskDetails integration test', () => {
|
|
50
53
|
}));
|
51
54
|
const integrationTestHelper = new IntegrationTestHelper(reducers);
|
52
55
|
|
53
|
-
const component = integrationTestHelper.mount(
|
56
|
+
const component = integrationTestHelper.mount(
|
57
|
+
<TaskDetails {...minProps} id="test" />
|
58
|
+
);
|
54
59
|
|
55
60
|
const reloadButton = component.find('.reload-button').at(0);
|
56
61
|
reloadButton.simulate('click');
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
2
|
-
import API from 'foremanReact/API';
|
2
|
+
import { API } from 'foremanReact/redux/API';
|
3
3
|
import { timeToHoursNumber } from '../TasksDashboardHelper';
|
4
4
|
import {
|
5
5
|
initializeDashboard,
|
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
apiGetMock,
|
15
15
|
} from './TaskDashboard.fixtures';
|
16
16
|
|
17
|
-
jest.mock('foremanReact/API');
|
17
|
+
jest.mock('foremanReact/redux/API');
|
18
18
|
jest.mock('../TasksDashboardHelper');
|
19
19
|
|
20
20
|
timeToHoursNumber.mockImplementation(arg => arg);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
2
|
-
import API from 'foremanReact/API';
|
2
|
+
import { API } from 'foremanReact/redux/API';
|
3
3
|
import {
|
4
4
|
bulkCancelById,
|
5
5
|
bulkCancelBySearch,
|
@@ -13,7 +13,7 @@ jest.mock('foremanReact/components/common/table', () => ({
|
|
13
13
|
getTableItemsAction: jest.fn(controller => controller),
|
14
14
|
}));
|
15
15
|
|
16
|
-
jest.mock('foremanReact/API');
|
16
|
+
jest.mock('foremanReact/redux/API');
|
17
17
|
|
18
18
|
const task = {
|
19
19
|
id: 'some-id',
|
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: 2.0.
|
4
|
+
version: 2.0.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: 2020-06-
|
11
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|
@@ -248,6 +248,7 @@ files:
|
|
248
248
|
- db/migrate/20190318153925_add_task_state_updated_at.foreman_tasks.rb
|
249
249
|
- db/migrate/20200517215015_rename_bookmarks_controller.rb
|
250
250
|
- db/migrate/20200519093217_drop_dynflow_allow_dangerous_actions_setting.foreman_tasks.rb
|
251
|
+
- db/migrate/20200611090846_add_task_lock_index_on_resource_type_and_task_id.rb
|
251
252
|
- db/seeds.d/20-foreman_tasks_permissions.rb
|
252
253
|
- db/seeds.d/30-notification_blueprints.rb
|
253
254
|
- db/seeds.d/60-dynflow_proxy_feature.rb
|
@@ -281,6 +282,12 @@ files:
|
|
281
282
|
- locale/en/LC_MESSAGES/foreman_tasks.mo
|
282
283
|
- locale/en/foreman_tasks.po
|
283
284
|
- locale/foreman_tasks.pot
|
285
|
+
- locale/fr/LC_MESSAGES/foreman_tasks.mo
|
286
|
+
- locale/fr/foreman_tasks.po
|
287
|
+
- locale/ja/LC_MESSAGES/foreman_tasks.mo
|
288
|
+
- locale/ja/foreman_tasks.po
|
289
|
+
- locale/zh_CN/LC_MESSAGES/foreman_tasks.mo
|
290
|
+
- locale/zh_CN/foreman_tasks.po
|
284
291
|
- package.json
|
285
292
|
- script/rails
|
286
293
|
- script/travis_run_js_tests.sh
|
@@ -367,6 +374,7 @@ files:
|
|
367
374
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js
|
368
375
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js
|
369
376
|
- webpack/ForemanTasks/Components/TaskDetails/TasksDetailsHelper.js
|
377
|
+
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js
|
370
378
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js
|
371
379
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js
|
372
380
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js
|
@@ -545,7 +553,6 @@ files:
|
|
545
553
|
- webpack/ForemanTasks/Routes/__snapshots__/ForemanTasksRoutes.test.js.snap
|
546
554
|
- webpack/ForemanTasks/__snapshots__/ForemanTasks.test.js.snap
|
547
555
|
- webpack/ForemanTasks/index.js
|
548
|
-
- webpack/__mocks__/foremanReact/API.js
|
549
556
|
- webpack/__mocks__/foremanReact/common/I18n.js
|
550
557
|
- webpack/__mocks__/foremanReact/common/helpers.js
|
551
558
|
- webpack/__mocks__/foremanReact/common/urlHelpers.js
|
@@ -561,6 +568,7 @@ files:
|
|
561
568
|
- webpack/__mocks__/foremanReact/components/common/table.js
|
562
569
|
- webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js
|
563
570
|
- webpack/__mocks__/foremanReact/constants.js
|
571
|
+
- webpack/__mocks__/foremanReact/redux/API.js
|
564
572
|
- webpack/__mocks__/foremanReact/redux/actions/toasts.js
|
565
573
|
- webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js
|
566
574
|
- webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js
|
@@ -585,7 +593,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
585
593
|
- !ruby/object:Gem::Version
|
586
594
|
version: '0'
|
587
595
|
requirements: []
|
588
|
-
rubygems_version: 3.0.
|
596
|
+
rubygems_version: 3.0.4
|
589
597
|
signing_key:
|
590
598
|
specification_version: 4
|
591
599
|
summary: Foreman plugin for showing tasks information for resources and users
|