@kineticdata/bundle-tech-bar 5.1.2 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +54 -64
|
@@ -1,63 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.mapStateToProps = exports.MetricsTrendComponent = exports.MetricsTrend = void 0;
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _store = require("../../../redux/store");
|
|
13
|
+
var _recompose = require("recompose");
|
|
14
|
+
var _victory = require("victory");
|
|
15
|
+
var _bundleCommon = require("@kineticdata/bundle-common");
|
|
16
|
+
var _react2 = require("@kineticdata/react");
|
|
17
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
18
|
+
var _immutable = require("immutable");
|
|
19
|
+
var _excluded = ["error", "metrics"];
|
|
12
20
|
var toInt = function toInt(value) {
|
|
13
21
|
return parseInt(value, 10) || 0;
|
|
14
22
|
};
|
|
15
|
-
|
|
16
23
|
var toPercentNumber = function toPercentNumber(a, b) {
|
|
17
24
|
return b !== 0 ? Math.round(a / b * 100) : 0;
|
|
18
25
|
};
|
|
19
|
-
|
|
20
26
|
var Appointments = function Appointments(_ref) {
|
|
21
27
|
var appointments = _ref.appointments,
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
formatDate = _ref.formatDate;
|
|
24
29
|
var _Object$keys$sort$red = Object.keys(appointments.total).sort().reduce(function (appts, date) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
var scheduled = toInt(appointments.scheduled[date]);
|
|
31
|
+
var walkins = toInt(appointments.walkins[date]);
|
|
32
|
+
var total = toInt(appointments.total[date]);
|
|
33
|
+
var scheduledPercentage = toPercentNumber(scheduled, total) || 0;
|
|
34
|
+
var walkinsPercentage = toPercentNumber(walkins, total) || 0;
|
|
35
|
+
appts.labelHeaders.push({
|
|
36
|
+
x: formatDate(date),
|
|
37
|
+
y: 0,
|
|
38
|
+
label: "".concat(formatDate(date), "\n").concat(scheduledPercentage, "% Scheduled (").concat(scheduled, ")\n").concat(walkinsPercentage, "% Walk-Ins (").concat(walkins, ")")
|
|
39
|
+
});
|
|
40
|
+
appts.scheduled.push({
|
|
41
|
+
x: formatDate(date),
|
|
42
|
+
y: scheduledPercentage,
|
|
43
|
+
_label: "".concat(scheduledPercentage, "% Scheduled (").concat(scheduled, ")")
|
|
44
|
+
});
|
|
45
|
+
appts.walkins.push({
|
|
46
|
+
x: formatDate(date),
|
|
47
|
+
y: walkinsPercentage,
|
|
48
|
+
_label: "".concat(walkinsPercentage, "% Walk-Ins (").concat(walkins, ")")
|
|
49
|
+
});
|
|
50
|
+
return appts;
|
|
51
|
+
}, {
|
|
52
|
+
labelHeaders: [],
|
|
53
|
+
scheduled: [],
|
|
54
|
+
walkins: []
|
|
55
|
+
}),
|
|
56
|
+
scheduled = _Object$keys$sort$red.scheduled,
|
|
57
|
+
walkins = _Object$keys$sort$red.walkins,
|
|
58
|
+
labelHeaders = _Object$keys$sort$red.labelHeaders;
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
56
60
|
className: "section__title"
|
|
57
|
-
}, /*#__PURE__*/
|
|
61
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Appointments")), /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
|
|
58
62
|
render: function render(translate) {
|
|
59
|
-
return /*#__PURE__*/
|
|
60
|
-
containerComponent: /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement(_victory.VictoryChart, {
|
|
64
|
+
containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryVoronoiContainer, {
|
|
61
65
|
className: "VictoryContainer max-height-350",
|
|
62
66
|
style: {
|
|
63
67
|
height: 'auto'
|
|
@@ -78,27 +82,27 @@ var Appointments = function Appointments(_ref) {
|
|
|
78
82
|
maxDomain: {
|
|
79
83
|
y: 100
|
|
80
84
|
}
|
|
81
|
-
}, /*#__PURE__*/
|
|
82
|
-
colorScale: [Constants.COLORS.black, Constants.COLORS.blueSky, Constants.COLORS.sunflower]
|
|
83
|
-
}, /*#__PURE__*/
|
|
85
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryGroup, {
|
|
86
|
+
colorScale: [_bundleCommon.Constants.COLORS.black, _bundleCommon.Constants.COLORS.blueSky, _bundleCommon.Constants.COLORS.sunflower]
|
|
87
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryScatter, {
|
|
84
88
|
data: labelHeaders,
|
|
85
89
|
size: 2,
|
|
86
|
-
labelComponent: /*#__PURE__*/
|
|
87
|
-
}), /*#__PURE__*/
|
|
90
|
+
labelComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryTooltip, null)
|
|
91
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
88
92
|
data: scheduled,
|
|
89
93
|
style: {
|
|
90
94
|
data: {
|
|
91
95
|
strokeWidth: 3
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
|
-
}), /*#__PURE__*/
|
|
98
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
95
99
|
data: walkins,
|
|
96
100
|
style: {
|
|
97
101
|
data: {
|
|
98
102
|
strokeWidth: 3
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
|
-
})), /*#__PURE__*/
|
|
105
|
+
})), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
102
106
|
style: {
|
|
103
107
|
tickLabels: {
|
|
104
108
|
angle: 45,
|
|
@@ -108,7 +112,7 @@ var Appointments = function Appointments(_ref) {
|
|
|
108
112
|
fontSize: 14
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
|
-
}), /*#__PURE__*/
|
|
115
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
112
116
|
dependentAxis: true,
|
|
113
117
|
tickFormat: function tickFormat(y) {
|
|
114
118
|
return "".concat(y, "%");
|
|
@@ -119,66 +123,63 @@ var Appointments = function Appointments(_ref) {
|
|
|
119
123
|
fontSize: 14
|
|
120
124
|
},
|
|
121
125
|
ticks: {
|
|
122
|
-
stroke: Constants.COLORS.black,
|
|
126
|
+
stroke: _bundleCommon.Constants.COLORS.black,
|
|
123
127
|
size: 5
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
}));
|
|
127
131
|
}
|
|
128
|
-
}), /*#__PURE__*/
|
|
132
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
129
133
|
className: "text-center"
|
|
130
|
-
}, /*#__PURE__*/
|
|
134
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
131
135
|
className: "fa fa-square fa-fw",
|
|
132
136
|
style: {
|
|
133
|
-
color: Constants.COLORS.blueSky
|
|
137
|
+
color: _bundleCommon.Constants.COLORS.blueSky
|
|
134
138
|
}
|
|
135
|
-
}), /*#__PURE__*/
|
|
139
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Scheduled")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
136
140
|
className: "fa fa-square fa-fw",
|
|
137
141
|
style: {
|
|
138
|
-
color: Constants.COLORS.sunflower
|
|
142
|
+
color: _bundleCommon.Constants.COLORS.sunflower
|
|
139
143
|
}
|
|
140
|
-
}), /*#__PURE__*/
|
|
144
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Walk-Ins"))));
|
|
141
145
|
};
|
|
142
|
-
|
|
143
146
|
var Feedback = function Feedback(_ref2) {
|
|
144
147
|
var feedback = _ref2.feedback,
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
formatDate = _ref2.formatDate;
|
|
147
149
|
var _Object$keys$sort$red2 = Object.keys(feedback.total).sort().reduce(function (appts, date) {
|
|
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
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
var positive = toInt(feedback.positive[date]);
|
|
151
|
+
var negative = toInt(feedback.negative[date]);
|
|
152
|
+
var total = toInt(feedback.total[date]);
|
|
153
|
+
var positivePercentage = toPercentNumber(positive, total) || 0;
|
|
154
|
+
var negativePercentage = toPercentNumber(negative, total) || 0;
|
|
155
|
+
appts.labelHeaders.push({
|
|
156
|
+
x: formatDate(date),
|
|
157
|
+
y: 0,
|
|
158
|
+
label: "".concat(formatDate(date), "\n").concat(positivePercentage, "% Positive (").concat(positive, ")\n").concat(negativePercentage, "% Negative (").concat(negative, ")")
|
|
159
|
+
});
|
|
160
|
+
appts.positive.push({
|
|
161
|
+
x: formatDate(date),
|
|
162
|
+
y: positivePercentage
|
|
163
|
+
});
|
|
164
|
+
appts.negative.push({
|
|
165
|
+
x: formatDate(date),
|
|
166
|
+
y: negativePercentage
|
|
167
|
+
});
|
|
168
|
+
return appts;
|
|
169
|
+
}, {
|
|
170
|
+
labelHeaders: [],
|
|
171
|
+
positive: [],
|
|
172
|
+
negative: []
|
|
173
|
+
}),
|
|
174
|
+
positive = _Object$keys$sort$red2.positive,
|
|
175
|
+
negative = _Object$keys$sort$red2.negative,
|
|
176
|
+
labelHeaders = _Object$keys$sort$red2.labelHeaders;
|
|
177
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
177
178
|
className: "section__title"
|
|
178
|
-
}, /*#__PURE__*/
|
|
179
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Feedback")), /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
|
|
179
180
|
render: function render(translate) {
|
|
180
|
-
return /*#__PURE__*/
|
|
181
|
-
containerComponent: /*#__PURE__*/
|
|
181
|
+
return /*#__PURE__*/_react["default"].createElement(_victory.VictoryChart, {
|
|
182
|
+
containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryVoronoiContainer, {
|
|
182
183
|
className: "VictoryContainer max-height-350",
|
|
183
184
|
style: {
|
|
184
185
|
height: 'auto'
|
|
@@ -199,27 +200,27 @@ var Feedback = function Feedback(_ref2) {
|
|
|
199
200
|
maxDomain: {
|
|
200
201
|
y: 100
|
|
201
202
|
}
|
|
202
|
-
}, /*#__PURE__*/
|
|
203
|
-
colorScale: [Constants.COLORS.black, Constants.COLORS.green, Constants.COLORS.red]
|
|
204
|
-
}, /*#__PURE__*/
|
|
203
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryGroup, {
|
|
204
|
+
colorScale: [_bundleCommon.Constants.COLORS.black, _bundleCommon.Constants.COLORS.green, _bundleCommon.Constants.COLORS.red]
|
|
205
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryScatter, {
|
|
205
206
|
data: labelHeaders,
|
|
206
207
|
size: 2,
|
|
207
|
-
labelComponent: /*#__PURE__*/
|
|
208
|
-
}), /*#__PURE__*/
|
|
208
|
+
labelComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryTooltip, null)
|
|
209
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
209
210
|
data: positive,
|
|
210
211
|
style: {
|
|
211
212
|
data: {
|
|
212
213
|
strokeWidth: 3
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
|
-
}), /*#__PURE__*/
|
|
216
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
216
217
|
data: negative,
|
|
217
218
|
style: {
|
|
218
219
|
data: {
|
|
219
220
|
strokeWidth: 3
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
|
-
})), /*#__PURE__*/
|
|
223
|
+
})), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
223
224
|
style: {
|
|
224
225
|
tickLabels: {
|
|
225
226
|
angle: 45,
|
|
@@ -229,7 +230,7 @@ var Feedback = function Feedback(_ref2) {
|
|
|
229
230
|
fontSize: 14
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
|
-
}), /*#__PURE__*/
|
|
233
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
233
234
|
dependentAxis: true,
|
|
234
235
|
tickFormat: function tickFormat(y) {
|
|
235
236
|
return "".concat(y, "%");
|
|
@@ -240,69 +241,66 @@ var Feedback = function Feedback(_ref2) {
|
|
|
240
241
|
fontSize: 14
|
|
241
242
|
},
|
|
242
243
|
ticks: {
|
|
243
|
-
stroke: Constants.COLORS.black,
|
|
244
|
+
stroke: _bundleCommon.Constants.COLORS.black,
|
|
244
245
|
size: 5
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
}));
|
|
248
249
|
}
|
|
249
|
-
}), /*#__PURE__*/
|
|
250
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
250
251
|
className: "text-center"
|
|
251
|
-
}, /*#__PURE__*/
|
|
252
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
252
253
|
className: "fa fa-square fa-fw",
|
|
253
254
|
style: {
|
|
254
|
-
color: Constants.COLORS.green
|
|
255
|
+
color: _bundleCommon.Constants.COLORS.green
|
|
255
256
|
}
|
|
256
|
-
}), /*#__PURE__*/
|
|
257
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Positive")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
257
258
|
className: "fa fa-square fa-fw",
|
|
258
259
|
style: {
|
|
259
|
-
color: Constants.COLORS.red
|
|
260
|
+
color: _bundleCommon.Constants.COLORS.red
|
|
260
261
|
}
|
|
261
|
-
}), /*#__PURE__*/
|
|
262
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Negative"))));
|
|
262
263
|
};
|
|
263
|
-
|
|
264
264
|
var Utilization = function Utilization(_ref3) {
|
|
265
265
|
var utilization = _ref3.utilization,
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
formatDate = _ref3.formatDate;
|
|
268
267
|
var _Object$keys$sort$red3 = Object.keys(utilization.available).sort().reduce(function (utils, date) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
268
|
+
var scheduled = toInt(utilization.scheduled[date]);
|
|
269
|
+
var actual = toInt(utilization.actual[date]);
|
|
270
|
+
var available = toInt(utilization.available[date]);
|
|
271
|
+
var scheduledPercentage = toPercentNumber(scheduled, available) || 0;
|
|
272
|
+
var actualPercentage = toPercentNumber(actual, available) || 0;
|
|
273
|
+
utils.labelHeaders.push({
|
|
274
|
+
x: formatDate(date),
|
|
275
|
+
y: 0,
|
|
276
|
+
label: "".concat(formatDate(date), "\n").concat(scheduledPercentage, "% Scheduled (").concat(scheduled, ")\n").concat(actualPercentage, "% Actual (").concat(actual, ")")
|
|
277
|
+
});
|
|
278
|
+
utils.scheduled.push({
|
|
279
|
+
x: formatDate(date),
|
|
280
|
+
y: scheduledPercentage
|
|
281
|
+
});
|
|
282
|
+
utils.actual.push({
|
|
283
|
+
x: formatDate(date),
|
|
284
|
+
y: actualPercentage
|
|
285
|
+
});
|
|
286
|
+
utils.maxY = Math.max(utils.maxY, scheduledPercentage, actualPercentage);
|
|
287
|
+
return utils;
|
|
288
|
+
}, {
|
|
289
|
+
labelHeaders: [],
|
|
290
|
+
scheduled: [],
|
|
291
|
+
actual: [],
|
|
292
|
+
maxY: 10
|
|
293
|
+
}),
|
|
294
|
+
scheduled = _Object$keys$sort$red3.scheduled,
|
|
295
|
+
actual = _Object$keys$sort$red3.actual,
|
|
296
|
+
labelHeaders = _Object$keys$sort$red3.labelHeaders,
|
|
297
|
+
maxY = _Object$keys$sort$red3.maxY;
|
|
298
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
301
299
|
className: "section__title"
|
|
302
|
-
}, /*#__PURE__*/
|
|
300
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Utilization")), /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
|
|
303
301
|
render: function render(translate) {
|
|
304
|
-
return /*#__PURE__*/
|
|
305
|
-
containerComponent: /*#__PURE__*/
|
|
302
|
+
return /*#__PURE__*/_react["default"].createElement(_victory.VictoryChart, {
|
|
303
|
+
containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryVoronoiContainer, {
|
|
306
304
|
className: "VictoryContainer max-height-350",
|
|
307
305
|
style: {
|
|
308
306
|
height: 'auto'
|
|
@@ -323,27 +321,27 @@ var Utilization = function Utilization(_ref3) {
|
|
|
323
321
|
maxDomain: {
|
|
324
322
|
y: maxY
|
|
325
323
|
}
|
|
326
|
-
}, /*#__PURE__*/
|
|
327
|
-
colorScale: [Constants.COLORS.black, Constants.COLORS.blueSky, Constants.COLORS.greenGrass]
|
|
328
|
-
}, /*#__PURE__*/
|
|
324
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryGroup, {
|
|
325
|
+
colorScale: [_bundleCommon.Constants.COLORS.black, _bundleCommon.Constants.COLORS.blueSky, _bundleCommon.Constants.COLORS.greenGrass]
|
|
326
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryScatter, {
|
|
329
327
|
data: labelHeaders,
|
|
330
328
|
size: 2,
|
|
331
|
-
labelComponent: /*#__PURE__*/
|
|
332
|
-
}), /*#__PURE__*/
|
|
329
|
+
labelComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryTooltip, null)
|
|
330
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
333
331
|
data: scheduled,
|
|
334
332
|
style: {
|
|
335
333
|
data: {
|
|
336
334
|
strokeWidth: 3
|
|
337
335
|
}
|
|
338
336
|
}
|
|
339
|
-
}), /*#__PURE__*/
|
|
337
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
340
338
|
data: actual,
|
|
341
339
|
style: {
|
|
342
340
|
data: {
|
|
343
341
|
strokeWidth: 3
|
|
344
342
|
}
|
|
345
343
|
}
|
|
346
|
-
})), /*#__PURE__*/
|
|
344
|
+
})), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
347
345
|
style: {
|
|
348
346
|
tickLabels: {
|
|
349
347
|
angle: 45,
|
|
@@ -353,7 +351,7 @@ var Utilization = function Utilization(_ref3) {
|
|
|
353
351
|
fontSize: 14
|
|
354
352
|
}
|
|
355
353
|
}
|
|
356
|
-
}), /*#__PURE__*/
|
|
354
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
357
355
|
dependentAxis: true,
|
|
358
356
|
tickFormat: function tickFormat(y) {
|
|
359
357
|
return "".concat(y, "%");
|
|
@@ -364,75 +362,72 @@ var Utilization = function Utilization(_ref3) {
|
|
|
364
362
|
fontSize: 14
|
|
365
363
|
},
|
|
366
364
|
ticks: {
|
|
367
|
-
stroke: Constants.COLORS.black,
|
|
365
|
+
stroke: _bundleCommon.Constants.COLORS.black,
|
|
368
366
|
size: 5
|
|
369
367
|
}
|
|
370
368
|
}
|
|
371
369
|
}));
|
|
372
370
|
}
|
|
373
|
-
}), /*#__PURE__*/
|
|
371
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
374
372
|
className: "text-center"
|
|
375
|
-
}, /*#__PURE__*/
|
|
373
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
376
374
|
className: "fa fa-square fa-fw",
|
|
377
375
|
style: {
|
|
378
|
-
color: Constants.COLORS.blueSky
|
|
376
|
+
color: _bundleCommon.Constants.COLORS.blueSky
|
|
379
377
|
}
|
|
380
|
-
}), /*#__PURE__*/
|
|
378
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Scheduled")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
381
379
|
className: "fa fa-square fa-fw",
|
|
382
380
|
style: {
|
|
383
|
-
color: Constants.COLORS.greenGrass
|
|
381
|
+
color: _bundleCommon.Constants.COLORS.greenGrass
|
|
384
382
|
}
|
|
385
|
-
}), /*#__PURE__*/
|
|
383
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Actual"))));
|
|
386
384
|
};
|
|
387
|
-
|
|
388
385
|
var Durations = function Durations(_ref4) {
|
|
389
386
|
var durations = _ref4.durations,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
387
|
+
selectedDuration = _ref4.selectedDuration,
|
|
388
|
+
setSelectedDuration = _ref4.setSelectedDuration,
|
|
389
|
+
formatDate = _ref4.formatDate;
|
|
394
390
|
var _ref5 = selectedDuration ? Object.keys(durations.data[selectedDuration.techBarId].eventTypes[selectedDuration.eventType].data).sort().reduce(function (result, date) {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
391
|
+
var eventType = durations.data[selectedDuration.techBarId].eventTypes[selectedDuration.eventType];
|
|
392
|
+
var quantity = eventType.data[date].quantity;
|
|
393
|
+
result.labelHeaders.push({
|
|
394
|
+
x: formatDate(date),
|
|
395
|
+
y: 0,
|
|
396
|
+
label: "".concat(formatDate(date), "\nScheduled: ").concat(eventType.duration, " minutes\nActual: ").concat(quantity > 0 ? Math.round(eventType.data[date].actual / quantity) : 0, " minutes\nQuantity: ").concat(eventType.data[date].quantity)
|
|
397
|
+
});
|
|
398
|
+
result.scheduled.push({
|
|
399
|
+
x: formatDate(date),
|
|
400
|
+
y: eventType.duration
|
|
401
|
+
});
|
|
402
|
+
result.actual.push({
|
|
403
|
+
x: formatDate(date),
|
|
404
|
+
y: quantity > 0 ? Math.round(eventType.data[date].actual / quantity) : 0
|
|
405
|
+
});
|
|
406
|
+
result.waitTime.push({
|
|
407
|
+
x: formatDate(date),
|
|
408
|
+
y: quantity > 0 ? Math.round(eventType.data[date].waitTime / quantity) : 0
|
|
409
|
+
});
|
|
410
|
+
result.quantity.push({
|
|
411
|
+
x: formatDate(date),
|
|
412
|
+
y: eventType.data[date].quantity
|
|
413
|
+
});
|
|
414
|
+
return result;
|
|
415
|
+
}, {
|
|
416
|
+
labelHeaders: [],
|
|
417
|
+
scheduled: [],
|
|
418
|
+
actual: [],
|
|
419
|
+
waitTime: [],
|
|
420
|
+
quantity: []
|
|
421
|
+
}) : {},
|
|
422
|
+
labelHeaders = _ref5.labelHeaders,
|
|
423
|
+
scheduled = _ref5.scheduled,
|
|
424
|
+
actual = _ref5.actual,
|
|
425
|
+
quantity = _ref5.quantity;
|
|
426
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
432
427
|
className: "section__title"
|
|
433
|
-
}, /*#__PURE__*/
|
|
428
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Average Duration")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("label", {
|
|
434
429
|
htmlFor: "duration-event-select"
|
|
435
|
-
}, "Tech Bar and Event Type"), /*#__PURE__*/
|
|
430
|
+
}, "Tech Bar and Event Type"), /*#__PURE__*/_react["default"].createElement("select", {
|
|
436
431
|
name: "duration-event-select",
|
|
437
432
|
id: "duration-event-select",
|
|
438
433
|
className: "form-control",
|
|
@@ -442,21 +437,21 @@ var Durations = function Durations(_ref4) {
|
|
|
442
437
|
return o.value === e.target.value;
|
|
443
438
|
}));
|
|
444
439
|
}
|
|
445
|
-
}, /*#__PURE__*/
|
|
446
|
-
return /*#__PURE__*/
|
|
440
|
+
}, /*#__PURE__*/_react["default"].createElement("option", null), durations.options.map(function (option) {
|
|
441
|
+
return /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
|
|
447
442
|
key: option.value,
|
|
448
443
|
render: function render(translate) {
|
|
449
|
-
return /*#__PURE__*/
|
|
444
|
+
return /*#__PURE__*/_react["default"].createElement("option", {
|
|
450
445
|
value: option.value
|
|
451
446
|
}, translate(option.techBarName), " ::", ' ', translate(option.eventType));
|
|
452
447
|
}
|
|
453
448
|
});
|
|
454
|
-
}))), selectedDuration ? /*#__PURE__*/
|
|
449
|
+
}))), selectedDuration ? /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
|
|
455
450
|
render: function render(translate) {
|
|
456
|
-
return /*#__PURE__*/
|
|
451
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
457
452
|
className: "standalone-victory-group"
|
|
458
|
-
}, /*#__PURE__*/
|
|
459
|
-
containerComponent: /*#__PURE__*/
|
|
453
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryChart, {
|
|
454
|
+
containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryContainer, {
|
|
460
455
|
className: "VictoryContainer max-height-350",
|
|
461
456
|
style: {
|
|
462
457
|
height: 'auto'
|
|
@@ -473,14 +468,14 @@ var Durations = function Durations(_ref4) {
|
|
|
473
468
|
minDomain: {
|
|
474
469
|
y: 0
|
|
475
470
|
}
|
|
476
|
-
}, /*#__PURE__*/
|
|
471
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryBar, {
|
|
477
472
|
data: quantity,
|
|
478
473
|
style: {
|
|
479
474
|
data: {
|
|
480
|
-
fill: Constants.COLORS.sunflower
|
|
475
|
+
fill: _bundleCommon.Constants.COLORS.sunflower
|
|
481
476
|
}
|
|
482
477
|
}
|
|
483
|
-
}), /*#__PURE__*/
|
|
478
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
484
479
|
dependentAxis: true,
|
|
485
480
|
offsetX: 70,
|
|
486
481
|
orientation: "right",
|
|
@@ -491,18 +486,18 @@ var Durations = function Durations(_ref4) {
|
|
|
491
486
|
tickLabels: {
|
|
492
487
|
padding: 5,
|
|
493
488
|
fontSize: 14,
|
|
494
|
-
fill: Constants.COLORS.sunflower
|
|
489
|
+
fill: _bundleCommon.Constants.COLORS.sunflower
|
|
495
490
|
},
|
|
496
491
|
ticks: {
|
|
497
|
-
stroke: Constants.COLORS.sunflower,
|
|
492
|
+
stroke: _bundleCommon.Constants.COLORS.sunflower,
|
|
498
493
|
size: 5
|
|
499
494
|
},
|
|
500
495
|
axis: {
|
|
501
|
-
stroke: Constants.COLORS.sunflower
|
|
496
|
+
stroke: _bundleCommon.Constants.COLORS.sunflower
|
|
502
497
|
}
|
|
503
498
|
}
|
|
504
|
-
})), /*#__PURE__*/
|
|
505
|
-
containerComponent: /*#__PURE__*/
|
|
499
|
+
})), /*#__PURE__*/_react["default"].createElement(_victory.VictoryChart, {
|
|
500
|
+
containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryVoronoiContainer, {
|
|
506
501
|
className: "VictoryContainer max-height-350",
|
|
507
502
|
style: {
|
|
508
503
|
height: 'auto'
|
|
@@ -520,13 +515,13 @@ var Durations = function Durations(_ref4) {
|
|
|
520
515
|
minDomain: {
|
|
521
516
|
y: 0
|
|
522
517
|
}
|
|
523
|
-
}, /*#__PURE__*/
|
|
524
|
-
colorScale: [Constants.COLORS.black, Constants.COLORS.greenGrass, Constants.COLORS.blueSky]
|
|
525
|
-
}, /*#__PURE__*/
|
|
518
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryGroup, {
|
|
519
|
+
colorScale: [_bundleCommon.Constants.COLORS.black, _bundleCommon.Constants.COLORS.greenGrass, _bundleCommon.Constants.COLORS.blueSky]
|
|
520
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryScatter, {
|
|
526
521
|
data: labelHeaders,
|
|
527
522
|
size: 2,
|
|
528
|
-
labelComponent: /*#__PURE__*/
|
|
529
|
-
}), /*#__PURE__*/
|
|
523
|
+
labelComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryTooltip, null)
|
|
524
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
530
525
|
data: scheduled,
|
|
531
526
|
style: {
|
|
532
527
|
data: {
|
|
@@ -534,14 +529,14 @@ var Durations = function Durations(_ref4) {
|
|
|
534
529
|
strokeWidth: 3
|
|
535
530
|
}
|
|
536
531
|
}
|
|
537
|
-
}), /*#__PURE__*/
|
|
532
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
538
533
|
data: actual,
|
|
539
534
|
style: {
|
|
540
535
|
data: {
|
|
541
536
|
strokeWidth: 3
|
|
542
537
|
}
|
|
543
538
|
}
|
|
544
|
-
})), /*#__PURE__*/
|
|
539
|
+
})), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
545
540
|
style: {
|
|
546
541
|
tickLabels: {
|
|
547
542
|
angle: 45,
|
|
@@ -551,7 +546,7 @@ var Durations = function Durations(_ref4) {
|
|
|
551
546
|
fontSize: 14
|
|
552
547
|
}
|
|
553
548
|
}
|
|
554
|
-
}), /*#__PURE__*/
|
|
549
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
555
550
|
dependentAxis: true,
|
|
556
551
|
tickFormat: function tickFormat(y) {
|
|
557
552
|
return "".concat(y, " min");
|
|
@@ -562,40 +557,39 @@ var Durations = function Durations(_ref4) {
|
|
|
562
557
|
fontSize: 14
|
|
563
558
|
},
|
|
564
559
|
ticks: {
|
|
565
|
-
stroke: Constants.COLORS.black,
|
|
560
|
+
stroke: _bundleCommon.Constants.COLORS.black,
|
|
566
561
|
size: 5
|
|
567
562
|
}
|
|
568
563
|
}
|
|
569
564
|
})));
|
|
570
565
|
}
|
|
571
|
-
}), /*#__PURE__*/
|
|
566
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
572
567
|
className: "text-center"
|
|
573
|
-
}, /*#__PURE__*/
|
|
568
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
574
569
|
className: "fa fa-square fa-fw",
|
|
575
570
|
style: {
|
|
576
|
-
color: Constants.COLORS.greenGrass
|
|
571
|
+
color: _bundleCommon.Constants.COLORS.greenGrass
|
|
577
572
|
}
|
|
578
|
-
}), /*#__PURE__*/
|
|
573
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Scheduled Duration")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
579
574
|
className: "fa fa-square fa-fw",
|
|
580
575
|
style: {
|
|
581
|
-
color: Constants.COLORS.blueSky
|
|
576
|
+
color: _bundleCommon.Constants.COLORS.blueSky
|
|
582
577
|
}
|
|
583
|
-
}), /*#__PURE__*/
|
|
578
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Actual Duration")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
584
579
|
className: "fa fa-square fa-fw",
|
|
585
580
|
style: {
|
|
586
|
-
color: Constants.COLORS.sunflower
|
|
581
|
+
color: _bundleCommon.Constants.COLORS.sunflower
|
|
587
582
|
}
|
|
588
|
-
}), /*#__PURE__*/
|
|
583
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Quantity")))) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
589
584
|
className: "text-info"
|
|
590
|
-
}, /*#__PURE__*/
|
|
585
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "The duration trend graph is only available once you select a Tech Bar and Event Type.", ' '), durations.options.length === 0 && /*#__PURE__*/_react["default"].createElement("strong", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "The selected Tech Bar does not have any Event Types."))));
|
|
591
586
|
};
|
|
592
|
-
|
|
593
587
|
var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
594
588
|
var timeOfVisit = _ref6.timeOfVisit,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
589
|
+
formatDate = _ref6.formatDate,
|
|
590
|
+
dates = _ref6.dates,
|
|
591
|
+
timeOfVisitData = _ref6.timeOfVisitData,
|
|
592
|
+
toggleTimeOfVisitData = _ref6.toggleTimeOfVisitData;
|
|
599
593
|
var sourceData = timeOfVisitData ? timeOfVisit.scheduled : timeOfVisit.walkins;
|
|
600
594
|
var graphData = Object.keys(sourceData).sort().reduce(function (tov, date) {
|
|
601
595
|
var allTimes = [];
|
|
@@ -605,9 +599,9 @@ var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
|
605
599
|
x: date,
|
|
606
600
|
y: hour,
|
|
607
601
|
size: (timeOfVisit.max > 15 ? sourceData[date][hour] / timeOfVisit.max * 15 : sourceData[date][hour]) + 2,
|
|
608
|
-
label: "".concat(formatDate(date), "\n").concat(
|
|
602
|
+
label: "".concat(formatDate(date), "\n").concat((0, _moment["default"])(hour, 'H').format('LT'), "\n").concat(timeOfVisitData ? 'Scheduled' : 'Walk-Ins', ": ").concat(sourceData[date][hour])
|
|
609
603
|
});
|
|
610
|
-
allTimes.push.apply(allTimes,
|
|
604
|
+
allTimes.push.apply(allTimes, (0, _toConsumableArray2["default"])(Array(sourceData[date][hour]).fill(hour)));
|
|
611
605
|
}
|
|
612
606
|
});
|
|
613
607
|
tov.median.push({
|
|
@@ -621,25 +615,25 @@ var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
|
621
615
|
data: [],
|
|
622
616
|
median: []
|
|
623
617
|
});
|
|
624
|
-
return /*#__PURE__*/
|
|
618
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
625
619
|
className: "section__title"
|
|
626
|
-
}, /*#__PURE__*/
|
|
620
|
+
}, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Time of Visit")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
627
621
|
className: "text-center"
|
|
628
|
-
}, /*#__PURE__*/
|
|
622
|
+
}, /*#__PURE__*/_react["default"].createElement("label", {
|
|
629
623
|
htmlFor: "time-of-visit-scheduled",
|
|
630
624
|
className: "btn mr-2",
|
|
631
625
|
style: {
|
|
632
|
-
backgroundColor: Constants.COLORS.blueSky,
|
|
633
|
-
color: Constants.COLORS.white,
|
|
626
|
+
backgroundColor: _bundleCommon.Constants.COLORS.blueSky,
|
|
627
|
+
color: _bundleCommon.Constants.COLORS.white,
|
|
634
628
|
fontSize: '1rem',
|
|
635
629
|
cursor: 'pointer'
|
|
636
630
|
}
|
|
637
|
-
}, /*#__PURE__*/
|
|
631
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
638
632
|
className: "fa fa-".concat(timeOfVisitData ? 'check-' : '', "square fa-fw"),
|
|
639
633
|
style: {
|
|
640
|
-
color: Constants.COLORS.white
|
|
634
|
+
color: _bundleCommon.Constants.COLORS.white
|
|
641
635
|
}
|
|
642
|
-
}), /*#__PURE__*/
|
|
636
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Scheduled"), /*#__PURE__*/_react["default"].createElement("input", {
|
|
643
637
|
type: "radio",
|
|
644
638
|
name: "time-of-visit-radio",
|
|
645
639
|
id: "time-of-visit-scheduled",
|
|
@@ -648,21 +642,21 @@ var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
|
648
642
|
onChange: function onChange() {
|
|
649
643
|
return toggleTimeOfVisitData(!timeOfVisitData);
|
|
650
644
|
}
|
|
651
|
-
})), /*#__PURE__*/
|
|
645
|
+
})), /*#__PURE__*/_react["default"].createElement("label", {
|
|
652
646
|
htmlFor: "time-of-visit-walkins",
|
|
653
647
|
className: "btn",
|
|
654
648
|
style: {
|
|
655
|
-
backgroundColor: Constants.COLORS.sunflower,
|
|
656
|
-
color: Constants.COLORS.white,
|
|
649
|
+
backgroundColor: _bundleCommon.Constants.COLORS.sunflower,
|
|
650
|
+
color: _bundleCommon.Constants.COLORS.white,
|
|
657
651
|
fontSize: '1rem',
|
|
658
652
|
cursor: 'pointer'
|
|
659
653
|
}
|
|
660
|
-
}, /*#__PURE__*/
|
|
654
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
661
655
|
className: "fa fa-".concat(!timeOfVisitData ? 'check-' : '', "square fa-fw"),
|
|
662
656
|
style: {
|
|
663
|
-
color: Constants.COLORS.white
|
|
657
|
+
color: _bundleCommon.Constants.COLORS.white
|
|
664
658
|
}
|
|
665
|
-
}), /*#__PURE__*/
|
|
659
|
+
}), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Walkins"), /*#__PURE__*/_react["default"].createElement("input", {
|
|
666
660
|
type: "radio",
|
|
667
661
|
name: "time-of-visit-radio",
|
|
668
662
|
id: "time-of-visit-walkins",
|
|
@@ -671,10 +665,10 @@ var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
|
671
665
|
onChange: function onChange() {
|
|
672
666
|
return toggleTimeOfVisitData(!timeOfVisitData);
|
|
673
667
|
}
|
|
674
|
-
}))), /*#__PURE__*/
|
|
668
|
+
}))), /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
|
|
675
669
|
render: function render(translate) {
|
|
676
|
-
return /*#__PURE__*/
|
|
677
|
-
containerComponent: /*#__PURE__*/
|
|
670
|
+
return /*#__PURE__*/_react["default"].createElement(_victory.VictoryChart, {
|
|
671
|
+
containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryContainer, {
|
|
678
672
|
className: "VictoryContainer max-height-1000",
|
|
679
673
|
style: {
|
|
680
674
|
height: 'auto'
|
|
@@ -689,7 +683,7 @@ var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
|
689
683
|
bottom: 80
|
|
690
684
|
},
|
|
691
685
|
domainPadding: 17
|
|
692
|
-
}, /*#__PURE__*/
|
|
686
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
693
687
|
tickValues: dates.sort(),
|
|
694
688
|
tickFormat: function tickFormat(x) {
|
|
695
689
|
return formatDate(x);
|
|
@@ -703,20 +697,20 @@ var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
|
703
697
|
fontSize: 14
|
|
704
698
|
},
|
|
705
699
|
ticks: {
|
|
706
|
-
stroke: Constants.COLORS.black,
|
|
700
|
+
stroke: _bundleCommon.Constants.COLORS.black,
|
|
707
701
|
size: 5
|
|
708
702
|
},
|
|
709
703
|
grid: {
|
|
710
704
|
stroke: 'whitesmoke'
|
|
711
705
|
}
|
|
712
706
|
}
|
|
713
|
-
}), /*#__PURE__*/
|
|
707
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
|
|
714
708
|
dependentAxis: true,
|
|
715
709
|
tickValues: Array(24).fill(0).map(function (_, i) {
|
|
716
710
|
return i;
|
|
717
711
|
}),
|
|
718
712
|
tickFormat: function tickFormat(y) {
|
|
719
|
-
return
|
|
713
|
+
return (0, _moment["default"])(y, 'H').format('LT');
|
|
720
714
|
},
|
|
721
715
|
style: {
|
|
722
716
|
tickLabels: {
|
|
@@ -724,71 +718,69 @@ var TimeOfVisit = function TimeOfVisit(_ref6) {
|
|
|
724
718
|
fontSize: 14
|
|
725
719
|
},
|
|
726
720
|
ticks: {
|
|
727
|
-
stroke: Constants.COLORS.black,
|
|
721
|
+
stroke: _bundleCommon.Constants.COLORS.black,
|
|
728
722
|
size: 5
|
|
729
723
|
},
|
|
730
724
|
grid: {
|
|
731
725
|
stroke: 'whitesmoke'
|
|
732
726
|
}
|
|
733
727
|
}
|
|
734
|
-
}), /*#__PURE__*/
|
|
735
|
-
colorScale: ['transparent', timeOfVisitData ? Constants.COLORS.blueSky : Constants.COLORS.sunflower]
|
|
736
|
-
}, /*#__PURE__*/
|
|
728
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryGroup, {
|
|
729
|
+
colorScale: ['transparent', timeOfVisitData ? _bundleCommon.Constants.COLORS.blueSky : _bundleCommon.Constants.COLORS.sunflower]
|
|
730
|
+
}, /*#__PURE__*/_react["default"].createElement(_victory.VictoryLine, {
|
|
737
731
|
data: graphData.median,
|
|
738
732
|
interpolation: "monotoneX"
|
|
739
|
-
}), /*#__PURE__*/
|
|
733
|
+
}), /*#__PURE__*/_react["default"].createElement(_victory.VictoryScatter, {
|
|
740
734
|
data: graphData.data,
|
|
741
|
-
labelComponent: /*#__PURE__*/
|
|
735
|
+
labelComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryTooltip, null)
|
|
742
736
|
})));
|
|
743
737
|
}
|
|
744
738
|
}));
|
|
745
739
|
};
|
|
746
|
-
|
|
747
|
-
export var MetricsTrendComponent = function MetricsTrendComponent(_ref7) {
|
|
740
|
+
var MetricsTrendComponent = function MetricsTrendComponent(_ref7) {
|
|
748
741
|
var error = _ref7.error,
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
return /*#__PURE__*/React.createElement(StateListWrapper, {
|
|
742
|
+
metrics = _ref7.metrics,
|
|
743
|
+
data = (0, _objectWithoutProperties2["default"])(_ref7, _excluded);
|
|
744
|
+
return /*#__PURE__*/_react["default"].createElement(_bundleCommon.StateListWrapper, {
|
|
753
745
|
data: data,
|
|
754
746
|
loading: !metrics,
|
|
755
747
|
error: error
|
|
756
748
|
}, function (_ref8) {
|
|
757
749
|
var trend = _ref8.trend,
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
return /*#__PURE__*/
|
|
750
|
+
techBars = _ref8.techBars,
|
|
751
|
+
formatDate = _ref8.formatDate,
|
|
752
|
+
dates = _ref8.dates,
|
|
753
|
+
selectedDuration = _ref8.selectedDuration,
|
|
754
|
+
setSelectedDuration = _ref8.setSelectedDuration,
|
|
755
|
+
timeOfVisitData = _ref8.timeOfVisitData,
|
|
756
|
+
toggleTimeOfVisitData = _ref8.toggleTimeOfVisitData;
|
|
757
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
766
758
|
className: "row"
|
|
767
|
-
}, /*#__PURE__*/
|
|
759
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
768
760
|
className: "col-12 mb-5"
|
|
769
|
-
}, /*#__PURE__*/
|
|
761
|
+
}, /*#__PURE__*/_react["default"].createElement(Appointments, {
|
|
770
762
|
appointments: trend.appointments,
|
|
771
763
|
formatDate: formatDate
|
|
772
|
-
})), /*#__PURE__*/
|
|
764
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
773
765
|
className: "col-12 mb-5"
|
|
774
|
-
}, /*#__PURE__*/
|
|
766
|
+
}, /*#__PURE__*/_react["default"].createElement(Feedback, {
|
|
775
767
|
feedback: trend.feedback,
|
|
776
768
|
formatDate: formatDate
|
|
777
|
-
})), /*#__PURE__*/
|
|
769
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
778
770
|
className: "col-12 mb-5"
|
|
779
|
-
}, /*#__PURE__*/
|
|
771
|
+
}, /*#__PURE__*/_react["default"].createElement(Utilization, {
|
|
780
772
|
utilization: trend.utilization,
|
|
781
773
|
formatDate: formatDate
|
|
782
|
-
})), /*#__PURE__*/
|
|
774
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
783
775
|
className: "col-12 mb-5"
|
|
784
|
-
}, /*#__PURE__*/
|
|
776
|
+
}, /*#__PURE__*/_react["default"].createElement(Durations, {
|
|
785
777
|
durations: trend.durations,
|
|
786
778
|
formatDate: formatDate,
|
|
787
779
|
selectedDuration: selectedDuration,
|
|
788
780
|
setSelectedDuration: setSelectedDuration
|
|
789
|
-
})), /*#__PURE__*/
|
|
781
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
790
782
|
className: "col-12 mb-5"
|
|
791
|
-
}, /*#__PURE__*/
|
|
783
|
+
}, /*#__PURE__*/_react["default"].createElement(TimeOfVisit, {
|
|
792
784
|
timeOfVisit: trend.timeOfVisit,
|
|
793
785
|
formatDate: formatDate,
|
|
794
786
|
dates: dates,
|
|
@@ -797,19 +789,20 @@ export var MetricsTrendComponent = function MetricsTrendComponent(_ref7) {
|
|
|
797
789
|
})));
|
|
798
790
|
});
|
|
799
791
|
};
|
|
800
|
-
|
|
792
|
+
exports.MetricsTrendComponent = MetricsTrendComponent;
|
|
793
|
+
var mapStateToProps = function mapStateToProps(state, props) {
|
|
801
794
|
return {
|
|
802
795
|
error: state.metrics.error,
|
|
803
796
|
metrics: state.metrics.data
|
|
804
797
|
};
|
|
805
798
|
};
|
|
806
|
-
|
|
799
|
+
exports.mapStateToProps = mapStateToProps;
|
|
807
800
|
var TrendSummary = function TrendSummary() {
|
|
808
801
|
var dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
809
802
|
var techBars = arguments.length > 1 ? arguments[1] : undefined;
|
|
810
803
|
var defaultMap = dates.reduce(function (map, date) {
|
|
811
804
|
return map.set(date, 0);
|
|
812
|
-
}, Map());
|
|
805
|
+
}, (0, _immutable.Map)());
|
|
813
806
|
return {
|
|
814
807
|
appointments: {
|
|
815
808
|
scheduled: defaultMap.toJS(),
|
|
@@ -848,42 +841,40 @@ var TrendSummary = function TrendSummary() {
|
|
|
848
841
|
datesMap: defaultMap,
|
|
849
842
|
options: []
|
|
850
843
|
} // data: <schedulerId>.eventTypes.<eventType>.data.<date> = {}
|
|
851
|
-
|
|
852
844
|
};
|
|
853
845
|
};
|
|
854
846
|
|
|
855
847
|
var buildTrend = function buildTrend(_ref9) {
|
|
856
848
|
var setTrend = _ref9.setTrend,
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
849
|
+
schedulerId = _ref9.schedulerId,
|
|
850
|
+
eventType = _ref9.eventType,
|
|
851
|
+
metrics = _ref9.metrics,
|
|
852
|
+
dates = _ref9.dates,
|
|
853
|
+
techBars = _ref9.techBars,
|
|
854
|
+
selectedDuration = _ref9.selectedDuration,
|
|
855
|
+
setSelectedDuration = _ref9.setSelectedDuration;
|
|
864
856
|
return function () {
|
|
865
857
|
if (!metrics) {
|
|
866
858
|
return;
|
|
867
859
|
}
|
|
868
|
-
|
|
869
860
|
var records = schedulerId ? metrics.filter(function (m) {
|
|
870
861
|
return m.schedulerId === schedulerId;
|
|
871
862
|
}) : metrics;
|
|
872
863
|
var trend = records.reduce(function (trend, _ref10) {
|
|
873
864
|
var data = _ref10.data,
|
|
874
|
-
|
|
875
|
-
|
|
865
|
+
period = _ref10.period,
|
|
866
|
+
techBarId = _ref10.schedulerId;
|
|
876
867
|
// Add total available minutes
|
|
877
|
-
trend.utilization.available[period] += toInt(data.totalMinutesAvailable);
|
|
878
|
-
|
|
868
|
+
trend.utilization.available[period] += toInt(data.totalMinutesAvailable);
|
|
869
|
+
// If event type is not specified, add feedback results not associated to events
|
|
879
870
|
if (!eventType) {
|
|
880
871
|
trend.feedback.positive[period] += toInt(data.feedback.Positive);
|
|
881
872
|
trend.feedback.negative[period] += toInt(data.feedback.Negative);
|
|
882
873
|
trend.feedback.total[period] += toInt(data.feedback.Positive) + toInt(data.feedback.Negative);
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
874
|
+
}
|
|
875
|
+
// Iterate through all the event types
|
|
876
|
+
return data.eventTypes
|
|
877
|
+
// If event type is selected, filter to only that type
|
|
887
878
|
.filter(function (event) {
|
|
888
879
|
return !eventType || eventType === event.type;
|
|
889
880
|
}).reduce(function (t, event) {
|
|
@@ -891,23 +882,23 @@ var buildTrend = function buildTrend(_ref9) {
|
|
|
891
882
|
t.appointments.scheduled[period] += toInt(event.scheduledAppointments);
|
|
892
883
|
t.appointments.walkins[period] += toInt(event.walkins);
|
|
893
884
|
t.appointments.sameDay[period] += toInt(event.sameDayAppointments);
|
|
894
|
-
t.appointments.total[period] += toInt(event.scheduledAppointments) + toInt(event.walkins);
|
|
895
|
-
|
|
885
|
+
t.appointments.total[period] += toInt(event.scheduledAppointments) + toInt(event.walkins);
|
|
886
|
+
// Add feedback counts
|
|
896
887
|
t.feedback.positive[period] += toInt(event.feedback.Positive);
|
|
897
888
|
t.feedback.negative[period] += toInt(event.feedback.Negative);
|
|
898
|
-
t.feedback.total[period] += toInt(event.feedback.Positive) + toInt(event.feedback.Negative);
|
|
899
|
-
|
|
889
|
+
t.feedback.total[period] += toInt(event.feedback.Positive) + toInt(event.feedback.Negative);
|
|
890
|
+
// Add total scheduled minutes and actual minutes
|
|
900
891
|
t.utilization.scheduled[period] += parseInt(event.scheduledAppointments, 10) * toInt(event.duration);
|
|
901
|
-
t.utilization.actual[period] += toInt(event.scheduledTotalDuration);
|
|
902
|
-
|
|
892
|
+
t.utilization.actual[period] += toInt(event.scheduledTotalDuration);
|
|
893
|
+
// Add time of visit counts for scheduled appointments
|
|
903
894
|
Object.keys(event.scheduledAppointmentTimes).forEach(function (time) {
|
|
904
895
|
t.timeOfVisit.scheduled[period][toInt(time)] += toInt(event.scheduledAppointmentTimes[time]);
|
|
905
896
|
});
|
|
906
897
|
Object.keys(event.walkinAppointmentTimes).forEach(function (time) {
|
|
907
898
|
t.timeOfVisit.walkins[period][toInt(time)] += toInt(event.walkinAppointmentTimes[time]);
|
|
908
899
|
});
|
|
909
|
-
t.timeOfVisit.max = Math.max.apply(Math, [t.timeOfVisit.max].concat(
|
|
910
|
-
|
|
900
|
+
t.timeOfVisit.max = Math.max.apply(Math, [t.timeOfVisit.max].concat((0, _toConsumableArray2["default"])(t.timeOfVisit.scheduled[period] || []), (0, _toConsumableArray2["default"])(t.timeOfVisit.walkins[period] || [])));
|
|
901
|
+
// Add duration info
|
|
911
902
|
if (t.durations.data[techBarId]) {
|
|
912
903
|
if (!t.durations.data[techBarId].eventTypes[event.type]) {
|
|
913
904
|
t.durations.data[techBarId].eventTypes[event.type] = {
|
|
@@ -921,19 +912,18 @@ var buildTrend = function buildTrend(_ref9) {
|
|
|
921
912
|
}).toJS()
|
|
922
913
|
};
|
|
923
914
|
}
|
|
924
|
-
|
|
925
915
|
var currentDuration = t.durations.data[techBarId].eventTypes[event.type];
|
|
926
916
|
currentDuration.data[period].quantity += toInt(event.scheduledAppointments) + toInt(event.walkins);
|
|
927
917
|
currentDuration.data[period].actual += toInt(event.walkinTotalDuration) + toInt(event.scheduledTotalDuration);
|
|
928
918
|
currentDuration.data[period].waitTime += toInt(event.walkinTotalWaitTime) + toInt(event.scheduledTotalWaitTime);
|
|
929
919
|
}
|
|
930
|
-
|
|
931
920
|
return t;
|
|
932
921
|
}, trend);
|
|
933
922
|
}, TrendSummary(dates, techBars.filter(function (t) {
|
|
934
923
|
return !schedulerId || t.values['Id'] === schedulerId;
|
|
935
|
-
})));
|
|
924
|
+
})));
|
|
936
925
|
|
|
926
|
+
// Build options for duration select
|
|
937
927
|
trend.durations.options = Object.keys(trend.durations.data).reduce(function (options, techBarId) {
|
|
938
928
|
Object.keys(trend.durations.data[techBarId].eventTypes).forEach(function (eventType) {
|
|
939
929
|
options.push({
|
|
@@ -944,24 +934,23 @@ var buildTrend = function buildTrend(_ref9) {
|
|
|
944
934
|
});
|
|
945
935
|
});
|
|
946
936
|
return options;
|
|
947
|
-
}, []);
|
|
948
|
-
|
|
937
|
+
}, []);
|
|
938
|
+
// Updated selectedDuration value if only a single value exists
|
|
949
939
|
if (trend.durations.options.length === 1 && (!selectedDuration || selectedDuration.value !== trend.durations.options[0].value)) {
|
|
950
940
|
setSelectedDuration(trend.durations.options[0]);
|
|
951
|
-
}
|
|
941
|
+
}
|
|
942
|
+
// If selectedDuration value is no longer valid, clear the value
|
|
952
943
|
else if (selectedDuration && !trend.durations.options.find(function (o) {
|
|
953
944
|
return o.value === selectedDuration.value;
|
|
954
945
|
})) {
|
|
955
946
|
setSelectedDuration(null);
|
|
956
947
|
}
|
|
957
|
-
|
|
958
948
|
setTrend(trend);
|
|
959
949
|
};
|
|
960
950
|
};
|
|
961
|
-
|
|
962
|
-
export var MetricsTrend = compose(connect(mapStateToProps), withState('trend', 'setTrend', TrendSummary()), withState('timeOfVisitData', 'toggleTimeOfVisitData', true), withState('selectedDuration', 'setSelectedDuration', null), withHandlers({
|
|
951
|
+
var MetricsTrend = (0, _recompose.compose)((0, _store.connect)(mapStateToProps), (0, _recompose.withState)('trend', 'setTrend', TrendSummary()), (0, _recompose.withState)('timeOfVisitData', 'toggleTimeOfVisitData', true), (0, _recompose.withState)('selectedDuration', 'setSelectedDuration', null), (0, _recompose.withHandlers)({
|
|
963
952
|
buildTrend: buildTrend
|
|
964
|
-
}), lifecycle({
|
|
953
|
+
}), (0, _recompose.lifecycle)({
|
|
965
954
|
componentDidMount: function componentDidMount() {
|
|
966
955
|
this.props.buildTrend();
|
|
967
956
|
},
|
|
@@ -970,4 +959,5 @@ export var MetricsTrend = compose(connect(mapStateToProps), withState('trend', '
|
|
|
970
959
|
this.props.buildTrend();
|
|
971
960
|
}
|
|
972
961
|
}
|
|
973
|
-
}))(MetricsTrendComponent);
|
|
962
|
+
}))(MetricsTrendComponent);
|
|
963
|
+
exports.MetricsTrend = MetricsTrend;
|