@kineticdata/bundle-queue 6.0.1 → 6.0.2
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.
- package/lib/App.js +1 -2
- package/lib/components/FormPreview.js +6 -11
- package/lib/components/filter_menu/FilterMenuAbstract.js +6 -11
- package/lib/components/filter_menu/FilterMenuModal.js +1 -2
- package/lib/components/filter_menu/FilterMenuToolbar.js +3 -5
- package/lib/components/new_item_menu/NewItemMenu.js +2 -3
- package/lib/components/new_item_menu/NewItemMenuContainer.js +2 -3
- package/lib/components/queue_item/AssignmentBadge.js +2 -3
- package/lib/components/queue_item/QueueItem.js +5 -9
- package/lib/components/queue_item/QueueItemDetails.js +5 -9
- package/lib/components/queue_item/ViewOriginalRequest.js +3 -5
- package/lib/components/queue_list/BulkAssignModal.js +2 -3
- package/lib/components/queue_list/BulkStatusModal.js +2 -3
- package/lib/components/queue_list/BulkWorkModal.js +2 -3
- package/lib/components/queue_list/QueueList.js +2 -3
- package/lib/components/queue_list/QueueListContainer.js +2 -3
- package/lib/components/queue_list/QueueListItem.js +3 -5
- package/lib/components/queue_list/QueueListPagination.js +3 -5
- package/lib/components/queue_list/QueueListSelection.js +3 -5
- package/lib/components/queue_list/QueueListSidebar.js +2 -3
- package/lib/components/settings/QueueSettings.js +3 -5
- package/lib/components/settings/Settings.js +3 -6
- package/lib/components/settings/Sidebar.js +3 -6
- package/lib/components/settings/forms/Export.js +2 -3
- package/lib/components/settings/forms/ExportModal.js +1 -2
- package/lib/components/settings/forms/FormActivity.js +3 -5
- package/lib/components/settings/forms/FormList.js +3 -5
- package/lib/components/settings/forms/FormSettings.js +4 -7
- package/lib/components/settings/forms/FormSubmissions.js +3 -5
- package/lib/components/shared/AssignmentItem.js +2 -3
- package/lib/components/shared/AssignmentSelector.js +2 -3
- package/lib/components/shared/PageTitle.js +3 -5
- package/lib/components/shared/StatusContent.js +4 -7
- package/lib/components/shared/WallyButton.js +5 -9
- package/lib/components/work_menu/WorkMenu.js +5 -9
- package/lib/index.js +3 -2
- package/lib/models.js +2 -3
- package/lib/records.js +11 -21
- package/lib/redux/modules/app.js +4 -7
- package/lib/redux/modules/filterMenu.js +5 -9
- package/lib/redux/modules/forms.js +5 -9
- package/lib/redux/modules/queue.js +4 -8
- package/lib/redux/modules/queueApp.js +11 -19
- package/lib/redux/modules/settingsForms.js +18 -33
- package/lib/redux/modules/settingsQueue.js +5 -9
- package/lib/redux/modules/workMenu.js +5 -9
- package/lib/redux/reducers.js +2 -3
- package/lib/redux/sagas/app.js +11 -15
- package/lib/redux/sagas/forms.js +38 -42
- package/lib/redux/sagas/queue.js +410 -432
- package/lib/redux/sagas/queueApp.js +106 -113
- package/lib/redux/sagas/settingsForms.js +484 -508
- package/lib/redux/sagas/settingsQueue.js +232 -248
- package/lib/redux/sagas.js +7 -9
- package/lib/redux/store.js +5 -9
- package/lib/utils.js +2 -3
- package/package.json +58 -57
package/lib/redux/sagas/queue.js
CHANGED
|
@@ -30,12 +30,9 @@ var _marked = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(fetchList
|
|
|
30
30
|
_marked7 = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(bulkWorkTask),
|
|
31
31
|
_marked8 = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(submitBulkSubmission),
|
|
32
32
|
_marked9 = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(watchQueue);
|
|
33
|
-
var ERROR_STATUS_STRING = 'There was a problem retrieving items.';
|
|
34
|
-
exports.
|
|
35
|
-
var
|
|
36
|
-
exports.SUBMISSION_INCLUDES = SUBMISSION_INCLUDES;
|
|
37
|
-
var SUBMISSION_LIST_INCLUDES = ['details', 'form', 'form.kapp', 'form.attributes', 'form.fields', 'form.fields.details', 'values'];
|
|
38
|
-
exports.SUBMISSION_LIST_INCLUDES = SUBMISSION_LIST_INCLUDES;
|
|
33
|
+
var ERROR_STATUS_STRING = exports.ERROR_STATUS_STRING = 'There was a problem retrieving items.';
|
|
34
|
+
var SUBMISSION_INCLUDES = exports.SUBMISSION_INCLUDES = 'details,values,attributes,form,form.kapp,children,children.details,children.form,children.form.kapp,children.values,form.attributes,parent,parent.details,parent.values,parent.form,parent.form.kapp';
|
|
35
|
+
var SUBMISSION_LIST_INCLUDES = exports.SUBMISSION_LIST_INCLUDES = ['details', 'form', 'form.kapp', 'form.attributes', 'form.fields', 'form.fields.details', 'values'];
|
|
39
36
|
var calculateTeams = function calculateTeams(myTeams, teams) {
|
|
40
37
|
return teams.isEmpty() ? myTeams.map(function (t) {
|
|
41
38
|
return t.name;
|
|
@@ -43,7 +40,7 @@ var calculateTeams = function calculateTeams(myTeams, teams) {
|
|
|
43
40
|
return t.name;
|
|
44
41
|
}));
|
|
45
42
|
};
|
|
46
|
-
var buildSearch = function buildSearch(filter, appSettings, profile) {
|
|
43
|
+
var buildSearch = exports.buildSearch = function buildSearch(filter, appSettings, profile) {
|
|
47
44
|
var searcher = (0, _react.defineKqlQuery)();
|
|
48
45
|
var searcherParams = {};
|
|
49
46
|
|
|
@@ -102,497 +99,478 @@ var buildSearch = function buildSearch(filter, appSettings, profile) {
|
|
|
102
99
|
invalidAssignment: invalidAssignment
|
|
103
100
|
};
|
|
104
101
|
};
|
|
105
|
-
exports.buildSearch = buildSearch;
|
|
106
102
|
function fetchListTask(action) {
|
|
107
103
|
var filter, appSettings, profile, kappSlug, _yield$call, search, invalidAssignment, pageToken, limit, hasPreviousPage, _yield$call2, submissions, nextPageToken, error, count, countPageToken;
|
|
108
104
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchListTask$(_context) {
|
|
109
|
-
while (1) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (!filter) {
|
|
120
|
-
_context.next = 59;
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
_context.next = 7;
|
|
124
|
-
return (0, _effects.select)(function (state) {
|
|
125
|
-
return state.queueApp;
|
|
126
|
-
});
|
|
127
|
-
case 7:
|
|
128
|
-
appSettings = _context.sent;
|
|
129
|
-
_context.next = 10;
|
|
130
|
-
return (0, _effects.select)(function (state) {
|
|
131
|
-
return state.app.profile;
|
|
132
|
-
});
|
|
133
|
-
case 10:
|
|
134
|
-
profile = _context.sent;
|
|
135
|
-
_context.next = 13;
|
|
136
|
-
return (0, _effects.select)(function (state) {
|
|
137
|
-
return state.app.kappSlug;
|
|
138
|
-
});
|
|
139
|
-
case 13:
|
|
140
|
-
kappSlug = _context.sent;
|
|
141
|
-
_context.next = 16;
|
|
142
|
-
return (0, _effects.call)(buildSearch, filter, appSettings, profile);
|
|
143
|
-
case 16:
|
|
144
|
-
_yield$call = _context.sent;
|
|
145
|
-
search = _yield$call.search;
|
|
146
|
-
invalidAssignment = _yield$call.invalidAssignment;
|
|
147
|
-
_context.next = 21;
|
|
148
|
-
return (0, _effects.select)(function (state) {
|
|
149
|
-
return state.queue.pageToken;
|
|
150
|
-
});
|
|
151
|
-
case 21:
|
|
152
|
-
pageToken = _context.sent;
|
|
153
|
-
_context.next = 24;
|
|
154
|
-
return (0, _effects.select)(function (state) {
|
|
155
|
-
return state.queue.limit;
|
|
156
|
-
});
|
|
157
|
-
case 24:
|
|
158
|
-
limit = _context.sent;
|
|
159
|
-
_context.next = 27;
|
|
160
|
-
return (0, _effects.select)(function (state) {
|
|
161
|
-
return state.queue.hasPreviousPage;
|
|
162
|
-
});
|
|
163
|
-
case 27:
|
|
164
|
-
hasPreviousPage = _context.sent;
|
|
165
|
-
if (!invalidAssignment) {
|
|
166
|
-
_context.next = 35;
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
_context.next = 31;
|
|
170
|
-
return (0, _effects.put)(_queue.actions.setListItems(filter, []));
|
|
171
|
-
case 31:
|
|
172
|
-
_context.next = 33;
|
|
173
|
-
return (0, _effects.put)(_queue.actions.fetchListSuccess({
|
|
174
|
-
submissions: [],
|
|
175
|
-
nextPageToken: null
|
|
176
|
-
}));
|
|
177
|
-
case 33:
|
|
105
|
+
while (1) switch (_context.prev = _context.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
_context.prev = 0;
|
|
108
|
+
_context.next = 3;
|
|
109
|
+
return (0, _effects.select)(function (state) {
|
|
110
|
+
return state.queue.currentFilter;
|
|
111
|
+
});
|
|
112
|
+
case 3:
|
|
113
|
+
filter = _context.sent;
|
|
114
|
+
if (!filter) {
|
|
178
115
|
_context.next = 59;
|
|
179
116
|
break;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
117
|
+
}
|
|
118
|
+
_context.next = 7;
|
|
119
|
+
return (0, _effects.select)(function (state) {
|
|
120
|
+
return state.queueApp;
|
|
121
|
+
});
|
|
122
|
+
case 7:
|
|
123
|
+
appSettings = _context.sent;
|
|
124
|
+
_context.next = 10;
|
|
125
|
+
return (0, _effects.select)(function (state) {
|
|
126
|
+
return state.app.profile;
|
|
127
|
+
});
|
|
128
|
+
case 10:
|
|
129
|
+
profile = _context.sent;
|
|
130
|
+
_context.next = 13;
|
|
131
|
+
return (0, _effects.select)(function (state) {
|
|
132
|
+
return state.app.kappSlug;
|
|
133
|
+
});
|
|
134
|
+
case 13:
|
|
135
|
+
kappSlug = _context.sent;
|
|
136
|
+
_context.next = 16;
|
|
137
|
+
return (0, _effects.call)(buildSearch, filter, appSettings, profile);
|
|
138
|
+
case 16:
|
|
139
|
+
_yield$call = _context.sent;
|
|
140
|
+
search = _yield$call.search;
|
|
141
|
+
invalidAssignment = _yield$call.invalidAssignment;
|
|
142
|
+
_context.next = 21;
|
|
143
|
+
return (0, _effects.select)(function (state) {
|
|
144
|
+
return state.queue.pageToken;
|
|
145
|
+
});
|
|
146
|
+
case 21:
|
|
147
|
+
pageToken = _context.sent;
|
|
148
|
+
_context.next = 24;
|
|
149
|
+
return (0, _effects.select)(function (state) {
|
|
150
|
+
return state.queue.limit;
|
|
151
|
+
});
|
|
152
|
+
case 24:
|
|
153
|
+
limit = _context.sent;
|
|
154
|
+
_context.next = 27;
|
|
155
|
+
return (0, _effects.select)(function (state) {
|
|
156
|
+
return state.queue.hasPreviousPage;
|
|
157
|
+
});
|
|
158
|
+
case 27:
|
|
159
|
+
hasPreviousPage = _context.sent;
|
|
160
|
+
if (!invalidAssignment) {
|
|
161
|
+
_context.next = 35;
|
|
204
162
|
break;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
163
|
+
}
|
|
164
|
+
_context.next = 31;
|
|
165
|
+
return (0, _effects.put)(_queue.actions.setListItems(filter, []));
|
|
166
|
+
case 31:
|
|
167
|
+
_context.next = 33;
|
|
168
|
+
return (0, _effects.put)(_queue.actions.fetchListSuccess({
|
|
169
|
+
submissions: [],
|
|
170
|
+
nextPageToken: null
|
|
171
|
+
}));
|
|
172
|
+
case 33:
|
|
173
|
+
_context.next = 59;
|
|
174
|
+
break;
|
|
175
|
+
case 35:
|
|
176
|
+
_context.next = 37;
|
|
177
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
178
|
+
kapp: kappSlug,
|
|
179
|
+
search: search,
|
|
180
|
+
limit: limit,
|
|
181
|
+
pageToken: pageToken,
|
|
182
|
+
count: !pageToken
|
|
183
|
+
});
|
|
184
|
+
case 37:
|
|
185
|
+
_yield$call2 = _context.sent;
|
|
186
|
+
submissions = _yield$call2.submissions;
|
|
187
|
+
nextPageToken = _yield$call2.nextPageToken;
|
|
188
|
+
error = _yield$call2.error;
|
|
189
|
+
count = _yield$call2.count;
|
|
190
|
+
countPageToken = _yield$call2.countPageToken;
|
|
191
|
+
if (!error) {
|
|
192
|
+
_context.next = 48;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
_context.next = 46;
|
|
196
|
+
return (0, _effects.put)(_queue.actions.fetchListFailure(error));
|
|
197
|
+
case 46:
|
|
198
|
+
_context.next = 59;
|
|
199
|
+
break;
|
|
200
|
+
case 48:
|
|
201
|
+
if (!((!submissions || submissions.length === 0) && hasPreviousPage)) {
|
|
202
|
+
_context.next = 53;
|
|
214
203
|
break;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
204
|
+
}
|
|
205
|
+
_context.next = 51;
|
|
206
|
+
return (0, _effects.put)(_queue.actions.fetchListPrevious());
|
|
207
|
+
case 51:
|
|
208
|
+
_context.next = 59;
|
|
209
|
+
break;
|
|
210
|
+
case 53:
|
|
211
|
+
_context.next = 55;
|
|
212
|
+
return (0, _effects.put)(_queue.actions.fetchListSuccess({
|
|
213
|
+
submissions: submissions,
|
|
214
|
+
nextPageToken: nextPageToken
|
|
215
|
+
}));
|
|
216
|
+
case 55:
|
|
217
|
+
if (!(typeof count !== 'undefined')) {
|
|
226
218
|
_context.next = 58;
|
|
227
|
-
return (0, _effects.put)(_queue.actions.fetchListCountSuccess({
|
|
228
|
-
filter: filter,
|
|
229
|
-
count: countPageToken ? "".concat(count, "+") : count
|
|
230
|
-
}));
|
|
231
|
-
case 58:
|
|
232
|
-
// Call the callback if provided
|
|
233
|
-
if (typeof action.payload === 'function') {
|
|
234
|
-
action.payload(submissions);
|
|
235
|
-
}
|
|
236
|
-
case 59:
|
|
237
|
-
_context.next = 64;
|
|
238
219
|
break;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
220
|
+
}
|
|
221
|
+
_context.next = 58;
|
|
222
|
+
return (0, _effects.put)(_queue.actions.fetchListCountSuccess({
|
|
223
|
+
filter: filter,
|
|
224
|
+
count: countPageToken ? "".concat(count, "+") : count
|
|
225
|
+
}));
|
|
226
|
+
case 58:
|
|
227
|
+
// Call the callback if provided
|
|
228
|
+
if (typeof action.payload === 'function') {
|
|
229
|
+
action.payload(submissions);
|
|
230
|
+
}
|
|
231
|
+
case 59:
|
|
232
|
+
_context.next = 64;
|
|
233
|
+
break;
|
|
234
|
+
case 61:
|
|
235
|
+
_context.prev = 61;
|
|
236
|
+
_context.t0 = _context["catch"](0);
|
|
237
|
+
console.error('There was a problem fetching queue list items:', _context.t0);
|
|
238
|
+
case 64:
|
|
239
|
+
case "end":
|
|
240
|
+
return _context.stop();
|
|
247
241
|
}
|
|
248
242
|
}, _marked, null, [[0, 61]]);
|
|
249
243
|
}
|
|
250
244
|
function fetchListCountTask(action) {
|
|
251
245
|
var filter, appSettings, profile, kappSlug, _yield$call3, search, invalidAssignment, _yield$call4, error, count, countPageToken;
|
|
252
246
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchListCountTask$(_context2) {
|
|
253
|
-
while (1) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (!filter) {
|
|
259
|
-
_context2.next = 31;
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
_context2.next = 5;
|
|
263
|
-
return (0, _effects.select)(function (state) {
|
|
264
|
-
return state.queueApp;
|
|
265
|
-
});
|
|
266
|
-
case 5:
|
|
267
|
-
appSettings = _context2.sent;
|
|
268
|
-
_context2.next = 8;
|
|
269
|
-
return (0, _effects.select)(function (state) {
|
|
270
|
-
return state.app.profile;
|
|
271
|
-
});
|
|
272
|
-
case 8:
|
|
273
|
-
profile = _context2.sent;
|
|
274
|
-
_context2.next = 11;
|
|
275
|
-
return (0, _effects.select)(function (state) {
|
|
276
|
-
return state.app.kappSlug;
|
|
277
|
-
});
|
|
278
|
-
case 11:
|
|
279
|
-
kappSlug = _context2.sent;
|
|
280
|
-
_context2.next = 14;
|
|
281
|
-
return (0, _effects.call)(buildSearch, filter, appSettings, profile);
|
|
282
|
-
case 14:
|
|
283
|
-
_yield$call3 = _context2.sent;
|
|
284
|
-
search = _yield$call3.search;
|
|
285
|
-
invalidAssignment = _yield$call3.invalidAssignment;
|
|
286
|
-
if (!invalidAssignment) {
|
|
287
|
-
_context2.next = 22;
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
_context2.next = 20;
|
|
291
|
-
return (0, _effects.put)(_queue.actions.fetchListSuccess([], null));
|
|
292
|
-
case 20:
|
|
247
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
248
|
+
case 0:
|
|
249
|
+
_context2.prev = 0;
|
|
250
|
+
filter = action.payload;
|
|
251
|
+
if (!filter) {
|
|
293
252
|
_context2.next = 31;
|
|
294
253
|
break;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
254
|
+
}
|
|
255
|
+
_context2.next = 5;
|
|
256
|
+
return (0, _effects.select)(function (state) {
|
|
257
|
+
return state.queueApp;
|
|
258
|
+
});
|
|
259
|
+
case 5:
|
|
260
|
+
appSettings = _context2.sent;
|
|
261
|
+
_context2.next = 8;
|
|
262
|
+
return (0, _effects.select)(function (state) {
|
|
263
|
+
return state.app.profile;
|
|
264
|
+
});
|
|
265
|
+
case 8:
|
|
266
|
+
profile = _context2.sent;
|
|
267
|
+
_context2.next = 11;
|
|
268
|
+
return (0, _effects.select)(function (state) {
|
|
269
|
+
return state.app.kappSlug;
|
|
270
|
+
});
|
|
271
|
+
case 11:
|
|
272
|
+
kappSlug = _context2.sent;
|
|
273
|
+
_context2.next = 14;
|
|
274
|
+
return (0, _effects.call)(buildSearch, filter, appSettings, profile);
|
|
275
|
+
case 14:
|
|
276
|
+
_yield$call3 = _context2.sent;
|
|
277
|
+
search = _yield$call3.search;
|
|
278
|
+
invalidAssignment = _yield$call3.invalidAssignment;
|
|
279
|
+
if (!invalidAssignment) {
|
|
280
|
+
_context2.next = 22;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
_context2.next = 20;
|
|
284
|
+
return (0, _effects.put)(_queue.actions.fetchListSuccess([], null));
|
|
285
|
+
case 20:
|
|
286
|
+
_context2.next = 31;
|
|
287
|
+
break;
|
|
288
|
+
case 22:
|
|
289
|
+
_context2.next = 24;
|
|
290
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
291
|
+
kapp: kappSlug,
|
|
292
|
+
search: search,
|
|
293
|
+
count: true,
|
|
294
|
+
limit: 0
|
|
295
|
+
});
|
|
296
|
+
case 24:
|
|
297
|
+
_yield$call4 = _context2.sent;
|
|
298
|
+
error = _yield$call4.error;
|
|
299
|
+
count = _yield$call4.count;
|
|
300
|
+
countPageToken = _yield$call4.countPageToken;
|
|
301
|
+
if (!(!error && typeof count !== 'undefined')) {
|
|
312
302
|
_context2.next = 31;
|
|
313
|
-
return (0, _effects.put)(_queue.actions.fetchListCountSuccess({
|
|
314
|
-
filter: filter,
|
|
315
|
-
count: countPageToken ? "".concat(count, "+") : count
|
|
316
|
-
}));
|
|
317
|
-
case 31:
|
|
318
|
-
_context2.next = 36;
|
|
319
303
|
break;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
304
|
+
}
|
|
305
|
+
_context2.next = 31;
|
|
306
|
+
return (0, _effects.put)(_queue.actions.fetchListCountSuccess({
|
|
307
|
+
filter: filter,
|
|
308
|
+
count: countPageToken ? "".concat(count, "+") : count
|
|
309
|
+
}));
|
|
310
|
+
case 31:
|
|
311
|
+
_context2.next = 36;
|
|
312
|
+
break;
|
|
313
|
+
case 33:
|
|
314
|
+
_context2.prev = 33;
|
|
315
|
+
_context2.t0 = _context2["catch"](0);
|
|
316
|
+
console.error('There was a problem fetching queue list counts:', _context2.t0);
|
|
317
|
+
case 36:
|
|
318
|
+
case "end":
|
|
319
|
+
return _context2.stop();
|
|
328
320
|
}
|
|
329
321
|
}, _marked2, null, [[0, 33]]);
|
|
330
322
|
}
|
|
331
323
|
function fetchCurrentItemTask(action) {
|
|
332
324
|
var _yield$call5, submission, error;
|
|
333
325
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchCurrentItemTask$(_context3) {
|
|
334
|
-
while (1) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
_context3.next = 10;
|
|
348
|
-
break;
|
|
349
|
-
}
|
|
350
|
-
_context3.next = 8;
|
|
351
|
-
return (0, _effects.put)(_queue.actions.setCurrentItem(submission));
|
|
352
|
-
case 8:
|
|
353
|
-
_context3.next = 12;
|
|
326
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
327
|
+
case 0:
|
|
328
|
+
_context3.next = 2;
|
|
329
|
+
return (0, _effects.call)(_react.fetchSubmission, {
|
|
330
|
+
id: action.payload,
|
|
331
|
+
include: SUBMISSION_INCLUDES
|
|
332
|
+
});
|
|
333
|
+
case 2:
|
|
334
|
+
_yield$call5 = _context3.sent;
|
|
335
|
+
submission = _yield$call5.submission;
|
|
336
|
+
error = _yield$call5.error;
|
|
337
|
+
if (error) {
|
|
338
|
+
_context3.next = 10;
|
|
354
339
|
break;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
340
|
+
}
|
|
341
|
+
_context3.next = 8;
|
|
342
|
+
return (0, _effects.put)(_queue.actions.setCurrentItem(submission));
|
|
343
|
+
case 8:
|
|
344
|
+
_context3.next = 12;
|
|
345
|
+
break;
|
|
346
|
+
case 10:
|
|
347
|
+
_context3.next = 12;
|
|
348
|
+
return (0, _effects.put)((0, _bundleCommon.addToastAlert)('Failed to retrieve item!'));
|
|
349
|
+
case 12:
|
|
350
|
+
case "end":
|
|
351
|
+
return _context3.stop();
|
|
362
352
|
}
|
|
363
353
|
}, _marked3);
|
|
364
354
|
}
|
|
365
355
|
function updateQueueItemTask(action) {
|
|
366
356
|
var _yield$call6, submission;
|
|
367
357
|
return (0, _regeneratorRuntime2["default"])().wrap(function updateQueueItemTask$(_context4) {
|
|
368
|
-
while (1) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
_context4.next = 8;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
if ((0, _isFunction["default"])(action.payload.onSuccess)) {
|
|
385
|
-
action.payload.onSuccess(submission);
|
|
386
|
-
}
|
|
387
|
-
_context4.next = 10;
|
|
358
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
359
|
+
case 0:
|
|
360
|
+
_context4.next = 2;
|
|
361
|
+
return (0, _effects.call)(_react.updateSubmission, {
|
|
362
|
+
id: action.payload.id,
|
|
363
|
+
values: action.payload.values,
|
|
364
|
+
include: SUBMISSION_INCLUDES
|
|
365
|
+
});
|
|
366
|
+
case 2:
|
|
367
|
+
_yield$call6 = _context4.sent;
|
|
368
|
+
submission = _yield$call6.submission;
|
|
369
|
+
if (!submission) {
|
|
370
|
+
_context4.next = 8;
|
|
388
371
|
break;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
372
|
+
}
|
|
373
|
+
if ((0, _isFunction["default"])(action.payload.onSuccess)) {
|
|
374
|
+
action.payload.onSuccess(submission);
|
|
375
|
+
}
|
|
376
|
+
_context4.next = 10;
|
|
377
|
+
break;
|
|
378
|
+
case 8:
|
|
379
|
+
_context4.next = 10;
|
|
380
|
+
return (0, _effects.put)((0, _bundleCommon.addToastAlert)('Failed to update item!'));
|
|
381
|
+
case 10:
|
|
382
|
+
case "end":
|
|
383
|
+
return _context4.stop();
|
|
396
384
|
}
|
|
397
385
|
}, _marked4);
|
|
398
386
|
}
|
|
399
387
|
function bulkAssignTask(action) {
|
|
400
388
|
var submissions, assignment;
|
|
401
389
|
return (0, _regeneratorRuntime2["default"])().wrap(function bulkAssignTask$(_context5) {
|
|
402
|
-
while (1) {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return
|
|
407
|
-
|
|
390
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
391
|
+
case 0:
|
|
392
|
+
_context5.next = 2;
|
|
393
|
+
return (0, _effects.select)(function (state) {
|
|
394
|
+
return state.queue.selectedList;
|
|
395
|
+
});
|
|
396
|
+
case 2:
|
|
397
|
+
submissions = _context5.sent;
|
|
398
|
+
assignment = action.payload.assignment;
|
|
399
|
+
if (!(!submissions || !assignment)) {
|
|
400
|
+
_context5.next = 6;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
return _context5.abrupt("return");
|
|
404
|
+
case 6:
|
|
405
|
+
_context5.next = 8;
|
|
406
|
+
return (0, _effects.all)(submissions.toList().map(function (submission, i) {
|
|
407
|
+
return (0, _effects.call)(updateBulkSubmission, {
|
|
408
|
+
id: submission.id,
|
|
409
|
+
values: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, submission.values), assignment),
|
|
410
|
+
include: SUBMISSION_LIST_INCLUDES.join(',')
|
|
408
411
|
});
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
return (0, _effects.all)(submissions.toList().map(function (submission, i) {
|
|
420
|
-
return (0, _effects.call)(updateBulkSubmission, {
|
|
421
|
-
id: submission.id,
|
|
422
|
-
values: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, submission.values), assignment),
|
|
423
|
-
include: SUBMISSION_LIST_INCLUDES.join(',')
|
|
424
|
-
});
|
|
425
|
-
}).toJS());
|
|
426
|
-
case 8:
|
|
427
|
-
_context5.next = 10;
|
|
428
|
-
return (0, _reduxSaga.delay)(500);
|
|
429
|
-
case 10:
|
|
430
|
-
_context5.next = 12;
|
|
431
|
-
return (0, _effects.put)(_queue.actions.bulkAssignComplete());
|
|
432
|
-
case 12:
|
|
433
|
-
case "end":
|
|
434
|
-
return _context5.stop();
|
|
435
|
-
}
|
|
412
|
+
}).toJS());
|
|
413
|
+
case 8:
|
|
414
|
+
_context5.next = 10;
|
|
415
|
+
return (0, _reduxSaga.delay)(500);
|
|
416
|
+
case 10:
|
|
417
|
+
_context5.next = 12;
|
|
418
|
+
return (0, _effects.put)(_queue.actions.bulkAssignComplete());
|
|
419
|
+
case 12:
|
|
420
|
+
case "end":
|
|
421
|
+
return _context5.stop();
|
|
436
422
|
}
|
|
437
423
|
}, _marked5);
|
|
438
424
|
}
|
|
439
425
|
function updateBulkSubmission(params) {
|
|
440
426
|
var _yield$call7, submission, error;
|
|
441
427
|
return (0, _regeneratorRuntime2["default"])().wrap(function updateBulkSubmission$(_context6) {
|
|
442
|
-
while (1) {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
_context6.next = 10;
|
|
453
|
-
break;
|
|
454
|
-
}
|
|
455
|
-
_context6.next = 8;
|
|
456
|
-
return (0, _effects.put)(_queue.actions.bulkStatusUpdate({
|
|
457
|
-
status: 'error',
|
|
458
|
-
data: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, error), {}, {
|
|
459
|
-
submissionId: params.id
|
|
460
|
-
})
|
|
461
|
-
}));
|
|
462
|
-
case 8:
|
|
463
|
-
_context6.next = 12;
|
|
428
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
429
|
+
case 0:
|
|
430
|
+
_context6.next = 2;
|
|
431
|
+
return (0, _effects.call)(_react.updateSubmission, params);
|
|
432
|
+
case 2:
|
|
433
|
+
_yield$call7 = _context6.sent;
|
|
434
|
+
submission = _yield$call7.submission;
|
|
435
|
+
error = _yield$call7.error;
|
|
436
|
+
if (!error) {
|
|
437
|
+
_context6.next = 10;
|
|
464
438
|
break;
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
439
|
+
}
|
|
440
|
+
_context6.next = 8;
|
|
441
|
+
return (0, _effects.put)(_queue.actions.bulkStatusUpdate({
|
|
442
|
+
status: 'error',
|
|
443
|
+
data: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, error), {}, {
|
|
444
|
+
submissionId: params.id
|
|
445
|
+
})
|
|
446
|
+
}));
|
|
447
|
+
case 8:
|
|
448
|
+
_context6.next = 12;
|
|
449
|
+
break;
|
|
450
|
+
case 10:
|
|
451
|
+
_context6.next = 12;
|
|
452
|
+
return (0, _effects.put)(_queue.actions.bulkStatusUpdate({
|
|
453
|
+
status: 'success',
|
|
454
|
+
data: submission
|
|
455
|
+
}));
|
|
456
|
+
case 12:
|
|
457
|
+
case "end":
|
|
458
|
+
return _context6.stop();
|
|
475
459
|
}
|
|
476
460
|
}, _marked6);
|
|
477
461
|
}
|
|
478
462
|
function bulkWorkTask(action) {
|
|
479
463
|
var submissions, profile, assignment, values;
|
|
480
464
|
return (0, _regeneratorRuntime2["default"])().wrap(function bulkWorkTask$(_context7) {
|
|
481
|
-
while (1) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
return
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
return
|
|
492
|
-
|
|
465
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
466
|
+
case 0:
|
|
467
|
+
_context7.next = 2;
|
|
468
|
+
return (0, _effects.select)(function (state) {
|
|
469
|
+
return state.queue.selectedList;
|
|
470
|
+
});
|
|
471
|
+
case 2:
|
|
472
|
+
submissions = _context7.sent;
|
|
473
|
+
_context7.next = 5;
|
|
474
|
+
return (0, _effects.select)(function (state) {
|
|
475
|
+
return state.app.profile;
|
|
476
|
+
});
|
|
477
|
+
case 5:
|
|
478
|
+
profile = _context7.sent;
|
|
479
|
+
// Override the assigned individual to be the current user in case someone
|
|
480
|
+
// grabbed this ticket while the bulk action was being taken
|
|
481
|
+
assignment = {
|
|
482
|
+
'Assigned Individual': profile.username,
|
|
483
|
+
'Assigned Individual Display Name': profile.displayName || profile.username
|
|
484
|
+
};
|
|
485
|
+
values = action.payload.values;
|
|
486
|
+
if (!(!submissions || !values)) {
|
|
487
|
+
_context7.next = 10;
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
return _context7.abrupt("return");
|
|
491
|
+
case 10:
|
|
492
|
+
_context7.next = 12;
|
|
493
|
+
return (0, _effects.all)(submissions.toList().map(function (submission, i) {
|
|
494
|
+
return (0, _effects.call)(submitBulkSubmission, {
|
|
495
|
+
id: submission.id,
|
|
496
|
+
page: submission.currentPage,
|
|
497
|
+
values: (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, submission.values), assignment), values),
|
|
498
|
+
include: SUBMISSION_LIST_INCLUDES.join(',')
|
|
493
499
|
});
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
_context7.next = 10;
|
|
505
|
-
break;
|
|
506
|
-
}
|
|
507
|
-
return _context7.abrupt("return");
|
|
508
|
-
case 10:
|
|
509
|
-
_context7.next = 12;
|
|
510
|
-
return (0, _effects.all)(submissions.toList().map(function (submission, i) {
|
|
511
|
-
return (0, _effects.call)(submitBulkSubmission, {
|
|
512
|
-
id: submission.id,
|
|
513
|
-
page: submission.currentPage,
|
|
514
|
-
values: (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, submission.values), assignment), values),
|
|
515
|
-
include: SUBMISSION_LIST_INCLUDES.join(',')
|
|
516
|
-
});
|
|
517
|
-
}).toJS());
|
|
518
|
-
case 12:
|
|
519
|
-
_context7.next = 14;
|
|
520
|
-
return (0, _reduxSaga.delay)(500);
|
|
521
|
-
case 14:
|
|
522
|
-
_context7.next = 16;
|
|
523
|
-
return (0, _effects.put)(_queue.actions.bulkWorkComplete());
|
|
524
|
-
case 16:
|
|
525
|
-
case "end":
|
|
526
|
-
return _context7.stop();
|
|
527
|
-
}
|
|
500
|
+
}).toJS());
|
|
501
|
+
case 12:
|
|
502
|
+
_context7.next = 14;
|
|
503
|
+
return (0, _reduxSaga.delay)(500);
|
|
504
|
+
case 14:
|
|
505
|
+
_context7.next = 16;
|
|
506
|
+
return (0, _effects.put)(_queue.actions.bulkWorkComplete());
|
|
507
|
+
case 16:
|
|
508
|
+
case "end":
|
|
509
|
+
return _context7.stop();
|
|
528
510
|
}
|
|
529
511
|
}, _marked7);
|
|
530
512
|
}
|
|
531
513
|
function submitBulkSubmission(params) {
|
|
532
514
|
var _yield$call8, submission, error;
|
|
533
515
|
return (0, _regeneratorRuntime2["default"])().wrap(function submitBulkSubmission$(_context8) {
|
|
534
|
-
while (1) {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
_context8.next = 10;
|
|
545
|
-
break;
|
|
546
|
-
}
|
|
547
|
-
_context8.next = 8;
|
|
548
|
-
return (0, _effects.put)(_queue.actions.bulkStatusUpdate({
|
|
549
|
-
status: 'error',
|
|
550
|
-
data: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, error), {}, {
|
|
551
|
-
submissionId: params.id
|
|
552
|
-
})
|
|
553
|
-
}));
|
|
554
|
-
case 8:
|
|
555
|
-
_context8.next = 12;
|
|
516
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
517
|
+
case 0:
|
|
518
|
+
_context8.next = 2;
|
|
519
|
+
return (0, _effects.call)(_react.submitSubmission, params);
|
|
520
|
+
case 2:
|
|
521
|
+
_yield$call8 = _context8.sent;
|
|
522
|
+
submission = _yield$call8.submission;
|
|
523
|
+
error = _yield$call8.error;
|
|
524
|
+
if (!error) {
|
|
525
|
+
_context8.next = 10;
|
|
556
526
|
break;
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
527
|
+
}
|
|
528
|
+
_context8.next = 8;
|
|
529
|
+
return (0, _effects.put)(_queue.actions.bulkStatusUpdate({
|
|
530
|
+
status: 'error',
|
|
531
|
+
data: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, error), {}, {
|
|
532
|
+
submissionId: params.id
|
|
533
|
+
})
|
|
534
|
+
}));
|
|
535
|
+
case 8:
|
|
536
|
+
_context8.next = 12;
|
|
537
|
+
break;
|
|
538
|
+
case 10:
|
|
539
|
+
_context8.next = 12;
|
|
540
|
+
return (0, _effects.put)(_queue.actions.bulkStatusUpdate({
|
|
541
|
+
status: 'success',
|
|
542
|
+
data: submission
|
|
543
|
+
}));
|
|
544
|
+
case 12:
|
|
545
|
+
case "end":
|
|
546
|
+
return _context8.stop();
|
|
567
547
|
}
|
|
568
548
|
}, _marked8);
|
|
569
549
|
}
|
|
570
550
|
function watchQueue() {
|
|
571
551
|
return (0, _regeneratorRuntime2["default"])().wrap(function watchQueue$(_context9) {
|
|
572
|
-
while (1) {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
return _context9.stop();
|
|
595
|
-
}
|
|
552
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
553
|
+
case 0:
|
|
554
|
+
_context9.next = 2;
|
|
555
|
+
return (0, _effects.takeLatest)([_queue.types.FETCH_LIST_REQUEST, _queue.types.FETCH_LIST_PREVIOUS, _queue.types.FETCH_LIST_NEXT, _queue.types.FETCH_LIST_RESET, _queue.types.UPDATE_LIST_LIMIT], fetchListTask);
|
|
556
|
+
case 2:
|
|
557
|
+
_context9.next = 4;
|
|
558
|
+
return (0, _effects.takeEvery)(_queue.types.FETCH_LIST_COUNT_REQUEST, fetchListCountTask);
|
|
559
|
+
case 4:
|
|
560
|
+
_context9.next = 6;
|
|
561
|
+
return (0, _effects.takeEvery)(_queue.types.FETCH_CURRENT_ITEM, fetchCurrentItemTask);
|
|
562
|
+
case 6:
|
|
563
|
+
_context9.next = 8;
|
|
564
|
+
return (0, _effects.takeEvery)(_queue.types.UPDATE_QUEUE_ITEM, updateQueueItemTask);
|
|
565
|
+
case 8:
|
|
566
|
+
_context9.next = 10;
|
|
567
|
+
return (0, _effects.takeEvery)(_queue.types.BULK_ASSIGN_REQUEST, bulkAssignTask);
|
|
568
|
+
case 10:
|
|
569
|
+
_context9.next = 12;
|
|
570
|
+
return (0, _effects.takeEvery)(_queue.types.BULK_WORK_REQUEST, bulkWorkTask);
|
|
571
|
+
case 12:
|
|
572
|
+
case "end":
|
|
573
|
+
return _context9.stop();
|
|
596
574
|
}
|
|
597
575
|
}, _marked9);
|
|
598
576
|
}
|