@plusscommunities/pluss-circles-web-groups 1.0.17 → 1.0.19
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/dist/index.cjs.js +355 -91
- package/dist/index.esm.js +355 -93
- package/dist/index.umd.js +357 -95
- package/package.json +5 -2
- package/src/apis/index.js +6 -0
- package/src/components/AnalyticsHub.js +214 -0
- package/src/index.js +2 -0
- package/src/screens/AddCircle.js +2 -0
package/dist/index.esm.js
CHANGED
|
@@ -7,7 +7,7 @@ import _inherits from '@babel/runtime/helpers/inherits';
|
|
|
7
7
|
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
8
8
|
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
9
9
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
10
|
-
import React, { Component } from 'react';
|
|
10
|
+
import React, { Component, useState, useEffect } from 'react';
|
|
11
11
|
import { connect } from 'react-redux';
|
|
12
12
|
import _ from 'lodash';
|
|
13
13
|
import moment from 'moment';
|
|
@@ -17,6 +17,8 @@ import { Table } from 'react-bootstrap';
|
|
|
17
17
|
import FontAwesome from 'react-fontawesome';
|
|
18
18
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
19
19
|
import { withRouter } from 'react-router';
|
|
20
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
21
|
+
import { faUserGroup, faMessage, faUserTie, faUsers, faUsersRectangle, faPeopleArrows } from '@fortawesome/free-solid-svg-icons';
|
|
20
22
|
|
|
21
23
|
var values = {
|
|
22
24
|
featureKey: 'groups',
|
|
@@ -151,10 +153,10 @@ var circleRemoved = function circleRemoved(circleId) {
|
|
|
151
153
|
};
|
|
152
154
|
|
|
153
155
|
var Helper$3 = PlussCore.Helper,
|
|
154
|
-
Session$
|
|
156
|
+
Session$4 = PlussCore.Session;
|
|
155
157
|
var circleActions = {
|
|
156
158
|
getAll: function getAll(site) {
|
|
157
|
-
return Session$
|
|
159
|
+
return Session$4.authedFunction({
|
|
158
160
|
method: 'GET',
|
|
159
161
|
url: Helper$3.getUrl(values.serviceKey, 'get/all', {
|
|
160
162
|
site: site
|
|
@@ -162,7 +164,7 @@ var circleActions = {
|
|
|
162
164
|
});
|
|
163
165
|
},
|
|
164
166
|
getFiles: function getFiles(circleId) {
|
|
165
|
-
return Session$
|
|
167
|
+
return Session$4.authedFunction({
|
|
166
168
|
method: 'GET',
|
|
167
169
|
url: Helper$3.getUrl(values.serviceKey, 'get/files', {
|
|
168
170
|
circleId: circleId
|
|
@@ -170,7 +172,7 @@ var circleActions = {
|
|
|
170
172
|
});
|
|
171
173
|
},
|
|
172
174
|
getImages: function getImages(circleId) {
|
|
173
|
-
return Session$
|
|
175
|
+
return Session$4.authedFunction({
|
|
174
176
|
method: 'GET',
|
|
175
177
|
url: Helper$3.getUrl(values.serviceKey, 'get/images', {
|
|
176
178
|
circleId: circleId
|
|
@@ -178,7 +180,7 @@ var circleActions = {
|
|
|
178
180
|
});
|
|
179
181
|
},
|
|
180
182
|
add: function add(site, title, image, audience, isPublic) {
|
|
181
|
-
return Session$
|
|
183
|
+
return Session$4.authedFunction({
|
|
182
184
|
method: 'POST',
|
|
183
185
|
url: Helper$3.getUrl(values.serviceKey, 'update/add'),
|
|
184
186
|
data: {
|
|
@@ -191,7 +193,7 @@ var circleActions = {
|
|
|
191
193
|
});
|
|
192
194
|
},
|
|
193
195
|
edit: function edit(circleId, title, image, audience, isPublic) {
|
|
194
|
-
return Session$
|
|
196
|
+
return Session$4.authedFunction({
|
|
195
197
|
method: 'POST',
|
|
196
198
|
url: Helper$3.getUrl(values.serviceKey, 'update/edit'),
|
|
197
199
|
data: {
|
|
@@ -204,7 +206,7 @@ var circleActions = {
|
|
|
204
206
|
});
|
|
205
207
|
},
|
|
206
208
|
delete: function _delete(circleId) {
|
|
207
|
-
return Session$
|
|
209
|
+
return Session$4.authedFunction({
|
|
208
210
|
method: 'POST',
|
|
209
211
|
url: Helper$3.getUrl(values.serviceKey, 'update/delete'),
|
|
210
212
|
data: {
|
|
@@ -213,7 +215,7 @@ var circleActions = {
|
|
|
213
215
|
});
|
|
214
216
|
},
|
|
215
217
|
addAdmin: function addAdmin(circleId, userId) {
|
|
216
|
-
return Session$
|
|
218
|
+
return Session$4.authedFunction({
|
|
217
219
|
method: 'POST',
|
|
218
220
|
url: Helper$3.getUrl(values.serviceKey, 'update/addadmin'),
|
|
219
221
|
data: {
|
|
@@ -223,7 +225,7 @@ var circleActions = {
|
|
|
223
225
|
});
|
|
224
226
|
},
|
|
225
227
|
removeAdmin: function removeAdmin(circleId, userId) {
|
|
226
|
-
return Session$
|
|
228
|
+
return Session$4.authedFunction({
|
|
227
229
|
method: 'POST',
|
|
228
230
|
url: Helper$3.getUrl(values.serviceKey, 'update/removeadmin'),
|
|
229
231
|
data: {
|
|
@@ -255,7 +257,7 @@ var circleActions = {
|
|
|
255
257
|
query.limit = limit;
|
|
256
258
|
}
|
|
257
259
|
|
|
258
|
-
return _context.abrupt("return", Session$
|
|
260
|
+
return _context.abrupt("return", Session$4.authedFunction({
|
|
259
261
|
method: 'GET',
|
|
260
262
|
url: Helper$3.getUrl(values.serviceKey, 'getMessages', query)
|
|
261
263
|
}));
|
|
@@ -280,7 +282,7 @@ var circleActions = {
|
|
|
280
282
|
while (1) {
|
|
281
283
|
switch (_context2.prev = _context2.next) {
|
|
282
284
|
case 0:
|
|
283
|
-
return _context2.abrupt("return", Session$
|
|
285
|
+
return _context2.abrupt("return", Session$4.authedFunction({
|
|
284
286
|
method: 'post',
|
|
285
287
|
url: Helper$3.getUrl(values.serviceKey, 'sendMessage'),
|
|
286
288
|
data: {
|
|
@@ -305,11 +307,14 @@ var circleActions = {
|
|
|
305
307
|
}()
|
|
306
308
|
};
|
|
307
309
|
|
|
310
|
+
var Apis$1 = PlussCore.Apis;
|
|
311
|
+
var analyticsActions = Apis$1.analyticsActions;
|
|
312
|
+
|
|
308
313
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
309
314
|
|
|
310
315
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
311
|
-
var Components$
|
|
312
|
-
Session$
|
|
316
|
+
var Components$4 = PlussCore.Components,
|
|
317
|
+
Session$3 = PlussCore.Session,
|
|
313
318
|
Helper$2 = PlussCore.Helper;
|
|
314
319
|
|
|
315
320
|
var Circles = /*#__PURE__*/function (_Component) {
|
|
@@ -372,13 +377,13 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
372
377
|
|
|
373
378
|
_defineProperty(_assertThisInitialized(_this), "canAddNew", function () {
|
|
374
379
|
var auth = _this.props.auth;
|
|
375
|
-
return Session$
|
|
380
|
+
return Session$3.validateAccess(auth.site, values.permission, auth);
|
|
376
381
|
});
|
|
377
382
|
|
|
378
383
|
_defineProperty(_assertThisInitialized(_this), "onAddNew", function () {
|
|
379
384
|
var auth = _this.props.auth;
|
|
380
385
|
|
|
381
|
-
if (Session$
|
|
386
|
+
if (Session$3.validateAccess(auth.site, values.permission, auth)) {
|
|
382
387
|
_this.props.history.push("/".concat(values.featureKey, "/add"));
|
|
383
388
|
}
|
|
384
389
|
});
|
|
@@ -535,7 +540,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
535
540
|
value: function validateCircleAdmin(circle, onlyCreator) {
|
|
536
541
|
var _this4 = this;
|
|
537
542
|
|
|
538
|
-
if (Session$
|
|
543
|
+
if (Session$3.validateAccess(this.props.auth.site, values.permission, this.props.auth)) {
|
|
539
544
|
return true;
|
|
540
545
|
}
|
|
541
546
|
|
|
@@ -559,7 +564,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
559
564
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
560
565
|
to: "/".concat(values.featureKey, "/").concat(values.entityKey, "/").concat(circle.Id)
|
|
561
566
|
}, this.getTitle(circle))), /*#__PURE__*/React.createElement("td", null, moment(circle.Changed).local().format('D MMM YYYY')), /*#__PURE__*/React.createElement("td", null, circle.Audience.map(function (user) {
|
|
562
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
567
|
+
return /*#__PURE__*/React.createElement(Components$4.ProfilePic, {
|
|
563
568
|
size: 30,
|
|
564
569
|
image: user.profilePic,
|
|
565
570
|
hoverText: user.displayName,
|
|
@@ -599,24 +604,24 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
599
604
|
}, {
|
|
600
605
|
key: "renderFilters",
|
|
601
606
|
value: function renderFilters() {
|
|
602
|
-
var userFilter = /*#__PURE__*/React.createElement(Components$
|
|
607
|
+
var userFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
603
608
|
className: "marginRight-10",
|
|
604
609
|
onClick: this.openUserFilter,
|
|
605
610
|
text: "User"
|
|
606
611
|
});
|
|
607
|
-
var typeFilter = /*#__PURE__*/React.createElement(Components$
|
|
612
|
+
var typeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
608
613
|
className: "marginRight-10",
|
|
609
614
|
onClick: this.openTypeFilter,
|
|
610
615
|
text: "Type"
|
|
611
616
|
});
|
|
612
617
|
|
|
613
618
|
if (this.state.selectedUserFilter) {
|
|
614
|
-
userFilter = /*#__PURE__*/React.createElement(Components$
|
|
619
|
+
userFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
615
620
|
className: "marginRight-10",
|
|
616
621
|
onClick: this.openUserFilter,
|
|
617
622
|
rightIcon: "close",
|
|
618
623
|
rightClick: this.removeUserFilter
|
|
619
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
624
|
+
}, /*#__PURE__*/React.createElement(Components$4.UserListing, {
|
|
620
625
|
size: 15,
|
|
621
626
|
user: this.state.selectedUserFilter,
|
|
622
627
|
textClass: "tag_text"
|
|
@@ -624,7 +629,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
624
629
|
}
|
|
625
630
|
|
|
626
631
|
if (this.state.selectedTypeFilter) {
|
|
627
|
-
typeFilter = /*#__PURE__*/React.createElement(Components$
|
|
632
|
+
typeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
628
633
|
className: "marginRight-10",
|
|
629
634
|
onClick: this.openTypeFilter,
|
|
630
635
|
rightIcon: "close",
|
|
@@ -635,7 +640,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
635
640
|
|
|
636
641
|
return /*#__PURE__*/React.createElement("div", {
|
|
637
642
|
className: "flex flex-center marginTop-20"
|
|
638
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
643
|
+
}, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
639
644
|
type: "h5",
|
|
640
645
|
className: "marginRight-20"
|
|
641
646
|
}, "Filter by"), userFilter, typeFilter);
|
|
@@ -649,14 +654,14 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
649
654
|
return null;
|
|
650
655
|
}
|
|
651
656
|
|
|
652
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
657
|
+
return /*#__PURE__*/React.createElement(Components$4.Popup, {
|
|
653
658
|
title: "Select User",
|
|
654
659
|
maxWidth: 600,
|
|
655
660
|
minWidth: 400,
|
|
656
661
|
minHeight: 400,
|
|
657
662
|
hasPadding: true,
|
|
658
663
|
onClose: this.closeUserFilter
|
|
659
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
664
|
+
}, /*#__PURE__*/React.createElement(Components$4.GenericInput, {
|
|
660
665
|
id: "userSearch",
|
|
661
666
|
type: "text",
|
|
662
667
|
label: "Search",
|
|
@@ -667,7 +672,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
667
672
|
},
|
|
668
673
|
alwaysShowLabel: true
|
|
669
674
|
}), this.getUsers().map(function (user) {
|
|
670
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
675
|
+
return /*#__PURE__*/React.createElement(Components$4.UserListing, {
|
|
671
676
|
key: user.userId,
|
|
672
677
|
user: user,
|
|
673
678
|
onClick: function onClick() {
|
|
@@ -685,19 +690,19 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
685
690
|
return null;
|
|
686
691
|
}
|
|
687
692
|
|
|
688
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
693
|
+
return /*#__PURE__*/React.createElement(Components$4.Popup, {
|
|
689
694
|
title: "Select Type",
|
|
690
695
|
maxWidth: 600,
|
|
691
696
|
minWidth: 400,
|
|
692
697
|
hasPadding: true,
|
|
693
698
|
onClose: this.closeTypeFilter
|
|
694
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
699
|
+
}, /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
695
700
|
onClick: function onClick() {
|
|
696
701
|
_this7.selectTypeFilter('circle');
|
|
697
702
|
},
|
|
698
703
|
text: _.capitalize(values.entityName),
|
|
699
704
|
className: "marginRight-10"
|
|
700
|
-
}), /*#__PURE__*/React.createElement(Components$
|
|
705
|
+
}), /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
701
706
|
onClick: function onClick() {
|
|
702
707
|
_this7.selectTypeFilter('private');
|
|
703
708
|
},
|
|
@@ -709,12 +714,12 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
709
714
|
value: function render() {
|
|
710
715
|
var _this8 = this;
|
|
711
716
|
|
|
712
|
-
return /*#__PURE__*/React.createElement("div", null, this.renderTypeFilterPopup(), this.renderUserFilterPopup(), /*#__PURE__*/React.createElement(Components$
|
|
717
|
+
return /*#__PURE__*/React.createElement("div", null, this.renderTypeFilterPopup(), this.renderUserFilterPopup(), /*#__PURE__*/React.createElement(Components$4.Header, null, this.canAddNew() && /*#__PURE__*/React.createElement(Components$4.AddButton, {
|
|
713
718
|
onClick: this.onAddNew,
|
|
714
719
|
text: "NEW ".concat(_.upperCase(values.entityName))
|
|
715
720
|
})), /*#__PURE__*/React.createElement("div", {
|
|
716
721
|
className: "pageContainer paddingVertical-20 paddingHorizontal-40"
|
|
717
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
722
|
+
}, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
718
723
|
type: "h1",
|
|
719
724
|
className: ""
|
|
720
725
|
}, values.textFeatureTitle), this.renderFilters(), /*#__PURE__*/React.createElement(Table, {
|
|
@@ -741,7 +746,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
741
746
|
return Circles;
|
|
742
747
|
}(Component);
|
|
743
748
|
|
|
744
|
-
var mapStateToProps$
|
|
749
|
+
var mapStateToProps$3 = function mapStateToProps(state) {
|
|
745
750
|
var circles = state[values.reducerKey].circles;
|
|
746
751
|
var auth = state.auth;
|
|
747
752
|
return {
|
|
@@ -751,17 +756,21 @@ var mapStateToProps$2 = function mapStateToProps(state) {
|
|
|
751
756
|
};
|
|
752
757
|
};
|
|
753
758
|
|
|
754
|
-
var Circles$1 = connect(mapStateToProps$
|
|
759
|
+
var Circles$1 = connect(mapStateToProps$3, {
|
|
755
760
|
circlesLoaded: circlesLoaded,
|
|
756
761
|
circleRemoved: circleRemoved
|
|
757
762
|
})(Circles);
|
|
758
763
|
|
|
764
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
765
|
+
|
|
766
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
767
|
+
|
|
759
768
|
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
760
769
|
|
|
761
770
|
function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
762
771
|
var Actions$1 = PlussCore.Actions,
|
|
763
|
-
Components$
|
|
764
|
-
Session$
|
|
772
|
+
Components$3 = PlussCore.Components,
|
|
773
|
+
Session$2 = PlussCore.Session,
|
|
765
774
|
Apis = PlussCore.Apis,
|
|
766
775
|
Colours$2 = PlussCore.Colours,
|
|
767
776
|
Helper$1 = PlussCore.Helper;
|
|
@@ -792,6 +801,10 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
792
801
|
_this.setState({
|
|
793
802
|
users: _.sortBy(res.data.results.Items, function (u) {
|
|
794
803
|
return (u.displayName || '').toLowerCase();
|
|
804
|
+
}).map(function (u) {
|
|
805
|
+
return _objectSpread$3(_objectSpread$3({}, u), {}, {
|
|
806
|
+
userId: u.userId || u.Id
|
|
807
|
+
});
|
|
795
808
|
})
|
|
796
809
|
});
|
|
797
810
|
}
|
|
@@ -1037,7 +1050,7 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1037
1050
|
_createClass(AddCircle, [{
|
|
1038
1051
|
key: "componentDidMount",
|
|
1039
1052
|
value: function componentDidMount() {
|
|
1040
|
-
Session$
|
|
1053
|
+
Session$2.checkLoggedIn(this, this.props.auth);
|
|
1041
1054
|
this.props.addRecentlyCreated(values.entityKey);
|
|
1042
1055
|
this.getUsers();
|
|
1043
1056
|
this.checkGetCircle();
|
|
@@ -1083,7 +1096,7 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1083
1096
|
key: "renderSuccess",
|
|
1084
1097
|
value: function renderSuccess() {
|
|
1085
1098
|
if (!this.state.success) return null;
|
|
1086
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1099
|
+
return /*#__PURE__*/React.createElement(Components$3.SuccessPopup, {
|
|
1087
1100
|
text: "".concat(_.capitalize(values.entityName), " has been ").concat(this.state.circleId == null ? 'added' : 'edited'),
|
|
1088
1101
|
buttons: [{
|
|
1089
1102
|
type: 'outlined',
|
|
@@ -1100,12 +1113,12 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1100
1113
|
var _this4 = this;
|
|
1101
1114
|
|
|
1102
1115
|
if (this.state.updating) {
|
|
1103
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1116
|
+
return /*#__PURE__*/React.createElement(Components$3.Button, {
|
|
1104
1117
|
buttonType: "secondary"
|
|
1105
1118
|
}, "Saving...");
|
|
1106
1119
|
}
|
|
1107
1120
|
|
|
1108
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$
|
|
1121
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$3.Button, {
|
|
1109
1122
|
inline: true,
|
|
1110
1123
|
buttonType: "tertiary",
|
|
1111
1124
|
onClick: function onClick() {
|
|
@@ -1115,7 +1128,7 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1115
1128
|
style: {
|
|
1116
1129
|
marginRight: 16
|
|
1117
1130
|
}
|
|
1118
|
-
}, "Cancel"), /*#__PURE__*/React.createElement(Components$
|
|
1131
|
+
}, "Cancel"), /*#__PURE__*/React.createElement(Components$3.Button, {
|
|
1119
1132
|
inline: true,
|
|
1120
1133
|
buttonType: "primary",
|
|
1121
1134
|
onClick: this.onSave,
|
|
@@ -1129,7 +1142,7 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1129
1142
|
|
|
1130
1143
|
return /*#__PURE__*/React.createElement("div", {
|
|
1131
1144
|
className: "optionsContent_bottom"
|
|
1132
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1145
|
+
}, /*#__PURE__*/React.createElement(Components$3.RadioButton, {
|
|
1133
1146
|
label: "Do you want to make this ".concat(values.entityName, " a public ").concat(values.entityName, "?"),
|
|
1134
1147
|
isActive: this.state.isPublic,
|
|
1135
1148
|
options: [{
|
|
@@ -1184,7 +1197,7 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1184
1197
|
return null;
|
|
1185
1198
|
}
|
|
1186
1199
|
|
|
1187
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1200
|
+
return /*#__PURE__*/React.createElement(Components$3.OptionsSection, {
|
|
1188
1201
|
options: options,
|
|
1189
1202
|
selected: this.state.selectedOption,
|
|
1190
1203
|
selectOption: this.selectOption
|
|
@@ -1197,12 +1210,12 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1197
1210
|
|
|
1198
1211
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
1199
1212
|
className: "padding-60 paddingVertical-40 bottomDivideBorder"
|
|
1200
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1213
|
+
}, /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
1201
1214
|
type: "formTitleLarge",
|
|
1202
1215
|
className: "marginBottom-24"
|
|
1203
1216
|
}, this.state.circleId == null ? 'New' : 'Edit', " ", _.capitalize(values.entityName)), /*#__PURE__*/React.createElement("div", {
|
|
1204
1217
|
className: "flex flex-reverse"
|
|
1205
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1218
|
+
}, /*#__PURE__*/React.createElement(Components$3.ImageInput, {
|
|
1206
1219
|
ref: function ref(_ref2) {
|
|
1207
1220
|
_this6.imageInput = _ref2;
|
|
1208
1221
|
},
|
|
@@ -1214,7 +1227,7 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1214
1227
|
}
|
|
1215
1228
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1216
1229
|
className: "flex-1"
|
|
1217
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1230
|
+
}, /*#__PURE__*/React.createElement(Components$3.GenericInput, {
|
|
1218
1231
|
id: "title",
|
|
1219
1232
|
type: "text",
|
|
1220
1233
|
label: "Title",
|
|
@@ -1233,16 +1246,16 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1233
1246
|
}
|
|
1234
1247
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
1235
1248
|
className: "padding-60 paddingVertical-40 bottomDivideBorder"
|
|
1236
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1249
|
+
}, /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
1237
1250
|
type: "formTitleMedium"
|
|
1238
1251
|
}, "Members"), /*#__PURE__*/React.createElement("div", {
|
|
1239
1252
|
className: "flex marginTop-20"
|
|
1240
1253
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1241
1254
|
className: "flex-1"
|
|
1242
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1255
|
+
}, /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
1243
1256
|
type: "formTitleSmall",
|
|
1244
1257
|
className: "marginBottom-10"
|
|
1245
|
-
}, "Select Users"), /*#__PURE__*/React.createElement(Components$
|
|
1258
|
+
}, "Select Users"), /*#__PURE__*/React.createElement(Components$3.GenericInput, {
|
|
1246
1259
|
id: "userSearch",
|
|
1247
1260
|
type: "text",
|
|
1248
1261
|
label: "Search",
|
|
@@ -1253,7 +1266,7 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1253
1266
|
},
|
|
1254
1267
|
alwaysShowLabel: true
|
|
1255
1268
|
}), this.getShownUsers().map(function (user) {
|
|
1256
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1269
|
+
return /*#__PURE__*/React.createElement(Components$3.UserListing, {
|
|
1257
1270
|
key: user.userId,
|
|
1258
1271
|
user: user,
|
|
1259
1272
|
onClick: function onClick() {
|
|
@@ -1262,23 +1275,23 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1262
1275
|
});
|
|
1263
1276
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1264
1277
|
className: "flex-1"
|
|
1265
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1278
|
+
}, /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
1266
1279
|
type: "formTitleSmall",
|
|
1267
1280
|
className: "marginBottom-10"
|
|
1268
1281
|
}, "Selected"), this.state.selectedUsers.map(function (user) {
|
|
1269
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1282
|
+
return /*#__PURE__*/React.createElement(Components$3.UserListing, {
|
|
1270
1283
|
key: user.userId,
|
|
1271
1284
|
user: user,
|
|
1272
1285
|
rightContent: /*#__PURE__*/React.createElement("div", {
|
|
1273
1286
|
className: "flex flex-reverse flex-center"
|
|
1274
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1287
|
+
}, /*#__PURE__*/React.createElement(Components$3.SVGIcon, {
|
|
1275
1288
|
className: "removeIcon marginLeft-8",
|
|
1276
1289
|
icon: "close",
|
|
1277
1290
|
colour: Colours$2.COLOUR_DUSK,
|
|
1278
1291
|
onClick: function onClick() {
|
|
1279
1292
|
_this6.onSelectUser(user);
|
|
1280
1293
|
}
|
|
1281
|
-
}), /*#__PURE__*/React.createElement(Components$
|
|
1294
|
+
}), /*#__PURE__*/React.createElement(Components$3.StatusButton, {
|
|
1282
1295
|
isActive: user.isAdmin,
|
|
1283
1296
|
activate: function activate() {
|
|
1284
1297
|
_this6.addAdmin(user);
|
|
@@ -1298,18 +1311,18 @@ var AddCircle = /*#__PURE__*/function (_Component) {
|
|
|
1298
1311
|
key: "render",
|
|
1299
1312
|
value: function render() {
|
|
1300
1313
|
var success = this.state.success;
|
|
1301
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1314
|
+
return /*#__PURE__*/React.createElement(Components$3.OverlayPage, null, /*#__PURE__*/React.createElement(Components$3.OverlayPageContents, {
|
|
1302
1315
|
noBottomButtons: success
|
|
1303
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1316
|
+
}, /*#__PURE__*/React.createElement(Components$3.OverlayPageSection, {
|
|
1304
1317
|
className: "pageSectionWrapper--newPopup"
|
|
1305
|
-
}, /*#__PURE__*/React.createElement("div", null, this.renderSuccess(), !success && this.renderMain()))), /*#__PURE__*/React.createElement(Components$
|
|
1318
|
+
}, /*#__PURE__*/React.createElement("div", null, this.renderSuccess(), !success && this.renderMain()))), /*#__PURE__*/React.createElement(Components$3.OverlayPageBottomButtons, null, this.renderSubmit()));
|
|
1306
1319
|
}
|
|
1307
1320
|
}]);
|
|
1308
1321
|
|
|
1309
1322
|
return AddCircle;
|
|
1310
1323
|
}(Component);
|
|
1311
1324
|
|
|
1312
|
-
var mapStateToProps$
|
|
1325
|
+
var mapStateToProps$2 = function mapStateToProps(state) {
|
|
1313
1326
|
var circles = state[values.reducerKey].circles;
|
|
1314
1327
|
var auth = state.auth;
|
|
1315
1328
|
return {
|
|
@@ -1319,7 +1332,7 @@ var mapStateToProps$1 = function mapStateToProps(state) {
|
|
|
1319
1332
|
};
|
|
1320
1333
|
};
|
|
1321
1334
|
|
|
1322
|
-
var AddCircle$1 = connect(mapStateToProps$
|
|
1335
|
+
var AddCircle$1 = connect(mapStateToProps$2, {
|
|
1323
1336
|
circlesLoaded: circlesLoaded,
|
|
1324
1337
|
circleUpdated: circleUpdated,
|
|
1325
1338
|
addRecentlyCreated: Actions$1.addRecentlyCreated
|
|
@@ -1328,10 +1341,10 @@ var AddCircle$1 = connect(mapStateToProps$1, {
|
|
|
1328
1341
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1329
1342
|
|
|
1330
1343
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1331
|
-
var Components$
|
|
1344
|
+
var Components$2 = PlussCore.Components,
|
|
1332
1345
|
Helper = PlussCore.Helper,
|
|
1333
1346
|
Actions = PlussCore.Actions,
|
|
1334
|
-
Session = PlussCore.Session,
|
|
1347
|
+
Session$1 = PlussCore.Session,
|
|
1335
1348
|
Colours$1 = PlussCore.Colours;
|
|
1336
1349
|
|
|
1337
1350
|
var Circle = /*#__PURE__*/function (_Component) {
|
|
@@ -1752,7 +1765,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1752
1765
|
value: function validateCircleAdmin() {
|
|
1753
1766
|
var _this4 = this;
|
|
1754
1767
|
|
|
1755
|
-
if (Session.validateAccess(this.props.auth.site, values.permission, this.props.auth)) {
|
|
1768
|
+
if (Session$1.validateAccess(this.props.auth.site, values.permission, this.props.auth)) {
|
|
1756
1769
|
return true;
|
|
1757
1770
|
}
|
|
1758
1771
|
|
|
@@ -1766,7 +1779,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1766
1779
|
var _this5 = this;
|
|
1767
1780
|
|
|
1768
1781
|
if (!this.isMember()) {
|
|
1769
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1782
|
+
return /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1770
1783
|
type: "highlightedHelp",
|
|
1771
1784
|
className: "chat_noMessage"
|
|
1772
1785
|
}, "You can't send a message to this ", _.capitalize(values.entityName), " as you are not a member.");
|
|
@@ -1780,7 +1793,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1780
1793
|
onClick: this.sendMessage
|
|
1781
1794
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1782
1795
|
className: "chat_inputContainer"
|
|
1783
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1796
|
+
}, /*#__PURE__*/React.createElement(Components$2.GenericInput, {
|
|
1784
1797
|
id: "messageInput",
|
|
1785
1798
|
type: "textarea",
|
|
1786
1799
|
className: "chat_input",
|
|
@@ -1807,7 +1820,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1807
1820
|
style: {
|
|
1808
1821
|
display: this.state.imageInputShowing ? 'block' : 'none'
|
|
1809
1822
|
}
|
|
1810
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1823
|
+
}, /*#__PURE__*/React.createElement(Components$2.ImageInput, {
|
|
1811
1824
|
ref: function ref(_ref4) {
|
|
1812
1825
|
_this5.imageInput = _ref4;
|
|
1813
1826
|
},
|
|
@@ -1822,7 +1835,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1822
1835
|
style: {
|
|
1823
1836
|
display: this.state.fileInputShowing ? 'block' : 'none'
|
|
1824
1837
|
}
|
|
1825
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1838
|
+
}, /*#__PURE__*/React.createElement(Components$2.FileInput, {
|
|
1826
1839
|
ref: function ref(_ref5) {
|
|
1827
1840
|
_this5.fileInput = _ref5;
|
|
1828
1841
|
},
|
|
@@ -1843,7 +1856,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1843
1856
|
return /*#__PURE__*/React.createElement("div", {
|
|
1844
1857
|
key: m._id,
|
|
1845
1858
|
className: "message"
|
|
1846
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1859
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1847
1860
|
type: "h5",
|
|
1848
1861
|
className: "message_system"
|
|
1849
1862
|
}, m.text));
|
|
@@ -1853,28 +1866,28 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1853
1866
|
return /*#__PURE__*/React.createElement("div", {
|
|
1854
1867
|
key: m._id,
|
|
1855
1868
|
className: "message".concat(isSelf ? ' message-self' : '').concat(m.uploading ? ' message-uploading' : '')
|
|
1856
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1869
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1857
1870
|
type: "h5-noUpper",
|
|
1858
1871
|
className: "message_time"
|
|
1859
1872
|
}, moment.utc(m.createdAt).local().format('D MMM YYYY • h:mma')), /*#__PURE__*/React.createElement("div", {
|
|
1860
1873
|
className: "message_inner"
|
|
1861
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1874
|
+
}, /*#__PURE__*/React.createElement(Components$2.ProfilePic, {
|
|
1862
1875
|
size: 40,
|
|
1863
1876
|
image: m.user.avatar,
|
|
1864
1877
|
className: "message_profilePic"
|
|
1865
1878
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1866
1879
|
className: "message_bubbleContainer"
|
|
1867
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1880
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1868
1881
|
type: "body",
|
|
1869
1882
|
className: "message_name"
|
|
1870
1883
|
}, m.user.name, m.replyingTo ? " replied to ".concat(m.replyingTo.user.name) : ''), m.replyingTo && /*#__PURE__*/React.createElement("div", {
|
|
1871
1884
|
className: "message_replyBubble"
|
|
1872
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1885
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1873
1886
|
type: "body",
|
|
1874
1887
|
className: "message_text"
|
|
1875
1888
|
}, Helper.toParagraphed((m.replyingTo.text || '').substr(0, 100)))), /*#__PURE__*/React.createElement("div", {
|
|
1876
1889
|
className: "message_bubble"
|
|
1877
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1890
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1878
1891
|
type: "body",
|
|
1879
1892
|
className: "message_text"
|
|
1880
1893
|
}, Helper.toParagraphed(m.text)), /*#__PURE__*/React.createElement("div", null, (m.image || []).map(function (url, i) {
|
|
@@ -1888,14 +1901,14 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1888
1901
|
alt: Helper.getFileName(url)
|
|
1889
1902
|
}));
|
|
1890
1903
|
})), /*#__PURE__*/React.createElement("div", null, (m.attachments || []).map(function (url, i) {
|
|
1891
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1904
|
+
return /*#__PURE__*/React.createElement(Components$2.Attachment, {
|
|
1892
1905
|
source: url,
|
|
1893
1906
|
key: i,
|
|
1894
1907
|
white: isSelf
|
|
1895
1908
|
});
|
|
1896
1909
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
1897
1910
|
className: "message_reply"
|
|
1898
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1911
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1899
1912
|
type: "button",
|
|
1900
1913
|
onClick: function onClick() {
|
|
1901
1914
|
_this6.onReply(m);
|
|
@@ -1944,12 +1957,12 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1944
1957
|
onClick: this.toggleMembers
|
|
1945
1958
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1946
1959
|
className: "flex-1"
|
|
1947
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1960
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1948
1961
|
type: "formTitleMedium"
|
|
1949
1962
|
}, "Member", Helper.getPluralS(members.length), " (", members.length, ")"))), this.state.membersExpanded && /*#__PURE__*/React.createElement("div", {
|
|
1950
1963
|
className: "paddingTop-8"
|
|
1951
1964
|
}, members.map(function (user) {
|
|
1952
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
1965
|
+
return /*#__PURE__*/React.createElement(Components$2.UserListing, {
|
|
1953
1966
|
user: user
|
|
1954
1967
|
});
|
|
1955
1968
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -1962,7 +1975,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1962
1975
|
onClick: this.toggleImages
|
|
1963
1976
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1964
1977
|
className: "flex-1"
|
|
1965
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
1978
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1966
1979
|
type: "formTitleMedium"
|
|
1967
1980
|
}, "Image", Helper.getPluralS(this.state.images.length), " (", this.state.images.length, ")"))), this.state.imagesExpanded && /*#__PURE__*/React.createElement("div", {
|
|
1968
1981
|
className: "paddingTop-8"
|
|
@@ -1985,12 +1998,12 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1985
1998
|
onClick: this.toggleFiles
|
|
1986
1999
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1987
2000
|
className: "flex-1"
|
|
1988
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
2001
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
1989
2002
|
type: "formTitleMedium"
|
|
1990
2003
|
}, "File", Helper.getPluralS(this.state.files.length), " (", this.state.files.length, ")"))), this.state.filesExpanded && /*#__PURE__*/React.createElement("div", {
|
|
1991
2004
|
className: "paddingTop-8"
|
|
1992
2005
|
}, this.state.files.map(function (file, i) {
|
|
1993
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
2006
|
+
return /*#__PURE__*/React.createElement(Components$2.Attachment, {
|
|
1994
2007
|
source: file.Url,
|
|
1995
2008
|
key: i
|
|
1996
2009
|
});
|
|
@@ -2010,13 +2023,13 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
2010
2023
|
className: "chat_replyTo"
|
|
2011
2024
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2012
2025
|
className: "chat_replyTo_container"
|
|
2013
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
2026
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
2014
2027
|
type: "h5"
|
|
2015
|
-
}, "Replying to ", m && m.user && !_.isEmpty(m.user.displayName) ? m.user.displayName : ''), m && !_.isEmpty(m.text) && /*#__PURE__*/React.createElement(Components$
|
|
2028
|
+
}, "Replying to ", m && m.user && !_.isEmpty(m.user.displayName) ? m.user.displayName : ''), m && !_.isEmpty(m.text) && /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
2016
2029
|
type: "body"
|
|
2017
2030
|
}, m.text.substr(0, 50))), /*#__PURE__*/React.createElement("div", {
|
|
2018
2031
|
className: "chat_replyTo_remove"
|
|
2019
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
2032
|
+
}, /*#__PURE__*/React.createElement(Components$2.SVGIcon, {
|
|
2020
2033
|
className: "removeIcon",
|
|
2021
2034
|
icon: "close",
|
|
2022
2035
|
onClick: function onClick() {
|
|
@@ -2030,13 +2043,13 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
2030
2043
|
value: function render() {
|
|
2031
2044
|
var _this8 = this;
|
|
2032
2045
|
|
|
2033
|
-
return /*#__PURE__*/React.createElement(Components$
|
|
2046
|
+
return /*#__PURE__*/React.createElement(Components$2.OverlayPage, {
|
|
2034
2047
|
fullPage: true,
|
|
2035
2048
|
fullPageStyle: {
|
|
2036
2049
|
display: 'flex',
|
|
2037
2050
|
flexDirection: 'column'
|
|
2038
2051
|
}
|
|
2039
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
2052
|
+
}, /*#__PURE__*/React.createElement(Components$2.Header, {
|
|
2040
2053
|
rightContent: this.renderHeaderRight()
|
|
2041
2054
|
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
2042
2055
|
className: "header_back",
|
|
@@ -2044,21 +2057,21 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
2044
2057
|
onClick: function onClick() {
|
|
2045
2058
|
window.history.back();
|
|
2046
2059
|
}
|
|
2047
|
-
}), /*#__PURE__*/React.createElement(Components$
|
|
2060
|
+
}), /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
2048
2061
|
type: "formTitleLarge",
|
|
2049
2062
|
className: "header_title"
|
|
2050
2063
|
}, this.getTitle())), /*#__PURE__*/React.createElement("div", {
|
|
2051
2064
|
className: "flex flex-1 flex-reverse overflow-hidden"
|
|
2052
2065
|
}, this.renderSideBar(), /*#__PURE__*/React.createElement("div", {
|
|
2053
2066
|
className: "flex-1 flex flex-column overflow-hidden"
|
|
2054
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
2067
|
+
}, /*#__PURE__*/React.createElement(Components$2.Header, {
|
|
2055
2068
|
onlyContainer: true
|
|
2056
2069
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2057
2070
|
className: "flex flex-center flex-1 paddingHorizontal-16"
|
|
2058
|
-
}, /*#__PURE__*/React.createElement(Components$
|
|
2071
|
+
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
2059
2072
|
type: "h5",
|
|
2060
2073
|
className: "marginRight-20"
|
|
2061
|
-
}, "Filter by"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$
|
|
2074
|
+
}, "Filter by"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$2.GenericInput, {
|
|
2062
2075
|
id: "messageDate",
|
|
2063
2076
|
label: "Date",
|
|
2064
2077
|
alwaysShowLabel: true,
|
|
@@ -2069,13 +2082,13 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
2069
2082
|
showMessageDate: !_this8.state.showMessageDate
|
|
2070
2083
|
});
|
|
2071
2084
|
},
|
|
2072
|
-
rightContent: !_.isEmpty(this.state.messageDate) && /*#__PURE__*/React.createElement(Components$
|
|
2085
|
+
rightContent: !_.isEmpty(this.state.messageDate) && /*#__PURE__*/React.createElement(Components$2.SVGIcon, {
|
|
2073
2086
|
colour: Colours$1.COLOUR_DUSK_LIGHT,
|
|
2074
2087
|
icon: "close",
|
|
2075
2088
|
className: "timepicker_clear",
|
|
2076
2089
|
onClick: this.onClearDate
|
|
2077
2090
|
})
|
|
2078
|
-
}), this.state.showMessageDate && /*#__PURE__*/React.createElement(Components$
|
|
2091
|
+
}), this.state.showMessageDate && /*#__PURE__*/React.createElement(Components$2.DatePicker, {
|
|
2079
2092
|
hideTop: true,
|
|
2080
2093
|
selectedDate: this.state.messageDate,
|
|
2081
2094
|
selectDate: this.handleMessageDateChange
|
|
@@ -2097,7 +2110,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
2097
2110
|
return Circle;
|
|
2098
2111
|
}(Component);
|
|
2099
2112
|
|
|
2100
|
-
var mapStateToProps = function mapStateToProps(state) {
|
|
2113
|
+
var mapStateToProps$1 = function mapStateToProps(state) {
|
|
2101
2114
|
var circles = state[values.reducerKey].circles;
|
|
2102
2115
|
var auth = state.auth;
|
|
2103
2116
|
return {
|
|
@@ -2107,11 +2120,259 @@ var mapStateToProps = function mapStateToProps(state) {
|
|
|
2107
2120
|
};
|
|
2108
2121
|
};
|
|
2109
2122
|
|
|
2110
|
-
var Circle$1 = connect(mapStateToProps, {
|
|
2123
|
+
var Circle$1 = connect(mapStateToProps$1, {
|
|
2111
2124
|
circlesLoaded: circlesLoaded,
|
|
2112
2125
|
setNavData: Actions.setNavData
|
|
2113
2126
|
})(Circle);
|
|
2114
2127
|
|
|
2128
|
+
var Analytics$1 = PlussCore.Analytics,
|
|
2129
|
+
Session = PlussCore.Session,
|
|
2130
|
+
Components$1 = PlussCore.Components;
|
|
2131
|
+
|
|
2132
|
+
var getInitialState = function getInitialState() {
|
|
2133
|
+
return {
|
|
2134
|
+
isLoading: true,
|
|
2135
|
+
messages: 0,
|
|
2136
|
+
prevMessages: 0,
|
|
2137
|
+
staffMessages: 0,
|
|
2138
|
+
prevStaffMessages: 0,
|
|
2139
|
+
residentMessages: 0,
|
|
2140
|
+
prevResidentMessages: 0,
|
|
2141
|
+
groupMessages: 0,
|
|
2142
|
+
prevGroupMessages: 0,
|
|
2143
|
+
privateMessages: 0,
|
|
2144
|
+
prevPrivateMessages: 0,
|
|
2145
|
+
activeGroups: 0,
|
|
2146
|
+
prevActiveGroups: 0
|
|
2147
|
+
};
|
|
2148
|
+
}; // AnalyticsHub Component
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
2152
|
+
var startTime = _ref.startTime,
|
|
2153
|
+
endTime = _ref.endTime,
|
|
2154
|
+
auth = _ref.auth,
|
|
2155
|
+
prevText = _ref.prevText,
|
|
2156
|
+
dayCount = _ref.dayCount,
|
|
2157
|
+
strings = _ref.strings;
|
|
2158
|
+
|
|
2159
|
+
var _useState = useState(getInitialState()),
|
|
2160
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2161
|
+
analyticsData = _useState2[0],
|
|
2162
|
+
setAnalyticsData = _useState2[1];
|
|
2163
|
+
|
|
2164
|
+
var _useState3 = useState(false),
|
|
2165
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2166
|
+
isExportOpen = _useState4[0],
|
|
2167
|
+
setIsExportOpen = _useState4[1];
|
|
2168
|
+
|
|
2169
|
+
var hasAccess = Session.validateAccess(auth.site, values.permissionNewsletter, auth);
|
|
2170
|
+
|
|
2171
|
+
if (!hasAccess) {
|
|
2172
|
+
return null;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
var featureTitle = function (key) {
|
|
2176
|
+
if (!strings || !strings.sideNav || !strings.sideNav[key]) {
|
|
2177
|
+
return values.textFeatureTitle;
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
return strings.sideNav[key];
|
|
2181
|
+
}();
|
|
2182
|
+
|
|
2183
|
+
var exportColumns = [{
|
|
2184
|
+
label: 'Select All',
|
|
2185
|
+
key: ''
|
|
2186
|
+
}, {
|
|
2187
|
+
label: 'Start Date',
|
|
2188
|
+
key: 'startDate'
|
|
2189
|
+
}, {
|
|
2190
|
+
label: 'End Date',
|
|
2191
|
+
key: 'endDate'
|
|
2192
|
+
}, {
|
|
2193
|
+
label: 'Messages',
|
|
2194
|
+
key: 'messages'
|
|
2195
|
+
}, {
|
|
2196
|
+
label: 'Messages by Staff',
|
|
2197
|
+
key: 'staffMessages'
|
|
2198
|
+
}, {
|
|
2199
|
+
label: 'Messages by Primary Users',
|
|
2200
|
+
key: 'residentMessages'
|
|
2201
|
+
}, {
|
|
2202
|
+
label: 'Group Messages',
|
|
2203
|
+
key: 'groupMessages'
|
|
2204
|
+
}, {
|
|
2205
|
+
label: 'Private Messages',
|
|
2206
|
+
key: 'privateMessages'
|
|
2207
|
+
}, {
|
|
2208
|
+
label: 'Groups with Messages',
|
|
2209
|
+
key: 'activeGroups'
|
|
2210
|
+
}];
|
|
2211
|
+
useEffect(function () {
|
|
2212
|
+
getData();
|
|
2213
|
+
}, [startTime, endTime]);
|
|
2214
|
+
|
|
2215
|
+
var getData = /*#__PURE__*/function () {
|
|
2216
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
2217
|
+
var timeDifference, _yield$Promise$all, _yield$Promise$all2, currentStatsResponse, prevStatsResponse, data;
|
|
2218
|
+
|
|
2219
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2220
|
+
while (1) {
|
|
2221
|
+
switch (_context.prev = _context.next) {
|
|
2222
|
+
case 0:
|
|
2223
|
+
setAnalyticsData(getInitialState()); // Load analytics data here using startTime and endTime
|
|
2224
|
+
|
|
2225
|
+
timeDifference = endTime - startTime;
|
|
2226
|
+
_context.next = 4;
|
|
2227
|
+
return Promise.all([analyticsActions.getAggregateEntityStats(auth.site, values.entityKey, startTime, endTime, true), analyticsActions.getAggregateEntityStats(auth.site, values.entityKey, startTime - timeDifference, startTime, true)]);
|
|
2228
|
+
|
|
2229
|
+
case 4:
|
|
2230
|
+
_yield$Promise$all = _context.sent;
|
|
2231
|
+
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
2232
|
+
currentStatsResponse = _yield$Promise$all2[0];
|
|
2233
|
+
prevStatsResponse = _yield$Promise$all2[1];
|
|
2234
|
+
data = {
|
|
2235
|
+
messages: Analytics$1.countActivities(currentStatsResponse.data, 'Message', 'total'),
|
|
2236
|
+
prevMessages: Analytics$1.countActivities(prevStatsResponse.data, 'Message', 'total'),
|
|
2237
|
+
staffMessages: Analytics$1.countActivities(currentStatsResponse.data, 'StaffMessage', 'total'),
|
|
2238
|
+
prevStaffMessages: Analytics$1.countActivities(prevStatsResponse.data, 'StaffMessage', 'total'),
|
|
2239
|
+
residentMessages: Analytics$1.countActivities(currentStatsResponse.data, 'ResidentMessage', 'total'),
|
|
2240
|
+
prevResidentMessages: Analytics$1.countActivities(prevStatsResponse.data, 'ResidentMessage', 'total'),
|
|
2241
|
+
groupMessages: Analytics$1.countActivities(currentStatsResponse.data, 'GroupMessage', 'total'),
|
|
2242
|
+
prevGroupMessages: Analytics$1.countActivities(prevStatsResponse.data, 'GroupMessage', 'total'),
|
|
2243
|
+
privateMessages: Analytics$1.countActivities(currentStatsResponse.data, 'PrivateMessage', 'total'),
|
|
2244
|
+
prevPrivateMessages: Analytics$1.countActivities(prevStatsResponse.data, 'PrivateMessage', 'total'),
|
|
2245
|
+
activeGroups: Analytics$1.countActivities(currentStatsResponse.data, 'GroupMessage', 'unique'),
|
|
2246
|
+
prevActiveGroups: Analytics$1.countActivities(prevStatsResponse.data, 'GroupMessage', 'unique'),
|
|
2247
|
+
// uniquePageView: Analytics.countActivities(currentStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
2248
|
+
// prevUniquePageView: Analytics.countActivities(prevStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
2249
|
+
isLoading: false
|
|
2250
|
+
};
|
|
2251
|
+
setAnalyticsData(data);
|
|
2252
|
+
|
|
2253
|
+
case 10:
|
|
2254
|
+
case "end":
|
|
2255
|
+
return _context.stop();
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
}, _callee);
|
|
2259
|
+
}));
|
|
2260
|
+
|
|
2261
|
+
return function getData() {
|
|
2262
|
+
return _ref2.apply(this, arguments);
|
|
2263
|
+
};
|
|
2264
|
+
}();
|
|
2265
|
+
|
|
2266
|
+
var isReadyToOpenCSV = function isReadyToOpenCSV() {
|
|
2267
|
+
return !analyticsData.isLoading;
|
|
2268
|
+
};
|
|
2269
|
+
|
|
2270
|
+
var getExportSource = function getExportSource() {
|
|
2271
|
+
return [{
|
|
2272
|
+
startDate: moment(startTime + 1).format('D-MM-YYYY'),
|
|
2273
|
+
endDate: moment(endTime).format('D-MM-YYYY'),
|
|
2274
|
+
messages: analyticsData.messages,
|
|
2275
|
+
staffMessages: analyticsData.staffMessages,
|
|
2276
|
+
residentMessages: analyticsData.residentMessages,
|
|
2277
|
+
groupMessages: analyticsData.groupMessages,
|
|
2278
|
+
privateMessages: analyticsData.privateMessages,
|
|
2279
|
+
activeGroups: analyticsData.activeGroups
|
|
2280
|
+
}];
|
|
2281
|
+
};
|
|
2282
|
+
|
|
2283
|
+
var csvPopup = function csvPopup() {
|
|
2284
|
+
if (!isExportOpen) {
|
|
2285
|
+
return null;
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
var source = getExportSource();
|
|
2289
|
+
return /*#__PURE__*/React.createElement(Components$1.ExportCsvPopup, {
|
|
2290
|
+
onClose: function onClose() {
|
|
2291
|
+
setIsExportOpen(false);
|
|
2292
|
+
},
|
|
2293
|
+
columns: exportColumns,
|
|
2294
|
+
source: source,
|
|
2295
|
+
filename: "".concat(values.analyticsKey, "analytics_").concat(source[0].startDate, "_").concat(source[0].endDate, ".csv")
|
|
2296
|
+
});
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2300
|
+
className: "dashboardSection"
|
|
2301
|
+
}, csvPopup(), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$1.Text, {
|
|
2302
|
+
type: "h4",
|
|
2303
|
+
className: "inlineBlock marginRight-40"
|
|
2304
|
+
}, featureTitle), /*#__PURE__*/React.createElement(Components$1.Button, {
|
|
2305
|
+
inline: true,
|
|
2306
|
+
buttonType: "primaryAction",
|
|
2307
|
+
onClick: function onClick() {
|
|
2308
|
+
if (!isReadyToOpenCSV()) return;
|
|
2309
|
+
setIsExportOpen(true);
|
|
2310
|
+
},
|
|
2311
|
+
isActive: isReadyToOpenCSV(),
|
|
2312
|
+
leftIcon: "file-code-o"
|
|
2313
|
+
}, "Export CSV")), /*#__PURE__*/React.createElement("div", {
|
|
2314
|
+
className: "analyticsSection dashboardSection_content"
|
|
2315
|
+
}, /*#__PURE__*/React.createElement(Components$1.StatBox, {
|
|
2316
|
+
title: "Groups with Messages",
|
|
2317
|
+
icon: faUserGroup,
|
|
2318
|
+
value: analyticsData.activeGroups,
|
|
2319
|
+
previousValue: analyticsData.prevActiveGroups,
|
|
2320
|
+
prevText: prevText,
|
|
2321
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=GroupMessage&countType=unique&dayCount=").concat(dayCount),
|
|
2322
|
+
isLoading: analyticsData.isLoading
|
|
2323
|
+
}), /*#__PURE__*/React.createElement(Components$1.StatBox, {
|
|
2324
|
+
title: "Messages",
|
|
2325
|
+
icon: faMessage,
|
|
2326
|
+
value: analyticsData.messages,
|
|
2327
|
+
previousValue: analyticsData.prevMessages,
|
|
2328
|
+
prevText: prevText,
|
|
2329
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Message&countType=total&dayCount=").concat(dayCount),
|
|
2330
|
+
isLoading: analyticsData.isLoading
|
|
2331
|
+
}), /*#__PURE__*/React.createElement(Components$1.StatBox, {
|
|
2332
|
+
title: "Messages by Staff",
|
|
2333
|
+
icon: faUserTie,
|
|
2334
|
+
value: analyticsData.staffMessages,
|
|
2335
|
+
previousValue: analyticsData.prevStaffMessages,
|
|
2336
|
+
prevText: prevText,
|
|
2337
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=StaffMessage&countType=total&dayCount=").concat(dayCount),
|
|
2338
|
+
isLoading: analyticsData.isLoading
|
|
2339
|
+
}), /*#__PURE__*/React.createElement(Components$1.StatBox, {
|
|
2340
|
+
title: "Messages by Primary Users",
|
|
2341
|
+
icon: faUsers,
|
|
2342
|
+
value: analyticsData.residentMessages,
|
|
2343
|
+
previousValue: analyticsData.prevResidentMessages,
|
|
2344
|
+
prevText: prevText,
|
|
2345
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=ResidentMessage&countType=total&dayCount=").concat(dayCount),
|
|
2346
|
+
isLoading: analyticsData.isLoading
|
|
2347
|
+
}), /*#__PURE__*/React.createElement(Components$1.StatBox, {
|
|
2348
|
+
title: "Group Messages",
|
|
2349
|
+
icon: faUsersRectangle,
|
|
2350
|
+
value: analyticsData.groupMessages,
|
|
2351
|
+
previousValue: analyticsData.prevGroupMessages,
|
|
2352
|
+
prevText: prevText,
|
|
2353
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=GroupMessage&countType=total&dayCount=").concat(dayCount),
|
|
2354
|
+
isLoading: analyticsData.isLoading
|
|
2355
|
+
}), /*#__PURE__*/React.createElement(Components$1.StatBox, {
|
|
2356
|
+
title: "Private Messages",
|
|
2357
|
+
icon: faPeopleArrows,
|
|
2358
|
+
value: analyticsData.privateMessages,
|
|
2359
|
+
previousValue: analyticsData.prevPrivateMessages,
|
|
2360
|
+
prevText: prevText,
|
|
2361
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=PrivateMessage&countType=total&dayCount=").concat(dayCount),
|
|
2362
|
+
isLoading: analyticsData.isLoading
|
|
2363
|
+
})));
|
|
2364
|
+
};
|
|
2365
|
+
|
|
2366
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
2367
|
+
var auth = state.auth;
|
|
2368
|
+
return {
|
|
2369
|
+
auth: auth,
|
|
2370
|
+
strings: state.strings && state.strings.config || {}
|
|
2371
|
+
};
|
|
2372
|
+
};
|
|
2373
|
+
|
|
2374
|
+
var toExport = connect(mapStateToProps, {})(AnalyticsHub);
|
|
2375
|
+
|
|
2115
2376
|
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2116
2377
|
|
|
2117
2378
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -2416,5 +2677,6 @@ var FeaturePickerContent = (function () {
|
|
|
2416
2677
|
var _Screens;
|
|
2417
2678
|
var Reducers = _defineProperty({}, values.reducerKey, CircleReducer);
|
|
2418
2679
|
var Screens = (_Screens = {}, _defineProperty(_Screens, values.componentCircles, Circles$1), _defineProperty(_Screens, values.componentAddCircle, AddCircle$1), _defineProperty(_Screens, values.componentCircle, Circle$1), _Screens);
|
|
2680
|
+
var Analytics = [toExport];
|
|
2419
2681
|
|
|
2420
|
-
export { FeatureConfig as Config, FeaturePickerContent, PreviewFull, PreviewGrid, PreviewWidget, Reducers, Screens, ViewFull, ViewWidget };
|
|
2682
|
+
export { Analytics, FeatureConfig as Config, FeaturePickerContent, PreviewFull, PreviewGrid, PreviewWidget, Reducers, Screens, ViewFull, ViewWidget };
|