@kineticdata/bundle-tech-bar 6.0.0 → 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 +6 -6
|
@@ -8,7 +8,7 @@ var _immutable = require("immutable");
|
|
|
8
8
|
var _bundleCommon = require("@kineticdata/bundle-common");
|
|
9
9
|
var withPayload = _bundleCommon.Utils.withPayload;
|
|
10
10
|
var ns = _bundleCommon.Utils.namespaceBuilder('techbar/walkins');
|
|
11
|
-
var types = {
|
|
11
|
+
var types = exports.types = {
|
|
12
12
|
FETCH_WALK_INS_FAILURE: ns('FETCH_WALK_INS_FAILURE'),
|
|
13
13
|
FETCH_TODAY_WALK_INS_REQUEST: ns('FETCH_TODAY_WALK_INS_REQUEST'),
|
|
14
14
|
FETCH_TODAY_WALK_INS_SUCCESS: ns('FETCH_TODAY_WALK_INS_SUCCESS'),
|
|
@@ -16,8 +16,7 @@ var types = {
|
|
|
16
16
|
FETCH_WALK_INS_OVERVIEW_SUCCESS: ns('FETCH_WALK_INS_OVERVIEW_SUCCESS'),
|
|
17
17
|
FETCH_WALK_INS_OVERVIEW_FAILURE: ns('FETCH_WALK_INS_OVERVIEW_FAILURE')
|
|
18
18
|
};
|
|
19
|
-
exports.
|
|
20
|
-
var actions = {
|
|
19
|
+
var actions = exports.actions = {
|
|
21
20
|
fetchWalkInsFailure: withPayload(types.FETCH_WALK_INS_FAILURE),
|
|
22
21
|
fetchTodayWalkInsRequest: withPayload(types.FETCH_TODAY_WALK_INS_REQUEST),
|
|
23
22
|
fetchTodayWalkInsSuccess: withPayload(types.FETCH_TODAY_WALK_INS_SUCCESS),
|
|
@@ -25,16 +24,14 @@ var actions = {
|
|
|
25
24
|
fetchWalkInsOverviewSuccess: withPayload(types.FETCH_WALK_INS_OVERVIEW_SUCCESS),
|
|
26
25
|
fetchWalkInsOverviewFailure: withPayload(types.FETCH_WALK_INS_OVERVIEW_FAILURE)
|
|
27
26
|
};
|
|
28
|
-
exports.
|
|
29
|
-
var State = (0, _immutable.Record)({
|
|
27
|
+
var State = exports.State = (0, _immutable.Record)({
|
|
30
28
|
loading: true,
|
|
31
29
|
error: null,
|
|
32
30
|
today: null,
|
|
33
31
|
overview: null,
|
|
34
32
|
overviewError: null
|
|
35
33
|
});
|
|
36
|
-
exports.
|
|
37
|
-
var reducer = function reducer() {
|
|
34
|
+
var reducer = exports.reducer = function reducer() {
|
|
38
35
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : State();
|
|
39
36
|
var _ref = arguments.length > 1 ? arguments[1] : undefined,
|
|
40
37
|
type = _ref.type,
|
|
@@ -57,5 +54,4 @@ var reducer = function reducer() {
|
|
|
57
54
|
default:
|
|
58
55
|
return state;
|
|
59
56
|
}
|
|
60
|
-
};
|
|
61
|
-
exports.reducer = reducer;
|
|
57
|
+
};
|
package/lib/redux/reducers.js
CHANGED
|
@@ -10,12 +10,11 @@ var _techBarApp = require("./modules/techBarApp");
|
|
|
10
10
|
var _walkIns = require("./modules/walkIns");
|
|
11
11
|
var _metrics = require("./modules/metrics");
|
|
12
12
|
var _export = require("./modules/export");
|
|
13
|
-
var _default = {
|
|
13
|
+
var _default = exports["default"] = {
|
|
14
14
|
app: _app.reducer,
|
|
15
15
|
appointments: _appointments.reducer,
|
|
16
16
|
techBarApp: _techBarApp.reducer,
|
|
17
17
|
walkIns: _walkIns.reducer,
|
|
18
18
|
metrics: _metrics.reducer,
|
|
19
19
|
"export": _export.reducer
|
|
20
|
-
};
|
|
21
|
-
exports["default"] = _default;
|
|
20
|
+
};
|
package/lib/redux/sagas/app.js
CHANGED
|
@@ -12,26 +12,22 @@ var _marked = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(syncAppSt
|
|
|
12
12
|
_marked2 = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(watchApp);
|
|
13
13
|
function syncAppState(action) {
|
|
14
14
|
return (0, _regeneratorRuntime2["default"])().wrap(function syncAppState$(_context) {
|
|
15
|
-
while (1) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return _context.stop();
|
|
20
|
-
}
|
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16
|
+
case 0:
|
|
17
|
+
case "end":
|
|
18
|
+
return _context.stop();
|
|
21
19
|
}
|
|
22
20
|
}, _marked);
|
|
23
21
|
}
|
|
24
22
|
function watchApp() {
|
|
25
23
|
return (0, _regeneratorRuntime2["default"])().wrap(function watchApp$(_context2) {
|
|
26
|
-
while (1) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return _context2.stop();
|
|
34
|
-
}
|
|
24
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
25
|
+
case 0:
|
|
26
|
+
_context2.next = 2;
|
|
27
|
+
return (0, _effects.takeEvery)(_app.types.SYNC_APP_STATE, syncAppState);
|
|
28
|
+
case 2:
|
|
29
|
+
case "end":
|
|
30
|
+
return _context2.stop();
|
|
35
31
|
}
|
|
36
32
|
}, _marked2);
|
|
37
33
|
}
|
|
@@ -25,233 +25,223 @@ var _marked = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(fetchUpco
|
|
|
25
25
|
function fetchUpcomingAppointmentsRequestSaga() {
|
|
26
26
|
var kappSlug, username, searchBuilder, _yield$call, submissions, error;
|
|
27
27
|
return (0, _regeneratorRuntime2["default"])().wrap(function fetchUpcomingAppointmentsRequestSaga$(_context) {
|
|
28
|
-
while (1) {
|
|
29
|
-
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
_context.next = 2;
|
|
31
|
+
return (0, _effects.select)(function (state) {
|
|
32
|
+
return state.app.kappSlug;
|
|
33
|
+
});
|
|
34
|
+
case 2:
|
|
35
|
+
kappSlug = _context.sent;
|
|
36
|
+
_context.next = 5;
|
|
37
|
+
return (0, _effects.select)(function (state) {
|
|
38
|
+
return state.app.profile.username;
|
|
39
|
+
});
|
|
40
|
+
case 5:
|
|
41
|
+
username = _context.sent;
|
|
42
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').coreState('Submitted').eq('values[Requested For]', username);
|
|
43
|
+
_context.next = 9;
|
|
44
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
45
|
+
search: searchBuilder.build(),
|
|
46
|
+
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
47
|
+
kapp: kappSlug
|
|
48
|
+
});
|
|
49
|
+
case 9:
|
|
50
|
+
_yield$call = _context.sent;
|
|
51
|
+
submissions = _yield$call.submissions;
|
|
52
|
+
error = _yield$call.error;
|
|
53
|
+
if (!error) {
|
|
54
|
+
_context.next = 18;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
_context.next = 15;
|
|
58
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
59
|
+
case 15:
|
|
60
|
+
(0, _bundleCommon.addToastAlert)({
|
|
61
|
+
title: 'Failed to fetch upcoming appointments.',
|
|
62
|
+
message: error.message
|
|
63
|
+
});
|
|
64
|
+
_context.next = 20;
|
|
65
|
+
break;
|
|
66
|
+
case 18:
|
|
67
|
+
_context.next = 20;
|
|
68
|
+
return (0, _effects.put)(_appointments.actions.fetchUpcomingAppointmentsSuccess(submissions));
|
|
69
|
+
case 20:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context.stop();
|
|
72
|
+
}
|
|
73
|
+
}, _marked);
|
|
74
|
+
}
|
|
75
|
+
function fetchPastAppointmentsRequestSaga() {
|
|
76
|
+
var kappSlug, username, searchBuilder, _yield$call2, submissions, error;
|
|
77
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function fetchPastAppointmentsRequestSaga$(_context2) {
|
|
78
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
79
|
+
case 0:
|
|
80
|
+
_context2.next = 2;
|
|
81
|
+
return (0, _effects.select)(function (state) {
|
|
82
|
+
return state.app.kappSlug;
|
|
83
|
+
});
|
|
84
|
+
case 2:
|
|
85
|
+
kappSlug = _context2.sent;
|
|
86
|
+
_context2.next = 5;
|
|
87
|
+
return (0, _effects.select)(function (state) {
|
|
88
|
+
return state.app.profile.username;
|
|
89
|
+
});
|
|
90
|
+
case 5:
|
|
91
|
+
username = _context2.sent;
|
|
92
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').coreState('Closed').eq('values[Requested For]', username);
|
|
93
|
+
_context2.next = 9;
|
|
94
|
+
return (0, _effects.call)(_react.searchSubmissions, {
|
|
95
|
+
search: searchBuilder.build(),
|
|
96
|
+
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
97
|
+
kapp: kappSlug
|
|
98
|
+
});
|
|
99
|
+
case 9:
|
|
100
|
+
_yield$call2 = _context2.sent;
|
|
101
|
+
submissions = _yield$call2.submissions;
|
|
102
|
+
error = _yield$call2.error;
|
|
103
|
+
if (!error) {
|
|
104
|
+
_context2.next = 18;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
_context2.next = 15;
|
|
108
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
109
|
+
case 15:
|
|
110
|
+
(0, _bundleCommon.addToastAlert)({
|
|
111
|
+
title: 'Failed to fetch past appointments.',
|
|
112
|
+
message: error.message
|
|
113
|
+
});
|
|
114
|
+
_context2.next = 20;
|
|
115
|
+
break;
|
|
116
|
+
case 18:
|
|
117
|
+
_context2.next = 20;
|
|
118
|
+
return (0, _effects.put)(_appointments.actions.fetchPastAppointmentsSuccess(submissions));
|
|
119
|
+
case 20:
|
|
120
|
+
case "end":
|
|
121
|
+
return _context2.stop();
|
|
122
|
+
}
|
|
123
|
+
}, _marked2);
|
|
124
|
+
}
|
|
125
|
+
function fetchTodayAppointmentsRequestSaga(_ref) {
|
|
126
|
+
var _ref$payload = _ref.payload,
|
|
127
|
+
schedulerId = _ref$payload.schedulerId,
|
|
128
|
+
status = _ref$payload.status;
|
|
129
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
130
|
+
var kappSlug, searchBuilder, _yield$call3, submissions, error;
|
|
131
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context3) {
|
|
132
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
30
133
|
case 0:
|
|
31
|
-
|
|
134
|
+
_context3.next = 2;
|
|
32
135
|
return (0, _effects.select)(function (state) {
|
|
33
136
|
return state.app.kappSlug;
|
|
34
137
|
});
|
|
35
138
|
case 2:
|
|
36
|
-
kappSlug =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_context.next = 9;
|
|
139
|
+
kappSlug = _context3.sent;
|
|
140
|
+
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'));
|
|
141
|
+
if ((0, _isarray["default"])(status) && status.length > 0) {
|
|
142
|
+
searchBuilder["in"]('values[Status]', status);
|
|
143
|
+
} else if (status) {
|
|
144
|
+
searchBuilder.eq('values[Status]', status);
|
|
145
|
+
}
|
|
146
|
+
_context3.next = 7;
|
|
45
147
|
return (0, _effects.call)(_react.searchSubmissions, {
|
|
46
148
|
search: searchBuilder.build(),
|
|
47
149
|
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
48
150
|
kapp: kappSlug
|
|
49
151
|
});
|
|
50
|
-
case
|
|
51
|
-
_yield$
|
|
52
|
-
submissions = _yield$
|
|
53
|
-
error = _yield$
|
|
152
|
+
case 7:
|
|
153
|
+
_yield$call3 = _context3.sent;
|
|
154
|
+
submissions = _yield$call3.submissions;
|
|
155
|
+
error = _yield$call3.error;
|
|
54
156
|
if (!error) {
|
|
55
|
-
|
|
157
|
+
_context3.next = 16;
|
|
56
158
|
break;
|
|
57
159
|
}
|
|
58
|
-
|
|
160
|
+
_context3.next = 13;
|
|
59
161
|
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
60
|
-
case
|
|
162
|
+
case 13:
|
|
61
163
|
(0, _bundleCommon.addToastAlert)({
|
|
62
|
-
title:
|
|
164
|
+
title: "Failed to fetch today's appointments.",
|
|
63
165
|
message: error.message
|
|
64
166
|
});
|
|
65
|
-
|
|
167
|
+
_context3.next = 18;
|
|
66
168
|
break;
|
|
169
|
+
case 16:
|
|
170
|
+
_context3.next = 18;
|
|
171
|
+
return (0, _effects.put)(_appointments.actions.fetchTodayAppointmentsSuccess(submissions.filter(function (s) {
|
|
172
|
+
return s.coreState !== 'Draft';
|
|
173
|
+
})));
|
|
67
174
|
case 18:
|
|
68
|
-
_context.next = 20;
|
|
69
|
-
return (0, _effects.put)(_appointments.actions.fetchUpcomingAppointmentsSuccess(submissions));
|
|
70
|
-
case 20:
|
|
71
175
|
case "end":
|
|
72
|
-
return
|
|
176
|
+
return _context3.stop();
|
|
73
177
|
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
178
|
+
}, _callee);
|
|
179
|
+
})();
|
|
76
180
|
}
|
|
77
|
-
function
|
|
78
|
-
var
|
|
79
|
-
return (0, _regeneratorRuntime2["default"])().
|
|
80
|
-
|
|
81
|
-
switch (
|
|
181
|
+
function setAppointmentsListDateSaga(_ref2) {
|
|
182
|
+
var payload = _ref2.payload;
|
|
183
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
184
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context4) {
|
|
185
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
82
186
|
case 0:
|
|
83
|
-
|
|
187
|
+
_context4.next = 2;
|
|
188
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsListRequest(payload));
|
|
189
|
+
case 2:
|
|
190
|
+
case "end":
|
|
191
|
+
return _context4.stop();
|
|
192
|
+
}
|
|
193
|
+
}, _callee2);
|
|
194
|
+
})();
|
|
195
|
+
}
|
|
196
|
+
function fetchAppointmentsListRequestSaga(_ref3) {
|
|
197
|
+
var schedulerId = _ref3.payload.schedulerId;
|
|
198
|
+
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
199
|
+
var kappSlug, date, searchBuilder, _yield$call4, submissions, error;
|
|
200
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context5) {
|
|
201
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
202
|
+
case 0:
|
|
203
|
+
_context5.next = 2;
|
|
84
204
|
return (0, _effects.select)(function (state) {
|
|
85
205
|
return state.app.kappSlug;
|
|
86
206
|
});
|
|
87
207
|
case 2:
|
|
88
|
-
kappSlug =
|
|
89
|
-
|
|
208
|
+
kappSlug = _context5.sent;
|
|
209
|
+
_context5.next = 5;
|
|
90
210
|
return (0, _effects.select)(function (state) {
|
|
91
|
-
return state.
|
|
211
|
+
return state.appointments.listDate;
|
|
92
212
|
});
|
|
93
213
|
case 5:
|
|
94
|
-
|
|
95
|
-
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').
|
|
96
|
-
|
|
214
|
+
date = _context5.sent;
|
|
215
|
+
searchBuilder = new _react.SubmissionSearch().limit(1000).include('details,values').eq('values[Scheduler Id]', schedulerId).eq('values[Event Date]', date.format('YYYY-MM-DD'));
|
|
216
|
+
_context5.next = 9;
|
|
97
217
|
return (0, _effects.call)(_react.searchSubmissions, {
|
|
98
218
|
search: searchBuilder.build(),
|
|
99
219
|
form: _constants.APPOINTMENT_FORM_SLUG,
|
|
100
220
|
kapp: kappSlug
|
|
101
221
|
});
|
|
102
222
|
case 9:
|
|
103
|
-
_yield$
|
|
104
|
-
submissions = _yield$
|
|
105
|
-
error = _yield$
|
|
223
|
+
_yield$call4 = _context5.sent;
|
|
224
|
+
submissions = _yield$call4.submissions;
|
|
225
|
+
error = _yield$call4.error;
|
|
106
226
|
if (!error) {
|
|
107
|
-
|
|
227
|
+
_context5.next = 18;
|
|
108
228
|
break;
|
|
109
229
|
}
|
|
110
|
-
|
|
230
|
+
_context5.next = 15;
|
|
111
231
|
return (0, _effects.put)(_appointments.actions.fetchAppointmentsFailure(error));
|
|
112
232
|
case 15:
|
|
113
233
|
(0, _bundleCommon.addToastAlert)({
|
|
114
|
-
title: 'Failed to fetch
|
|
234
|
+
title: 'Failed to fetch appointments.',
|
|
115
235
|
message: error.message
|
|
116
236
|
});
|
|
117
|
-
|
|
237
|
+
_context5.next = 20;
|
|
118
238
|
break;
|
|
119
239
|
case 18:
|
|
120
|
-
|
|
121
|
-
return (0, _effects.put)(_appointments.actions.
|
|
240
|
+
_context5.next = 20;
|
|
241
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsListSuccess(submissions));
|
|
122
242
|
case 20:
|
|
123
243
|
case "end":
|
|
124
|
-
return
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}, _marked2);
|
|
128
|
-
}
|
|
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;
|
|
173
|
-
break;
|
|
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
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}, _callee);
|
|
185
|
-
})();
|
|
186
|
-
}
|
|
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
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}, _callee2);
|
|
202
|
-
})();
|
|
203
|
-
}
|
|
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;
|
|
247
|
-
break;
|
|
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
|
-
}
|
|
244
|
+
return _context5.stop();
|
|
255
245
|
}
|
|
256
246
|
}, _callee3);
|
|
257
247
|
})();
|
|
@@ -261,76 +251,72 @@ function fetchAppointmentsOverviewRequestSaga(_ref4) {
|
|
|
261
251
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
262
252
|
var kappSlug, _yield$call5, records, error;
|
|
263
253
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context6) {
|
|
264
|
-
while (1) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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;
|
|
254
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
255
|
+
case 0:
|
|
256
|
+
_context6.next = 2;
|
|
257
|
+
return (0, _effects.select)(function (state) {
|
|
258
|
+
return state.app.kappSlug;
|
|
259
|
+
});
|
|
260
|
+
case 2:
|
|
261
|
+
kappSlug = _context6.sent;
|
|
262
|
+
_context6.next = 5;
|
|
263
|
+
return (0, _effects.call)(_react.fetchBridgedResource, {
|
|
264
|
+
kappSlug: kappSlug,
|
|
265
|
+
formSlug: 'bridged-resources',
|
|
266
|
+
bridgedResourceName: 'Tech Bar Appointments Overview',
|
|
267
|
+
values: {
|
|
268
|
+
Id: id,
|
|
269
|
+
Date: (0, _moment["default"])().format('YYYY-MM-DD')
|
|
290
270
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
271
|
+
});
|
|
272
|
+
case 5:
|
|
273
|
+
_yield$call5 = _context6.sent;
|
|
274
|
+
records = _yield$call5.records;
|
|
275
|
+
error = _yield$call5.error;
|
|
276
|
+
if (!error) {
|
|
277
|
+
_context6.next = 14;
|
|
296
278
|
break;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
279
|
+
}
|
|
280
|
+
_context6.next = 11;
|
|
281
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsOverviewFailure(error));
|
|
282
|
+
case 11:
|
|
283
|
+
console.error('Failed to fetch appointments overview.', error.message);
|
|
284
|
+
_context6.next = 16;
|
|
285
|
+
break;
|
|
286
|
+
case 14:
|
|
287
|
+
_context6.next = 16;
|
|
288
|
+
return (0, _effects.put)(_appointments.actions.fetchAppointmentsOverviewSuccess(records));
|
|
289
|
+
case 16:
|
|
290
|
+
case "end":
|
|
291
|
+
return _context6.stop();
|
|
304
292
|
}
|
|
305
293
|
}, _callee4);
|
|
306
294
|
})();
|
|
307
295
|
}
|
|
308
296
|
function watchAppointments() {
|
|
309
297
|
return (0, _regeneratorRuntime2["default"])().wrap(function watchAppointments$(_context7) {
|
|
310
|
-
while (1) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
return _context7.stop();
|
|
333
|
-
}
|
|
298
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
299
|
+
case 0:
|
|
300
|
+
_context7.next = 2;
|
|
301
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_UPCOMING_APPOINTMENTS_REQUEST, fetchUpcomingAppointmentsRequestSaga);
|
|
302
|
+
case 2:
|
|
303
|
+
_context7.next = 4;
|
|
304
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_PAST_APPOINTMENTS_REQUEST, fetchPastAppointmentsRequestSaga);
|
|
305
|
+
case 4:
|
|
306
|
+
_context7.next = 6;
|
|
307
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_TODAY_APPOINTMENTS_REQUEST, fetchTodayAppointmentsRequestSaga);
|
|
308
|
+
case 6:
|
|
309
|
+
_context7.next = 8;
|
|
310
|
+
return (0, _effects.takeEvery)(_appointments.types.SET_APPOINTMENTS_LIST_DATE, setAppointmentsListDateSaga);
|
|
311
|
+
case 8:
|
|
312
|
+
_context7.next = 10;
|
|
313
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_APPOINTMENTS_LIST_REQUEST, fetchAppointmentsListRequestSaga);
|
|
314
|
+
case 10:
|
|
315
|
+
_context7.next = 12;
|
|
316
|
+
return (0, _effects.takeEvery)(_appointments.types.FETCH_APPOINTMENTS_OVERVIEW_REQUEST, fetchAppointmentsOverviewRequestSaga);
|
|
317
|
+
case 12:
|
|
318
|
+
case "end":
|
|
319
|
+
return _context7.stop();
|
|
334
320
|
}
|
|
335
321
|
}, _marked3);
|
|
336
322
|
}
|