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