@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.
Files changed (43) hide show
  1. package/lib/App.js +41 -36
  2. package/lib/components/AppointmentForm.js +48 -36
  3. package/lib/components/CheckIn.js +86 -78
  4. package/lib/components/Display.js +64 -53
  5. package/lib/components/Feedback.js +106 -103
  6. package/lib/components/Form.js +56 -48
  7. package/lib/components/Home.js +148 -144
  8. package/lib/components/Overhead.js +52 -44
  9. package/lib/components/Past.js +56 -44
  10. package/lib/components/Sidebar.js +58 -51
  11. package/lib/components/TechBars.js +72 -68
  12. package/lib/components/settings/SchedulerSettings.js +32 -21
  13. package/lib/components/settings/Settings.js +54 -50
  14. package/lib/components/settings/Sidebar.js +41 -31
  15. package/lib/components/settings/TechBarMetrics.js +124 -120
  16. package/lib/components/settings/TechBarSettings.js +46 -36
  17. package/lib/components/settings/metrics/MetricsExport.js +120 -107
  18. package/lib/components/settings/metrics/MetricsSummary.js +140 -141
  19. package/lib/components/settings/metrics/MetricsTrend.js +331 -341
  20. package/lib/components/settings/tech-bar/AppointmentForm.js +30 -20
  21. package/lib/components/settings/tech-bar/TechBar.js +90 -79
  22. package/lib/components/settings/tech-bar/TechBarDisplayMembers.js +108 -108
  23. package/lib/components/settings/tech-bar/TechBarSettingsForm.js +44 -34
  24. package/lib/components/shared/PageTitle.js +24 -15
  25. package/lib/constants.js +38 -16
  26. package/lib/index.js +49 -53
  27. package/lib/redux/modules/app.js +22 -17
  28. package/lib/redux/modules/appointments.js +31 -35
  29. package/lib/redux/modules/export.js +26 -21
  30. package/lib/redux/modules/metrics.js +24 -19
  31. package/lib/redux/modules/techBarApp.js +33 -34
  32. package/lib/redux/modules/walkIns.js +23 -21
  33. package/lib/redux/reducers.js +21 -14
  34. package/lib/redux/sagas/app.js +15 -13
  35. package/lib/redux/sagas/appointments.js +220 -256
  36. package/lib/redux/sagas/export.js +153 -166
  37. package/lib/redux/sagas/metrics.js +76 -76
  38. package/lib/redux/sagas/techBarApp.js +240 -258
  39. package/lib/redux/sagas/walkIns.js +124 -132
  40. package/lib/redux/sagas.js +18 -14
  41. package/lib/redux/store.js +36 -27
  42. package/lib/utils.js +9 -2
  43. package/package.json +54 -64
@@ -1,52 +1,58 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import React, { Fragment } from 'react';
4
- import { connect } from '../../../redux/store';
5
- import { compose, withProps } from 'recompose';
6
- import { VictoryContainer, VictoryPie, VictoryChart, VictoryBar, VictoryGroup, VictoryTooltip, VictoryAxis } from 'victory';
7
- import { Constants, Table, StateListWrapper } from '@kineticdata/bundle-common';
8
- import { I18n } from '@kineticdata/react';
9
- import moment from 'moment';
10
- import { Record } from 'immutable';
1
+ "use strict";
11
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.MetricsSummaryComponent = exports.MetricsSummary = void 0;
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
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 toPercent = function toPercent(a, b) {
17
24
  return b !== 0 ? "".concat(Math.round(a / b * 100), "%") : '';
18
25
  };
19
-
20
26
  var Appointments = function Appointments(_ref) {
21
27
  var appointments = _ref.appointments;
22
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
28
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
23
29
  className: "section__title"
24
- }, /*#__PURE__*/React.createElement(I18n, null, "Appointments")), appointments.total > 0 ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(I18n, {
30
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Appointments")), appointments.total > 0 ? /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
25
31
  render: function render(translate) {
26
- return /*#__PURE__*/React.createElement("div", {
32
+ return /*#__PURE__*/_react["default"].createElement("div", {
27
33
  className: "text-center"
28
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
34
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
29
35
  className: "fa fa-square fa-fw",
30
36
  style: {
31
- color: Constants.COLORS.blueSky
37
+ color: _bundleCommon.Constants.COLORS.blueSky
32
38
  }
33
- }), "".concat(toPercent(appointments.scheduled, appointments.total), " ").concat(translate('Scheduled'), " (").concat(appointments.scheduled, ")")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
39
+ }), "".concat(toPercent(appointments.scheduled, appointments.total), " ").concat(translate('Scheduled'), " (").concat(appointments.scheduled, ")")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
34
40
  className: "fa fa-square fa-fw",
35
41
  style: {
36
- color: Constants.COLORS.sunflower
42
+ color: _bundleCommon.Constants.COLORS.sunflower
37
43
  }
38
44
  }), "".concat(toPercent(appointments.walkins, appointments.total), " ").concat(translate('Walk-Ins'), " (").concat(appointments.walkins, ")")));
