@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
|
@@ -36,72 +36,68 @@ var _marked = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(fetchForm
|
|
|
36
36
|
function fetchFormSaga(action) {
|
|
37
37
|
var _yield$call, error, form;
|
|
38
38
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchFormSaga$(_context) {
|
|
39
|
-
while (1) {
|
|
40
|
-
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_context.next = 2;
|
|
42
|
+
return (0, _effects.call)(_react.fetchForm, {
|
|
43
|
+
kappSlug: action.payload.kappSlug,
|
|
44
|
+
formSlug: action.payload.formSlug,
|
|
45
|
+
include: _settingsForms.FORM_INCLUDES
|
|
46
|
+
});
|
|
47
|
+
case 2:
|
|
48
|
+
_yield$call = _context.sent;
|
|
49
|
+
error = _yield$call.error;
|
|
50
|
+
form = _yield$call.form;
|
|
51
|
+
if (!error) {
|
|
52
|
+
_context.next = 10;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
_context.next = 8;
|
|
56
|
+
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
57
|
+
case 8:
|
|
58
|
+
_context.next = 12;
|
|
59
|
+
break;
|
|
60
|
+
case 10:
|
|
61
|
+
_context.next = 12;
|
|
62
|
+
return (0, _effects.put)(_settingsForms.actions.setForm(form));
|
|
63
|
+
case 12:
|
|
64
|
+
case "end":
|
|
65
|
+
return _context.stop();
|
|
66
|
+
}
|
|
67
|
+
}, _marked);
|
|
68
|
+
}
|
|
69
|
+
function fetchFormRequestSaga(_ref) {
|
|
70
|
+
var payload = _ref.payload;
|
|
71
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
72
|
+
var _yield$call2, error, form;
|
|
73
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context2) {
|
|
74
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
41
75
|
case 0:
|
|
42
|
-
|
|
76
|
+
_context2.next = 2;
|
|
43
77
|
return (0, _effects.call)(_react.fetchForm, {
|
|
44
|
-
kappSlug:
|
|
45
|
-
formSlug:
|
|
78
|
+
kappSlug: payload.kappSlug,
|
|
79
|
+
formSlug: payload.formSlug,
|
|
46
80
|
include: _settingsForms.FORM_INCLUDES
|
|
47
81
|
});
|
|
48
82
|
case 2:
|
|
49
|
-
_yield$
|
|
50
|
-
error = _yield$
|
|
51
|
-
form = _yield$
|
|
83
|
+
_yield$call2 = _context2.sent;
|
|
84
|
+
error = _yield$call2.error;
|
|
85
|
+
form = _yield$call2.form;
|
|
52
86
|
if (!error) {
|
|
53
|
-
|
|
87
|
+
_context2.next = 10;
|
|
54
88
|
break;
|
|
55
89
|
}
|
|
56
|
-
|
|
57
|
-
return (0, _effects.put)(_settingsForms.actions.
|
|
90
|
+
_context2.next = 8;
|
|
91
|
+
return (0, _effects.put)(_settingsForms.actions.fetchFormFailure(error));
|
|
58
92
|
case 8:
|
|
59
|
-
|
|
93
|
+
_context2.next = 12;
|
|
60
94
|
break;
|
|
61
95
|
case 10:
|
|
62
|
-
|
|
63
|
-
return (0, _effects.put)(_settingsForms.actions.
|
|
96
|
+
_context2.next = 12;
|
|
97
|
+
return (0, _effects.put)(_settingsForms.actions.fetchFormSuccess(form));
|
|
64
98
|
case 12:
|
|
65
99
|
case "end":
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, _marked);
|
|
70
|
-
}
|
|
71
|
-
function fetchFormRequestSaga(_ref) {
|
|
72
|
-
var payload = _ref.payload;
|
|
73
|
-
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
74
|
-
var _yield$call2, error, form;
|
|
75
|
-
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context2) {
|
|
76
|
-
while (1) {
|
|
77
|
-
switch (_context2.prev = _context2.next) {
|
|
78
|
-
case 0:
|
|
79
|
-
_context2.next = 2;
|
|
80
|
-
return (0, _effects.call)(_react.fetchForm, {
|
|
81
|
-
kappSlug: payload.kappSlug,
|
|
82
|
-
formSlug: payload.formSlug,
|
|
83
|
-
include: _settingsForms.FORM_INCLUDES
|
|
84
|
-
});
|
|
85
|
-
case 2:
|
|
86
|
-
_yield$call2 = _context2.sent;
|
|
87
|
-
error = _yield$call2.error;
|
|
88
|
-
form = _yield$call2.form;
|
|
89
|
-
if (!error) {
|
|
90
|
-
_context2.next = 10;
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
_context2.next = 8;
|
|
94
|
-
return (0, _effects.put)(_settingsForms.actions.fetchFormFailure(error));
|
|
95
|
-
case 8:
|
|
96
|
-
_context2.next = 12;
|
|
97
|
-
break;
|
|
98
|
-
case 10:
|
|
99
|
-
_context2.next = 12;
|
|
100
|
-
return (0, _effects.put)(_settingsForms.actions.fetchFormSuccess(form));
|
|
101
|
-
case 12:
|
|
102
|
-
case "end":
|
|
103
|
-
return _context2.stop();
|
|
104
|
-
}
|
|
100
|
+
return _context2.stop();
|
|
105
101
|
}
|
|
106
102
|
}, _callee);
|
|
107
103
|
})();
|
|
@@ -111,71 +107,69 @@ function cloneFormSaga(_ref2) {
|
|
|
111
107
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
112
108
|
var _yield$call3, cloneError, cloneForm, _yield$call4, error, form;
|
|
113
109
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context3) {
|
|
114
|
-
while (1) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
_context3.next = 11;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
(0, _bundleCommon.addToastAlert)({
|
|
132
|
-
title: 'Error Cloning Form',
|
|
133
|
-
message: 'Could not find form to clone.'
|
|
134
|
-
});
|
|
135
|
-
_context3.next = 9;
|
|
136
|
-
return (0, _effects.put)(_settingsForms.actions.cloneFormComplete(payload));
|
|
137
|
-
case 9:
|
|
138
|
-
_context3.next = 24;
|
|
110
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
_context3.next = 2;
|
|
113
|
+
return (0, _effects.call)(_react.fetchForm, {
|
|
114
|
+
kappSlug: payload.kappSlug,
|
|
115
|
+
formSlug: payload.cloneFormSlug,
|
|
116
|
+
include: _settingsForms.FORM_FULL_INCLUDES
|
|
117
|
+
});
|
|
118
|
+
case 2:
|
|
119
|
+
_yield$call3 = _context3.sent;
|
|
120
|
+
cloneError = _yield$call3.error;
|
|
121
|
+
cloneForm = _yield$call3.form;
|
|
122
|
+
if (!cloneError) {
|
|
123
|
+
_context3.next = 11;
|
|
139
124
|
break;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
125
|
+
}
|
|
126
|
+
(0, _bundleCommon.addToastAlert)({
|
|
127
|
+
title: 'Error Cloning Form',
|
|
128
|
+
message: 'Could not find form to clone.'
|
|
129
|
+
});
|
|
130
|
+
_context3.next = 9;
|
|
131
|
+
return (0, _effects.put)(_settingsForms.actions.cloneFormComplete(payload));
|
|
132
|
+
case 9:
|
|
133
|
+
_context3.next = 24;
|
|
134
|
+
break;
|
|
135
|
+
case 11:
|
|
136
|
+
_context3.next = 13;
|
|
137
|
+
return (0, _effects.call)(_react.updateForm, {
|
|
138
|
+
kappSlug: payload.kappSlug,
|
|
139
|
+
formSlug: payload.formSlug,
|
|
140
|
+
form: {
|
|
141
|
+
bridgedResources: cloneForm.bridgedResources,
|
|
142
|
+
customHeadContent: cloneForm.customHeadContent,
|
|
143
|
+
pages: cloneForm.pages,
|
|
144
|
+
securityPolicies: cloneForm.securityPolicies,
|
|
145
|
+
attributesMap: cloneForm.attributesMap,
|
|
146
|
+
categorizations: cloneForm.categorizations
|
|
161
147
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
148
|
+
});
|
|
149
|
+
case 13:
|
|
150
|
+
_yield$call4 = _context3.sent;
|
|
151
|
+
error = _yield$call4.error;
|
|
152
|
+
form = _yield$call4.form;
|
|
153
|
+
if (!error) {
|
|
166
154
|
_context3.next = 20;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
(0, _bundleCommon.addToastAlert)({
|
|
158
|
+
title: 'Error Cloning Form',
|
|
159
|
+
message: error.message
|
|
160
|
+
});
|
|
161
|
+
_context3.next = 20;
|
|
162
|
+
return (0, _effects.put)(_settingsForms.actions.cloneFormComplete(payload));
|
|
163
|
+
case 20:
|
|
164
|
+
(0, _bundleCommon.addToast)("".concat(form.name, " cloned successfully from ").concat(cloneForm.name));
|
|
165
|
+
if (typeof payload.callback === 'function') {
|
|
166
|
+
payload.callback(form);
|
|
167
|
+
}
|
|
168
|
+
_context3.next = 24;
|
|
169
|
+
return (0, _effects.put)(_settingsForms.actions.cloneFormComplete(payload));
|
|
170
|
+
case 24:
|
|
171
|
+
case "end":
|
|
172
|
+
return _context3.stop();
|
|
179
173
|
}
|
|
180
174
|
}, _callee2);
|
|
181
175
|
})();
|
|
@@ -183,372 +177,358 @@ function cloneFormSaga(_ref2) {
|
|
|
183
177
|
function fetchFormSubmissionsSaga(action) {
|
|
184
178
|
var kappSlug, pageToken, formSlug, q, searchBuilder, key, search, _yield$call5, submissions, nextPageToken, error;
|
|
185
179
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchFormSubmissionsSaga$(_context4) {
|
|
186
|
-
while (1) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
searchBuilder.eq(key, q[key]);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
searchBuilder.end();
|
|
203
|
-
search = searchBuilder.build();
|
|
204
|
-
_context4.next = 11;
|
|
205
|
-
return (0, _effects.call)(_react.searchSubmissions, {
|
|
206
|
-
search: search,
|
|
207
|
-
kapp: kappSlug,
|
|
208
|
-
form: formSlug
|
|
209
|
-
});
|
|
210
|
-
case 11:
|
|
211
|
-
_yield$call5 = _context4.sent;
|
|
212
|
-
submissions = _yield$call5.submissions;
|
|
213
|
-
nextPageToken = _yield$call5.nextPageToken;
|
|
214
|
-
error = _yield$call5.error;
|
|
215
|
-
if (!error) {
|
|
216
|
-
_context4.next = 20;
|
|
217
|
-
break;
|
|
180
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
181
|
+
case 0:
|
|
182
|
+
kappSlug = action.payload.kappSlug;
|
|
183
|
+
pageToken = action.payload.pageToken;
|
|
184
|
+
formSlug = action.payload.formSlug;
|
|
185
|
+
q = action.payload.q;
|
|
186
|
+
searchBuilder = new _react.SubmissionSearch().includes(['details', 'values', 'form', 'form.kapp']); // Add some of the optional parameters to the search
|
|
187
|
+
if (pageToken) searchBuilder.pageToken(pageToken);
|
|
188
|
+
// Loop over items in q and append them as "eq"
|
|
189
|
+
// to search build
|
|
190
|
+
if (q) {
|
|
191
|
+
for (key in q) {
|
|
192
|
+
searchBuilder.eq(key, q[key]);
|
|
218
193
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
194
|
+
}
|
|
195
|
+
searchBuilder.end();
|
|
196
|
+
search = searchBuilder.build();
|
|
197
|
+
_context4.next = 11;
|
|
198
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
199
|
+
search: search,
|
|
200
|
+
kapp: kappSlug,
|
|
201
|
+
form: formSlug
|
|
202
|
+
});
|
|
203
|
+
case 11:
|
|
204
|
+
_yield$call5 = _context4.sent;
|
|
205
|
+
submissions = _yield$call5.submissions;
|
|
206
|
+
nextPageToken = _yield$call5.nextPageToken;
|
|
207
|
+
error = _yield$call5.error;
|
|
208
|
+
if (!error) {
|
|
209
|
+
_context4.next = 20;
|
|
223
210
|
break;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
211
|
+
}
|
|
212
|
+
_context4.next = 18;
|
|
213
|
+
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
214
|
+
case 18:
|
|
215
|
+
_context4.next = 22;
|
|
216
|
+
break;
|
|
217
|
+
case 20:
|
|
218
|
+
_context4.next = 22;
|
|
219
|
+
return (0, _effects.put)(_settingsForms.actions.setFormSubmissions({
|
|
220
|
+
submissions: submissions,
|
|
221
|
+
nextPageToken: nextPageToken
|
|
222
|
+
}));
|
|
223
|
+
case 22:
|
|
224
|
+
case "end":
|
|
225
|
+
return _context4.stop();
|
|
234
226
|
}
|
|
235
227
|
}, _marked2);
|
|
236
228
|
}
|
|
237
229
|
function fetchFormSubmissionSaga(action) {
|
|
238
230
|
var id, _yield$call6, submission, error;
|
|
239
231
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchFormSubmissionSaga$(_context5) {
|
|
240
|
-
while (1) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
_context5.next = 11;
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
_context5.next = 9;
|
|
258
|
-
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
259
|
-
case 9:
|
|
260
|
-
_context5.next = 13;
|
|
232
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
233
|
+
case 0:
|
|
234
|
+
id = action.payload.id;
|
|
235
|
+
_context5.next = 3;
|
|
236
|
+
return (0, _effects.call)(_react.fetchSubmission, {
|
|
237
|
+
id: id,
|
|
238
|
+
include: _settingsForms.SUBMISSION_INCLUDES
|
|
239
|
+
});
|
|
240
|
+
case 3:
|
|
241
|
+
_yield$call6 = _context5.sent;
|
|
242
|
+
submission = _yield$call6.submission;
|
|
243
|
+
error = _yield$call6.error;
|
|
244
|
+
if (!error) {
|
|
245
|
+
_context5.next = 11;
|
|
261
246
|
break;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
247
|
+
}
|
|
248
|
+
_context5.next = 9;
|
|
249
|
+
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
250
|
+
case 9:
|
|
251
|
+
_context5.next = 13;
|
|
252
|
+
break;
|
|
253
|
+
case 11:
|
|
254
|
+
_context5.next = 13;
|
|
255
|
+
return (0, _effects.put)(_settingsForms.actions.setFormSubmission(submission));
|
|
256
|
+
case 13:
|
|
257
|
+
case "end":
|
|
258
|
+
return _context5.stop();
|
|
269
259
|
}
|
|
270
260
|
}, _marked3);
|
|
271
261
|
}
|
|
272
262
|
function fetchKappSaga(action) {
|
|
273
263
|
var _yield$call7, error, kapp, me;
|
|
274
264
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchKappSaga$(_context6) {
|
|
275
|
-
while (1) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
_context6.next = 10;
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
_context6.next = 8;
|
|
292
|
-
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
293
|
-
case 8:
|
|
294
|
-
_context6.next = 18;
|
|
265
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
266
|
+
case 0:
|
|
267
|
+
_context6.next = 2;
|
|
268
|
+
return (0, _effects.call)(_react.fetchKapp, {
|
|
269
|
+
kappSlug: action.payload,
|
|
270
|
+
include: 'formTypes, categories, formAttributeDefinitions'
|
|
271
|
+
});
|
|
272
|
+
case 2:
|
|
273
|
+
_yield$call7 = _context6.sent;
|
|
274
|
+
error = _yield$call7.error;
|
|
275
|
+
kapp = _yield$call7.kapp;
|
|
276
|
+
if (!error) {
|
|
277
|
+
_context6.next = 10;
|
|
295
278
|
break;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
279
|
+
}
|
|
280
|
+
_context6.next = 8;
|
|
281
|
+
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
282
|
+
case 8:
|
|
283
|
+
_context6.next = 18;
|
|
284
|
+
break;
|
|
285
|
+
case 10:
|
|
286
|
+
_context6.next = 12;
|
|
287
|
+
return (0, _effects.select)(function (state) {
|
|
288
|
+
return state.app.profile;
|
|
289
|
+
});
|
|
290
|
+
case 12:
|
|
291
|
+
me = _context6.sent;
|
|
292
|
+
if (!(me.spaceAdmin && !kapp.formAttributeDefinitions.find(function (d) {
|
|
293
|
+
return d.name === 'Form Configuration';
|
|
294
|
+
}))) {
|
|
309
295
|
_context6.next = 16;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
_context6.next = 16;
|
|
299
|
+
return (0, _effects.call)(_axios["default"].request, {
|
|
300
|
+
method: 'post',
|
|
301
|
+
url: "".concat(_react.bundle.apiLocation(), "/kapps/").concat(kapp.slug, "/formAttributeDefinitions"),
|
|
302
|
+
data: {
|
|
303
|
+
name: 'Form Configuration',
|
|
304
|
+
allowsMultiple: false
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
case 16:
|
|
308
|
+
_context6.next = 18;
|
|
309
|
+
return (0, _effects.put)(_settingsForms.actions.setKapp(kapp));
|
|
310
|
+
case 18:
|
|
311
|
+
case "end":
|
|
312
|
+
return _context6.stop();
|
|
325
313
|
}
|
|
326
314
|
}, _marked4);
|
|
327
315
|
}
|
|
328
316
|
function updateFormSaga(action) {
|
|
329
317
|
var currentForm, currentFormChanges, formContent, _yield$call8, error;
|
|
330
318
|
return (0, _regeneratorRuntime2["default"])().wrap(function updateFormSaga$(_context7) {
|
|
331
|
-
while (1) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
if (error) {
|
|
365
|
-
_context7.next = 12;
|
|
366
|
-
break;
|
|
367
|
-
}
|
|
368
|
-
_context7.next = 10;
|
|
369
|
-
return (0, _effects.put)((0, _bundleCommon.addSuccess)('The form was successfully updated.', 'Update Successful'));
|
|
370
|
-
case 10:
|
|
319
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
320
|
+
case 0:
|
|
321
|
+
currentForm = action.payload.form;
|
|
322
|
+
currentFormChanges = action.payload.inputs;
|
|
323
|
+
formContent = {
|
|
324
|
+
attributesMap: {
|
|
325
|
+
'Permitted Subtasks': currentFormChanges['Permitted Subtasks'] ? [currentFormChanges['Permitted Subtasks'].join(',')] : [],
|
|
326
|
+
'Prohibit Subtasks': currentFormChanges['Prohibit Subtasks'] ? [currentFormChanges['Prohibit Subtasks']] : [],
|
|
327
|
+
'Allow Reassignment': currentFormChanges['Allow Reassignment'] ? [currentFormChanges['Allow Reassignment']] : [],
|
|
328
|
+
'Assignable Teams': currentFormChanges['Assignable Teams'] ? currentFormChanges['Assignable Teams'] : [],
|
|
329
|
+
'Notification Template Name - Create': currentFormChanges['Notification Template Name - Create'] ? [currentFormChanges['Notification Template Name - Create']] : [],
|
|
330
|
+
'Notification Template Name - Complete': currentFormChanges['Notification Template Name - Complete'] ? [currentFormChanges['Notification Template Name - Complete']] : [],
|
|
331
|
+
'Owning Team': currentFormChanges['Owning Team'] ? currentFormChanges['Owning Team'] : [],
|
|
332
|
+
'Form Configuration': [JSON.stringify({
|
|
333
|
+
columns: currentFormChanges.columns.toJS()
|
|
334
|
+
})]
|
|
335
|
+
},
|
|
336
|
+
status: currentFormChanges.status,
|
|
337
|
+
type: currentFormChanges.type,
|
|
338
|
+
description: currentFormChanges.description,
|
|
339
|
+
categorizations: currentFormChanges.categories
|
|
340
|
+
};
|
|
341
|
+
_context7.next = 5;
|
|
342
|
+
return (0, _effects.call)(_react.updateForm, {
|
|
343
|
+
kappSlug: action.payload.kappSlug,
|
|
344
|
+
formSlug: currentForm.slug,
|
|
345
|
+
form: formContent,
|
|
346
|
+
include: _settingsForms.FORM_INCLUDES
|
|
347
|
+
});
|
|
348
|
+
case 5:
|
|
349
|
+
_yield$call8 = _context7.sent;
|
|
350
|
+
error = _yield$call8.error;
|
|
351
|
+
if (error) {
|
|
371
352
|
_context7.next = 12;
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
_context7.next = 10;
|
|
356
|
+
return (0, _effects.put)((0, _bundleCommon.addSuccess)('The form was successfully updated.', 'Update Successful'));
|
|
357
|
+
case 10:
|
|
358
|
+
_context7.next = 12;
|
|
359
|
+
return (0, _effects.put)(_settingsForms.actions.fetchForm({
|
|
360
|
+
kappSlug: action.payload.kappSlug,
|
|
361
|
+
formSlug: currentForm.slug
|
|
362
|
+
}));
|
|
363
|
+
case 12:
|
|
364
|
+
case "end":
|
|
365
|
+
return _context7.stop();
|
|
380
366
|
}
|
|
381
367
|
}, _marked5);
|
|
382
368
|
}
|
|
383
369
|
function fetchNotificationsSaga() {
|
|
384
370
|
var search, _yield$call9, error, submissions;
|
|
385
371
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchNotificationsSaga$(_context8) {
|
|
386
|
-
while (1) {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
_context8.next = 11;
|
|
402
|
-
break;
|
|
403
|
-
}
|
|
404
|
-
_context8.next = 9;
|
|
405
|
-
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
406
|
-
case 9:
|
|
407
|
-
_context8.next = 13;
|
|
372
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
373
|
+
case 0:
|
|
374
|
+
search = new _react.SubmissionSearch(true).index('values[Name]').includes(['details', 'values']).build();
|
|
375
|
+
_context8.next = 3;
|
|
376
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
377
|
+
search: search,
|
|
378
|
+
form: 'notification-data',
|
|
379
|
+
datastore: true
|
|
380
|
+
});
|
|
381
|
+
case 3:
|
|
382
|
+
_yield$call9 = _context8.sent;
|
|
383
|
+
error = _yield$call9.error;
|
|
384
|
+
submissions = _yield$call9.submissions;
|
|
385
|
+
if (!error) {
|
|
386
|
+
_context8.next = 11;
|
|
408
387
|
break;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
388
|
+
}
|
|
389
|
+
_context8.next = 9;
|
|
390
|
+
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
391
|
+
case 9:
|
|
392
|
+
_context8.next = 13;
|
|
393
|
+
break;
|
|
394
|
+
case 11:
|
|
395
|
+
_context8.next = 13;
|
|
396
|
+
return (0, _effects.put)(_settingsForms.actions.setNotifications(submissions));
|
|
397
|
+
case 13:
|
|
398
|
+
case "end":
|
|
399
|
+
return _context8.stop();
|
|
416
400
|
}
|
|
417
401
|
}, _marked6);
|
|
418
402
|
}
|
|
419
403
|
function createFormSaga(action) {
|
|
420
404
|
var _yield$call10, error, form, formContent, createdForm;
|
|
421
405
|
return (0, _regeneratorRuntime2["default"])().wrap(function createFormSaga$(_context9) {
|
|
422
|
-
while (1) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
if (!error) {
|
|
436
|
-
_context9.next = 8;
|
|
437
|
-
break;
|
|
438
|
-
}
|
|
406
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
407
|
+
case 0:
|
|
408
|
+
_context9.next = 2;
|
|
409
|
+
return (0, _effects.call)(_react.fetchForm, {
|
|
410
|
+
kappSlug: action.payload.kappSlug,
|
|
411
|
+
formSlug: action.payload.inputs['Template to Clone'],
|
|
412
|
+
include: _settingsForms.FORM_FULL_INCLUDES
|
|
413
|
+
});
|
|
414
|
+
case 2:
|
|
415
|
+
_yield$call10 = _context9.sent;
|
|
416
|
+
error = _yield$call10.error;
|
|
417
|
+
form = _yield$call10.form;
|
|
418
|
+
if (!error) {
|
|
439
419
|
_context9.next = 8;
|
|
440
|
-
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
441
|
-
case 8:
|
|
442
|
-
formContent = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, form), {}, {
|
|
443
|
-
slug: action.payload.inputs.Slug,
|
|
444
|
-
name: action.payload.inputs.Name,
|
|
445
|
-
description: action.payload.inputs.Description,
|
|
446
|
-
status: action.payload.inputs.Status,
|
|
447
|
-
type: action.payload.inputs.Type,
|
|
448
|
-
attributesMap: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, form.attributesMap), {}, {
|
|
449
|
-
'Owning Team': action.payload.inputs['Owning Team']
|
|
450
|
-
})
|
|
451
|
-
});
|
|
452
|
-
_context9.next = 11;
|
|
453
|
-
return (0, _effects.call)(_react.createForm, {
|
|
454
|
-
kappSlug: action.payload.kappSlug,
|
|
455
|
-
form: formContent,
|
|
456
|
-
include: _settingsForms.FORM_FULL_INCLUDES
|
|
457
|
-
});
|
|
458
|
-
case 11:
|
|
459
|
-
createdForm = _context9.sent;
|
|
460
|
-
if (!createdForm.error) {
|
|
461
|
-
_context9.next = 17;
|
|
462
|
-
break;
|
|
463
|
-
}
|
|
464
|
-
_context9.next = 15;
|
|
465
|
-
return (0, _effects.put)((0, _bundleCommon.addError)(createdForm.error.message));
|
|
466
|
-
case 15:
|
|
467
|
-
_context9.next = 18;
|
|
468
420
|
break;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
421
|
+
}
|
|
422
|
+
_context9.next = 8;
|
|
423
|
+
return (0, _effects.put)(_settingsForms.actions.setFormsError(error));
|
|
424
|
+
case 8:
|
|
425
|
+
formContent = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, form), {}, {
|
|
426
|
+
slug: action.payload.inputs.Slug,
|
|
427
|
+
name: action.payload.inputs.Name,
|
|
428
|
+
description: action.payload.inputs.Description,
|
|
429
|
+
status: action.payload.inputs.Status,
|
|
430
|
+
type: action.payload.inputs.Type,
|
|
431
|
+
attributesMap: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, form.attributesMap), {}, {
|
|
432
|
+
'Owning Team': action.payload.inputs['Owning Team']
|
|
433
|
+
})
|
|
434
|
+
});
|
|
435
|
+
_context9.next = 11;
|
|
436
|
+
return (0, _effects.call)(_react.createForm, {
|
|
437
|
+
kappSlug: action.payload.kappSlug,
|
|
438
|
+
form: formContent,
|
|
439
|
+
include: _settingsForms.FORM_FULL_INCLUDES
|
|
440
|
+
});
|
|
441
|
+
case 11:
|
|
442
|
+
createdForm = _context9.sent;
|
|
443
|
+
if (!createdForm.error) {
|
|
444
|
+
_context9.next = 17;
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
_context9.next = 15;
|
|
448
|
+
return (0, _effects.put)((0, _bundleCommon.addError)(createdForm.error.message));
|
|
449
|
+
case 15:
|
|
450
|
+
_context9.next = 18;
|
|
451
|
+
break;
|
|
452
|
+
case 17:
|
|
453
|
+
if (typeof action.payload.callback === 'function') {
|
|
454
|
+
action.payload.callback(createdForm.form.slug);
|
|
455
|
+
}
|
|
456
|
+
case 18:
|
|
457
|
+
case "end":
|
|
458
|
+
return _context9.stop();
|
|
477
459
|
}
|
|
478
460
|
}, _marked7);
|
|
479
461
|
}
|
|
480
462
|
function fetchAllSubmissionsSaga(action) {
|
|
481
463
|
var _action$payload, pageToken, accumulator, formSlug, kappSlug, createdAt, coreState, q, searcher, key, _yield$call11, submissions, _yield$call11$nextPag, nextPageToken, error;
|
|
482
464
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchAllSubmissionsSaga$(_context10) {
|
|
483
|
-
while (1) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
searcher.eq(key, q[key]);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
if (createdAt) {
|
|
494
|
-
createdAt['startDate'] && searcher.startDate(createdAt['startDate']);
|
|
495
|
-
createdAt['endDate'] && searcher.endDate(createdAt['endDate']);
|
|
496
|
-
}
|
|
497
|
-
if (coreState) {
|
|
498
|
-
searcher.coreState(coreState);
|
|
499
|
-
}
|
|
500
|
-
searcher.include('values,form,form.kapp');
|
|
501
|
-
searcher.limit(1000);
|
|
502
|
-
if (pageToken) {
|
|
503
|
-
searcher.pageToken(pageToken);
|
|
504
|
-
}
|
|
505
|
-
_context10.next = 10;
|
|
506
|
-
return (0, _effects.call)(_react.searchSubmissions, {
|
|
507
|
-
search: searcher.build(),
|
|
508
|
-
form: formSlug,
|
|
509
|
-
kapp: kappSlug
|
|
510
|
-
});
|
|
511
|
-
case 10:
|
|
512
|
-
_yield$call11 = _context10.sent;
|
|
513
|
-
submissions = _yield$call11.submissions;
|
|
514
|
-
_yield$call11$nextPag = _yield$call11.nextPageToken;
|
|
515
|
-
nextPageToken = _yield$call11$nextPag === void 0 ? null : _yield$call11$nextPag;
|
|
516
|
-
error = _yield$call11.error;
|
|
517
|
-
// Update the action with the new results
|
|
518
|
-
action = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, action), {}, {
|
|
519
|
-
payload: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, action.payload), {}, {
|
|
520
|
-
accumulator: [].concat((0, _toConsumableArray2["default"])(accumulator), (0, _toConsumableArray2["default"])(submissions)),
|
|
521
|
-
pageToken: nextPageToken
|
|
522
|
-
})
|
|
523
|
-
});
|
|
524
|
-
_context10.next = 18;
|
|
525
|
-
return (0, _effects.put)(_settingsForms.actions.setExportCount(action.payload.accumulator.length));
|
|
526
|
-
case 18:
|
|
527
|
-
if (!nextPageToken) {
|
|
528
|
-
_context10.next = 23;
|
|
529
|
-
break;
|
|
465
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
466
|
+
case 0:
|
|
467
|
+
_action$payload = action.payload, pageToken = _action$payload.pageToken, accumulator = _action$payload.accumulator, formSlug = _action$payload.formSlug, kappSlug = _action$payload.kappSlug, createdAt = _action$payload.createdAt, coreState = _action$payload.coreState, q = _action$payload.q;
|
|
468
|
+
searcher = new _react.SubmissionSearch(false); // changed to false!
|
|
469
|
+
if (q) {
|
|
470
|
+
for (key in q) {
|
|
471
|
+
searcher.eq(key, q[key]);
|
|
530
472
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
473
|
+
}
|
|
474
|
+
if (createdAt) {
|
|
475
|
+
createdAt['startDate'] && searcher.startDate(createdAt['startDate']);
|
|
476
|
+
createdAt['endDate'] && searcher.endDate(createdAt['endDate']);
|
|
477
|
+
}
|
|
478
|
+
if (coreState) {
|
|
479
|
+
searcher.coreState(coreState);
|
|
480
|
+
}
|
|
481
|
+
searcher.include('values,form,form.kapp');
|
|
482
|
+
searcher.limit(1000);
|
|
483
|
+
if (pageToken) {
|
|
484
|
+
searcher.pageToken(pageToken);
|
|
485
|
+
}
|
|
486
|
+
_context10.next = 10;
|
|
487
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
488
|
+
search: searcher.build(),
|
|
489
|
+
form: formSlug,
|
|
490
|
+
kapp: kappSlug
|
|
491
|
+
});
|
|
492
|
+
case 10:
|
|
493
|
+
_yield$call11 = _context10.sent;
|
|
494
|
+
submissions = _yield$call11.submissions;
|
|
495
|
+
_yield$call11$nextPag = _yield$call11.nextPageToken;
|
|
496
|
+
nextPageToken = _yield$call11$nextPag === void 0 ? null : _yield$call11$nextPag;
|
|
497
|
+
error = _yield$call11.error;
|
|
498
|
+
// Update the action with the new results
|
|
499
|
+
action = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, action), {}, {
|
|
500
|
+
payload: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, action.payload), {}, {
|
|
501
|
+
accumulator: [].concat((0, _toConsumableArray2["default"])(accumulator), (0, _toConsumableArray2["default"])(submissions)),
|
|
502
|
+
pageToken: nextPageToken
|
|
503
|
+
})
|
|
504
|
+
});
|
|
505
|
+
_context10.next = 18;
|
|
506
|
+
return (0, _effects.put)(_settingsForms.actions.setExportCount(action.payload.accumulator.length));
|
|
507
|
+
case 18:
|
|
508
|
+
if (!nextPageToken) {
|
|
509
|
+
_context10.next = 23;
|
|
535
510
|
break;
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
511
|
+
}
|
|
512
|
+
_context10.next = 21;
|
|
513
|
+
return (0, _effects.call)(fetchAllSubmissionsSaga, action);
|
|
514
|
+
case 21:
|
|
515
|
+
_context10.next = 29;
|
|
516
|
+
break;
|
|
517
|
+
case 23:
|
|
518
|
+
if (!error) {
|
|
519
|
+
_context10.next = 27;
|
|
544
520
|
break;
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
521
|
+
}
|
|
522
|
+
// What should we do?
|
|
523
|
+
console.log(error);
|
|
524
|
+
_context10.next = 29;
|
|
525
|
+
break;
|
|
526
|
+
case 27:
|
|
527
|
+
_context10.next = 29;
|
|
528
|
+
return (0, _effects.put)(_settingsForms.actions.setExportSubmissions(action.payload.accumulator));
|
|
529
|
+
case 29:
|
|
530
|
+
case "end":
|
|
531
|
+
return _context10.stop();
|
|
552
532
|
}
|
|
553
533
|
}, _marked8);
|
|
554
534
|
}
|
|
@@ -557,89 +537,85 @@ function deleteFormSaga(_ref3) {
|
|
|
557
537
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
558
538
|
var _yield$call12, form, error;
|
|
559
539
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context11) {
|
|
560
|
-
while (1) {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
if (!(typeof payload.onSuccess === 'function')) {
|
|
577
|
-
_context11.next = 9;
|
|
578
|
-
break;
|
|
579
|
-
}
|
|
540
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
541
|
+
case 0:
|
|
542
|
+
_context11.next = 2;
|
|
543
|
+
return (0, _effects.call)(_react.deleteForm, {
|
|
544
|
+
kappSlug: payload.kappSlug,
|
|
545
|
+
formSlug: payload.formSlug
|
|
546
|
+
});
|
|
547
|
+
case 2:
|
|
548
|
+
_yield$call12 = _context11.sent;
|
|
549
|
+
form = _yield$call12.form;
|
|
550
|
+
error = _yield$call12.error;
|
|
551
|
+
if (!form) {
|
|
552
|
+
_context11.next = 14;
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
if (!(typeof payload.onSuccess === 'function')) {
|
|
580
556
|
_context11.next = 9;
|
|
581
|
-
return (0, _effects.call)(payload.onSuccess, form);
|
|
582
|
-
case 9:
|
|
583
|
-
_context11.next = 11;
|
|
584
|
-
return (0, _effects.put)(_settingsForms.actions.deleteFormComplete(payload));
|
|
585
|
-
case 11:
|
|
586
|
-
(0, _bundleCommon.addToast)('Form deleted successfully.');
|
|
587
|
-
_context11.next = 15;
|
|
588
557
|
break;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
558
|
+
}
|
|
559
|
+
_context11.next = 9;
|
|
560
|
+
return (0, _effects.call)(payload.onSuccess, form);
|
|
561
|
+
case 9:
|
|
562
|
+
_context11.next = 11;
|
|
563
|
+
return (0, _effects.put)(_settingsForms.actions.deleteFormComplete(payload));
|
|
564
|
+
case 11:
|
|
565
|
+
(0, _bundleCommon.addToast)('Form deleted successfully.');
|
|
566
|
+
_context11.next = 15;
|
|
567
|
+
break;
|
|
568
|
+
case 14:
|
|
569
|
+
(0, _bundleCommon.addToastAlert)({
|
|
570
|
+
title: 'Error Deleting Form',
|
|
571
|
+
message: error.message
|
|
572
|
+
});
|
|
573
|
+
case 15:
|
|
574
|
+
case "end":
|
|
575
|
+
return _context11.stop();
|
|
598
576
|
}
|
|
599
577
|
}, _callee3);
|
|
600
578
|
})();
|
|
601
579
|
}
|
|
602
580
|
function watchSettingsForms() {
|
|
603
581
|
return (0, _regeneratorRuntime2["default"])().wrap(function watchSettingsForms$(_context12) {
|
|
604
|
-
while (1) {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
return _context12.stop();
|
|
642
|
-
}
|
|
582
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
583
|
+
case 0:
|
|
584
|
+
_context12.next = 2;
|
|
585
|
+
return (0, _effects.takeEvery)(_settingsForms.types.FETCH_FORM, fetchFormSaga);
|
|
586
|
+
case 2:
|
|
587
|
+
_context12.next = 4;
|
|
588
|
+
return (0, _effects.takeEvery)(_settingsForms.types.FETCH_FORM_REQUEST, fetchFormRequestSaga);
|
|
589
|
+
case 4:
|
|
590
|
+
_context12.next = 6;
|
|
591
|
+
return (0, _effects.takeEvery)(_settingsForms.types.FETCH_KAPP, fetchKappSaga);
|
|
592
|
+
case 6:
|
|
593
|
+
_context12.next = 8;
|
|
594
|
+
return (0, _effects.takeEvery)(_settingsForms.types.UPDATE_QUEUE_FORM, updateFormSaga);
|
|
595
|
+
case 8:
|
|
596
|
+
_context12.next = 10;
|
|
597
|
+
return (0, _effects.takeEvery)(_settingsForms.types.CREATE_FORM, createFormSaga);
|
|
598
|
+
case 10:
|
|
599
|
+
_context12.next = 12;
|
|
600
|
+
return (0, _effects.takeEvery)(_settingsForms.types.CLONE_FORM_REQUEST, cloneFormSaga);
|
|
601
|
+
case 12:
|
|
602
|
+
_context12.next = 14;
|
|
603
|
+
return (0, _effects.takeEvery)(_settingsForms.types.FETCH_NOTIFICATIONS, fetchNotificationsSaga);
|
|
604
|
+
case 14:
|
|
605
|
+
_context12.next = 16;
|
|
606
|
+
return (0, _effects.takeEvery)(_settingsForms.types.FETCH_FORM_SUBMISSIONS, fetchFormSubmissionsSaga);
|
|
607
|
+
case 16:
|
|
608
|
+
_context12.next = 18;
|
|
609
|
+
return (0, _effects.takeEvery)(_settingsForms.types.FETCH_FORM_SUBMISSION, fetchFormSubmissionSaga);
|
|
610
|
+
case 18:
|
|
611
|
+
_context12.next = 20;
|
|
612
|
+
return (0, _effects.takeEvery)(_settingsForms.types.FETCH_ALL_SUBMISSIONS, fetchAllSubmissionsSaga);
|
|
613
|
+
case 20:
|
|
614
|
+
_context12.next = 22;
|
|
615
|
+
return (0, _effects.takeEvery)(_settingsForms.types.DELETE_FORM_REQUEST, deleteFormSaga);
|
|
616
|
+
case 22:
|
|
617
|
+
case "end":
|
|
618
|
+
return _context12.stop();
|
|
643
619
|
}
|
|
644
620
|
}, _marked9);
|
|
645
621
|
}
|