@kineticdata/bundle-tech-bar 5.1.2 → 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/lib/App.js +41 -36
- package/lib/components/AppointmentForm.js +48 -36
- package/lib/components/CheckIn.js +86 -78
- package/lib/components/Display.js +64 -53
- package/lib/components/Feedback.js +106 -103
- package/lib/components/Form.js +56 -48
- package/lib/components/Home.js +148 -144
- package/lib/components/Overhead.js +52 -44
- package/lib/components/Past.js +56 -44
- package/lib/components/Sidebar.js +58 -51
- package/lib/components/TechBars.js +72 -68
- package/lib/components/settings/SchedulerSettings.js +32 -21
- package/lib/components/settings/Settings.js +54 -50
- package/lib/components/settings/Sidebar.js +41 -31
- package/lib/components/settings/TechBarMetrics.js +124 -120
- package/lib/components/settings/TechBarSettings.js +46 -36
- package/lib/components/settings/metrics/MetricsExport.js +120 -107
- package/lib/components/settings/metrics/MetricsSummary.js +140 -141
- package/lib/components/settings/metrics/MetricsTrend.js +331 -341
- package/lib/components/settings/tech-bar/AppointmentForm.js +30 -20
- package/lib/components/settings/tech-bar/TechBar.js +90 -79
- package/lib/components/settings/tech-bar/TechBarDisplayMembers.js +108 -108
- package/lib/components/settings/tech-bar/TechBarSettingsForm.js +44 -34
- package/lib/components/shared/PageTitle.js +24 -15
- package/lib/constants.js +38 -16
- package/lib/index.js +49 -53
- package/lib/redux/modules/app.js +22 -17
- package/lib/redux/modules/appointments.js +31 -35
- package/lib/redux/modules/export.js +26 -21
- package/lib/redux/modules/metrics.js +24 -19
- package/lib/redux/modules/techBarApp.js +33 -34
- package/lib/redux/modules/walkIns.js +23 -21
- package/lib/redux/reducers.js +21 -14
- package/lib/redux/sagas/app.js +15 -13
- package/lib/redux/sagas/appointments.js +220 -256
- package/lib/redux/sagas/export.js +153 -166
- package/lib/redux/sagas/metrics.js +76 -76
- package/lib/redux/sagas/techBarApp.js +240 -258
- package/lib/redux/sagas/walkIns.js +124 -132
- package/lib/redux/sagas.js +18 -14
- package/lib/redux/store.js +36 -27
- package/lib/utils.js +9 -2
- package/package.json +5 -14
|
@@ -1,74 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.fetchAppointmentsListRequestSaga = fetchAppointmentsListRequestSaga;
|
|
8
|
+
exports.fetchAppointmentsOverviewRequestSaga = fetchAppointmentsOverviewRequestSaga;
|
|
9
|
+
exports.fetchPastAppointmentsRequestSaga = fetchPastAppointmentsRequestSaga;
|
|
10
|
+
exports.fetchTodayAppointmentsRequestSaga = fetchTodayAppointmentsRequestSaga;
|
|
11
|
+
exports.fetchUpcomingAppointmentsRequestSaga = fetchUpcomingAppointmentsRequestSaga;
|
|
12
|
+
exports.setAppointmentsListDateSaga = setAppointmentsListDateSaga;
|
|
13
|
+
exports.watchAppointments = watchAppointments;
|
|
14
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
|
|
15
|
+
var _effects = require("redux-saga/effects");
|
|
16
|
+
var _react = require("@kineticdata/react");
|
|
17
|
+
var _appointments = require("../modules/appointments");
|
|
18
|
+
var _bundleCommon = require("@kineticdata/bundle-common");
|
|
19
|
+
var _constants = require("../../constants");
|
|
20
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
21
|
+
var _isarray = _interopRequireDefault(require("isarray"));
|
|
22
|
+
var _marked = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(fetchUpcomingAppointmentsRequestSaga),
|
|
23
|
+
_marked2 = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(fetchPastAppointmentsRequestSaga),
|
|
24
|
+
_marked3 = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(watchAppointments);
|
|
25
|
+
function fetchUpcomingAppointmentsRequestSaga() {
|
|
19
26
|
var kappSlug, username, searchBuilder, _yield$call, submissions, error;
|
|
20
|
-
|
|
21
|
-
return _regeneratorRuntime.wrap(function fetchUpcomingAppointmentsRequestSaga$(_context) {
|
|
27
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function fetchUpcomingAppointmentsRequestSaga$(_context) {
|
|
22
28
|
while (1) {
|
|
23
29
|
switch (_context.prev = _context.next) {
|
|
24
30
|
case 0:
|
|
25
31
|
_context.next = 2;
|
|
26
|
-
return select(function (state) {
|
|
32
|
+
return (0, _effects.select)(function (state) {
|
|
27
33
|
return state.app.kappSlug;
|
|
28
34
|
});
|
|
29
|
-
|
|
30
35
|
case 2:
|
|
31
36
|
kappSlug = _context.sent;
|
|
32
37
|
_context.next = 5;
|
|
33
|
-
return select(function (state) {
|
|
38
|
+
return (0, _effects.select)(function (state) {
|
|
34
39
|
return state.app.profile.username;
|
|
35
40
|
});
|
|
36
|
-
|
|
37
41
|
case 5:
|
|
38
42
|
username = _context.sent;
|
|
39
|
-
searchBuilder = new SubmissionSearch().limit(1000).include('details,values').coreState('Submitted').eq('values[Requested For]', username);
|
|
43
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').coreState('Submitted').eq('values[Requested For]', username);
|
|
40
44
|
_context.next = 9;
|
|
41
|
-
return call(searchSubmissions, {
|
|
45
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
42
46
|
search: searchBuilder.build(),
|
|
43
|
-
form: APPOINTMENT_FORM_SLUG,
|
|
47
|
+
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
44
48
|
kapp: kappSlug
|
|
45
49
|
});
|
|
46
|
-
|
|
47
50
|
case 9:
|
|
48
51
|
_yield$call = _context.sent;
|
|
49
52
|
submissions = _yield$call.submissions;
|
|
50
53
|
error = _yield$call.error;
|
|
51
|
-
|
|
52
54
|
if (!error) {
|
|
53
55
|
_context.next = 18;
|
|
54
56
|
break;
|
|
55
57
|
}
|
|
56
|
-
|
|
57
58
|
_context.next = 15;
|
|
58
|
-
return put(actions.fetchAppointmentsFailure(error));
|
|
59
|
-
|
|
59
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
60
60
|
case 15:
|
|
61
|
-
addToastAlert({
|
|
61
|
+
(0, _bundleCommon.addToastAlert)({
|
|
62
62
|
title: 'Failed to fetch upcoming appointments.',
|
|
63
63
|
message: error.message
|
|
64
64
|
});
|
|
65
65
|
_context.next = 20;
|
|
66
66
|
break;
|
|
67
|
-
|
|
68
67
|
case 18:
|
|
69
68
|
_context.next = 20;
|
|
70
|
-
return put(actions.fetchUpcomingAppointmentsSuccess(submissions));
|
|
71
|
-
|
|
69
|
+
return (0, _effects.put)(_appointments.actions.fetchUpcomingAppointmentsSuccess(submissions));
|
|
72
70
|
case 20:
|
|
73
71
|
case "end":
|
|
74
72
|
return _context.stop();
|
|
@@ -76,60 +74,51 @@ export function fetchUpcomingAppointmentsRequestSaga() {
|
|
|
76
74
|
}
|
|
77
75
|
}, _marked);
|
|
78
76
|
}
|
|
79
|
-
|
|
77
|
+
function fetchPastAppointmentsRequestSaga() {
|
|
80
78
|
var kappSlug, username, searchBuilder, _yield$call2, submissions, error;
|
|
81
|
-
|
|
82
|
-
return _regeneratorRuntime.wrap(function fetchPastAppointmentsRequestSaga$(_context2) {
|
|
79
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function fetchPastAppointmentsRequestSaga$(_context2) {
|
|
83
80
|
while (1) {
|
|
84
81
|
switch (_context2.prev = _context2.next) {
|
|
85
82
|
case 0:
|
|
86
83
|
_context2.next = 2;
|
|
87
|
-
return select(function (state) {
|
|
84
|
+
return (0, _effects.select)(function (state) {
|
|
88
85
|
return state.app.kappSlug;
|
|
89
86
|
});
|
|
90
|
-
|
|
91
87
|
case 2:
|
|
92
88
|
kappSlug = _context2.sent;
|
|
93
89
|
_context2.next = 5;
|
|
94
|
-
return select(function (state) {
|
|
90
|
+
return (0, _effects.select)(function (state) {
|
|
95
91
|
return state.app.profile.username;
|
|
96
92
|
});
|
|
97
|
-
|
|
98
93
|
case 5:
|
|
99
94
|
username = _context2.sent;
|
|
100
|
-
searchBuilder = new SubmissionSearch().limit(1000).include('details,values').coreState('Closed').eq('values[Requested For]', username);
|
|
95
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').coreState('Closed').eq('values[Requested For]', username);
|
|
101
96
|
_context2.next = 9;
|
|
102
|
-
return call(searchSubmissions, {
|
|
97
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
103
98
|
search: searchBuilder.build(),
|
|
104
|
-
form: APPOINTMENT_FORM_SLUG,
|
|
99
|
+
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
105
100
|
kapp: kappSlug
|
|
106
101
|
});
|
|
107
|
-
|
|
108
102
|
case 9:
|
|
109
103
|
_yield$call2 = _context2.sent;
|
|
110
104
|
submissions = _yield$call2.submissions;
|
|
111
105
|
error = _yield$call2.error;
|
|
112
|
-
|
|
113
106
|
if (!error) {
|
|
114
107
|
_context2.next = 18;
|
|
115
108
|
break;
|
|
116
109
|
}
|
|
117
|
-
|
|
118
110
|
_context2.next = 15;
|
|
119
|
-
return put(actions.fetchAppointmentsFailure(error));
|
|
120
|
-
|
|
111
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
121
112
|
case 15:
|
|
122
|
-
addToastAlert({
|
|
113
|
+
(0, _bundleCommon.addToastAlert)({
|
|
123
114
|
title: 'Failed to fetch past appointments.',
|
|
124
115
|
message: error.message
|
|
125
116
|
});
|
|
126
117
|
_context2.next = 20;
|
|
127
118
|
break;
|
|
128
|
-
|
|
129
119
|
case 18:
|
|
130
120
|
_context2.next = 20;
|
|
131
|
-
return put(actions.fetchPastAppointmentsSuccess(submissions));
|
|
132
|
-
|
|
121
|
+
return (0, _effects.put)(_appointments.actions.fetchPastAppointmentsSuccess(submissions));
|
|
133
122
|
case 20:
|
|
134
123
|
case "end":
|
|
135
124
|
return _context2.stop();
|
|
@@ -137,236 +126,211 @@ export function fetchPastAppointmentsRequestSaga() {
|
|
|
137
126
|
}
|
|
138
127
|
}, _marked2);
|
|
139
128
|
}
|
|
140
|
-
|
|
141
|
-
var _ref$payload
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
_context3.next =
|
|
129
|
+
function fetchTodayAppointmentsRequestSaga(_ref) {
|
|
130
|
+
var _ref$payload = _ref.payload,
|
|
131
|
+
schedulerId = _ref$payload.schedulerId,
|
|
132
|
+
status = _ref$payload.status;
|
|
133
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
134
|
+
var kappSlug, searchBuilder, _yield$call3, submissions, error;
|
|
135
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context3) {
|
|
136
|
+
while (1) {
|
|
137
|
+
switch (_context3.prev = _context3.next) {
|
|
138
|
+
case 0:
|
|
139
|
+
_context3.next = 2;
|
|
140
|
+
return (0, _effects.select)(function (state) {
|
|
141
|
+
return state.app.kappSlug;
|
|
142
|
+
});
|
|
143
|
+
case 2:
|
|
144
|
+
kappSlug = _context3.sent;
|
|
145
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').eq('values[Scheduler Id]', schedulerId).eq('values[Event Date]', (0, _moment["default"])().format('YYYY-MM-DD'));
|
|
146
|
+
if ((0, _isarray["default"])(status) && status.length > 0) {
|
|
147
|
+
searchBuilder["in"]('values[Status]', status);
|
|
148
|
+
} else if (status) {
|
|
149
|
+
searchBuilder.eq('values[Status]', status);
|
|
150
|
+
}
|
|
151
|
+
_context3.next = 7;
|
|
152
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
153
|
+
search: searchBuilder.build(),
|
|
154
|
+
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
155
|
+
kapp: kappSlug
|
|
156
|
+
});
|
|
157
|
+
case 7:
|
|
158
|
+
_yield$call3 = _context3.sent;
|
|
159
|
+
submissions = _yield$call3.submissions;
|
|
160
|
+
error = _yield$call3.error;
|
|
161
|
+
if (!error) {
|
|
162
|
+
_context3.next = 16;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
_context3.next = 13;
|
|
166
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
167
|
+
case 13:
|
|
168
|
+
(0, _bundleCommon.addToastAlert)({
|
|
169
|
+
title: "Failed to fetch today's appointments.",
|
|
170
|
+
message: error.message
|
|
171
|
+
});
|
|
172
|
+
_context3.next = 18;
|
|
177
173
|
break;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
});
|
|
188
|
-
_context3.next = 19;
|
|
189
|
-
break;
|
|
190
|
-
|
|
191
|
-
case 17:
|
|
192
|
-
_context3.next = 19;
|
|
193
|
-
return put(actions.fetchTodayAppointmentsSuccess(submissions.filter(function (s) {
|
|
194
|
-
return s.coreState !== 'Draft';
|
|
195
|
-
})));
|
|
196
|
-
|
|
197
|
-
case 19:
|
|
198
|
-
case "end":
|
|
199
|
-
return _context3.stop();
|
|
174
|
+
case 16:
|
|
175
|
+
_context3.next = 18;
|
|
176
|
+
return (0, _effects.put)(_appointments.actions.fetchTodayAppointmentsSuccess(submissions.filter(function (s) {
|
|
177
|
+
return s.coreState !== 'Draft';
|
|
178
|
+
})));
|
|
179
|
+
case 18:
|
|
180
|
+
case "end":
|
|
181
|
+
return _context3.stop();
|
|
182
|
+
}
|
|
200
183
|
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
184
|
+
}, _callee);
|
|
185
|
+
})();
|
|
203
186
|
}
|
|
204
|
-
|
|
205
|
-
var payload;
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
187
|
+
function setAppointmentsListDateSaga(_ref2) {
|
|
188
|
+
var payload = _ref2.payload;
|
|
189
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
190
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context4) {
|
|
191
|
+
while (1) {
|
|
192
|
+
switch (_context4.prev = _context4.next) {
|
|
193
|
+
case 0:
|
|
194
|
+
_context4.next = 2;
|
|
195
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsListRequest(payload));
|
|
196
|
+
case 2:
|
|
197
|
+
case "end":
|
|
198
|
+
return _context4.stop();
|
|
199
|
+
}
|
|
217
200
|
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
201
|
+
}, _callee2);
|
|
202
|
+
})();
|
|
220
203
|
}
|
|
221
|
-
|
|
222
|
-
var schedulerId
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
204
|
+
function fetchAppointmentsListRequestSaga(_ref3) {
|
|
205
|
+
var schedulerId = _ref3.payload.schedulerId;
|
|
206
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
207
|
+
var kappSlug, date, searchBuilder, _yield$call4, submissions, error;
|
|
208
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context5) {
|
|
209
|
+
while (1) {
|
|
210
|
+
switch (_context5.prev = _context5.next) {
|
|
211
|
+
case 0:
|
|
212
|
+
_context5.next = 2;
|
|
213
|
+
return (0, _effects.select)(function (state) {
|
|
214
|
+
return state.app.kappSlug;
|
|
215
|
+
});
|
|
216
|
+
case 2:
|
|
217
|
+
kappSlug = _context5.sent;
|
|
218
|
+
_context5.next = 5;
|
|
219
|
+
return (0, _effects.select)(function (state) {
|
|
220
|
+
return state.appointments.listDate;
|
|
221
|
+
});
|
|
222
|
+
case 5:
|
|
223
|
+
date = _context5.sent;
|
|
224
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').eq('values[Scheduler Id]', schedulerId).eq('values[Event Date]', date.format('YYYY-MM-DD'));
|
|
225
|
+
_context5.next = 9;
|
|
226
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
227
|
+
search: searchBuilder.build(),
|
|
228
|
+
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
229
|
+
kapp: kappSlug
|
|
230
|
+
});
|
|
231
|
+
case 9:
|
|
232
|
+
_yield$call4 = _context5.sent;
|
|
233
|
+
submissions = _yield$call4.submissions;
|
|
234
|
+
error = _yield$call4.error;
|
|
235
|
+
if (!error) {
|
|
236
|
+
_context5.next = 18;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
_context5.next = 15;
|
|
240
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
241
|
+
case 15:
|
|
242
|
+
(0, _bundleCommon.addToastAlert)({
|
|
243
|
+
title: 'Failed to fetch appointments.',
|
|
244
|
+
message: error.message
|
|
245
|
+
});
|
|
246
|
+
_context5.next = 20;
|
|
258
247
|
break;
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
title: 'Failed to fetch appointments.',
|
|
267
|
-
message: error.message
|
|
268
|
-
});
|
|
269
|
-
_context5.next = 21;
|
|
270
|
-
break;
|
|
271
|
-
|
|
272
|
-
case 19:
|
|
273
|
-
_context5.next = 21;
|
|
274
|
-
return put(actions.fetchAppointmentsListSuccess(submissions));
|
|
275
|
-
|
|
276
|
-
case 21:
|
|
277
|
-
case "end":
|
|
278
|
-
return _context5.stop();
|
|
248
|
+
case 18:
|
|
249
|
+
_context5.next = 20;
|
|
250
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsListSuccess(submissions));
|
|
251
|
+
case 20:
|
|
252
|
+
case "end":
|
|
253
|
+
return _context5.stop();
|
|
254
|
+
}
|
|
279
255
|
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
256
|
+
}, _callee3);
|
|
257
|
+
})();
|
|
282
258
|
}
|
|
283
|
-
|
|
284
|
-
var id
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
259
|
+
function fetchAppointmentsOverviewRequestSaga(_ref4) {
|
|
260
|
+
var id = _ref4.payload.id;
|
|
261
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
262
|
+
var kappSlug, _yield$call5, records, error;
|
|
263
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context6) {
|
|
264
|
+
while (1) {
|
|
265
|
+
switch (_context6.prev = _context6.next) {
|
|
266
|
+
case 0:
|
|
267
|
+
_context6.next = 2;
|
|
268
|
+
return (0, _effects.select)(function (state) {
|
|
269
|
+
return state.app.kappSlug;
|
|
270
|
+
});
|
|
271
|
+
case 2:
|
|
272
|
+
kappSlug = _context6.sent;
|
|
273
|
+
_context6.next = 5;
|
|
274
|
+
return (0, _effects.call)(_react.fetchBridgedResource, {
|
|
275
|
+
kappSlug: kappSlug,
|
|
276
|
+
formSlug: 'bridged-resources',
|
|
277
|
+
bridgedResourceName: 'Tech Bar Appointments Overview',
|
|
278
|
+
values: {
|
|
279
|
+
Id: id,
|
|
280
|
+
Date: (0, _moment["default"])().format('YYYY-MM-DD')
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
case 5:
|
|
284
|
+
_yield$call5 = _context6.sent;
|
|
285
|
+
records = _yield$call5.records;
|
|
286
|
+
error = _yield$call5.error;
|
|
287
|
+
if (!error) {
|
|
288
|
+
_context6.next = 14;
|
|
289
|
+
break;
|
|
306
290
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
error = _yield$call5.error;
|
|
313
|
-
|
|
314
|
-
if (!error) {
|
|
315
|
-
_context6.next = 15;
|
|
291
|
+
_context6.next = 11;
|
|
292
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsOverviewFailure(error));
|
|
293
|
+
case 11:
|
|
294
|
+
console.error('Failed to fetch appointments overview.', error.message);
|
|
295
|
+
_context6.next = 16;
|
|
316
296
|
break;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
_context6.next = 17;
|
|
325
|
-
break;
|
|
326
|
-
|
|
327
|
-
case 15:
|
|
328
|
-
_context6.next = 17;
|
|
329
|
-
return put(actions.fetchAppointmentsOverviewSuccess(records));
|
|
330
|
-
|
|
331
|
-
case 17:
|
|
332
|
-
case "end":
|
|
333
|
-
return _context6.stop();
|
|
297
|
+
case 14:
|
|
298
|
+
_context6.next = 16;
|
|
299
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsOverviewSuccess(records));
|
|
300
|
+
case 16:
|
|
301
|
+
case "end":
|
|
302
|
+
return _context6.stop();
|
|
303
|
+
}
|
|
334
304
|
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
305
|
+
}, _callee4);
|
|
306
|
+
})();
|
|
337
307
|
}
|
|
338
|
-
|
|
339
|
-
return
|
|
308
|
+
function watchAppointments() {
|
|
309
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function watchAppointments$(_context7) {
|
|
340
310
|
while (1) {
|
|
341
311
|
switch (_context7.prev = _context7.next) {
|
|
342
312
|
case 0:
|
|
343
313
|
_context7.next = 2;
|
|
344
|
-
return takeEvery(types.FETCH_UPCOMING_APPOINTMENTS_REQUEST, fetchUpcomingAppointmentsRequestSaga);
|
|
345
|
-
|
|
314
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_UPCOMING_APPOINTMENTS_REQUEST, fetchUpcomingAppointmentsRequestSaga);
|
|
346
315
|
case 2:
|
|
347
316
|
_context7.next = 4;
|
|
348
|
-
return takeEvery(types.FETCH_PAST_APPOINTMENTS_REQUEST, fetchPastAppointmentsRequestSaga);
|
|
349
|
-
|
|
317
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_PAST_APPOINTMENTS_REQUEST, fetchPastAppointmentsRequestSaga);
|
|
350
318
|
case 4:
|
|
351
319
|
_context7.next = 6;
|
|
352
|
-
return takeEvery(types.FETCH_TODAY_APPOINTMENTS_REQUEST, fetchTodayAppointmentsRequestSaga);
|
|
353
|
-
|
|
320
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_TODAY_APPOINTMENTS_REQUEST, fetchTodayAppointmentsRequestSaga);
|
|
354
321
|
case 6:
|
|
355
322
|
_context7.next = 8;
|
|
356
|
-
return takeEvery(types.SET_APPOINTMENTS_LIST_DATE, setAppointmentsListDateSaga);
|
|
357
|
-
|
|
323
|
+
return (0, _effects.takeEvery)(_appointments.types.SET_APPOINTMENTS_LIST_DATE, setAppointmentsListDateSaga);
|
|
358
324
|
case 8:
|
|
359
325
|
_context7.next = 10;
|
|
360
|
-
return takeEvery(types.FETCH_APPOINTMENTS_LIST_REQUEST, fetchAppointmentsListRequestSaga);
|
|
361
|
-
|
|
326
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_APPOINTMENTS_LIST_REQUEST, fetchAppointmentsListRequestSaga);
|
|
362
327
|
case 10:
|
|
363
328
|
_context7.next = 12;
|
|
364
|
-
return takeEvery(types.FETCH_APPOINTMENTS_OVERVIEW_REQUEST, fetchAppointmentsOverviewRequestSaga);
|
|
365
|
-
|
|
329
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_APPOINTMENTS_OVERVIEW_REQUEST, fetchAppointmentsOverviewRequestSaga);
|
|
366
330
|
case 12:
|
|
367
331
|
case "end":
|
|
368
332
|
return _context7.stop();
|
|
369
333
|
}
|
|
370
334
|
}
|
|
371
|
-
},
|
|
335
|
+
}, _marked3);
|
|
372
336
|
}
|