@kineticdata/bundle-tech-bar 5.1.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +6 -15
@@ -1,118 +1,126 @@
1
- import React, { Fragment } from 'react';
2
- import { connect } from '../redux/store';
3
- import { compose, lifecycle, withHandlers, withState } from 'recompose';
4
- import { Modal, ModalBody } from 'reactstrap';
5
- import { Card, CardCol, CardRow, Utils, openModalForm, StateListWrapper } from '@kineticdata/bundle-common';
6
- import { PageTitle } from './shared/PageTitle';
7
- import { Link } from '@reach/router';
8
- import { actions } from '../redux/modules/appointments';
9
- import { actions as walkInActions } from '../redux/modules/walkIns';
10
- import { enableLocationServices, mapTechBarsForDistance, sortTechBarsByDistance } from '../redux/modules/techBarApp';
11
- import { SESSION_ITEM_USER_LOCATION, SESSION_ITEM_CURRENT_TECH_BAR, DATE_FORMAT, TIME_FORMAT } from '../constants';
12
- import moment from 'moment';
13
- import { I18n, Moment } from '@kineticdata/react';
14
- import heroImage from '../../assets/images/tech-bar-hero.jpg';
15
- export var HomeComponent = function HomeComponent(_ref) {
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.mapDispatchToProps = exports.HomeComponent = exports.Home = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _store = require("../redux/store");
11
+ var _recompose = require("recompose");
12
+ var _reactstrap = require("reactstrap");
13
+ var _bundleCommon = require("@kineticdata/bundle-common");
14
+ var _PageTitle = require("./shared/PageTitle");
15
+ var _router = require("@reach/router");
16
+ var _appointments = require("../redux/modules/appointments");
17
+ var _walkIns = require("../redux/modules/walkIns");
18
+ var _techBarApp = require("../redux/modules/techBarApp");
19
+ var _constants = require("../constants");
20
+ var _moment = _interopRequireDefault(require("moment"));
21
+ var _react2 = require("@kineticdata/react");
22
+ var _techBarHero = _interopRequireDefault(require("../../assets/images/tech-bar-hero.jpg"));
23
+ var HomeComponent = function HomeComponent(_ref) {
16
24
  var kapp = _ref.kapp,
17
- techBars = _ref.techBars,
18
- upcomingAppointments = _ref.upcomingAppointments,
19
- error = _ref.error,
20
- modalOpen = _ref.modalOpen,
21
- setModalOpen = _ref.setModalOpen,
22
- currentTechBar = _ref.currentTechBar,
23
- selectCurrentTechBar = _ref.selectCurrentTechBar,
24
- useLocationServices = _ref.useLocationServices,
25
- userLocation = _ref.userLocation,
26
- getUserLocation = _ref.getUserLocation,
27
- openDropdown = _ref.openDropdown,
28
- toggleDropdown = _ref.toggleDropdown,
29
- hasTechBarDisplayRole = _ref.hasTechBarDisplayRole,
30
- waitingUsers = _ref.waitingUsers;
25
+ techBars = _ref.techBars,
26
+ upcomingAppointments = _ref.upcomingAppointments,
27
+ error = _ref.error,
28
+ modalOpen = _ref.modalOpen,
29
+ setModalOpen = _ref.setModalOpen,
30
+ currentTechBar = _ref.currentTechBar,
31
+ selectCurrentTechBar = _ref.selectCurrentTechBar,
32
+ useLocationServices = _ref.useLocationServices,
33
+ userLocation = _ref.userLocation,
34
+ getUserLocation = _ref.getUserLocation,
35
+ openDropdown = _ref.openDropdown,
36
+ toggleDropdown = _ref.toggleDropdown,
37
+ hasTechBarDisplayRole = _ref.hasTechBarDisplayRole,
38
+ waitingUsers = _ref.waitingUsers;
31
39
  var selectedTechBar = currentTechBar || techBars.get(0);
32
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
40
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
33
41
  className: "page-container page-container--lg"
34
- }, /*#__PURE__*/React.createElement("div", {
42
+ }, /*#__PURE__*/_react["default"].createElement("div", {
35
43
  className: "page-panel"
36
- }, /*#__PURE__*/React.createElement(PageTitle, {
44
+ }, /*#__PURE__*/_react["default"].createElement(_PageTitle.PageTitle, {
37
45
  hero: true,
38
46
  image: true,
39
- heroImage: heroImage,
47
+ heroImage: _techBarHero["default"],
40
48
  overlayColor: "rgba(0,0,0,0.6)",
41
49
  center: true,
42
50
  title: "Welcome to ".concat(selectedTechBar ? selectedTechBar.values['Name'] : kapp ? kapp.name : 'Tech Bar'),
43
51
  subtitle: selectedTechBar ? selectedTechBar.values['Description'] : 'We deliver in-person service that gets people back on track.',
44
52
  withCard: true
45
- }, /*#__PURE__*/React.createElement(Card, {
53
+ }, /*#__PURE__*/_react["default"].createElement(_bundleCommon.Card, {
46
54
  bar: true,
47
55
  barColor: "warning",
48
56
  barSize: "xs"
49
- }, /*#__PURE__*/React.createElement(CardCol, {
57
+ }, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardCol, {
50
58
  className: "overflow-auto"
51
- }, /*#__PURE__*/React.createElement(CardRow, null, /*#__PURE__*/React.createElement(CardRow, {
59
+ }, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, null, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
52
60
  type: "prepend"
53
- }, /*#__PURE__*/React.createElement("span", {
61
+ }, /*#__PURE__*/_react["default"].createElement("span", {
54
62
  className: "fa fa-map-marker fa-3x"
55
- })), /*#__PURE__*/React.createElement(CardCol, null, /*#__PURE__*/React.createElement(CardRow, null, /*#__PURE__*/React.createElement("strong", null, /*#__PURE__*/React.createElement(I18n, null, selectedTechBar.values['Name'])), techBars.size > 1 && /*#__PURE__*/React.createElement("button", {
63
+ })), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardCol, null, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, null, /*#__PURE__*/_react["default"].createElement("strong", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, selectedTechBar.values['Name'])), techBars.size > 1 && /*#__PURE__*/_react["default"].createElement("button", {
56
64
  className: "btn btn-inverse btn-sm ml-auto",
57
65
  onClick: function onClick() {
58
66
  return setModalOpen(true);
59
67
  }
60
- }, /*#__PURE__*/React.createElement(I18n, null, "Change"))), selectedTechBar.values['Location'] && /*#__PURE__*/React.createElement(CardRow, {
68
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Change"))), selectedTechBar.values['Location'] && /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
61
69
  type: "meta",
62
70
  className: "text-muted p-0"
63
- }, /*#__PURE__*/React.createElement(I18n, null, selectedTechBar.values['Location'])))), /*#__PURE__*/React.createElement(CardRow, {
71
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, selectedTechBar.values['Location'])))), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
64
72
  type: "meta",
65
73
  className: "flex-grow-1 flex-shrink-1 overflow-auto my-2"
66
- }, selectedTechBar.values['Details'] && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(I18n, null, selectedTechBar.values['Details']))), /*#__PURE__*/React.createElement(CardCol, {
74
+ }, selectedTechBar.values['Details'] && /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, selectedTechBar.values['Details']))), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardCol, {
67
75
  className: "flex-grow-0 flex-shrink-0"
68
- }, /*#__PURE__*/React.createElement(CardRow, null, /*#__PURE__*/React.createElement(Link, {
76
+ }, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, null, /*#__PURE__*/_react["default"].createElement(_router.Link, {
69
77
  to: "appointment/".concat(selectedTechBar.values['Id']),
70
78
  className: "btn btn-primary flex-grow-1"
71
- }, /*#__PURE__*/React.createElement(I18n, null, "Schedule Now"), " \u2192")), /*#__PURE__*/React.createElement(CardRow, {
79
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Schedule Now"), " \u2192")), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
72
80
  type: "meta",
73
81
  className: "pt-0"
74
- }, /*#__PURE__*/React.createElement("em", {
82
+ }, /*#__PURE__*/_react["default"].createElement("em", {
75
83
  className: "text-muted ".concat(waitingUsers === 0 ? '' : '')
76
- }, /*#__PURE__*/React.createElement(I18n, null, "Currently awaiting assistance"), ": ", waitingUsers, ' ', /*#__PURE__*/React.createElement(I18n, {
84
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Currently awaiting assistance"), ": ", waitingUsers, ' ', /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
77
85
  render: function render(translate) {
78
86
  return waitingUsers === 1 ? translate('person') : translate('people');
79
87
  }
80
- }))))))), /*#__PURE__*/React.createElement("section", {
88
+ }))))))), /*#__PURE__*/_react["default"].createElement("section", {
81
89
  className: "mt-4"
82
- }, selectedTechBar ? /*#__PURE__*/React.createElement("div", {
90
+ }, selectedTechBar ? /*#__PURE__*/_react["default"].createElement("div", {
83
91
  className: "info-tile__wrapper"
84
- }, /*#__PURE__*/React.createElement(Link, {
92
+ }, /*#__PURE__*/_react["default"].createElement(_router.Link, {
85
93
  to: "appointment/".concat(selectedTechBar.values['Id']),
86
94
  className: "info-tile"
87
- }, /*#__PURE__*/React.createElement("div", {
95
+ }, /*#__PURE__*/_react["default"].createElement("div", {
88
96
  className: "icon"
89
- }, /*#__PURE__*/React.createElement("span", {
97
+ }, /*#__PURE__*/_react["default"].createElement("span", {
90
98
  className: "fa fa-calendar-o fa-fw"
91
- })), /*#__PURE__*/React.createElement("div", {
99
+ })), /*#__PURE__*/_react["default"].createElement("div", {
92
100
  className: "title"
93
- }, /*#__PURE__*/React.createElement("span", {
101
+ }, /*#__PURE__*/_react["default"].createElement("span", {
94
102
  className: "fa fa-calendar-o fa-fw"
95
- }), /*#__PURE__*/React.createElement(I18n, null, "Schedule")), /*#__PURE__*/React.createElement("p", {
103
+ }), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Schedule")), /*#__PURE__*/_react["default"].createElement("p", {
96
104
  className: "description"
97
- }, /*#__PURE__*/React.createElement(I18n, null, "Schedule an appointment."))), /*#__PURE__*/React.createElement(Link, {
105
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Schedule an appointment."))), /*#__PURE__*/_react["default"].createElement(_router.Link, {
98
106
  to: "past",
99
107
  className: "info-tile"
100
- }, /*#__PURE__*/React.createElement("div", {
108
+ }, /*#__PURE__*/_react["default"].createElement("div", {
101
109
  className: "icon"
102
- }, /*#__PURE__*/React.createElement("span", {
110
+ }, /*#__PURE__*/_react["default"].createElement("span", {
103
111
  className: "fa fa-clock-o fa-fw"
104
- })), /*#__PURE__*/React.createElement("div", {
112
+ })), /*#__PURE__*/_react["default"].createElement("div", {
105
113
  className: "title"
106
- }, /*#__PURE__*/React.createElement("span", {
114
+ }, /*#__PURE__*/_react["default"].createElement("span", {
107
115
  className: "fa fa-clock-o fa-fw"
108
- }), /*#__PURE__*/React.createElement(I18n, null, "History")), /*#__PURE__*/React.createElement("p", {
116
+ }), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "History")), /*#__PURE__*/_react["default"].createElement("p", {
109
117
  className: "description"
110
- }, /*#__PURE__*/React.createElement(I18n, null, "View all of your past appointments."))), /*#__PURE__*/React.createElement(I18n, {
118
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "View all of your past appointments."))), /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
111
119
  render: function render(translate) {
112
- return /*#__PURE__*/React.createElement("div", {
120
+ return /*#__PURE__*/_react["default"].createElement("div", {
113
121
  className: "info-tile actionable",
114
122
  onClick: function onClick() {
115
- return openModalForm({
123
+ return (0, _bundleCommon.openModalForm)({
116
124
  formSlug: 'general-feedback',
117
125
  kappSlug: kapp.slug,
118
126
  values: {
@@ -122,166 +130,167 @@ export var HomeComponent = function HomeComponent(_ref) {
122
130
  confirmationMessage: translate('Thank you for your feedback.')
123
131
  });
124
132
  }
125
- }, /*#__PURE__*/React.createElement("div", {
133
+ }, /*#__PURE__*/_react["default"].createElement("div", {
126
134
  className: "icon"
127
- }, /*#__PURE__*/React.createElement("span", {
135
+ }, /*#__PURE__*/_react["default"].createElement("span", {
128
136
  className: "fa fa-comment-o fa-fw"
129
- })), /*#__PURE__*/React.createElement("div", {
137
+ })), /*#__PURE__*/_react["default"].createElement("div", {
130
138
  className: "title"
131
- }, /*#__PURE__*/React.createElement("span", {
139
+ }, /*#__PURE__*/_react["default"].createElement("span", {
132
140
  className: "fa fa-comment-o fa-fw"
133
- }), /*#__PURE__*/React.createElement(I18n, null, "Feedback")), /*#__PURE__*/React.createElement("p", {
141
+ }), /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Feedback")), /*#__PURE__*/_react["default"].createElement("p", {
134
142
  className: "description"
135
- }, /*#__PURE__*/React.createElement(I18n, null, "Questions, comments, or concerns.")));
143
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Questions, comments, or concerns.")));
136
144
  }
137
- })) : /*#__PURE__*/React.createElement("div", {
145
+ })) : /*#__PURE__*/_react["default"].createElement("div", {
138
146
  className: "alert alert-warning alert-bar"
139
- }, /*#__PURE__*/React.createElement("div", {
147
+ }, /*#__PURE__*/_react["default"].createElement("div", {
140
148
  className: "h5"
141
- }, "There are no Tech Bars configured."), /*#__PURE__*/React.createElement("div", null, "Please contact an administrator."))), /*#__PURE__*/React.createElement("section", {
149
+ }, "There are no Tech Bars configured."), /*#__PURE__*/_react["default"].createElement("div", null, "Please contact an administrator."))), /*#__PURE__*/_react["default"].createElement("section", {
142
150
  className: "mt-4"
143
- }, /*#__PURE__*/React.createElement("h2", {
151
+ }, /*#__PURE__*/_react["default"].createElement("h2", {
144
152
  className: "section__title"
145
- }, /*#__PURE__*/React.createElement("span", {
153
+ }, /*#__PURE__*/_react["default"].createElement("span", {
146
154
  className: "title"
147
- }, /*#__PURE__*/React.createElement(I18n, null, "Upcoming Appointments"))), /*#__PURE__*/React.createElement(StateListWrapper, {
155
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Upcoming Appointments"))), /*#__PURE__*/_react["default"].createElement(_bundleCommon.StateListWrapper, {
148
156
  data: upcomingAppointments,
149
157
  error: error,
150
158
  emptyTitle: "You have no upcoming appointments.",
151
159
  emptyMessage: "As you schedule appointments, they'll appear here."
152
160
  }, function (data) {
153
- return /*#__PURE__*/React.createElement("div", {
161
+ return /*#__PURE__*/_react["default"].createElement("div", {
154
162
  className: "cards mb-3"
155
163
  }, data.map(function (appt) {
156
164
  var techBar = techBars.find(function (t) {
157
165
  return t.values['Id'] === appt.values['Scheduler Id'];
158
166
  });
159
- var date = moment.utc(appt.values['Event Date'], DATE_FORMAT);
160
- var start = moment.utc(appt.values['Event Time'], TIME_FORMAT);
167
+ var date = _moment["default"].utc(appt.values['Event Date'], _constants.DATE_FORMAT);
168
+ var start = _moment["default"].utc(appt.values['Event Time'], _constants.TIME_FORMAT);
161
169
  var end = start.clone().add(appt.values['Event Duration'], 'minute');
162
- return /*#__PURE__*/React.createElement(Card, {
170
+ return /*#__PURE__*/_react["default"].createElement(_bundleCommon.Card, {
163
171
  key: appt.id,
164
172
  to: "appointment/".concat(appt.values['Scheduler Id'], "/").concat(appt.id),
165
173
  components: {
166
- Link: Link
174
+ Link: _router.Link
167
175
  }
168
- }, /*#__PURE__*/React.createElement(CardRow, null, /*#__PURE__*/React.createElement(CardRow, {
176
+ }, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, null, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
169
177
  type: "prepend"
170
- }, /*#__PURE__*/React.createElement("span", {
178
+ }, /*#__PURE__*/_react["default"].createElement("span", {
171
179
  className: "fa fa-calendar fa-rounded",
172
180
  style: {
173
181
  background: 'rgb(255, 74, 94)'
174
182
  }
175
- })), /*#__PURE__*/React.createElement(CardCol, null, /*#__PURE__*/React.createElement(CardRow, {
183
+ })), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardCol, null, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
176
184
  type: "multi"
177
- }, /*#__PURE__*/React.createElement(CardRow, {
185
+ }, /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
178
186
  type: "subtitle"
179
- }, /*#__PURE__*/React.createElement(Moment, {
187
+ }, /*#__PURE__*/_react["default"].createElement(_react2.Moment, {
180
188
  timestamp: date,
181
- format: Moment.formats.dateWithDay
182
- })), /*#__PURE__*/React.createElement(CardRow, {
189
+ format: _react2.Moment.formats.dateWithDay
190
+ })), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
183
191
  className: "text-muted"
184
- }, /*#__PURE__*/React.createElement(Moment, {
192
+ }, /*#__PURE__*/_react["default"].createElement(_react2.Moment, {
185
193
  timestamp: start,
186
- format: Moment.formats.time
187
- }), " - ", /*#__PURE__*/React.createElement(Moment, {
194
+ format: _react2.Moment.formats.time
195
+ }), " - ", /*#__PURE__*/_react["default"].createElement(_react2.Moment, {
188
196
  timestamp: end,
189
- format: Moment.formats.time
190
- })), /*#__PURE__*/React.createElement(CardRow, {
197
+ format: _react2.Moment.formats.time
198
+ })), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
191
199
  type: "meta"
192
- }, /*#__PURE__*/React.createElement("strong", null, /*#__PURE__*/React.createElement(I18n, null, techBar.values['Name']))), /*#__PURE__*/React.createElement(CardRow, {
200
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, techBar.values['Name']))), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
193
201
  type: "meta"
194
- }, appt.values['Summary']))), /*#__PURE__*/React.createElement(CardRow, {
202
+ }, appt.values['Summary']))), /*#__PURE__*/_react["default"].createElement(_bundleCommon.CardRow, {
195
203
  type: "append"
196
- }, /*#__PURE__*/React.createElement("span", {
204
+ }, /*#__PURE__*/_react["default"].createElement("span", {
197
205
  className: "badge badge-stylized badge-".concat(appt.coreState === 'Closed' ? 'dark' : 'success')
198
- }, /*#__PURE__*/React.createElement(I18n, null, appt.values['Status'])))));
206
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, appt.values['Status'])))));
199
207
  }));
