@kineticdata/bundle-queue 5.1.1 → 6.0.0
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/README.md +0 -2
- package/assets/styles/_submissions.scss +0 -4
- package/lib/App.js +62 -60
- package/lib/components/FormPreview.js +39 -27
- package/lib/components/filter_menu/FilterMenuAbstract.js +87 -107
- package/lib/components/filter_menu/FilterMenuModal.js +115 -114
- package/lib/components/filter_menu/FilterMenuToolbar.js +114 -108
- package/lib/components/new_item_menu/NewItemMenu.js +65 -63
- package/lib/components/new_item_menu/NewItemMenuContainer.js +40 -43
- package/lib/components/queue_item/AssignmentBadge.js +22 -14
- package/lib/components/queue_item/QueueItem.js +70 -132
- package/lib/components/queue_item/QueueItemDetails.js +122 -159
- package/lib/components/queue_item/QueueItemDetails.test.js +14 -11
- package/lib/components/queue_item/ViewOriginalRequest.js +28 -20
- package/lib/components/queue_list/BulkAssignModal.js +30 -27
- package/lib/components/queue_list/BulkStatusModal.js +64 -59
- package/lib/components/queue_list/BulkWorkModal.js +26 -21
- package/lib/components/queue_list/QueueList.js +56 -54
- package/lib/components/queue_list/QueueListContainer.js +25 -21
- package/lib/components/queue_list/QueueListItem.js +78 -85
- package/lib/components/queue_list/QueueListPagination.js +54 -47
- package/lib/components/queue_list/QueueListSelection.js +92 -82
- package/lib/components/queue_list/QueueListSidebar.js +64 -59
- package/lib/components/settings/QueueSettings.js +44 -37
- package/lib/components/settings/Settings.js +56 -50
- package/lib/components/settings/Sidebar.js +32 -22
- package/lib/components/settings/forms/Export.js +45 -48
- package/lib/components/settings/forms/ExportModal.js +25 -20
- package/lib/components/settings/forms/FormActivity.js +60 -52
- package/lib/components/settings/forms/FormList.js +109 -110
- package/lib/components/settings/forms/FormSettings.js +69 -63
- package/lib/components/settings/forms/FormSubmissions.js +65 -60
- package/lib/components/shared/AssignmentItem.js +24 -21
- package/lib/components/shared/AssignmentSelector.js +39 -40
- package/lib/components/shared/PageTitle.js +24 -15
- package/lib/components/shared/StatusContent.js +29 -24
- package/lib/components/shared/WallyButton.js +28 -19
- package/lib/components/work_menu/WorkMenu.js +39 -30
- package/lib/constants.js +1 -0
- package/lib/index.js +53 -49
- package/lib/models.js +13 -5
- package/lib/records.js +39 -26
- package/lib/redux/modules/app.js +22 -17
- package/lib/redux/modules/filterMenu.js +23 -26
- package/lib/redux/modules/forms.js +28 -21
- package/lib/redux/modules/queue.js +52 -64
- package/lib/redux/modules/queue.test.js +46 -44
- package/lib/redux/modules/queueApp.js +70 -63
- package/lib/redux/modules/queueApp.test.js +26 -24
- package/lib/redux/modules/settingsForms.js +66 -74
- package/lib/redux/modules/settingsQueue.js +21 -27
- package/lib/redux/modules/workMenu.js +21 -15
- package/lib/redux/reducers.js +25 -18
- package/lib/redux/sagas/app.js +15 -13
- package/lib/redux/sagas/forms.js +22 -25
- package/lib/redux/sagas/queue.js +117 -210
- package/lib/redux/sagas/queue.test.js +85 -83
- package/lib/redux/sagas/queueApp.js +48 -57
- package/lib/redux/sagas/settingsForms.js +264 -358
- package/lib/redux/sagas/settingsQueue.js +186 -229
- package/lib/redux/sagas.js +18 -14
- package/lib/redux/store.js +36 -27
- package/lib/utils.js +9 -2
- package/package.json +6 -17
- package/lib/components/Sidebar.js +0 -100
- package/lib/components/filter_menu/AssignmentSection.js +0 -52
- package/lib/components/filter_menu/CreatedByMe.js +0 -31
- package/lib/components/filter_menu/DateRangeSection.js +0 -54
- package/lib/components/filter_menu/FilterMenu.js +0 -83
- package/lib/components/filter_menu/FilterMenuContainer.js +0 -112
- package/lib/components/filter_menu/GroupedBySection.js +0 -34
- package/lib/components/filter_menu/MainSection.js +0 -187
- package/lib/components/filter_menu/SortedBySection.js +0 -50
- package/lib/components/filter_menu/StatusSection.js +0 -34
- package/lib/components/filter_menu/TeamsSection.js +0 -34
- package/lib/components/queue_list/FilterMenuMobile.js +0 -120
- package/lib/components/queue_list/FilterMenuToolbar.js +0 -306
|
@@ -1,46 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FormSettingsComponent = exports.FormSettings = exports.FieldsTableField = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _react2 = require("@kineticdata/react");
|
|
10
|
+
var _recompose = require("recompose");
|
|
11
|
+
var _store = require("../../../redux/store");
|
|
12
|
+
var _bundleCommon = require("@kineticdata/bundle-common");
|
|
13
|
+
var _settingsForms = require("../../../redux/modules/settingsForms");
|
|
14
|
+
var _reactBeautifulDnd = require("react-beautiful-dnd");
|
|
15
|
+
var _PageTitle = require("../../shared/PageTitle");
|
|
16
|
+
var _immutable = require("immutable");
|
|
17
|
+
var FieldsTableField = function FieldsTableField(props) {
|
|
18
|
+
return /*#__PURE__*/_react["default"].createElement("table", {
|
|
12
19
|
className: "table table-hover table--settings table-draggable"
|
|
13
|
-
}, /*#__PURE__*/
|
|
20
|
+
}, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", {
|
|
14
21
|
className: "header"
|
|
15
|
-
}, /*#__PURE__*/
|
|
22
|
+
}, /*#__PURE__*/_react["default"].createElement("th", {
|
|
16
23
|
scope: "col"
|
|
17
|
-
}, /*#__PURE__*/
|
|
24
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Field")), /*#__PURE__*/_react["default"].createElement("th", {
|
|
18
25
|
scope: "col"
|
|
19
|
-
}, /*#__PURE__*/
|
|
26
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Visible in Table")))), props.value && /*#__PURE__*/_react["default"].createElement(_reactBeautifulDnd.DragDropContext, {
|
|
20
27
|
onDragEnd: function onDragEnd(_ref) {
|
|
21
28
|
var source = _ref.source,
|
|
22
|
-
|
|
29
|
+
destination = _ref.destination;
|
|
23
30
|
return destination && source.index !== destination.index && props.onChange(props.value.update(function (cols) {
|
|
24
31
|
var col = cols.get(source.index);
|
|
25
32
|
return cols["delete"](source.index).insert(destination.index, col);
|
|
26
33
|
}));
|
|
27
34
|
}
|
|
28
|
-
}, /*#__PURE__*/
|
|
35
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactBeautifulDnd.Droppable, {
|
|
29
36
|
droppableId: "columns"
|
|
30
37
|
}, function (provided) {
|
|
31
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/_react["default"].createElement("tbody", {
|
|
32
39
|
ref: provided.innerRef
|
|
33
40
|
}, props.value.map(function (col, index) {
|
|
34
|
-
return /*#__PURE__*/
|
|
41
|
+
return /*#__PURE__*/_react["default"].createElement(_reactBeautifulDnd.Draggable, {
|
|
35
42
|
key: col.name,
|
|
36
43
|
draggableId: col.name,
|
|
37
44
|
index: index
|
|
38
45
|
}, function (provided, snapshot) {
|
|
39
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/_react["default"].createElement("tr", Object.assign({
|
|
40
47
|
ref: provided.innerRef
|
|
41
48
|
}, provided.draggableProps, provided.dragHandleProps, {
|
|
42
49
|
className: "".concat(snapshot.isDragging ? 'dragging' : '')
|
|
43
|
-
}), /*#__PURE__*/
|
|
50
|
+
}), /*#__PURE__*/_react["default"].createElement("td", null, col.type === 'value' ? /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, col.label) : /*#__PURE__*/_react["default"].createElement("i", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, col.label), ' ', /*#__PURE__*/_react["default"].createElement("small", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "(system field)")))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
|
44
51
|
onChange: function onChange(e) {
|
|
45
52
|
return props.onChange(props.value.setIn([index, 'visible'], e.target.checked));
|
|
46
53
|
},
|
|
@@ -49,45 +56,43 @@ export var FieldsTableField = function FieldsTableField(props) {
|
|
|
49
56
|
})));
|
|
50
57
|
});
|
|
51
58
|
}));
|
|
52
|
-
})), props.helpText && /*#__PURE__*/
|
|
59
|
+
})), props.helpText && /*#__PURE__*/_react["default"].createElement("tfoot", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
|
|
53
60
|
colSpan: "2"
|
|
54
|
-
}, /*#__PURE__*/
|
|
61
|
+
}, /*#__PURE__*/_react["default"].createElement("small", null, props.helpText)))));
|
|
55
62
|
};
|
|
63
|
+
exports.FieldsTableField = FieldsTableField;
|
|
56
64
|
var fieldSet = ['name', 'slug', 'status', 'type', 'submissionLabelExpression', 'description', 'attributesMap', 'submissionTableFields', 'prohibitSubtasks', 'permittedSubtasks', 'owningTeam', 'allowReassignment', 'assignableTeams', 'notificationComplete', 'notificationCreate'];
|
|
57
|
-
|
|
58
65
|
var FormLayout = function FormLayout(_ref2) {
|
|
59
66
|
var fields = _ref2.fields,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return /*#__PURE__*/
|
|
67
|
+
error = _ref2.error,
|
|
68
|
+
buttons = _ref2.buttons;
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("h2", {
|
|
63
70
|
className: "section__title"
|
|
64
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
65
72
|
className: "title"
|
|
66
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "General"))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
67
74
|
className: "form-group__columns"
|
|
68
|
-
}, fields.get('name'), fields.get('slug')), /*#__PURE__*/
|
|
75
|
+
}, fields.get('name'), fields.get('slug')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
69
76
|
className: "form-group__columns"
|
|
70
|
-
}, fields.get('status'), fields.get('type')), fields.get('submissionLabelExpression'), fields.get('description'), /*#__PURE__*/
|
|
77
|
+
}, fields.get('status'), fields.get('type')), fields.get('submissionLabelExpression'), fields.get('description'), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("h2", {
|
|
71
78
|
className: "section__title"
|
|
72
|
-
}, /*#__PURE__*/
|
|
79
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
73
80
|
className: "title"
|
|
74
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Attributes"))), fields.get('prohibitSubtasks'), fields.get('permittedSubtasks'), fields.get('owningTeam'), fields.get('allowReassignment'), fields.get('assignableTeams'), fields.get('notificationCreate'), fields.get('notificationComplete'), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("h2", {
|
|
75
82
|
className: "section__title"
|
|
76
|
-
}, /*#__PURE__*/
|
|
83
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
77
84
|
className: "title"
|
|
78
|
-
}, /*#__PURE__*/
|
|
85
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Submission Table - Default Columns"))), fields.get('submissionTableFields'), error, buttons);
|
|
79
86
|
};
|
|
80
|
-
|
|
81
87
|
var asArray = function asArray(value) {
|
|
82
88
|
return value ? [value] : [];
|
|
83
89
|
};
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
90
|
+
var notificationSearch = new _react2.SubmissionSearch(true).index('values[Name]').includes(['values']).limit(1000).build();
|
|
91
|
+
var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
87
92
|
var form = _ref3.form,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return /*#__PURE__*/
|
|
93
|
+
kapp = _ref3.kapp,
|
|
94
|
+
onSave = _ref3.onSave;
|
|
95
|
+
return /*#__PURE__*/_react["default"].createElement(_react2.FormForm, {
|
|
91
96
|
kappSlug: kapp.slug,
|
|
92
97
|
formSlug: form.slug,
|
|
93
98
|
fieldSet: fieldSet,
|
|
@@ -97,7 +102,7 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
97
102
|
},
|
|
98
103
|
addDataSources: {
|
|
99
104
|
notifications: {
|
|
100
|
-
fn: searchSubmissions,
|
|
105
|
+
fn: _react2.searchSubmissions,
|
|
101
106
|
params: [{
|
|
102
107
|
datastore: true,
|
|
103
108
|
form: 'notification-data',
|
|
@@ -111,7 +116,7 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
111
116
|
addFields: function addFields() {
|
|
112
117
|
return function (_ref4) {
|
|
113
118
|
var form = _ref4.form,
|
|
114
|
-
|
|
119
|
+
notifications = _ref4.notifications;
|
|
115
120
|
return form && notifications && [{
|
|
116
121
|
name: 'prohibitSubtasks',
|
|
117
122
|
label: 'Prohibit Subtasks',
|
|
@@ -135,7 +140,7 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
135
140
|
label: 'Owning Team',
|
|
136
141
|
type: 'team-multi',
|
|
137
142
|
helpText: 'Teams responsible for maintaining this form.',
|
|
138
|
-
initialValue: form.getIn(['attributesMap', 'Owning Team'], List()).map(function (name) {
|
|
143
|
+
initialValue: form.getIn(['attributesMap', 'Owning Team'], (0, _immutable.List)()).map(function (name) {
|
|
139
144
|
return {
|
|
140
145
|
name: name
|
|
141
146
|
};
|
|
@@ -157,7 +162,7 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
157
162
|
label: 'Assignable Teams',
|
|
158
163
|
type: 'team-multi',
|
|
159
164
|
helpText: 'Teams to which submissions of this form can be reassigned to.',
|
|
160
|
-
initialValue: form.getIn(['attributesMap', 'Assignable Teams'], List()).map(function (name) {
|
|
165
|
+
initialValue: form.getIn(['attributesMap', 'Assignable Teams'], (0, _immutable.List)()).map(function (name) {
|
|
161
166
|
return {
|
|
162
167
|
name: name
|
|
163
168
|
};
|
|
@@ -178,7 +183,7 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
178
183
|
slug: notification.get('id')
|
|
179
184
|
};
|
|
180
185
|
}).toJS() : [],
|
|
181
|
-
component: FormComponents.NotificationField
|
|
186
|
+
component: _bundleCommon.FormComponents.NotificationField
|
|
182
187
|
}, {
|
|
183
188
|
name: 'notificationComplete',
|
|
184
189
|
label: 'Notification Template Name - Complete',
|
|
@@ -195,20 +200,20 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
195
200
|
slug: notification.get('id')
|
|
196
201
|
};
|
|
197
202
|
}).toJS() : [],
|
|
198
|
-
component: FormComponents.NotificationField
|
|
203
|
+
component: _bundleCommon.FormComponents.NotificationField
|
|
199
204
|
}, {
|
|
200
205
|
name: 'submissionTableFields',
|
|
201
206
|
label: 'Submission Table - Fields',
|
|
202
207
|
type: 'custom',
|
|
203
208
|
helpText: 'Select which field columns should be visible by default when displaying submissions for this form in the settings pages. Drag and drop to change the order in which the columns will appear.',
|
|
204
|
-
initialValue: buildFormConfigurationObject(form.toJS()).columns,
|
|
209
|
+
initialValue: (0, _settingsForms.buildFormConfigurationObject)(form.toJS()).columns,
|
|
205
210
|
component: FieldsTableField
|
|
206
211
|
}];
|
|
207
212
|
};
|
|
208
213
|
},
|
|
209
214
|
alterFields: {
|
|
210
215
|
description: {
|
|
211
|
-
component: FormComponents.TextAreaField
|
|
216
|
+
component: _bundleCommon.FormComponents.TextAreaField
|
|
212
217
|
},
|
|
213
218
|
attributesMap: {
|
|
214
219
|
serialize: function serialize(_ref5) {
|
|
@@ -225,7 +230,8 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
225
230
|
}),
|
|
226
231
|
'Notification Template Name - Create': asArray(values.get('notificationCreate')),
|
|
227
232
|
'Notification Template Name - Complete': asArray(values.get('notificationComplete')),
|
|
228
|
-
'Form Configuration': [
|
|
233
|
+
'Form Configuration': [
|
|
234
|
+
// TODO Update to allow for other props in Form Config attribute
|
|
229
235
|
JSON.stringify({
|
|
230
236
|
columns: values.get('submissionTableFields').toJS()
|
|
231
237
|
})]
|
|
@@ -235,12 +241,12 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
235
241
|
}
|
|
236
242
|
}, function (_ref6) {
|
|
237
243
|
var formContent = _ref6.form,
|
|
238
|
-
|
|
239
|
-
return /*#__PURE__*/
|
|
244
|
+
initialized = _ref6.initialized;
|
|
245
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
240
246
|
className: "page-container"
|
|
241
|
-
}, /*#__PURE__*/
|
|
247
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
242
248
|
className: "page-panel"
|
|
243
|
-
}, /*#__PURE__*/
|
|
249
|
+
}, /*#__PURE__*/_react["default"].createElement(_PageTitle.PageTitle, {
|
|
244
250
|
parts: ["".concat(form.name, " Settings"), 'Forms'],
|
|
245
251
|
settings: true,
|
|
246
252
|
breadcrumbs: [{
|
|
@@ -262,22 +268,21 @@ export var FormSettingsComponent = function FormSettingsComponent(_ref3) {
|
|
|
262
268
|
icon: 'mouse-pointer',
|
|
263
269
|
href: "/app/builder/#/".concat(kapp.slug, "/forms/").concat(form.slug, "/builder")
|
|
264
270
|
}]
|
|
265
|
-
}), initialized ? /*#__PURE__*/
|
|
271
|
+
}), initialized ? /*#__PURE__*/_react["default"].createElement("section", {
|
|
266
272
|
className: "form form-unstyled mb-5"
|
|
267
|
-
}, formContent) : /*#__PURE__*/
|
|
273
|
+
}, formContent) : /*#__PURE__*/_react["default"].createElement(_bundleCommon.LoadingMessage, null)));
|
|
268
274
|
});
|
|
269
275
|
};
|
|
270
|
-
|
|
276
|
+
exports.FormSettingsComponent = FormSettingsComponent;
|
|
271
277
|
var mapStateToProps = function mapStateToProps(state) {
|
|
272
278
|
return {
|
|
273
279
|
kapp: state.app.kapp
|
|
274
280
|
};
|
|
275
281
|
};
|
|
276
|
-
|
|
277
282
|
var mapDispatchToProps = {
|
|
278
|
-
fetchFormRequest: actions.fetchForm
|
|
283
|
+
fetchFormRequest: _settingsForms.actions.fetchForm
|
|
279
284
|
};
|
|
280
|
-
|
|
285
|
+
var FormSettings = (0, _recompose.compose)((0, _store.connect)(mapStateToProps, mapDispatchToProps), (0, _recompose.withHandlers)({
|
|
281
286
|
onSave: function onSave(props) {
|
|
282
287
|
return function () {
|
|
283
288
|
return function () {
|
|
@@ -285,8 +290,9 @@ export var FormSettings = compose(connect(mapStateToProps, mapDispatchToProps),
|
|
|
285
290
|
kappSlug: props.kapp.slug,
|
|
286
291
|
formSlug: props.form.slug
|
|
287
292
|
});
|
|
288
|
-
addToast("".concat(props.form.name, " settings saved successfully."));
|
|
293
|
+
(0, _bundleCommon.addToast)("".concat(props.form.name, " settings saved successfully."));
|
|
289
294
|
};
|
|
290
295
|
};
|
|
291
296
|
}
|
|
292
|
-
}))(FormSettingsComponent);
|
|
297
|
+
}))(FormSettingsComponent);
|
|
298
|
+
exports.FormSettings = FormSettings;
|
|
@@ -1,38 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Link } from '@reach/router';
|
|
6
|
-
import { compose, withProps, withState, lifecycle } from 'recompose';
|
|
7
|
-
import { connect } from '../../../redux/store';
|
|
8
|
-
import { I18n, SubmissionTable, mountTable, unmountTable } from '@kineticdata/react';
|
|
9
|
-
import { TimeAgo, TableComponents } from '@kineticdata/bundle-common';
|
|
10
|
-
import { PageTitle } from '../../shared/PageTitle';
|
|
11
|
-
import { ExportModal } from './ExportModal';
|
|
12
|
-
import { actions, buildFormConfigurationObject } from '../../../redux/modules/settingsForms';
|
|
13
|
-
var tableKey = 'queue-settings-form-submissions';
|
|
1
|
+
"use strict";
|
|
14
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FormSubmissionsComponent = exports.FormSubmissions = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
9
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _router = require("@reach/router");
|
|
13
|
+
var _recompose = require("recompose");
|
|
14
|
+
var _store = require("../../../redux/store");
|
|
15
|
+
var _react2 = require("@kineticdata/react");
|
|
16
|
+
var _bundleCommon = require("@kineticdata/bundle-common");
|
|
17
|
+
var _PageTitle = require("../../shared/PageTitle");
|
|
18
|
+
var _ExportModal = require("./ExportModal");
|
|
19
|
+
var _settingsForms = require("../../../redux/modules/settingsForms");
|
|
20
|
+
var _excluded = ["value", "valueTransform"];
|
|
21
|
+
var tableKey = 'queue-settings-form-submissions';
|
|
15
22
|
var LinkCell = function LinkCell(_ref) {
|
|
16
23
|
var row = _ref.row,
|
|
17
|
-
|
|
18
|
-
return /*#__PURE__*/
|
|
24
|
+
value = _ref.value;
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_router.Link, {
|
|
19
26
|
to: "submissions/".concat(row.get('id'))
|
|
20
27
|
}, value));
|
|
21
28
|
};
|
|
22
|
-
|
|
23
|
-
var EmptyBodyRow = TableComponents.generateEmptyBodyRow({
|
|
29
|
+
var EmptyBodyRow = _bundleCommon.TableComponents.generateEmptyBodyRow({
|
|
24
30
|
loadingMessage: 'Loading Submissions...',
|
|
25
31
|
noSearchResultsMessage: 'No submissions were found - please modify your search criteria',
|
|
26
32
|
noItemsMessage: 'There are no submissions to display.'
|
|
27
33
|
});
|
|
28
|
-
|
|
34
|
+
var FormSubmissionsComponent = function FormSubmissionsComponent(_ref2) {
|
|
29
35
|
var kapp = _ref2.kapp,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var FilterFormLayout = TableComponents.generateFilterFormLayout({
|
|
36
|
+
form = _ref2.form,
|
|
37
|
+
columns = _ref2.columns,
|
|
38
|
+
openModal = _ref2.openModal,
|
|
39
|
+
filterOpen = _ref2.filterOpen,
|
|
40
|
+
setFilterOpen = _ref2.setFilterOpen;
|
|
41
|
+
var FilterFormLayout = _bundleCommon.TableComponents.generateFilterFormLayout({
|
|
36
42
|
isOpen: filterOpen,
|
|
37
43
|
toggle: function toggle() {
|
|
38
44
|
return setFilterOpen(function (open) {
|
|
@@ -58,19 +64,19 @@ export var FormSubmissionsComponent = function FormSubmissionsComponent(_ref2) {
|
|
|
58
64
|
components: i === 0 ? {
|
|
59
65
|
BodyCell: LinkCell
|
|
60
66
|
} : ['createdAt', 'updatedAt'].includes(c.name) ? {
|
|
61
|
-
BodyCell: TableComponents.TimeAgoCell
|
|
67
|
+
BodyCell: _bundleCommon.TableComponents.TimeAgoCell
|
|
62
68
|
} : c.name === 'coreState' ? {
|
|
63
|
-
BodyCell: TableComponents.CoreStateBadgeCell
|
|
69
|
+
BodyCell: _bundleCommon.TableComponents.CoreStateBadgeCell
|
|
64
70
|
} : undefined
|
|
65
71
|
};
|
|
66
72
|
}).push(visibleSortColumns.size === 0 ? {
|
|
67
73
|
value: 'updatedAt',
|
|
68
74
|
sortable: true,
|
|
69
75
|
components: {
|
|
70
|
-
BodyCell: TableComponents.TimeAgoCell
|
|
76
|
+
BodyCell: _bundleCommon.TableComponents.TimeAgoCell
|
|
71
77
|
}
|
|
72
78
|
} : undefined).filter(Boolean);
|
|
73
|
-
return form && /*#__PURE__*/
|
|
79
|
+
return form && /*#__PURE__*/_react["default"].createElement(_react2.SubmissionTable, {
|
|
74
80
|
tableKey: tableKey,
|
|
75
81
|
kappSlug: kapp.slug,
|
|
76
82
|
formSlug: form.slug,
|
|
@@ -78,7 +84,7 @@ export var FormSubmissionsComponent = function FormSubmissionsComponent(_ref2) {
|
|
|
78
84
|
components: {
|
|
79
85
|
EmptyBodyRow: EmptyBodyRow,
|
|
80
86
|
FilterFormLayout: FilterFormLayout,
|
|
81
|
-
FilterFormButtons: TableComponents.FilterFormButtons
|
|
87
|
+
FilterFormButtons: _bundleCommon.TableComponents.FilterFormButtons
|
|
82
88
|
},
|
|
83
89
|
columnSet: visibleColumns.map(function (c) {
|
|
84
90
|
return c.value;
|
|
@@ -91,10 +97,9 @@ export var FormSubmissionsComponent = function FormSubmissionsComponent(_ref2) {
|
|
|
91
97
|
return !c.valueTransform;
|
|
92
98
|
}).reduce(function (alter, _ref3) {
|
|
93
99
|
var value = _ref3.value,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return _objectSpread(_objectSpread({}, alter), {}, _defineProperty({}, value, properties));
|
|
100
|
+
valueTransform = _ref3.valueTransform,
|
|
101
|
+
properties = (0, _objectWithoutProperties2["default"])(_ref3, _excluded);
|
|
102
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, alter), {}, (0, _defineProperty2["default"])({}, value, properties));
|
|
98
103
|
}, {}),
|
|
99
104
|
filterSet: ['startDate', 'endDate', 'submittedBy', 'coreState', 'values'],
|
|
100
105
|
onSearch: function onSearch() {
|
|
@@ -104,15 +109,15 @@ export var FormSubmissionsComponent = function FormSubmissionsComponent(_ref2) {
|
|
|
104
109
|
}
|
|
105
110
|
}, function (_ref4) {
|
|
106
111
|
var pagination = _ref4.pagination,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return /*#__PURE__*/
|
|
112
|
+
table = _ref4.table,
|
|
113
|
+
filter = _ref4.filter,
|
|
114
|
+
appliedFilters = _ref4.appliedFilters,
|
|
115
|
+
filterFormKey = _ref4.filterFormKey;
|
|
116
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
117
|
className: "page-container"
|
|
113
|
-
}, /*#__PURE__*/
|
|
118
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
114
119
|
className: "page-panel"
|
|
115
|
-
}, /*#__PURE__*/
|
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement(_PageTitle.PageTitle, {
|
|
116
121
|
parts: [form.name, "Forms"],
|
|
117
122
|
settings: true,
|
|
118
123
|
breadcrumbs: [{
|
|
@@ -137,52 +142,52 @@ export var FormSubmissionsComponent = function FormSubmissionsComponent(_ref2) {
|
|
|
137
142
|
},
|
|
138
143
|
menu: true
|
|
139
144
|
}]
|
|
140
|
-
}), /*#__PURE__*/
|
|
145
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
141
146
|
className: "data-list data-list--fourths"
|
|
142
|
-
}, /*#__PURE__*/
|
|
147
|
+
}, /*#__PURE__*/_react["default"].createElement("dl", null, /*#__PURE__*/_react["default"].createElement("dt", null, "Type"), /*#__PURE__*/_react["default"].createElement("dd", null, form.type || /*#__PURE__*/_react["default"].createElement("em", {
|
|
143
148
|
className: "text-muted"
|
|
144
|
-
}, "None"))), /*#__PURE__*/
|
|
149
|
+
}, "None"))), /*#__PURE__*/_react["default"].createElement("dl", null, /*#__PURE__*/_react["default"].createElement("dt", null, "Status"), /*#__PURE__*/_react["default"].createElement("dd", null, form.status || /*#__PURE__*/_react["default"].createElement("em", {
|
|
145
150
|
className: "text-muted"
|
|
146
|
-
}, "None"))), /*#__PURE__*/
|
|
151
|
+
}, "None"))), /*#__PURE__*/_react["default"].createElement("dl", null, /*#__PURE__*/_react["default"].createElement("dt", null, "Created"), /*#__PURE__*/_react["default"].createElement("dd", null, /*#__PURE__*/_react["default"].createElement(_bundleCommon.TimeAgo, {
|
|
147
152
|
timestamp: form.createdAt
|
|
148
|
-
}), /*#__PURE__*/
|
|
153
|
+
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("small", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "by"), " ", form.createdBy))), /*#__PURE__*/_react["default"].createElement("dl", null, /*#__PURE__*/_react["default"].createElement("dt", null, "Updated"), /*#__PURE__*/_react["default"].createElement("dd", null, /*#__PURE__*/_react["default"].createElement(_bundleCommon.TimeAgo, {
|
|
149
154
|
timestamp: form.updatedAt
|
|
150
|
-
}), /*#__PURE__*/
|
|
155
|
+
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("small", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "by"), " ", form.updatedBy))), form.description && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("dl", null, /*#__PURE__*/_react["default"].createElement("dt", null, "Description"), /*#__PURE__*/_react["default"].createElement("dd", null, form.description)))), /*#__PURE__*/_react["default"].createElement("h3", {
|
|
151
156
|
className: "section__title"
|
|
152
|
-
}, /*#__PURE__*/
|
|
157
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
153
158
|
className: "title"
|
|
154
|
-
}, /*#__PURE__*/
|
|
159
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Submissions")), filter), /*#__PURE__*/_react["default"].createElement("div", {
|
|
155
160
|
className: "section__content"
|
|
156
|
-
}, /*#__PURE__*/
|
|
161
|
+
}, /*#__PURE__*/_react["default"].createElement(_bundleCommon.TableComponents.FilterPills, {
|
|
157
162
|
filterFormKey: filterFormKey,
|
|
158
163
|
appliedFilters: appliedFilters
|
|
159
|
-
}), /*#__PURE__*/
|
|
164
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
160
165
|
className: "scroll-wrapper-h"
|
|
161
|
-
}, table), pagination))), /*#__PURE__*/
|
|
166
|
+
}, table), pagination))), /*#__PURE__*/_react["default"].createElement(_ExportModal.ExportModal, {
|
|
162
167
|
form: form,
|
|
163
168
|
filter: filter
|
|
164
169
|
}));
|
|
165
170
|
});
|
|
166
171
|
};
|
|
167
|
-
|
|
172
|
+
exports.FormSubmissionsComponent = FormSubmissionsComponent;
|
|
168
173
|
var mapStateToProps = function mapStateToProps(state) {
|
|
169
174
|
return {
|
|
170
175
|
kapp: state.app.kapp
|
|
171
176
|
};
|
|
172
177
|
};
|
|
173
|
-
|
|
174
178
|
var mapDispatchToProps = {
|
|
175
|
-
openModal: actions.openModal
|
|
179
|
+
openModal: _settingsForms.actions.openModal
|
|
176
180
|
};
|
|
177
|
-
|
|
181
|
+
var FormSubmissions = (0, _recompose.compose)((0, _store.connect)(mapStateToProps, mapDispatchToProps), (0, _recompose.withState)('filterOpen', 'setFilterOpen', false), (0, _recompose.withProps)(function (props) {
|
|
178
182
|
return {
|
|
179
|
-
columns: buildFormConfigurationObject(props.form).columns
|
|
183
|
+
columns: (0, _settingsForms.buildFormConfigurationObject)(props.form).columns
|
|
180
184
|
};
|
|
181
|
-
}), lifecycle({
|
|
185
|
+
}), (0, _recompose.lifecycle)({
|
|
182
186
|
componentDidMount: function componentDidMount() {
|
|
183
|
-
mountTable(tableKey);
|
|
187
|
+
(0, _react2.mountTable)(tableKey);
|
|
184
188
|
},
|
|
185
189
|
componentWillUnmount: function componentWillUnmount() {
|
|
186
|
-
unmountTable(tableKey);
|
|
190
|
+
(0, _react2.unmountTable)(tableKey);
|
|
187
191
|
}
|
|
188
|
-
}))(FormSubmissionsComponent);
|
|
192
|
+
}))(FormSubmissionsComponent);
|
|
193
|
+
exports.FormSubmissions = FormSubmissions;
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
/* eslint-disable react/prefer-stateless-function */
|
|
7
|
-
|
|
8
|
-
export var AssignmentItem = /*#__PURE__*/function (_Component) {
|
|
9
|
-
_inherits(AssignmentItem, _Component);
|
|
10
|
-
|
|
11
|
-
var _super = _createSuper(AssignmentItem);
|
|
1
|
+
"use strict";
|
|
12
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.AssignmentItem = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
12
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
/* eslint-disable react/prefer-stateless-function */
|
|
15
|
+
var AssignmentItem = /*#__PURE__*/function (_Component) {
|
|
16
|
+
(0, _inherits2["default"])(AssignmentItem, _Component);
|
|
17
|
+
var _super = (0, _createSuper2["default"])(AssignmentItem);
|
|
13
18
|
function AssignmentItem() {
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
(0, _classCallCheck2["default"])(this, AssignmentItem);
|
|
16
20
|
return _super.apply(this, arguments);
|
|
17
21
|
}
|
|
18
|
-
|
|
19
|
-
_createClass(AssignmentItem, [{
|
|
22
|
+
(0, _createClass2["default"])(AssignmentItem, [{
|
|
20
23
|
key: "render",
|
|
21
24
|
value: function render() {
|
|
22
25
|
var _this$props = this.props,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/
|
|
26
|
+
item = _this$props.item,
|
|
27
|
+
isHighlighted = _this$props.isHighlighted,
|
|
28
|
+
onClick = _this$props.onClick;
|
|
29
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
30
|
className: "item ".concat(isHighlighted ? 'item-highlighted' : ''),
|
|
28
31
|
onClick: onClick,
|
|
29
32
|
role: "menuitem",
|
|
@@ -31,6 +34,6 @@ export var AssignmentItem = /*#__PURE__*/function (_Component) {
|
|
|
31
34
|
}, item.displayName || item.username);
|
|
32
35
|
}
|
|
33
36
|
}]);
|
|
34
|
-
|
|
35
37
|
return AssignmentItem;
|
|
36
|
-
}(Component);
|
|
38
|
+
}(_react.Component);
|
|
39
|
+
exports.AssignmentItem = AssignmentItem;
|