39
45
  }
40
- }), /*#__PURE__*/React.createElement(VictoryContainer, {
46
+ }), /*#__PURE__*/_react["default"].createElement(_victory.VictoryContainer, {
41
47
  className: "VictoryContainer max-height-250",
42
48
  height: 250,
43
49
  width: 250,
44
50
  style: {
45
51
  height: 'auto'
46
52
  }
47
- }, ' ', /*#__PURE__*/React.createElement(VictoryPie, {
53
+ }, ' ', /*#__PURE__*/_react["default"].createElement(_victory.VictoryPie, {
48
54
  standalone: false,
49
- colorScale: [Constants.COLORS.blueSky, Constants.COLORS.sunflower],
55
+ colorScale: [_bundleCommon.Constants.COLORS.blueSky, _bundleCommon.Constants.COLORS.sunflower],
50
56
  height: 250,
51
57
  width: 250,
52
58
  radius: 100,
@@ -59,9 +65,9 @@ var Appointments = function Appointments(_ref) {
59
65
  }, {
60
66
  y: appointments.walkins
61
67
  }]
62
- }), /*#__PURE__*/React.createElement(VictoryPie, {
68
+ }), /*#__PURE__*/_react["default"].createElement(_victory.VictoryPie, {
63
69
  standalone: false,
64
- colorScale: [Constants.COLORS.blueLake, 'whitesmoke', 'transparent'],
70
+ colorScale: [_bundleCommon.Constants.COLORS.blueLake, 'whitesmoke', 'transparent'],
65
71
  height: 250,
66
72
  width: 250,
67
73
  radius: 55,
@@ -76,40 +82,39 @@ var Appointments = function Appointments(_ref) {
76
82
  }, {
77
83
  y: appointments.walkins
78
84
  }]
79
- })), /*#__PURE__*/React.createElement("div", {
85
+ })), /*#__PURE__*/_react["default"].createElement("div", {
80
86
  className: "text-center"
81
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
87
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
82
88
  className: "fa fa-square fa-fw",
83
89
  style: {
84
- color: Constants.COLORS.blueLake
90
+ color: _bundleCommon.Constants.COLORS.blueLake
85
91
  }
86
- }), /*#__PURE__*/React.createElement(I18n, null, "Same Day Appointments"), " ", "(".concat(appointments.sameDay, ")")))) : /*#__PURE__*/React.createElement("div", {
92
+ }), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Same Day Appointments"), " ", "(".concat(appointments.sameDay, ")")))) : /*#__PURE__*/_react["default"].createElement("div", {
87
93
  className: "text-center"
88
- }, /*#__PURE__*/React.createElement("em", null, /*#__PURE__*/React.createElement(I18n, null, "No Appointments"))));
94
+ }, /*#__PURE__*/_react["default"].createElement("em", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "No Appointments"))));
89
95
  };
90
-
91
96
  var Feedback = function Feedback(_ref2) {
92
97
  var feedback = _ref2.feedback;
93
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
98
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
94
99
  className: "section__title"
95
- }, /*#__PURE__*/React.createElement(I18n, null, "Feedback")), feedback.total > 0 ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(I18n, {
100
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Feedback")), feedback.total > 0 ? /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
96
101
  render: function render(translate) {
97
- return /*#__PURE__*/React.createElement("div", {
102
+ return /*#__PURE__*/_react["default"].createElement("div", {
98
103
  className: "text-center"
99
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
104
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
100
105
  className: "fa fa-square fa-fw",
101
106
  style: {
102
- color: Constants.COLORS.green
107
+ color: _bundleCommon.Constants.COLORS.green
103
108
  }
104
- }), "".concat(toPercent(feedback.positive, feedback.total), " ").concat(translate('Happy'), " (").concat(feedback.positive, ")")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
109
+ }), "".concat(toPercent(feedback.positive, feedback.total), " ").concat(translate('Happy'), " (").concat(feedback.positive, ")")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
105
110
  className: "fa fa-square fa-fw",
106
111
  style: {
107
- color: Constants.COLORS.red
112
+ color: _bundleCommon.Constants.COLORS.red
108
113
  }
109
114
  }), "".concat(toPercent(feedback.negative, feedback.total), " ").concat(translate('Unhappy'), " (").concat(feedback.negative, ")")));