200
- })))), modalOpen && /*#__PURE__*/React.createElement(Modal, {
208
+ })))), modalOpen && /*#__PURE__*/_react["default"].createElement(_reactstrap.Modal, {
201
209
  isOpen: !!modalOpen,
202
210
  toggle: function toggle() {
203
211
  return setModalOpen(false);
204
212
  },
205
213
  size: "sm",
206
214
  className: "tech-bar-modal"
207
- }, /*#__PURE__*/React.createElement("div", {
215
+ }, /*#__PURE__*/_react["default"].createElement("div", {
208
216
  className: "modal-header"
209
- }, /*#__PURE__*/React.createElement("h4", {
217
+ }, /*#__PURE__*/_react["default"].createElement("h4", {
210
218
  className: "modal-title"
211
- }, /*#__PURE__*/React.createElement("button", {
219
+ }, /*#__PURE__*/_react["default"].createElement("button", {
212
220
  type: "button",
213
221
  className: "btn btn-link",
214
222
  onClick: function onClick() {
215
223
  return setModalOpen(false);
216
224
  }
217
- }, /*#__PURE__*/React.createElement(I18n, null, "Cancel")), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(I18n, null, "Location")), /*#__PURE__*/React.createElement(Link, {
225
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Cancel")), /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "Location")), /*#__PURE__*/_react["default"].createElement(_router.Link, {
218
226
  to: "tech-bars",
219
227
  className: "btn btn-link"
220
- }, /*#__PURE__*/React.createElement(I18n, null, "View All")))), useLocationServices && !userLocation && /*#__PURE__*/React.createElement("div", {
228
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "View All")))), useLocationServices && !userLocation && /*#__PURE__*/_react["default"].createElement("div", {
221
229
  className: "modal-header"
222
- }, /*#__PURE__*/React.createElement("div", {
230
+ }, /*#__PURE__*/_react["default"].createElement("div", {
223
231
  className: "px-3 py-1 text-center"
224
- }, /*#__PURE__*/React.createElement("button", {
232
+ }, /*#__PURE__*/_react["default"].createElement("button", {
225
233
  className: "btn btn-link",
226
234
  onClick: getUserLocation
227
- }, /*#__PURE__*/React.createElement("span", {
235
+ }, /*#__PURE__*/_react["default"].createElement("span", {
228
236
  className: "fa fa-fw fa-map-marker"
229
- }), ' ', /*#__PURE__*/React.createElement(I18n, null, "use my current location")))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("ul", null, techBars.map(function (techBar) {
230
- return /*#__PURE__*/React.createElement("li", {
237
+ }), ' ', /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, "use my current location")))), /*#__PURE__*/_react["default"].createElement(_reactstrap.ModalBody, null, /*#__PURE__*/_react["default"].createElement("ul", null, techBars.map(function (techBar) {
238
+ return /*#__PURE__*/_react["default"].createElement("li", {
231
239
  key: techBar.id,
232
240
  onClick: function onClick() {
233
241
  return selectCurrentTechBar(techBar.id);
234
242
  }
235
- }, /*#__PURE__*/React.createElement("span", {
243
+ }, /*#__PURE__*/_react["default"].createElement("span", {
236
244
  className: "title"
237
- }, /*#__PURE__*/React.createElement(I18n, null, techBar.values['Name'])), techBar.values['Location'] && /*#__PURE__*/React.createElement("div", {
245
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, techBar.values['Name'])), techBar.values['Location'] && /*#__PURE__*/_react["default"].createElement("div", {
238
246
  className: "subtitle"
239
- }, /*#__PURE__*/React.createElement(I18n, null, techBar.values['Location'])), userLocation && /*#__PURE__*/React.createElement("div", {
247
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, techBar.values['Location'])), userLocation && /*#__PURE__*/_react["default"].createElement("div", {
240
248
  className: "subtitle"
241
- }, /*#__PURE__*/React.createElement(I18n, {
249
+ }, /*#__PURE__*/_react["default"].createElement(_react2.I18n, {
242
250
  render: function render(translate) {
243
251
  return techBar.distance ? "(".concat(techBar.distance.toFixed(1), " ").concat(translate('miles'), ")") : "(".concat(translate('Distance Unknown'), ")");
244
252
  }
245
- })), /*#__PURE__*/React.createElement("div", {
253
+ })), /*#__PURE__*/_react["default"].createElement("div", {
246
254
  className: "details"
247
- }, techBar.values['Description'] && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(I18n, null, techBar.values['Description'])), techBar.values['Details'] && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(I18n, null, techBar.values['Details']))));
255
+ }, techBar.values['Description'] && /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, techBar.values['Description'])), techBar.values['Details'] && /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement(_react2.I18n, null, techBar.values['Details']))));
248
256
  })))));
