@kineticdata/bundle-tech-bar 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/AppointmentForm.js +5 -10
- package/lib/components/CheckIn.js +5 -9
- package/lib/components/Display.js +4 -8
- package/lib/components/Feedback.js +5 -9
- package/lib/components/Form.js +5 -10
- package/lib/components/Home.js +5 -9
- package/lib/components/Overhead.js +5 -9
- package/lib/components/Past.js +5 -9
- package/lib/components/Sidebar.js +4 -7
- package/lib/components/TechBars.js +4 -7
- package/lib/components/settings/SchedulerSettings.js +5 -9
- package/lib/components/settings/Settings.js +3 -6
- package/lib/components/settings/Sidebar.js +3 -6
- package/lib/components/settings/TechBarMetrics.js +5 -9
- package/lib/components/settings/TechBarSettings.js +5 -9
- package/lib/components/settings/metrics/MetricsExport.js +7 -13
- package/lib/components/settings/metrics/MetricsSummary.js +4 -7
- package/lib/components/settings/metrics/MetricsTrend.js +4 -7
- package/lib/components/settings/tech-bar/AppointmentForm.js +3 -6
- package/lib/components/settings/tech-bar/TechBar.js +5 -9
- package/lib/components/settings/tech-bar/TechBarDisplayMembers.js +4 -7
- package/lib/components/settings/tech-bar/TechBarSettingsForm.js +5 -9
- package/lib/components/shared/PageTitle.js +3 -5
- package/lib/constants.js +16 -32
- package/lib/index.js +4 -2
- package/lib/redux/modules/app.js +4 -7
- package/lib/redux/modules/appointments.js +5 -9
- package/lib/redux/modules/export.js +5 -9
- package/lib/redux/modules/metrics.js +6 -11
- package/lib/redux/modules/techBarApp.js +9 -17
- package/lib/redux/modules/walkIns.js +5 -9
- package/lib/redux/reducers.js +2 -3
- package/lib/redux/sagas/app.js +11 -15
- package/lib/redux/sagas/appointments.js +227 -241
- package/lib/redux/sagas/export.js +112 -118
- package/lib/redux/sagas/metrics.js +50 -54
- package/lib/redux/sagas/techBarApp.js +233 -245
- package/lib/redux/sagas/walkIns.js +90 -96
- package/lib/redux/sagas.js +7 -9
- package/lib/redux/store.js +5 -9
- package/lib/utils.js +2 -3
- package/package.json +55 -54
|
@@ -26,57 +26,55 @@ function fetchExportSubmissionsRequestSaga(_ref) {
|
|
|
26
26
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
27
27
|
var kappSlug, dateParts, i;
|
|
28
28
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
29
|
-
while (1) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
dateParts.push(dates.slice(i, i + 8));
|
|
42
|
-
}
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
_context.next = 2;
|
|
32
|
+
return (0, _effects.select)(function (state) {
|
|
33
|
+
return state.app.kappSlug;
|
|
34
|
+
});
|
|
35
|
+
case 2:
|
|
36
|
+
kappSlug = _context.sent;
|
|
37
|
+
dateParts = [];
|
|
38
|
+
if (dates && dates.length > 8) {
|
|
39
|
+
for (i = 0; i <= dates.length; i += 8) {
|
|
40
|
+
dateParts.push(dates.slice(i, i + 8));
|
|
43
41
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
queryBuilder: queryBuilder,
|
|
53
|
-
schedulerId: schedulerId,
|
|
54
|
-
eventType: eventType,
|
|
55
|
-
dates: datePart,
|
|
56
|
-
dateFieldName: dateFieldName
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
42
|
+
}
|
|
43
|
+
_context.next = 7;
|
|
44
|
+
return (0, _effects.call)(fetchExportSubmissions, {
|
|
45
|
+
kappSlug: kappSlug,
|
|
46
|
+
formSlug: formSlug,
|
|
47
|
+
searchers: schedulerIds.map(function (schedulerId) {
|
|
48
|
+
if (dateParts.length > 0) {
|
|
49
|
+
return dateParts.map(function (datePart) {
|
|
60
50
|
return buildSearcher({
|
|
61
51
|
queryBuilder: queryBuilder,
|
|
62
52
|
schedulerId: schedulerId,
|
|
63
53
|
eventType: eventType,
|
|
64
|
-
dates:
|
|
54
|
+
dates: datePart,
|
|
65
55
|
dateFieldName: dateFieldName
|
|
66
56
|
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
57
|
+
});
|
|
58
|
+
} else {
|
|
59
|
+
return buildSearcher({
|
|
60
|
+
queryBuilder: queryBuilder,
|
|
61
|
+
schedulerId: schedulerId,
|
|
62
|
+
eventType: eventType,
|
|
63
|
+
dates: dates,
|
|
64
|
+
dateFieldName: dateFieldName
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}).reduce(function (searchers, query) {
|
|
68
|
+
if ((0, _isarray["default"])(query)) {
|
|
69
|
+
return [].concat((0, _toConsumableArray2["default"])(searchers), (0, _toConsumableArray2["default"])(query));
|
|
70
|
+
} else {
|
|
71
|
+
return [].concat((0, _toConsumableArray2["default"])(searchers), [query]);
|
|
72
|
+
}
|
|
73
|
+
}, [])
|
|
74
|
+
});
|
|
75
|
+
case 7:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context.stop();
|
|
80
78
|
}
|
|
81
79
|
}, _callee);
|
|
82
80
|
})();
|
|
@@ -123,91 +121,87 @@ function fetchExportSubmissions(_ref3) {
|
|
|
123
121
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
124
122
|
var results, _results$reduce, submissions, error, nextSearchers;
|
|
125
123
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
126
|
-
while (1) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return (0, _effects.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
data.nextSearchers.push(searcher);
|
|
154
|
-
}
|
|
124
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
125
|
+
case 0:
|
|
126
|
+
_context2.next = 2;
|
|
127
|
+
return (0, _effects.all)(searchers.map(function (searcher) {
|
|
128
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
129
|
+
search: searcher.build(),
|
|
130
|
+
kapp: kappSlug,
|
|
131
|
+
form: formSlug
|
|
132
|
+
});
|
|
133
|
+
}));
|
|
134
|
+
case 2:
|
|
135
|
+
results = _context2.sent;
|
|
136
|
+
_results$reduce = results.reduce(function (data, _ref4, index) {
|
|
137
|
+
var submissions = _ref4.submissions,
|
|
138
|
+
_ref4$nextPageToken = _ref4.nextPageToken,
|
|
139
|
+
nextPageToken = _ref4$nextPageToken === void 0 ? null : _ref4$nextPageToken,
|
|
140
|
+
error = _ref4.error;
|
|
141
|
+
if (!data.error) {
|
|
142
|
+
if (error) {
|
|
143
|
+
data.error = error;
|
|
144
|
+
} else {
|
|
145
|
+
var _data$submissions;
|
|
146
|
+
(_data$submissions = data.submissions).push.apply(_data$submissions, (0, _toConsumableArray2["default"])(submissions));
|
|
147
|
+
if (nextPageToken) {
|
|
148
|
+
var searcher = searchers[index];
|
|
149
|
+
searcher.pageToken(nextPageToken);
|
|
150
|
+
data.nextSearchers.push(searcher);
|
|
155
151
|
}
|
|
156
152
|
}
|
|
157
|
-
return data;
|
|
158
|
-
}, {
|
|
159
|
-
submissions: [],
|
|
160
|
-
error: null,
|
|
161
|
-
nextSearchers: []
|
|
162
|
-
}), submissions = _results$reduce.submissions, error = _results$reduce.error, nextSearchers = _results$reduce.nextSearchers;
|
|
163
|
-
if (!error) {
|
|
164
|
-
_context2.next = 9;
|
|
165
|
-
break;
|
|
166
153
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
154
|
+
return data;
|
|
155
|
+
}, {
|
|
156
|
+
submissions: [],
|
|
157
|
+
error: null,
|
|
158
|
+
nextSearchers: []
|
|
159
|
+
}), submissions = _results$reduce.submissions, error = _results$reduce.error, nextSearchers = _results$reduce.nextSearchers;
|
|
160
|
+
if (!error) {
|
|
161
|
+
_context2.next = 9;
|
|
171
162
|
break;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
searchers: nextSearchers
|
|
185
|
-
});
|
|
186
|
-
case 14:
|
|
187
|
-
_context2.next = 18;
|
|
163
|
+
}
|
|
164
|
+
_context2.next = 7;
|
|
165
|
+
return (0, _effects.put)(_export.actions.fetchExportSubmissionsFailure(error));
|
|
166
|
+
case 7:
|
|
167
|
+
_context2.next = 11;
|
|
168
|
+
break;
|
|
169
|
+
case 9:
|
|
170
|
+
_context2.next = 11;
|
|
171
|
+
return (0, _effects.put)(_export.actions.fetchExportSubmissionsSuccess(submissions));
|
|
172
|
+
case 11:
|
|
173
|
+
if (!(nextSearchers.length > 0)) {
|
|
174
|
+
_context2.next = 16;
|
|
188
175
|
break;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
176
|
+
}
|
|
177
|
+
_context2.next = 14;
|
|
178
|
+
return (0, _effects.call)(fetchExportSubmissions, {
|
|
179
|
+
kappSlug: kappSlug,
|
|
180
|
+
formSlug: formSlug,
|
|
181
|
+
searchers: nextSearchers
|
|
182
|
+
});
|
|
183
|
+
case 14:
|
|
184
|
+
_context2.next = 18;
|
|
185
|
+
break;
|
|
186
|
+
case 16:
|
|
187
|
+
_context2.next = 18;
|
|
188
|
+
return (0, _effects.put)(_export.actions.fetchExportSubmissionsComplete());
|
|
189
|
+
case 18:
|
|
190
|
+
case "end":
|
|
191
|
+
return _context2.stop();
|
|
196
192
|
}
|
|
197
193
|
}, _callee2);
|
|
198
194
|
})();
|
|
199
195
|
}
|
|
200
196
|
function watchExport() {
|
|
201
197
|
return (0, _regeneratorRuntime2["default"])().wrap(function watchExport$(_context3) {
|
|
202
|
-
while (1) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return _context3.stop();
|
|
210
|
-
}
|
|
198
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
199
|
+
case 0:
|
|
200
|
+
_context3.next = 2;
|
|
201
|
+
return (0, _effects.takeEvery)(_export.types.FETCH_EXPORT_SUBMISSIONS_REQUEST, fetchExportSubmissionsRequestSaga);
|
|
202
|
+
case 2:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context3.stop();
|
|
211
205
|
}
|
|
212
206
|
}, _marked);
|
|
213
207
|
}
|
|
@@ -24,67 +24,63 @@ function fetchMetricsRequestSaga(_ref) {
|
|
|
24
24
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
25
25
|
var kappSlug, searchBuilder, _yield$call, submissions, error;
|
|
26
26
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
27
|
-
while (1) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
_context.next = 17;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
(0, _bundleCommon.addToastAlert)({
|
|
58
|
-
title: 'Error retrieving metrics data.',
|
|
59
|
-
message: error.message
|
|
60
|
-
});
|
|
61
|
-
_context.next = 15;
|
|
62
|
-
return (0, _effects.put)(_metrics.actions.fetchMetricsFailure(error));
|
|
63
|
-
case 15:
|
|
64
|
-
_context.next = 19;
|
|
27
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
_context.next = 2;
|
|
30
|
+
return (0, _effects.select)(function (state) {
|
|
31
|
+
return state.app.kappSlug;
|
|
32
|
+
});
|
|
33
|
+
case 2:
|
|
34
|
+
kappSlug = _context.sent;
|
|
35
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').coreState('Submitted').eq('values[Period Type]', monthly ? 'Monthly' : 'Daily');
|
|
36
|
+
if ((0, _isarray["default"])(schedulerIds) && schedulerIds.length > 0) {
|
|
37
|
+
searchBuilder["in"]('values[Scheduler Id]', schedulerIds);
|
|
38
|
+
}
|
|
39
|
+
if ((0, _isarray["default"])(dates) && dates.length > 0) {
|
|
40
|
+
searchBuilder["in"]('values[Period]', dates);
|
|
41
|
+
}
|
|
42
|
+
_context.next = 8;
|
|
43
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
44
|
+
search: searchBuilder.build(),
|
|
45
|
+
form: _constants.METRICS_FORM_SLUG,
|
|
46
|
+
kapp: kappSlug
|
|
47
|
+
});
|
|
48
|
+
case 8:
|
|
49
|
+
_yield$call = _context.sent;
|
|
50
|
+
submissions = _yield$call.submissions;
|
|
51
|
+
error = _yield$call.error;
|
|
52
|
+
if (!error) {
|
|
53
|
+
_context.next = 17;
|
|
65
54
|
break;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
}
|
|
56
|
+
(0, _bundleCommon.addToastAlert)({
|
|
57
|
+
title: 'Error retrieving metrics data.',
|
|
58
|
+
message: error.message
|
|
59
|
+
});
|
|
60
|
+
_context.next = 15;
|
|
61
|
+
return (0, _effects.put)(_metrics.actions.fetchMetricsFailure(error));
|
|
62
|
+
case 15:
|
|
63
|
+
_context.next = 19;
|
|
64
|
+
break;
|
|
65
|
+
case 17:
|
|
66
|
+
_context.next = 19;
|
|
67
|
+
return (0, _effects.put)(_metrics.actions.fetchMetricsSuccess(submissions));
|
|
68
|
+
case 19:
|
|
69
|
+
case "end":
|
|
70
|
+
return _context.stop();
|
|
73
71
|
}
|
|
74
72
|
}, _callee);
|
|
75
73
|
})();
|
|
76
74
|
}
|
|
77
75
|
function watchMetrics() {
|
|
78
76
|
return (0, _regeneratorRuntime2["default"])().wrap(function watchMetrics$(_context2) {
|
|
79
|
-
while (1) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return _context2.stop();
|
|
87
|
-
}
|
|
77
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
78
|
+
case 0:
|
|
79
|
+
_context2.next = 2;
|
|
80
|
+
return (0, _effects.takeEvery)(_metrics.types.FETCH_METRICS_REQUEST, fetchMetricsRequestSaga);
|
|
81
|
+
case 2:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context2.stop();
|
|
88
84
|
}
|
|
89
85
|
}, _marked);
|
|
90
86
|
}
|