110
115
  }
111
- }), /*#__PURE__*/React.createElement(VictoryPie, {
112
- containerComponent: /*#__PURE__*/React.createElement(VictoryContainer, {
116
+ }), /*#__PURE__*/_react["default"].createElement(_victory.VictoryPie, {
117
+ containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryContainer, {
113
118
  className: "VictoryContainer max-height-250",
114
119
  height: 250,
115
120
  width: 250,
@@ -117,7 +122,7 @@ var Feedback = function Feedback(_ref2) {
117
122
  height: 'auto'
118
123
  }
119
124
  }),
120
- colorScale: [Constants.COLORS.green, Constants.COLORS.red],
125
+ colorScale: [_bundleCommon.Constants.COLORS.green, _bundleCommon.Constants.COLORS.red],
121
126
  height: 250,
122
127
  width: 250,
123
128
  radius: 100,
@@ -130,37 +135,36 @@ var Feedback = function Feedback(_ref2) {
130
135
  }, {
131
136
  y: feedback.negative
132
137
  }]
133
- })) : /*#__PURE__*/React.createElement("div", {
138
+ })) : /*#__PURE__*/_react["default"].createElement("div", {
134
139
  className: "text-center"
135
- }, /*#__PURE__*/React.createElement("em", null, /*#__PURE__*/React.createElement(I18n, null, "No Feedback"))));
140
+ }, /*#__PURE__*/_react["default"].createElement("em", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "No Feedback"))));
136
141
  };
137
-
138
142
  var Utilization = function Utilization(_ref3) {
139
143
  var utilization = _ref3.utilization;
140
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
144
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
141
145
  className: "section__title"
142
- }, /*#__PURE__*/React.createElement(I18n, null, "Utilization")), utilization.available > 0 ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
146
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Utilization")), utilization.available > 0 ? /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
143
147
  className: "text-center"
144
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
148
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
145
149
  className: "fa fa-square fa-fw",
146
150
  style: {
147
- color: Constants.COLORS.blueSky
151
+ color: _bundleCommon.Constants.COLORS.blueSky
148
152
  }
149
- }), toPercent(utilization.scheduled, utilization.available), ' ', /*#__PURE__*/React.createElement(I18n, null, "Scheduled")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
153
+ }), toPercent(utilization.scheduled, utilization.available), ' ', /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Scheduled")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
150
154
  className: "fa fa-square fa-fw",
151
155
  style: {
152
- color: Constants.COLORS.greenGrass
156
+ color: _bundleCommon.Constants.COLORS.greenGrass
153
157
  }
154
- }), toPercent(utilization.actual, utilization.available), ' ', /*#__PURE__*/React.createElement(I18n, null, "Actual"))), /*#__PURE__*/React.createElement(VictoryContainer, {
158
+ }), toPercent(utilization.actual, utilization.available), ' ', /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Actual"))), /*#__PURE__*/_react["default"].createElement(_victory.VictoryContainer, {
155
159
  className: "VictoryContainer max-height-250",
156
160
  height: 250,
157
161
  width: 250,
158
162
  style: {
159
163
  height: 'auto'
160
164
  }