249
257
  };
250
- export var mapStateToProps = function mapStateToProps(state, props) {
258
+ exports.HomeComponent = HomeComponent;
259
+ var mapStateToProps = function mapStateToProps(state, props) {
251
260
  var techBars = state.techBarApp.schedulers.filter(function (s) {
252
261
  return s.values['Status'] === 'Active';
253
262
  });
254
- var useLocationServices = enableLocationServices(techBars);
263
+ var useLocationServices = (0, _techBarApp.enableLocationServices)(techBars);
255
264
  return {
256
265
  kappSlug: state.app.kappSlug,
257
266
  kapp: state.app.kapp,
258
267
  profile: state.app.profile,
259
- techBars: useLocationServices && props.userLocation ? techBars.map(mapTechBarsForDistance(props.userLocation)).sort(sortTechBarsByDistance) : techBars,
268
+ techBars: useLocationServices && props.userLocation ? techBars.map((0, _techBarApp.mapTechBarsForDistance)(props.userLocation)).sort(_techBarApp.sortTechBarsByDistance) : techBars,
260
269
  error: state.appointments.error,
261
270
  upcomingAppointments: state.appointments.upcoming,
262
271
  waitingUsers: (state.appointments.overview ? state.appointments.overview.size : 0) + (state.walkIns.overview ? state.walkIns.overview.size : 0),
263
272
  useLocationServices: useLocationServices
264
273
  };
265
274
  };
266
- export var mapDispatchToProps = {
267
- fetchUpcomingAppointmentsRequest: actions.fetchUpcomingAppointmentsRequest,
268
- fetchAppointmentsOverviewRequest: actions.fetchAppointmentsOverviewRequest,
269
- fetchWalkInsOverviewRequest: walkInActions.fetchWalkInsOverviewRequest
275
+ exports.mapStateToProps = mapStateToProps;
276
+ var mapDispatchToProps = {
277
+ fetchUpcomingAppointmentsRequest: _appointments.actions.fetchUpcomingAppointmentsRequest,
278
+ fetchAppointmentsOverviewRequest: _appointments.actions.fetchAppointmentsOverviewRequest,
279
+ fetchWalkInsOverviewRequest: _walkIns.actions.fetchWalkInsOverviewRequest
270
280
  };
271
-
281
+ exports.mapDispatchToProps = mapDispatchToProps;
272
282
  var selectCurrentTechBar = function selectCurrentTechBar(_ref2) {
273
283
  var techBars = _ref2.techBars,
274
- setCurrentTechBar = _ref2.setCurrentTechBar,
275
- setModalOpen = _ref2.setModalOpen;
284
+ setCurrentTechBar = _ref2.setCurrentTechBar,
285
+ setModalOpen = _ref2.setModalOpen;
276
286
  return function (id) {
277
287
  setModalOpen(false);
278
- sessionStorage.setItem(SESSION_ITEM_CURRENT_TECH_BAR, id);
288
+ sessionStorage.setItem(_constants.SESSION_ITEM_CURRENT_TECH_BAR, id);
279
289
  setCurrentTechBar(techBars.find(function (t) {
280
290
  return t.id === id;
281
291
  }));
282
292
  };
283
293
  };
284
-
285
294
  var getUserLocation = function getUserLocation(_ref3) {
286
295
  var setUserLocation = _ref3.setUserLocation;
287
296
  return function () {
@@ -292,60 +301,54 @@ var getUserLocation = function getUserLocation(_ref3) {
292
301
  longitude: position.coords.longitude
293
302
  };
294
303
  setUserLocation(userLocObj);
295
- sessionStorage.setItem(SESSION_ITEM_USER_LOCATION, JSON.stringify(userLocObj));
304
+ sessionStorage.setItem(_constants.SESSION_ITEM_USER_LOCATION, JSON.stringify(userLocObj));
296
305
  }
297
306
  });
298
307
  };
