foreman-tasks 1.1.0 → 1.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.
- checksums.yaml +4 -4
- data/app/controllers/foreman_tasks/api/tasks_controller.rb +12 -5
- data/app/lib/foreman_tasks/concerns/polling_action_extensions.rb +12 -0
- data/app/models/setting/foreman_tasks.rb +6 -1
- data/app/services/ui_notifications/tasks/task_bulk_cancel.rb +36 -0
- data/app/services/ui_notifications/tasks/task_bulk_resume.rb +38 -0
- data/db/seeds.d/30-notification_blueprints.rb +14 -0
- data/foreman-tasks.gemspec +1 -0
- data/gemfile.d/foreman-tasks.rb +1 -0
- data/lib/foreman_tasks/engine.rb +1 -0
- data/lib/foreman_tasks/version.rb +1 -1
- data/script/travis_run_js_tests.sh +2 -2
- data/test/lib/concerns/polling_action_extensions_test.rb +34 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +1 -3
- data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardConstants.js +5 -0
- data/webpack/ForemanTasks/Components/TasksDashboard/TasksDashboardHelper.js +3 -2
- data/webpack/ForemanTasks/Components/TasksTable/Components/SelectAllAlert.js +43 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/SelectAllAlert.test.js +29 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/SelectAllAlert.test.js.snap +75 -0
- data/webpack/ForemanTasks/Components/TasksTable/SubTasksPage.js +2 -1
- data/webpack/ForemanTasks/Components/TasksTable/TasksBulkActions.js +164 -0
- data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +24 -10
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableActionHelpers.js +52 -0
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js +66 -128
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +11 -1
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableHelpers.js +4 -3
- data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +64 -12
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js +21 -2
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableSelectors.js +6 -0
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksBulkActions.test.js +112 -0
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.fixtures.js +5 -3
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActionHelpers.test.js +46 -0
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActions.test.js +19 -41
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableHelpers.test.js +17 -1
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTablePage.test.js +9 -1
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableReducer.test.js +22 -1
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap +5 -3
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksBulkActions.test.js.snap +229 -0
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap +5 -3
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableActions.test.js.snap +39 -124
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +40 -16
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap +34 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionHeaderCellFormatter.test.js +1 -1
- data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionHeaderCellFormatter.js +2 -2
- data/webpack/ForemanTasks/Components/TasksTable/index.js +8 -2
- data/webpack/ForemanTasks/Components/common/ToastTypesConstants.js +11 -0
- metadata +31 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
import { updateURlQuery, getDuration } from '../TasksTableHelpers';
|
1
|
+
import { updateURlQuery, getDuration, getCSVurl } from '../TasksTableHelpers';
|
2
2
|
|
3
3
|
describe('updateURlQuery', () => {
|
4
4
|
it('should use url with new query', () => {
|
@@ -26,3 +26,19 @@ describe('updateURlQuery', () => {
|
|
26
26
|
expect(duration.tooltip).toEqual('Task was canceled');
|
27
27
|
});
|
28
28
|
});
|
29
|
+
|
30
|
+
describe('getCSVurl', () => {
|
31
|
+
it('should return currect url for tasks with search', () => {
|
32
|
+
const url = '/foreman_tasks/tasks';
|
33
|
+
const query = { state: 'stopped' };
|
34
|
+
expect(getCSVurl(url, query)).toEqual(
|
35
|
+
'/foreman_tasks/tasks.csv?state=stopped'
|
36
|
+
);
|
37
|
+
});
|
38
|
+
it('should return currect url for subtasks', () => {
|
39
|
+
const url = '/foreman_tasks/tasks/some-id/sub_tasks';
|
40
|
+
expect(getCSVurl(url, {})).toEqual(
|
41
|
+
'/foreman_tasks/tasks/some-id/sub_tasks.csv'
|
42
|
+
);
|
43
|
+
});
|
44
|
+
});
|
@@ -2,11 +2,19 @@ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
2
|
import TasksTablePage from '../TasksTablePage';
|
3
3
|
import { minProps } from './TasksTable.fixtures';
|
4
4
|
|
5
|
+
jest.mock('foremanReact/common/helpers', () => ({
|
6
|
+
getURIQuery: () => ({ state: 'stopped' }),
|
7
|
+
}));
|
8
|
+
|
9
|
+
const history = {
|
10
|
+
location: { pathname: '/foreman_tasks/tasks', search: '?action="some-name"' },
|
11
|
+
};
|
5
12
|
const fixtures = {
|
6
|
-
'render with minimal props': minProps,
|
13
|
+
'render with minimal props': { ...minProps, history },
|
7
14
|
|
8
15
|
'render with Breadcrubs': {
|
9
16
|
...minProps,
|
17
|
+
history,
|
10
18
|
getBreadcrumbs: () => ({
|
11
19
|
breadcrumbItems: [
|
12
20
|
{ caption: 'Tasks', url: `/foreman_tasks/tasks` },
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import Immutable from 'seamless-immutable';
|
1
2
|
import { testReducerSnapshotWithFixtures } from '@theforeman/test';
|
2
3
|
import {
|
3
4
|
TASKS_TABLE_ID,
|
@@ -7,6 +8,8 @@ import {
|
|
7
8
|
UNSELECT_ROWS,
|
8
9
|
UNSELECT_ALL_ROWS,
|
9
10
|
UPDATE_CLICKED,
|
11
|
+
SELECT_ALL_ROWS,
|
12
|
+
OPEN_SELECT_ALL,
|
10
13
|
} from '../TasksTableConstants';
|
11
14
|
import reducer from '../TasksTableReducer';
|
12
15
|
|
@@ -44,7 +47,7 @@ const fixtures = {
|
|
44
47
|
'should handle UNSELECT_ROWS': {
|
45
48
|
action: {
|
46
49
|
type: UNSELECT_ROWS,
|
47
|
-
payload: 4,
|
50
|
+
payload: [{ id: 4 }],
|
48
51
|
},
|
49
52
|
},
|
50
53
|
'should handle UNSELECT_ALL_ROWS': {
|
@@ -58,6 +61,24 @@ const fixtures = {
|
|
58
61
|
payload: { clicked: 'task' },
|
59
62
|
},
|
60
63
|
},
|
64
|
+
'should handle SELECT_ALL_ROWS': {
|
65
|
+
action: {
|
66
|
+
type: SELECT_ALL_ROWS,
|
67
|
+
payload: { clicked: 'task' },
|
68
|
+
},
|
69
|
+
},
|
70
|
+
'should handle OPEN_SELECT_ALL': {
|
71
|
+
action: {
|
72
|
+
type: OPEN_SELECT_ALL,
|
73
|
+
},
|
74
|
+
},
|
75
|
+
'should handle UNSELECT_ROWS with all rows selected': {
|
76
|
+
state: Immutable({ tasksTableQuery: { allRowsSelected: true } }),
|
77
|
+
action: {
|
78
|
+
type: UNSELECT_ROWS,
|
79
|
+
payload: { id: [4], results: [{ id: 3 }, { id: 4 }, { id: 5 }] },
|
80
|
+
},
|
81
|
+
},
|
61
82
|
};
|
62
83
|
|
63
84
|
describe('TasksTableReducer reducer', () =>
|
data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
exports[`SubTasksPage rendering render with minimal props 1`] = `
|
4
4
|
<Connect(TasksTablePage)
|
5
|
-
|
6
|
-
|
5
|
+
bulkCancelById={[MockFunction]}
|
6
|
+
bulkCancelBySearch={[MockFunction]}
|
7
|
+
bulkResumeById={[MockFunction]}
|
8
|
+
bulkResumeBySearch={[MockFunction]}
|
7
9
|
cancelTask={[MockFunction]}
|
8
10
|
createHeader={[Function]}
|
9
11
|
getBreadcrumbs={[MockFunction]}
|
@@ -47,6 +49,7 @@ exports[`SubTasksPage rendering render with minimal props 1`] = `
|
|
47
49
|
}
|
48
50
|
resumeTask={[MockFunction]}
|
49
51
|
selectAllRows={[MockFunction]}
|
52
|
+
selectPage={[MockFunction]}
|
50
53
|
selectRow={[MockFunction]}
|
51
54
|
selectedRows={Array []}
|
52
55
|
sort={
|
@@ -55,7 +58,6 @@ exports[`SubTasksPage rendering render with minimal props 1`] = `
|
|
55
58
|
"order": "w",
|
56
59
|
}
|
57
60
|
}
|
58
|
-
status="RESOLVED"
|
59
61
|
unselectAllRows={[MockFunction]}
|
60
62
|
unselectRow={[MockFunction]}
|
61
63
|
/>
|
@@ -0,0 +1,229 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`TasksTable bulk actions handles bulkCancelById requests 1`] = `
|
4
|
+
Array [
|
5
|
+
Array [
|
6
|
+
Object {
|
7
|
+
"type": "TASKS_CANCEL_REQUEST",
|
8
|
+
},
|
9
|
+
],
|
10
|
+
Array [
|
11
|
+
Object {
|
12
|
+
"type": "TASKS_CANCEL_SUCCESS",
|
13
|
+
},
|
14
|
+
],
|
15
|
+
Array [
|
16
|
+
Object {
|
17
|
+
"payload": Object {
|
18
|
+
"message": Object {
|
19
|
+
"message": "I am cancelled Task execution was cancelled",
|
20
|
+
"type": "success",
|
21
|
+
},
|
22
|
+
},
|
23
|
+
"type": "TOASTS_ADD",
|
24
|
+
},
|
25
|
+
],
|
26
|
+
Array [
|
27
|
+
"TASKS_TABLE",
|
28
|
+
],
|
29
|
+
Array [
|
30
|
+
[Function],
|
31
|
+
],
|
32
|
+
]
|
33
|
+
`;
|
34
|
+
|
35
|
+
exports[`TasksTable bulk actions handles bulkCancelById requests that are not cancellable 1`] = `
|
36
|
+
Array [
|
37
|
+
Array [
|
38
|
+
Object {
|
39
|
+
"payload": Object {
|
40
|
+
"message": Object {
|
41
|
+
"message": "Not all the selected tasks can be cancelled",
|
42
|
+
"type": "warning",
|
43
|
+
},
|
44
|
+
},
|
45
|
+
"type": "TOASTS_ADD",
|
46
|
+
},
|
47
|
+
],
|
48
|
+
]
|
49
|
+
`;
|
50
|
+
|
51
|
+
exports[`TasksTable bulk actions handles bulkCancelBySearch requests 1`] = `
|
52
|
+
Array [
|
53
|
+
Array [
|
54
|
+
Object {
|
55
|
+
"type": "TASKS_CANCEL_REQUEST",
|
56
|
+
},
|
57
|
+
],
|
58
|
+
Array [
|
59
|
+
Object {
|
60
|
+
"payload": Object {
|
61
|
+
"message": Object {
|
62
|
+
"message": "Canceling selected tasks, this might take a while",
|
63
|
+
"type": "info",
|
64
|
+
},
|
65
|
+
},
|
66
|
+
"type": "TOASTS_ADD",
|
67
|
+
},
|
68
|
+
],
|
69
|
+
]
|
70
|
+
`;
|
71
|
+
|
72
|
+
exports[`TasksTable bulk actions handles bulkResumeById requests that are not resumable 1`] = `
|
73
|
+
Array [
|
74
|
+
Array [
|
75
|
+
Object {
|
76
|
+
"payload": Object {
|
77
|
+
"message": Object {
|
78
|
+
"message": "Not all the selected tasks can be resumed",
|
79
|
+
"type": "warning",
|
80
|
+
},
|
81
|
+
},
|
82
|
+
"type": "TOASTS_ADD",
|
83
|
+
},
|
84
|
+
],
|
85
|
+
]
|
86
|
+
`;
|
87
|
+
|
88
|
+
exports[`TasksTable bulk actions handles bulkResumeById requests that fail 1`] = `
|
89
|
+
Array [
|
90
|
+
Array [
|
91
|
+
Object {
|
92
|
+
"type": "TASKS_RESUME_REQUEST",
|
93
|
+
},
|
94
|
+
],
|
95
|
+
Array [
|
96
|
+
Object {
|
97
|
+
"error": [Error: Network Error],
|
98
|
+
"type": "TASKS_RESUME_FAILURE",
|
99
|
+
},
|
100
|
+
],
|
101
|
+
Array [
|
102
|
+
Object {
|
103
|
+
"payload": Object {
|
104
|
+
"message": Object {
|
105
|
+
"message": "Cannot resume tasks at the moment Error: Network Error",
|
106
|
+
"type": "error",
|
107
|
+
},
|
108
|
+
},
|
109
|
+
"type": "TOASTS_ADD",
|
110
|
+
},
|
111
|
+
],
|
112
|
+
]
|
113
|
+
`;
|
114
|
+
|
115
|
+
exports[`TasksTable bulk actions handles bulkResumeBySearch requests 1`] = `
|
116
|
+
Array [
|
117
|
+
Array [
|
118
|
+
Object {
|
119
|
+
"type": "TASKS_RESUME_REQUEST",
|
120
|
+
},
|
121
|
+
],
|
122
|
+
Array [
|
123
|
+
Object {
|
124
|
+
"payload": Object {
|
125
|
+
"message": Object {
|
126
|
+
"message": "Resuming selected tasks, this might take a while",
|
127
|
+
"type": "info",
|
128
|
+
},
|
129
|
+
},
|
130
|
+
"type": "TOASTS_ADD",
|
131
|
+
},
|
132
|
+
],
|
133
|
+
]
|
134
|
+
`;
|
135
|
+
|
136
|
+
exports[`TasksTable bulk actions handles resumable bulkResumeById requests 1`] = `
|
137
|
+
Array [
|
138
|
+
Array [
|
139
|
+
Object {
|
140
|
+
"type": "TASKS_RESUME_REQUEST",
|
141
|
+
},
|
142
|
+
],
|
143
|
+
Array [
|
144
|
+
Object {
|
145
|
+
"type": "TASKS_RESUME_SUCCESS",
|
146
|
+
},
|
147
|
+
],
|
148
|
+
Array [
|
149
|
+
Object {
|
150
|
+
"payload": Object {
|
151
|
+
"message": Object {
|
152
|
+
"message": "I am resumed Task execution was resumed",
|
153
|
+
"type": "success",
|
154
|
+
},
|
155
|
+
},
|
156
|
+
"type": "TOASTS_ADD",
|
157
|
+
},
|
158
|
+
],
|
159
|
+
Array [
|
160
|
+
Object {
|
161
|
+
"payload": Object {
|
162
|
+
"message": Object {
|
163
|
+
"message": "I am failed Task execution could not be resumed",
|
164
|
+
"type": "error",
|
165
|
+
},
|
166
|
+
},
|
167
|
+
"type": "TOASTS_ADD",
|
168
|
+
},
|
169
|
+
],
|
170
|
+
Array [
|
171
|
+
"TASKS_TABLE",
|
172
|
+
],
|
173
|
+
Array [
|
174
|
+
[Function],
|
175
|
+
],
|
176
|
+
]
|
177
|
+
`;
|
178
|
+
|
179
|
+
exports[`TasksTable bulk actions handles skipped bulkCancelById requests 1`] = `
|
180
|
+
Array [
|
181
|
+
Array [
|
182
|
+
Object {
|
183
|
+
"type": "TASKS_CANCEL_REQUEST",
|
184
|
+
},
|
185
|
+
],
|
186
|
+
Array [
|
187
|
+
Object {
|
188
|
+
"type": "TASKS_CANCEL_SUCCESS",
|
189
|
+
},
|
190
|
+
],
|
191
|
+
Array [
|
192
|
+
Object {
|
193
|
+
"payload": Object {
|
194
|
+
"message": Object {
|
195
|
+
"message": "I am skipped Task execution task has to be cancellable",
|
196
|
+
"type": "warning",
|
197
|
+
},
|
198
|
+
},
|
199
|
+
"type": "TOASTS_ADD",
|
200
|
+
},
|
201
|
+
],
|
202
|
+
]
|
203
|
+
`;
|
204
|
+
|
205
|
+
exports[`TasksTable bulk actions handles skipped bulkResumeById requests 1`] = `
|
206
|
+
Array [
|
207
|
+
Array [
|
208
|
+
Object {
|
209
|
+
"type": "TASKS_RESUME_REQUEST",
|
210
|
+
},
|
211
|
+
],
|
212
|
+
Array [
|
213
|
+
Object {
|
214
|
+
"type": "TASKS_RESUME_SUCCESS",
|
215
|
+
},
|
216
|
+
],
|
217
|
+
Array [
|
218
|
+
Object {
|
219
|
+
"payload": Object {
|
220
|
+
"message": Object {
|
221
|
+
"message": "I am skipped Task execution task has to be resumable",
|
222
|
+
"type": "warning",
|
223
|
+
},
|
224
|
+
},
|
225
|
+
"type": "TOASTS_ADD",
|
226
|
+
},
|
227
|
+
],
|
228
|
+
]
|
229
|
+
`;
|
data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
exports[`TasksIndexPage rendering render with minimal props 1`] = `
|
4
4
|
<Connect(TasksTablePage)
|
5
|
-
|
6
|
-
|
5
|
+
bulkCancelById={[MockFunction]}
|
6
|
+
bulkCancelBySearch={[MockFunction]}
|
7
|
+
bulkResumeById={[MockFunction]}
|
8
|
+
bulkResumeBySearch={[MockFunction]}
|
7
9
|
cancelTask={[MockFunction]}
|
8
10
|
getBreadcrumbs={[MockFunction]}
|
9
11
|
getTableItems={[MockFunction]}
|
@@ -38,6 +40,7 @@ exports[`TasksIndexPage rendering render with minimal props 1`] = `
|
|
38
40
|
}
|
39
41
|
resumeTask={[MockFunction]}
|
40
42
|
selectAllRows={[MockFunction]}
|
43
|
+
selectPage={[MockFunction]}
|
41
44
|
selectRow={[MockFunction]}
|
42
45
|
selectedRows={Array []}
|
43
46
|
sort={
|
@@ -46,7 +49,6 @@ exports[`TasksIndexPage rendering render with minimal props 1`] = `
|
|
46
49
|
"order": "w",
|
47
50
|
}
|
48
51
|
}
|
49
|
-
status="RESOLVED"
|
50
52
|
unselectAllRows={[MockFunction]}
|
51
53
|
unselectRow={[MockFunction]}
|
52
54
|
/>
|
@@ -1,26 +1,34 @@
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
2
|
|
3
|
-
exports[`TasksTable actions
|
3
|
+
exports[`TasksTable actions should cancelTaskRequest and fail 1`] = `
|
4
4
|
Array [
|
5
5
|
Array [
|
6
|
-
|
6
|
+
Object {
|
7
|
+
"payload": Object {
|
8
|
+
"message": Object {
|
9
|
+
"message": "Trying to cancel some-name task",
|
10
|
+
"type": "info",
|
11
|
+
},
|
12
|
+
},
|
13
|
+
"type": "TOASTS_ADD",
|
14
|
+
},
|
7
15
|
],
|
8
16
|
Array [
|
9
|
-
|
17
|
+
Object {
|
18
|
+
"type": "TASKS_CANCEL_REQUEST",
|
19
|
+
},
|
10
20
|
],
|
11
21
|
Array [
|
12
|
-
|
22
|
+
Object {
|
23
|
+
"payload": undefined,
|
24
|
+
"type": "TASKS_CANCEL_FAILURE",
|
25
|
+
},
|
13
26
|
],
|
14
|
-
]
|
15
|
-
`;
|
16
|
-
|
17
|
-
exports[`TasksTable actions handles bulkCancel requests that are not cancellable 1`] = `
|
18
|
-
Array [
|
19
27
|
Array [
|
20
28
|
Object {
|
21
29
|
"payload": Object {
|
22
30
|
"message": Object {
|
23
|
-
"message": "
|
31
|
+
"message": "some-name Task execution task has to be cancellable",
|
24
32
|
"type": "warning",
|
25
33
|
},
|
26
34
|
},
|
@@ -30,41 +38,35 @@ Array [
|
|
30
38
|
]
|
31
39
|
`;
|
32
40
|
|
33
|
-
exports[`TasksTable actions
|
41
|
+
exports[`TasksTable actions should cancelTaskRequest and succeed 1`] = `
|
34
42
|
Array [
|
35
43
|
Array [
|
36
44
|
Object {
|
37
45
|
"payload": Object {
|
38
46
|
"message": Object {
|
39
|
-
"message": "
|
40
|
-
"type": "
|
47
|
+
"message": "Trying to cancel some-name task",
|
48
|
+
"type": "info",
|
41
49
|
},
|
42
50
|
},
|
43
51
|
"type": "TOASTS_ADD",
|
44
52
|
},
|
45
53
|
],
|
46
|
-
]
|
47
|
-
`;
|
48
|
-
|
49
|
-
exports[`TasksTable actions handles bulkResume requests that fail 1`] = `
|
50
|
-
Array [
|
51
54
|
Array [
|
52
55
|
Object {
|
53
|
-
"type": "
|
56
|
+
"type": "TASKS_CANCEL_REQUEST",
|
54
57
|
},
|
55
58
|
],
|
56
59
|
Array [
|
57
60
|
Object {
|
58
|
-
"
|
59
|
-
"type": "TASKS_RESUME_FAILURE",
|
61
|
+
"type": "TASKS_CANCEL_SUCCESS",
|
60
62
|
},
|
61
63
|
],
|
62
64
|
Array [
|
63
65
|
Object {
|
64
66
|
"payload": Object {
|
65
67
|
"message": Object {
|
66
|
-
"message": "
|
67
|
-
"type": "
|
68
|
+
"message": "some-name Task execution was cancelled",
|
69
|
+
"type": "success",
|
68
70
|
},
|
69
71
|
},
|
70
72
|
"type": "TOASTS_ADD",
|
@@ -73,7 +75,7 @@ Array [
|
|
73
75
|
]
|
74
76
|
`;
|
75
77
|
|
76
|
-
exports[`TasksTable actions
|
78
|
+
exports[`TasksTable actions should resumeTaskRequest and fail 1`] = `
|
77
79
|
Array [
|
78
80
|
Array [
|
79
81
|
Object {
|
@@ -82,99 +84,41 @@ Array [
|
|
82
84
|
],
|
83
85
|
Array [
|
84
86
|
Object {
|
85
|
-
"
|
86
|
-
|
87
|
-
],
|
88
|
-
Array [
|
89
|
-
Object {
|
90
|
-
"payload": Object {
|
91
|
-
"message": Object {
|
92
|
-
"message": "I am resumed Task execution was resumed",
|
93
|
-
"type": "success",
|
94
|
-
},
|
95
|
-
},
|
96
|
-
"type": "TOASTS_ADD",
|
87
|
+
"payload": undefined,
|
88
|
+
"type": "TASKS_RESUME_FAILURE",
|
97
89
|
},
|
98
90
|
],
|
99
91
|
Array [
|
100
92
|
Object {
|
101
93
|
"payload": Object {
|
102
94
|
"message": Object {
|
103
|
-
"message": "
|
95
|
+
"message": "some-name Task execution could not be resumed",
|
104
96
|
"type": "error",
|
105
97
|
},
|
106
98
|
},
|
107
99
|
"type": "TOASTS_ADD",
|
108
100
|
},
|
109
101
|
],
|
110
|
-
Array [
|
111
|
-
"TASKS_TABLE",
|
112
|
-
],
|
113
|
-
Array [
|
114
|
-
[Function],
|
115
|
-
],
|
116
|
-
]
|
117
|
-
`;
|
118
|
-
|
119
|
-
exports[`TasksTable actions should cancelTask 1`] = `
|
120
|
-
Array [
|
121
|
-
Array [
|
122
|
-
[Function],
|
123
|
-
],
|
124
|
-
Array [
|
125
|
-
"TASKS_TABLE",
|
126
|
-
],
|
127
|
-
Array [
|
128
|
-
[Function],
|
129
|
-
],
|
130
102
|
]
|
131
103
|
`;
|
132
104
|
|
133
|
-
exports[`TasksTable actions should
|
105
|
+
exports[`TasksTable actions should resumeTaskRequest and succeed 1`] = `
|
134
106
|
Array [
|
135
107
|
Array [
|
136
108
|
Object {
|
137
|
-
"
|
138
|
-
"message": Object {
|
139
|
-
"message": "Trying to cancel \\"some-name\\" task",
|
140
|
-
"type": "info",
|
141
|
-
},
|
142
|
-
},
|
143
|
-
"type": "TOASTS_ADD",
|
144
|
-
},
|
145
|
-
],
|
146
|
-
Array [
|
147
|
-
Object {
|
148
|
-
"payload": Object {
|
149
|
-
"message": Object {
|
150
|
-
"message": "\\"some-name\\" Task cannot be cancelled at the moment.",
|
151
|
-
"type": "error",
|
152
|
-
},
|
153
|
-
},
|
154
|
-
"type": "TOASTS_ADD",
|
109
|
+
"type": "TASKS_RESUME_REQUEST",
|
155
110
|
},
|
156
111
|
],
|
157
|
-
]
|
158
|
-
`;
|
159
|
-
|
160
|
-
exports[`TasksTable actions should cancelTaskRequest and succeed 1`] = `
|
161
|
-
Array [
|
162
112
|
Array [
|
163
113
|
Object {
|
164
|
-
"
|
165
|
-
"message": Object {
|
166
|
-
"message": "Trying to cancel \\"some-name\\" task",
|
167
|
-
"type": "info",
|
168
|
-
},
|
169
|
-
},
|
170
|
-
"type": "TOASTS_ADD",
|
114
|
+
"type": "TASKS_RESUME_SUCCESS",
|
171
115
|
},
|
172
116
|
],
|
173
117
|
Array [
|
174
118
|
Object {
|
175
119
|
"payload": Object {
|
176
120
|
"message": Object {
|
177
|
-
"message": "
|
121
|
+
"message": "some-name Task execution was resumed",
|
178
122
|
"type": "success",
|
179
123
|
},
|
180
124
|
},
|
@@ -184,48 +128,19 @@ Array [
|
|
184
128
|
]
|
185
129
|
`;
|
186
130
|
|
187
|
-
exports[`TasksTable actions should
|
188
|
-
Array [
|
189
|
-
Array [
|
190
|
-
[Function],
|
191
|
-
],
|
192
|
-
Array [
|
193
|
-
"TASKS_TABLE",
|
194
|
-
],
|
195
|
-
Array [
|
196
|
-
[Function],
|
197
|
-
undefined,
|
198
|
-
],
|
199
|
-
]
|
200
|
-
`;
|
201
|
-
|
202
|
-
exports[`TasksTable actions should resumeTaskRequest and fail 1`] = `
|
131
|
+
exports[`TasksTable actions should selectPage and succeed 1`] = `
|
203
132
|
Array [
|
204
133
|
Array [
|
205
134
|
Object {
|
206
|
-
"payload":
|
207
|
-
"
|
208
|
-
|
209
|
-
|
210
|
-
},
|
211
|
-
},
|
212
|
-
"type": "TOASTS_ADD",
|
135
|
+
"payload": Array [
|
136
|
+
"some-id",
|
137
|
+
],
|
138
|
+
"type": "SELECT_ROWS",
|
213
139
|
},
|
214
140
|
],
|
215
|
-
]
|
216
|
-
`;
|
217
|
-
|
218
|
-
exports[`TasksTable actions should resumeTaskRequest and succeed 1`] = `
|
219
|
-
Array [
|
220
141
|
Array [
|
221
142
|
Object {
|
222
|
-
"
|
223
|
-
"message": Object {
|
224
|
-
"message": "\\"some-name\\" Task execution was resumed",
|
225
|
-
"type": "success",
|
226
|
-
},
|
227
|
-
},
|
228
|
-
"type": "TOASTS_ADD",
|
143
|
+
"type": "OPEN_SELECT_ALL",
|
229
144
|
},
|
230
145
|
],
|
231
146
|
]
|