161
- }, "}", /*#__PURE__*/React.createElement(VictoryPie, {
165
+ }, "}", /*#__PURE__*/_react["default"].createElement(_victory.VictoryPie, {
162
166
  standalone: false,
163
- colorScale: [Constants.COLORS.greenGrass, 'whitesmoke'],
167
+ colorScale: [_bundleCommon.Constants.COLORS.greenGrass, 'whitesmoke'],
164
168
  height: 250,
165
169
  width: 250,
166
170
  radius: 100,
@@ -173,9 +177,9 @@ var Utilization = function Utilization(_ref3) {
173
177
  }, {
174
178
  y: utilization.available - utilization.actual
175
179
  }]
176
- }), /*#__PURE__*/React.createElement(VictoryPie, {
180
+ }), /*#__PURE__*/_react["default"].createElement(_victory.VictoryPie, {
177
181
  standalone: false,
178
- colorScale: [Constants.COLORS.blueSky, 'whitesmoke'],
182
+ colorScale: [_bundleCommon.Constants.COLORS.blueSky, 'whitesmoke'],
179
183
  height: 250,
180
184
  width: 250,
181
185
  radius: 55,
@@ -188,11 +192,10 @@ var Utilization = function Utilization(_ref3) {
188
192
  }, {
189
193
  y: utilization.available - utilization.scheduled
190
194
  }]
191
- }))) : /*#__PURE__*/React.createElement("div", {
195
+ }))) : /*#__PURE__*/_react["default"].createElement("div", {
192
196
  className: "text-center"
193
- }, /*#__PURE__*/React.createElement("em", null, /*#__PURE__*/React.createElement(I18n, null, "No Availability"))));
197
+ }, /*#__PURE__*/_react["default"].createElement("em", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "No Availability"))));
194
198
  };
195
-
196
199
  var TimeOfVisit = function TimeOfVisit(_ref4) {
197
200
  var timeOfVisit = _ref4.timeOfVisit;
198
201
  var scheduledData = Object.keys(timeOfVisit.scheduled).reduce(function (d, hour) {
@@ -203,12 +206,12 @@ var TimeOfVisit = function TimeOfVisit(_ref4) {
203
206
  d[toInt(hour)] = timeOfVisit.walkins[hour];
204
207
  return d;
205
208
  }, Array(24).fill(0));
206
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
209
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
207
210
  className: "section__title"
208
- }, /*#__PURE__*/React.createElement(I18n, null, "Time of Visit")), Object.keys(timeOfVisit.scheduled).length > 0 || Object.keys(timeOfVisit.walkins).length > 0 ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(I18n, {
211
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Time of Visit")), Object.keys(timeOfVisit.scheduled).length > 0 || Object.keys(timeOfVisit.walkins).length > 0 ? /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
209
212
  render: function render(translate) {
210
- return /*#__PURE__*/React.createElement(VictoryChart, {
211
- containerComponent: /*#__PURE__*/React.createElement(VictoryContainer, {
213
+ return /*#__PURE__*/_react["default"].createElement(_victory.VictoryChart, {
214
+ containerComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryContainer, {
212
215
  className: "VictoryContainer max-height-350",
213
216
  style: {
214
217
  height: 'auto'
@@ -218,33 +221,33 @@ var TimeOfVisit = function TimeOfVisit(_ref4) {
218
221
  width: 900,
219
222
  height: 350,
220
223
  domainPadding: 14
221
- }, /*#__PURE__*/React.createElement(VictoryGroup, {
222
- colorScale: [Constants.COLORS.blueSky, Constants.COLORS.sunflower],
224
+ }, /*#__PURE__*/_react["default"].createElement(_victory.VictoryGroup, {
225
+ colorScale: [_bundleCommon.Constants.COLORS.blueSky, _bundleCommon.Constants.COLORS.sunflower],
223
226
  offset: 14,
224
- labelComponent: /*#__PURE__*/React.createElement(VictoryTooltip, null)
225
- }, /*#__PURE__*/React.createElement(VictoryBar, {
227
+ labelComponent: /*#__PURE__*/_react["default"].createElement(_victory.VictoryTooltip, null)
228
+ }, /*#__PURE__*/_react["default"].createElement(_victory.VictoryBar, {
226
229
  barWidth: 14,
227
230
  data: scheduledData.map(function (count, index) {
228
231
  return {
229
- x: moment(index, 'H').format('LT'),
232
+ x: (0, _moment["default"])(index, 'H').format('LT'),
230
233
  y: count,
231
234
  label: function label(d) {
232
235
  return "".concat(d.x, ": ").concat(d.y, " ").concat(translate('Scheduled'));
233
236
  }
234
237
  };
235
238
  })
236
- }), /*#__PURE__*/React.createElement(VictoryBar, {
239
+ }), /*#__PURE__*/_react["default"].createElement(_victory.VictoryBar, {
237
240
  barWidth: 14,
238
241
  data: walkinsData.map(function (count, index) {
239
242
  return {
240
- x: moment(index, 'H').format('LT'),
243
+ x: (0, _moment["default"])(index, 'H').format('LT'),
241
244
  y: count,
242
245
  label: function label(d) {
243
246
  return "".concat(d.x, ": ").concat(d.y, " ").concat(d.y !== 1 ? translate('Walk-Ins') : translate('Walk-In'));
244
247
  }
245
248
  };
246
249
  })
247
- })), /*#__PURE__*/React.createElement(VictoryAxis, {
250
+ })), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
248
251
  style: {
249
252
  tickLabels: {
250
253
  angle: 45,
@@ -254,7 +257,7 @@ var TimeOfVisit = function TimeOfVisit(_ref4) {
254
257
  fontSize: 14
255
258
  }
256
259
  }
257
- }), /*#__PURE__*/React.createElement(VictoryAxis, {
260
+ }), /*#__PURE__*/_react["default"].createElement(_victory.VictoryAxis, {
258
261
  dependentAxis: true,
259
262
  style: {
260
263
  tickLabels: {
@@ -262,37 +265,36 @@ var TimeOfVisit = function TimeOfVisit(_ref4) {
262
265
  fontSize: 14
263
266
  },
264
267
  ticks: {
265
- stroke: Constants.COLORS.black,
268
+ stroke: _bundleCommon.Constants.COLORS.black,
266
269
  size: 5
267
270
  }
268
271
  }
269
272
  }));
270
273
  }
271
- }), /*#__PURE__*/React.createElement("div", {
274
+ }), /*#__PURE__*/_react["default"].createElement("div", {
272
275
  className: "text-center"
273
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
276
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
274
277
  className: "fa fa-square fa-fw",
275
278
  style: {
276
- color: Constants.COLORS.blueSky
279
+ color: _bundleCommon.Constants.COLORS.blueSky
277
280
  }
278
- }), /*#__PURE__*/React.createElement(I18n, null, "Scheduled")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
281
+ }), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Scheduled")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
279
282
  className: "fa fa-square fa-fw",
280
283
  style: {
281
- color: Constants.COLORS.sunflower
284
+ color: _bundleCommon.Constants.COLORS.sunflower
282
285
  }
283
- }), /*#__PURE__*/React.createElement(I18n, null, "Walk-Ins")))) : /*#__PURE__*/React.createElement("div", {
286
+ }), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Walk-Ins")))) : /*#__PURE__*/_react["default"].createElement("div", {
284
287
  className: "text-center"
285
- }, /*#__PURE__*/React.createElement("em", null, /*#__PURE__*/React.createElement(I18n, null, "No Visits"))));
288
+ }, /*#__PURE__*/_react["default"].createElement("em", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "No Visits"))));
286
289
  };