299
308
  };
300
-
301
309
  var toggleDropdown = function toggleDropdown(_ref4) {
302
310
  var setOpenDropdown = _ref4.setOpenDropdown,
303
- openDropdown = _ref4.openDropdown;
311
+ openDropdown = _ref4.openDropdown;
304
312
  return function (dropdownSlug) {
305
313
  return function () {
306
314
  return setOpenDropdown(dropdownSlug === openDropdown ? false : dropdownSlug);
307
315
  };
308
316
  };
309
317
  };
310
-
311
318
  var hasTechBarDisplayRole = function hasTechBarDisplayRole(_ref5) {
312
319
  var profile = _ref5.profile;
313
320
  return function (techBarName) {
314
- return Utils.isMemberOf(profile, "Role::Tech Bar Display::".concat(techBarName));
321
+ return _bundleCommon.Utils.isMemberOf(profile, "Role::Tech Bar Display::".concat(techBarName));
315
322
  };
316
323
  };
317
-
318
- export var Home = compose(withState('userLocation', 'setUserLocation', function () {
324
+ var Home = (0, _recompose.compose)((0, _recompose.withState)('userLocation', 'setUserLocation', function () {
319
325
  try {
320
- var locObj = JSON.parse(sessionStorage.getItem(SESSION_ITEM_USER_LOCATION));
321
-
326
+ var locObj = JSON.parse(sessionStorage.getItem(_constants.SESSION_ITEM_USER_LOCATION));
322
327
  if (locObj && locObj.latitude != null && locObj.longitude != null) {
323
328
  return locObj;
324
329
  }
325
330
  } catch (e) {}
326
-
327
331
  return null;
328
- }), connect(mapStateToProps, mapDispatchToProps), withState('currentTechBar', 'setCurrentTechBar', function (_ref6) {
332
+ }), (0, _store.connect)(mapStateToProps, mapDispatchToProps), (0, _recompose.withState)('currentTechBar', 'setCurrentTechBar', function (_ref6) {
329
333
  var techBars = _ref6.techBars;
330
- var techBarId = sessionStorage.getItem(SESSION_ITEM_CURRENT_TECH_BAR);
334
+ var techBarId = sessionStorage.getItem(_constants.SESSION_ITEM_CURRENT_TECH_BAR);
331
335
  return techBarId ? techBars.find(function (t) {
332
336
  return t.id === techBarId;
333
337
  }) : null;
334
- }), withState('modalOpen', 'setModalOpen', false), withState('openDropdown', 'setOpenDropdown', false), withHandlers({
338
+ }), (0, _recompose.withState)('modalOpen', 'setModalOpen', false), (0, _recompose.withState)('openDropdown', 'setOpenDropdown', false), (0, _recompose.withHandlers)({
335
339
  selectCurrentTechBar: selectCurrentTechBar,
336
340
  getUserLocation: getUserLocation,
337
341
  toggleDropdown: toggleDropdown,
338
342
  hasTechBarDisplayRole: hasTechBarDisplayRole
339
- }), lifecycle({
343
+ }), (0, _recompose.lifecycle)({
340
344
  componentDidMount: function componentDidMount() {
341
345
  // If not loading, fetch upcoming appointments
342
- this.props.fetchUpcomingAppointmentsRequest(); // Ask for user location if enabled and not already saved
343
-
346
+ this.props.fetchUpcomingAppointmentsRequest();
347
+ // Ask for user location if enabled and not already saved
344
348
  if (this.props.useLocationServices && this.props.userLocation === null) {
345
349
  this.props.getUserLocation();
346
- } // Fetch count of checked in customers at the current techbar
347
-
348
-
350
+ }
351
+ // Fetch count of checked in customers at the current techbar
349
352
  if (this.props.techBars.size > 0) {
350
353
  var selectedTechBar = this.props.currentTechBar || this.props.techBars.get(0);
351
354
  this.props.fetchAppointmentsOverviewRequest({
@@ -367,4 +370,5 @@ export var Home = compose(withState('userLocation', 'setUserLocation', function
367
370
  });
368
371
  }
369
372
  }
370
- }))(HomeComponent);
373
+ }))(HomeComponent);
374
+ exports.Home = Home;