287
-
288
290
  var Duration = function Duration(_ref5) {
289
291
  var durations = _ref5.durations,
290
- techBars = _ref5.techBars;
291
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
292
+ techBars = _ref5.techBars;
293
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
292
294
  className: "section__title"
293
- }, /*#__PURE__*/React.createElement(I18n, null, "Average Durations")), durations.length > 0 ? /*#__PURE__*/React.createElement(I18n, {
295
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Average Durations")), durations.length > 0 ? /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
294
296
  render: function render(translate) {
295
- return /*#__PURE__*/React.createElement(Table, {
297
+ return /*#__PURE__*/_react["default"].createElement(_bundleCommon.Table, {
296
298
  "class": "table-settings",
297
299
  data: durations.map(function (d) {
298
300
  var techBar = techBars.find(function (t) {
@@ -300,7 +302,7 @@ var Duration = function Duration(_ref5) {
300
302
  });
301
303
  var schedulerName = techBar ? techBar.values['Name'] : d.schedulerId;
302
304
  var actualAverage = d.quantity > 0 ? Math.round(d.actual / d.quantity) : null;
303
- return _objectSpread(_objectSpread({}, d), {}, {
305
+ return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, d), {}, {
304
306
  actualAverage: actualAverage,
305
307
  variance: d.quantity > 0 ? (actualAverage - d.duration) / d.duration : null,
306
308
  waitTimeAverage: d.quantity > 0 ? Math.round(d.waitTime / d.quantity) : null,
@@ -313,8 +315,8 @@ var Duration = function Duration(_ref5) {
313
315
  value: 'sortValue',
314
316
  renderBodyCell: function renderBodyCell(_ref6) {
315
317
  var value = _ref6.value,
316
- row = _ref6.row;
317
- return /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, translate(row.type)), /*#__PURE__*/React.createElement("small", {
318
+ row = _ref6.row;
319
+ return /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("div", null, translate(row.type)), /*#__PURE__*/_react["default"].createElement("small", {
318
320
  className: "text-muted"
319
321
  }, translate(row.schedulerName)));
320
322
  }
@@ -323,29 +325,29 @@ var Duration = function Duration(_ref5) {
323
325
  value: 'duration',
324
326
  renderBodyCell: function renderBodyCell(_ref7) {
325
327
  var value = _ref7.value;
326
- return /*#__PURE__*/React.createElement("td", null, "".concat(value, " ").concat(translate('min')));
328
+ return /*#__PURE__*/_react["default"].createElement("td", null, "".concat(value, " ").concat(translate('min')));
327
329
  }
328
330
  }, {
329
331
  title: 'Actual',
330
332
  value: 'actualAverage',
331
333
  renderBodyCell: function renderBodyCell(_ref8) {
332
334
  var value = _ref8.value;
333
- return /*#__PURE__*/React.createElement("td", null, value !== null ? "".concat(value, " ").concat(translate('min')) : '');
335
+ return /*#__PURE__*/_react["default"].createElement("td", null, value !== null ? "".concat(value, " ").concat(translate('min')) : '');
334
336
  }
335
337
  }, {
336
338
  title: 'Variance',
337
339
  value: 'variance',
338
340
  renderBodyCell: function renderBodyCell(_ref9) {
339
341
  var value = _ref9.value,
340
- row = _ref9.row;
341
- return /*#__PURE__*/React.createElement("td", null, value !== null ? toPercent(value, 1) : '');
342
+ row = _ref9.row;
343
+ return /*#__PURE__*/_react["default"].createElement("td", null, value !== null ? toPercent(value, 1) : '');
342
344
  }
343
345
  }, {
344
346
  title: 'Wait Time',
345
347
  value: 'waitTimeAverage',
346
348
  renderBodyCell: function renderBodyCell(_ref10) {
347
349
  var value = _ref10.value;
348
- return /*#__PURE__*/React.createElement("td", null, value !== null ? "".concat(value, " ").concat(translate('min')) : '');
350
+ return /*#__PURE__*/_react["default"].createElement("td", null, value !== null ? "".concat(value, " ").concat(translate('min')) : '');
349
351
  }
350
352
  }, {
351
353
  title: 'Qty',
@@ -356,62 +358,62 @@ var Duration = function Duration(_ref5) {
356
358
  pagination: false,
357
359
  render: function render(_ref11) {
358
360
  var table = _ref11.table;
359
- return /*#__PURE__*/React.createElement("div", {
361
+ return /*#__PURE__*/_react["default"].createElement("div", {
360
362
  className: "table-wrapper"
361
363
  }, table);
362
364
  }
363
365
  });
364
366
  }
365
- }) : /*#__PURE__*/React.createElement("div", {
367
+ }) : /*#__PURE__*/_react["default"].createElement("div", {
366
368
  className: "text-center"
367
- }, /*#__PURE__*/React.createElement("em", null, /*#__PURE__*/React.createElement(I18n, null, "No Event Types"))));
369
+ }, /*#__PURE__*/_react["default"].createElement("em", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "No Event Types"))));
368
370
  };
369
-
370
- export var MetricsSummaryComponent = function MetricsSummaryComponent(_ref12) {
371
+ var MetricsSummaryComponent = function MetricsSummaryComponent(_ref12) {
371
372
  var error = _ref12.error,
372
- metrics = _ref12.metrics,
373
- data = _objectWithoutProperties(_ref12, ["error", "metrics"]);
374
-
375
- return /*#__PURE__*/React.createElement(StateListWrapper, {
373
+ metrics = _ref12.metrics,
374
+ data = (0, _objectWithoutProperties2["default"])(_ref12, _excluded);
375
+ return /*#__PURE__*/_react["default"].createElement(_bundleCommon.StateListWrapper, {
376
376
  data: data,
377
377
  loading: !metrics,
378
378
  error: error
379
379
  }, function (_ref13) {
380
380
  var summary = _ref13.summary,
381
- techBars = _ref13.techBars;
382
- return /*#__PURE__*/React.createElement("div", {
381
+ techBars = _ref13.techBars;
382
+ return /*#__PURE__*/_react["default"].createElement("div", {
383
383
  className: "row"
384
- }, /*#__PURE__*/React.createElement("div", {
384
+ }, /*#__PURE__*/_react["default"].createElement("div", {
385
385
  className: "col-md-4 mb-5"
386
- }, /*#__PURE__*/React.createElement(Appointments, {
386
+ }, /*#__PURE__*/_react["default"].createElement(Appointments, {
387
387
  appointments: summary.appointments
388
- })), /*#__PURE__*/React.createElement("div", {
388
+ })), /*#__PURE__*/_react["default"].createElement("div", {
389
389
  className: "col-md-4 mb-5"
390
- }, /*#__PURE__*/React.createElement(Feedback, {
390
+ }, /*#__PURE__*/_react["default"].createElement(Feedback, {
391
391
  feedback: summary.feedback
392
- })), /*#__PURE__*/React.createElement("div", {
392
+ })), /*#__PURE__*/_react["default"].createElement("div", {
393
393
  className: "col-md-4 mb-5"
394
- }, /*#__PURE__*/React.createElement(Utilization, {
394
+ }, /*#__PURE__*/_react["default"].createElement(Utilization, {
395
395
  utilization: summary.utilization
396
- })), /*#__PURE__*/React.createElement("div", {
396
+ })), /*#__PURE__*/_react["default"].createElement("div", {
397
397
  className: "col-xl-6 mb-5"
398
- }, /*#__PURE__*/React.createElement(TimeOfVisit, {
398
+ }, /*#__PURE__*/_react["default"].createElement(TimeOfVisit, {
399
399
  timeOfVisit: summary.timeOfVisit
400
- })), /*#__PURE__*/React.createElement("div", {
400
+ })), /*#__PURE__*/_react["default"].createElement("div", {
401
401
  className: "col-xl-6 mb-5"
402
- }, /*#__PURE__*/React.createElement(Duration, {
402
+ }, /*#__PURE__*/_react["default"].createElement(Duration, {
403
403
  durations: summary.durations,
404
404
  techBars: techBars
405
405
  })));
406
406
  });
407
407
  };
408
- export var mapStateToProps = function mapStateToProps(state, props) {
408
+ exports.MetricsSummaryComponent = MetricsSummaryComponent;
409
+ var mapStateToProps = function mapStateToProps(state, props) {
409
410
  return {
410
411
  error: state.metrics.error,
411
412
  metrics: state.metrics.data
412
413
  };
413
414
  };
414
- var Summary = Record({
415
+ exports.mapStateToProps = mapStateToProps;
416
+ var Summary = (0, _immutable.Record)({
415
417
  appointments: {
416
418
  walkins: 0,
417
419
  scheduled: 0,
@@ -431,68 +433,65 @@ var Summary = Record({
431
433
  walkins: {}
432
434
  },
433
435
  durations: [] // { quantity, actual, duration, schedulerId, type }
434
-
435
436
  });
436
- export var MetricsSummary = compose(connect(mapStateToProps), withProps(function (_ref14) {
437
- var schedulerId = _ref14.schedulerId,
438
- eventType = _ref14.eventType,
439
- metrics = _ref14.metrics;
440
437
 
438
+ var MetricsSummary = (0, _recompose.compose)((0, _store.connect)(mapStateToProps), (0, _recompose.withProps)(function (_ref14) {
439
+ var schedulerId = _ref14.schedulerId,
440
+ eventType = _ref14.eventType,
441
+ metrics = _ref14.metrics;
441
442
  if (!metrics) {
442
443
  return {
443
444
  summary: Summary()
444
445
  };
445
446
  }
446
-
447
447
  var records = schedulerId ? metrics.filter(function (m) {
448
448
  return m.schedulerId === schedulerId;
449
449
  }) : metrics;
450
450
  var summary = records.reduce(function (summary, _ref15) {
451
451
  var data = _ref15.data;
452
452
  // Add total available minutes
453
- summary.utilization.available += toInt(data.totalMinutesAvailable); // If event type is not specified, add feedback results not associated to events
454
-
453
+ summary.utilization.available += toInt(data.totalMinutesAvailable);
454
+ // If event type is not specified, add feedback results not associated to events
455
455
  if (!eventType) {
456
456
  summary.feedback.positive += toInt(data.feedback.Positive);
457
457
  summary.feedback.negative += toInt(data.feedback.Negative);
458
- } // Iterate through all the event types
459
-
460
-
461
- return data.eventTypes // If event type is selected, filter to only that type
458
+ }
459
+ // Iterate through all the event types
460
+ return data.eventTypes
461
+ // If event type is selected, filter to only that type
462
462
  .filter(function (event) {
463
463
  return !eventType || eventType === event.type;
464
464
  }).reduce(function (s, event) {
465
465
  // Add appointment counts
466
466
  s.appointments.scheduled += toInt(event.scheduledAppointments);
467
467
  s.appointments.walkins += toInt(event.walkins);
468
- s.appointments.sameDay += toInt(event.sameDayAppointments); // Add feedback counts
469
-
468
+ s.appointments.sameDay += toInt(event.sameDayAppointments);
469
+ // Add feedback counts
470
470
  s.feedback.positive += toInt(event.feedback.Positive);
471
- s.feedback.negative += toInt(event.feedback.Negative); // Add total scheduled minutes and actual minutes
472
-
471
+ s.feedback.negative += toInt(event.feedback.Negative);
472
+ // Add total scheduled minutes and actual minutes
473
473
  s.utilization.scheduled += parseInt(event.scheduledAppointments, 10) * toInt(event.duration);
474
- s.utilization.actual += toInt(event.scheduledTotalDuration); // Add time of visit counts for scheduled appointments
475
-
474
+ s.utilization.actual += toInt(event.scheduledTotalDuration);
475
+ // Add time of visit counts for scheduled appointments
476
476
  Object.keys(event.scheduledAppointmentTimes).forEach(function (time) {
477
477
  if (!s.timeOfVisit.scheduled[time]) {
478
478
  s.timeOfVisit.scheduled[time] = toInt(event.scheduledAppointmentTimes[time]);
479
479
  } else {
480
480
  s.timeOfVisit.scheduled[time] += toInt(event.scheduledAppointmentTimes[time]);
481
481
  }
482
- }); // Add time of visit counts for walkin appointments
483
-
482
+ });
483
+ // Add time of visit counts for walkin appointments
484
484
  Object.keys(event.walkinAppointmentTimes).forEach(function (time) {
485
485
  if (!s.timeOfVisit.walkins[time]) {
486
486
  s.timeOfVisit.walkins[time] = toInt(event.walkinAppointmentTimes[time]);
487
487
  } else {
488
488
  s.timeOfVisit.walkins[time] += toInt(event.walkinAppointmentTimes[time]);
489
489
  }
490
- }); // Add duration info
491
-
490
+ });
491
+ // Add duration info
492
492
  var existingDuration = s.durations.find(function (d) {
493
493
  return d.schedulerId === data.schedulerId && d.type === event.type;
494
494
  });
495
-
496
495
  if (existingDuration) {
497
496
  existingDuration.quantity += toInt(event.scheduledAppointments) + toInt(event.walkins);
498
497
  existingDuration.actual += toInt(event.walkinTotalDuration) + toInt(event.scheduledTotalDuration);
@@ -507,14 +506,14 @@ export var MetricsSummary = compose(connect(mapStateToProps), withProps(function
507
506
  waitTime: toInt(event.walkinTotalWaitTime) + toInt(event.scheduledTotalWaitTime)
508
507
  });
509
508
  }
510
-
511
509
  return s;
512
510
  }, summary);
513
- }, Summary().toJS()); // Total appointments and feedback
514
-
511
+ }, Summary().toJS());
512
+ // Total appointments and feedback
515
513
  summary.appointments.total = summary.appointments.scheduled + summary.appointments.walkins;
516
514
  summary.feedback.total = summary.feedback.positive + summary.feedback.negative;
517
515
  return {
518
516
  summary: summary
519
517
  };
520
- }))(MetricsSummaryComponent);
518
+ }))(MetricsSummaryComponent);
519
+ exports.MetricsSummary = MetricsSummary;