@plusscommunities/pluss-circles-web-groups 1.5.5 → 1.5.7-beta.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.
- package/dist/index.cjs.js +151 -117
- package/dist/index.esm.js +151 -117
- package/dist/index.umd.js +151 -117
- package/package.json +2 -2
- package/src/screens/AddCircle.js +537 -478
- package/src/screens/Circle.js +843 -751
- package/src/screens/Circles.js +469 -376
package/dist/index.umd.js
CHANGED
|
@@ -44,30 +44,30 @@
|
|
|
44
44
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
45
45
|
|
|
46
46
|
var values = {
|
|
47
|
-
featureKey: '
|
|
48
|
-
entityKey: '
|
|
49
|
-
entityName: '
|
|
50
|
-
serviceKey: '
|
|
51
|
-
permission: '
|
|
52
|
-
menuIcon: '
|
|
47
|
+
featureKey: 'circles',
|
|
48
|
+
entityKey: 'circle',
|
|
49
|
+
entityName: 'circle',
|
|
50
|
+
serviceKey: 'circles',
|
|
51
|
+
permission: 'circles',
|
|
52
|
+
menuIcon: 'circle-o',
|
|
53
53
|
isFontAwesome: true,
|
|
54
|
-
reducerKey: '
|
|
55
|
-
actionCircleKey: '
|
|
56
|
-
textFeatureTitle: '
|
|
57
|
-
textAddMenuTitle: '
|
|
58
|
-
textEmptyGroups: "You aren't in any
|
|
54
|
+
reducerKey: 'circles',
|
|
55
|
+
actionCircleKey: 'CIRCLE',
|
|
56
|
+
textFeatureTitle: 'Circles',
|
|
57
|
+
textAddMenuTitle: 'Circle',
|
|
58
|
+
textEmptyGroups: "You aren't in any Circles",
|
|
59
59
|
textEmptyPeople: 'Contacts will show here',
|
|
60
|
-
componentCircles: '
|
|
61
|
-
componentAddCircle: '
|
|
62
|
-
componentCircle: '
|
|
63
|
-
inviteKey: '
|
|
64
|
-
messageKey: '
|
|
65
|
-
chatRoute: '
|
|
66
|
-
updateKeyUserCircles: '
|
|
67
|
-
allowPublicKey: '
|
|
68
|
-
allowPublicKeyDefault:
|
|
60
|
+
componentCircles: 'Circles',
|
|
61
|
+
componentAddCircle: 'AddCircle',
|
|
62
|
+
componentCircle: 'Circle',
|
|
63
|
+
inviteKey: 'circleInvite',
|
|
64
|
+
messageKey: 'circleMessage',
|
|
65
|
+
chatRoute: 'circleChat',
|
|
66
|
+
updateKeyUserCircles: 'userCircles',
|
|
67
|
+
allowPublicKey: 'circleAllowPublicCircles',
|
|
68
|
+
allowPublicKeyDefault: false,
|
|
69
69
|
settings: {
|
|
70
|
-
allowAnyCreate:
|
|
70
|
+
allowAnyCreate: false
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
|
|
399
399
|
case 3:
|
|
400
400
|
res = _context.sent;
|
|
401
|
-
console.log(
|
|
401
|
+
console.log("getData", res.data);
|
|
402
402
|
|
|
403
403
|
_this.props.circlesLoaded(res.data);
|
|
404
404
|
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
case 9:
|
|
413
413
|
_context.prev = 9;
|
|
414
414
|
_context.t0 = _context["catch"](0);
|
|
415
|
-
console.error(
|
|
415
|
+
console.error("getData", _context.t0);
|
|
416
416
|
|
|
417
417
|
_this.setState({
|
|
418
418
|
loadingAll: false
|
|
@@ -494,9 +494,15 @@
|
|
|
494
494
|
});
|
|
495
495
|
});
|
|
496
496
|
|
|
497
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "selectSort", function (sortType) {
|
|
498
|
+
_this.setState({
|
|
499
|
+
sortBy: sortType
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
|
|
497
503
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
498
504
|
var stateChange = {};
|
|
499
|
-
stateChange[event.target.getAttribute(
|
|
505
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
500
506
|
|
|
501
507
|
_this.setState(stateChange);
|
|
502
508
|
});
|
|
@@ -508,14 +514,14 @@
|
|
|
508
514
|
circleActions.delete(circle.Id).then(function (res) {
|
|
509
515
|
_this.getData();
|
|
510
516
|
}).catch(function (res) {
|
|
511
|
-
alert(
|
|
517
|
+
alert("Something went wrong with the request. Please try again.");
|
|
512
518
|
});
|
|
513
519
|
}
|
|
514
520
|
});
|
|
515
521
|
|
|
516
522
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getTypeFilterText", function (type) {
|
|
517
|
-
if (type ===
|
|
518
|
-
return
|
|
523
|
+
if (type === "private") {
|
|
524
|
+
return "Private Message";
|
|
519
525
|
}
|
|
520
526
|
|
|
521
527
|
return ___default['default'].capitalize(values.entityName);
|
|
@@ -525,14 +531,15 @@
|
|
|
525
531
|
if (circle.IsPrivate) {
|
|
526
532
|
return "PM: ".concat(circle.Audience.map(function (user) {
|
|
527
533
|
return user.displayName;
|
|
528
|
-
}).join(
|
|
534
|
+
}).join(", "));
|
|
529
535
|
}
|
|
530
536
|
|
|
531
537
|
return circle.Title;
|
|
532
538
|
});
|
|
533
539
|
|
|
534
540
|
_this.state = {
|
|
535
|
-
userSearch:
|
|
541
|
+
userSearch: "",
|
|
542
|
+
sortBy: "newest"
|
|
536
543
|
};
|
|
537
544
|
return _this;
|
|
538
545
|
}
|
|
@@ -551,7 +558,7 @@
|
|
|
551
558
|
|
|
552
559
|
if (this.state.selectedTypeFilter) {
|
|
553
560
|
result = ___default['default'].filter(result, function (circle) {
|
|
554
|
-
return _this2.state.selectedTypeFilter ===
|
|
561
|
+
return _this2.state.selectedTypeFilter === "circle" ? !circle.IsPrivate : circle.IsPrivate;
|
|
555
562
|
});
|
|
556
563
|
}
|
|
557
564
|
|
|
@@ -561,6 +568,15 @@
|
|
|
561
568
|
return user.userId === _this2.state.selectedUserFilter.userId;
|
|
562
569
|
});
|
|
563
570
|
});
|
|
571
|
+
} // Apply sorting
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
result = ___default['default'].sortBy(result, function (circle) {
|
|
575
|
+
return moment__default['default'](circle.Changed).valueOf();
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
if (this.state.sortBy === "newest") {
|
|
579
|
+
result.reverse();
|
|
564
580
|
}
|
|
565
581
|
|
|
566
582
|
return result;
|
|
@@ -578,10 +594,10 @@
|
|
|
578
594
|
});
|
|
579
595
|
users = ___default['default'].sortBy(___default['default'].uniqBy(users, function (user) {
|
|
580
596
|
return user.userId;
|
|
581
|
-
}),
|
|
597
|
+
}), "displayName");
|
|
582
598
|
return ___default['default'].filter(users, function (u) {
|
|
583
599
|
if (!___default['default'].isEmpty(_this3.state.userSearch)) {
|
|
584
|
-
return (u.displayName ||
|
|
600
|
+
return (u.displayName || "").toLowerCase().indexOf(_this3.state.userSearch.toLowerCase()) > -1;
|
|
585
601
|
}
|
|
586
602
|
|
|
587
603
|
return true;
|
|
@@ -615,7 +631,7 @@
|
|
|
615
631
|
className: "table-TitleColumn"
|
|
616
632
|
}, /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
|
|
617
633
|
to: "/".concat(values.featureKey, "/").concat(values.entityKey, "/").concat(circle.Id)
|
|
618
|
-
}, this.getTitle(circle))), /*#__PURE__*/React__default['default'].createElement("td", null, moment__default['default'](circle.Changed).local().format(
|
|
634
|
+
}, this.getTitle(circle))), /*#__PURE__*/React__default['default'].createElement("td", null, moment__default['default'](circle.Changed).local().format("D MMM YYYY")), /*#__PURE__*/React__default['default'].createElement("td", null, circle.Audience.map(function (user) {
|
|
619
635
|
return /*#__PURE__*/React__default['default'].createElement(Components$4.ProfilePic, {
|
|
620
636
|
size: 30,
|
|
621
637
|
image: user.profilePic,
|
|
@@ -626,8 +642,8 @@
|
|
|
626
642
|
className: "table-options"
|
|
627
643
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
628
644
|
style: {
|
|
629
|
-
display:
|
|
630
|
-
alignItems:
|
|
645
|
+
display: "flex",
|
|
646
|
+
alignItems: "center"
|
|
631
647
|
}
|
|
632
648
|
}, this.validateCircleAdmin(circle) && !circle.IsPrivate && /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
|
|
633
649
|
to: "/".concat(values.featureKey, "/edit/").concat(circle.Id)
|
|
@@ -636,7 +652,7 @@
|
|
|
636
652
|
fontSize: 20,
|
|
637
653
|
padding: 5,
|
|
638
654
|
marginLeft: 12,
|
|
639
|
-
cursor:
|
|
655
|
+
cursor: "pointer"
|
|
640
656
|
},
|
|
641
657
|
name: "pencil"
|
|
642
658
|
})), this.validateCircleAdmin(circle, true) && !circle.IsPrivate && /*#__PURE__*/React__default['default'].createElement("a", {
|
|
@@ -648,7 +664,7 @@
|
|
|
648
664
|
fontSize: 20,
|
|
649
665
|
padding: 5,
|
|
650
666
|
marginLeft: 12,
|
|
651
|
-
cursor:
|
|
667
|
+
cursor: "pointer"
|
|
652
668
|
},
|
|
653
669
|
name: "minus-circle"
|
|
654
670
|
})))));
|
|
@@ -656,6 +672,8 @@
|
|
|
656
672
|
}, {
|
|
657
673
|
key: "renderFilters",
|
|
658
674
|
value: function renderFilters() {
|
|
675
|
+
var _this6 = this;
|
|
676
|
+
|
|
659
677
|
var userFilter = /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
660
678
|
className: "marginRight-10",
|
|
661
679
|
onClick: this.openUserFilter,
|
|
@@ -695,12 +713,28 @@
|
|
|
695
713
|
}, /*#__PURE__*/React__default['default'].createElement(Components$4.Text, {
|
|
696
714
|
type: "h5",
|
|
697
715
|
className: "marginRight-20"
|
|
698
|
-
}, "Filter by"), userFilter, typeFilter
|
|
716
|
+
}, "Filter by"), userFilter, typeFilter, /*#__PURE__*/React__default['default'].createElement(Components$4.Text, {
|
|
717
|
+
type: "h5",
|
|
718
|
+
className: "marginRight-20 marginLeft-20"
|
|
719
|
+
}, "Sort by:"), /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
720
|
+
className: "marginRight-10",
|
|
721
|
+
onClick: function onClick() {
|
|
722
|
+
return _this6.selectSort("newest");
|
|
723
|
+
},
|
|
724
|
+
leftIcon: this.state.sortBy === "newest" ? "check" : null,
|
|
725
|
+
text: "Newest first"
|
|
726
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
727
|
+
onClick: function onClick() {
|
|
728
|
+
return _this6.selectSort("oldest");
|
|
729
|
+
},
|
|
730
|
+
leftIcon: this.state.sortBy === "oldest" ? "check" : null,
|
|
731
|
+
text: "Oldest first"
|
|
732
|
+
}));
|
|
699
733
|
}
|
|
700
734
|
}, {
|
|
701
735
|
key: "renderUserFilterPopup",
|
|
702
736
|
value: function renderUserFilterPopup() {
|
|
703
|
-
var
|
|
737
|
+
var _this7 = this;
|
|
704
738
|
|
|
705
739
|
if (!this.state.userFilterOpen) {
|
|
706
740
|
return null;
|
|
@@ -720,7 +754,7 @@
|
|
|
720
754
|
placeholder: "Enter name",
|
|
721
755
|
value: this.state.userSearch,
|
|
722
756
|
onChange: function onChange(e) {
|
|
723
|
-
return
|
|
757
|
+
return _this7.onHandleChange(e);
|
|
724
758
|
},
|
|
725
759
|
alwaysShowLabel: true
|
|
726
760
|
}), this.getUsers().map(function (user) {
|
|
@@ -728,7 +762,7 @@
|
|
|
728
762
|
key: user.userId,
|
|
729
763
|
user: user,
|
|
730
764
|
onClick: function onClick() {
|
|
731
|
-
|
|
765
|
+
_this7.selectUserFilter(user);
|
|
732
766
|
}
|
|
733
767
|
});
|
|
734
768
|
}));
|
|
@@ -736,7 +770,7 @@
|
|
|
736
770
|
}, {
|
|
737
771
|
key: "renderTypeFilterPopup",
|
|
738
772
|
value: function renderTypeFilterPopup() {
|
|
739
|
-
var
|
|
773
|
+
var _this8 = this;
|
|
740
774
|
|
|
741
775
|
if (!this.state.typeFilterOpen) {
|
|
742
776
|
return null;
|
|
@@ -750,13 +784,13 @@
|
|
|
750
784
|
onClose: this.closeTypeFilter
|
|
751
785
|
}, /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
752
786
|
onClick: function onClick() {
|
|
753
|
-
|
|
787
|
+
_this8.selectTypeFilter("circle");
|
|
754
788
|
},
|
|
755
789
|
text: ___default['default'].capitalize(values.entityName),
|
|
756
790
|
className: "marginRight-10"
|
|
757
791
|
}), /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
758
792
|
onClick: function onClick() {
|
|
759
|
-
|
|
793
|
+
_this8.selectTypeFilter("private");
|
|
760
794
|
},
|
|
761
795
|
text: "Private Message"
|
|
762
796
|
}));
|
|
@@ -764,7 +798,7 @@
|
|
|
764
798
|
}, {
|
|
765
799
|
key: "render",
|
|
766
800
|
value: function render() {
|
|
767
|
-
var
|
|
801
|
+
var _this9 = this;
|
|
768
802
|
|
|
769
803
|
return /*#__PURE__*/React__default['default'].createElement("div", null, this.renderTypeFilterPopup(), this.renderUserFilterPopup(), /*#__PURE__*/React__default['default'].createElement(Components$4.Header, null, this.canAddNew() && /*#__PURE__*/React__default['default'].createElement(Components$4.AddButton, {
|
|
770
804
|
onClick: this.onAddNew,
|
|
@@ -781,14 +815,14 @@
|
|
|
781
815
|
condensed: true,
|
|
782
816
|
hover: true,
|
|
783
817
|
style: {
|
|
784
|
-
minWidth:
|
|
818
|
+
minWidth: "100%"
|
|
785
819
|
}
|
|
786
820
|
}, /*#__PURE__*/React__default['default'].createElement("thead", null, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", null, "Title"), /*#__PURE__*/React__default['default'].createElement("th", null, "Last updated"), /*#__PURE__*/React__default['default'].createElement("th", null, "Members"), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
787
821
|
style: {
|
|
788
822
|
width: 50
|
|
789
823
|
}
|
|
790
824
|
}))), /*#__PURE__*/React__default['default'].createElement("tbody", null, this.getCircles().map(function (circle) {
|
|
791
|
-
return
|
|
825
|
+
return _this9.renderRow(circle);
|
|
792
826
|
})))));
|
|
793
827
|
}
|
|
794
828
|
}]);
|
|
@@ -850,7 +884,7 @@
|
|
|
850
884
|
if (res.data != null && !___default['default'].isEmpty(res.data.results.Items)) {
|
|
851
885
|
_this.setState({
|
|
852
886
|
users: ___default['default'].sortBy(res.data.results.Items, function (u) {
|
|
853
|
-
return (u.displayName ||
|
|
887
|
+
return (u.displayName || "").toLowerCase();
|
|
854
888
|
}).map(function (u) {
|
|
855
889
|
return _objectSpread$4(_objectSpread$4({}, u), {}, {
|
|
856
890
|
userId: u.userId || u.Id
|
|
@@ -874,7 +908,7 @@
|
|
|
874
908
|
}
|
|
875
909
|
|
|
876
910
|
if (!___default['default'].isEmpty(_this.state.userSearch)) {
|
|
877
|
-
return (u.displayName ||
|
|
911
|
+
return (u.displayName || "").toLowerCase().indexOf(_this.state.userSearch.toLowerCase()) > -1;
|
|
878
912
|
}
|
|
879
913
|
|
|
880
914
|
return true;
|
|
@@ -928,7 +962,7 @@
|
|
|
928
962
|
|
|
929
963
|
case 3:
|
|
930
964
|
res = _context.sent;
|
|
931
|
-
console.log(
|
|
965
|
+
console.log("getData", res.data);
|
|
932
966
|
circle = ___default['default'].find(res.data, function (c) {
|
|
933
967
|
return c.Id === _this.state.circleId;
|
|
934
968
|
});
|
|
@@ -948,7 +982,7 @@
|
|
|
948
982
|
case 11:
|
|
949
983
|
_context.prev = 11;
|
|
950
984
|
_context.t0 = _context["catch"](0);
|
|
951
|
-
console.error(
|
|
985
|
+
console.error("getData", _context.t0);
|
|
952
986
|
|
|
953
987
|
_this.setState({
|
|
954
988
|
loadingAll: false
|
|
@@ -965,7 +999,7 @@
|
|
|
965
999
|
|
|
966
1000
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
967
1001
|
var stateChange = {};
|
|
968
|
-
stateChange[event.target.getAttribute(
|
|
1002
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
969
1003
|
|
|
970
1004
|
_this.setState(stateChange);
|
|
971
1005
|
});
|
|
@@ -988,7 +1022,7 @@
|
|
|
988
1022
|
};
|
|
989
1023
|
|
|
990
1024
|
if (___default['default'].isEmpty(_this.state.title) && ___default['default'].includes(newState.selectedUsers, user)) {
|
|
991
|
-
newState.title = "".concat(user.displayName.split(
|
|
1025
|
+
newState.title = "".concat(user.displayName.split(" ")[0], "'s Circle");
|
|
992
1026
|
}
|
|
993
1027
|
|
|
994
1028
|
_this.setState(newState);
|
|
@@ -1029,17 +1063,17 @@
|
|
|
1029
1063
|
updating: false
|
|
1030
1064
|
});
|
|
1031
1065
|
|
|
1032
|
-
console.log(
|
|
1066
|
+
console.log("success");
|
|
1033
1067
|
|
|
1034
1068
|
_this.props.circleUpdated(res.data);
|
|
1035
1069
|
}).catch(function (err) {
|
|
1036
|
-
console.log(
|
|
1070
|
+
console.log("error");
|
|
1037
1071
|
|
|
1038
1072
|
_this.setState({
|
|
1039
1073
|
updating: false
|
|
1040
1074
|
});
|
|
1041
1075
|
|
|
1042
|
-
alert(
|
|
1076
|
+
alert("Something went wrong with the request. Please try again.");
|
|
1043
1077
|
});
|
|
1044
1078
|
} else {
|
|
1045
1079
|
circleActions.add(_this.props.auth.site, _this.state.title, _this.state.image, audience, _this.state.isPublic).then(function (res) {
|
|
@@ -1048,17 +1082,17 @@
|
|
|
1048
1082
|
updating: false
|
|
1049
1083
|
});
|
|
1050
1084
|
|
|
1051
|
-
console.log(
|
|
1085
|
+
console.log("success");
|
|
1052
1086
|
|
|
1053
1087
|
_this.props.circleUpdated(res.data);
|
|
1054
1088
|
}).catch(function (err) {
|
|
1055
|
-
console.log(
|
|
1089
|
+
console.log("error");
|
|
1056
1090
|
|
|
1057
1091
|
_this.setState({
|
|
1058
1092
|
updating: false
|
|
1059
1093
|
});
|
|
1060
1094
|
|
|
1061
|
-
alert(
|
|
1095
|
+
alert("Something went wrong with the request. Please try again.");
|
|
1062
1096
|
});
|
|
1063
1097
|
}
|
|
1064
1098
|
});
|
|
@@ -1079,20 +1113,20 @@
|
|
|
1079
1113
|
});
|
|
1080
1114
|
});
|
|
1081
1115
|
|
|
1082
|
-
var circleId = Helper$1.safeReadParams(props,
|
|
1116
|
+
var circleId = Helper$1.safeReadParams(props, "circleId");
|
|
1083
1117
|
_this.state = {
|
|
1084
1118
|
circleId: circleId,
|
|
1085
1119
|
circle: ___default['default'].find(props.circles, function (c) {
|
|
1086
1120
|
return c.Id === circleId;
|
|
1087
1121
|
}),
|
|
1088
|
-
title:
|
|
1122
|
+
title: "",
|
|
1089
1123
|
showWarnings: false,
|
|
1090
1124
|
success: false,
|
|
1091
1125
|
users: [],
|
|
1092
1126
|
selectedUsers: [],
|
|
1093
|
-
userSearch:
|
|
1127
|
+
userSearch: "",
|
|
1094
1128
|
isPublic: false,
|
|
1095
|
-
selectedOption:
|
|
1129
|
+
selectedOption: "visibility"
|
|
1096
1130
|
};
|
|
1097
1131
|
return _this;
|
|
1098
1132
|
}
|
|
@@ -1114,7 +1148,7 @@
|
|
|
1114
1148
|
this.setState({
|
|
1115
1149
|
image: url
|
|
1116
1150
|
});
|
|
1117
|
-
this.imageInput.
|
|
1151
|
+
this.imageInput.setValue(url);
|
|
1118
1152
|
} else {
|
|
1119
1153
|
setTimeout(function () {
|
|
1120
1154
|
_this2.checkSetImage(url);
|
|
@@ -1147,9 +1181,9 @@
|
|
|
1147
1181
|
value: function renderSuccess() {
|
|
1148
1182
|
if (!this.state.success) return null;
|
|
1149
1183
|
return /*#__PURE__*/React__default['default'].createElement(Components$3.SuccessPopup, {
|
|
1150
|
-
text: "".concat(___default['default'].capitalize(values.entityName), " has been ").concat(this.state.circleId == null ?
|
|
1184
|
+
text: "".concat(___default['default'].capitalize(values.entityName), " has been ").concat(this.state.circleId == null ? "added" : "edited"),
|
|
1151
1185
|
buttons: [{
|
|
1152
|
-
type:
|
|
1186
|
+
type: "outlined",
|
|
1153
1187
|
onClick: function onClick() {
|
|
1154
1188
|
window.history.back();
|
|
1155
1189
|
},
|
|
@@ -1196,7 +1230,7 @@
|
|
|
1196
1230
|
label: "Do you want to make this ".concat(values.entityName, " a public ").concat(values.entityName, "?"),
|
|
1197
1231
|
isActive: this.state.isPublic,
|
|
1198
1232
|
options: [{
|
|
1199
|
-
Label:
|
|
1233
|
+
Label: "Yes",
|
|
1200
1234
|
Value: true,
|
|
1201
1235
|
onChange: function onChange() {
|
|
1202
1236
|
return _this5.setState({
|
|
@@ -1204,7 +1238,7 @@
|
|
|
1204
1238
|
});
|
|
1205
1239
|
}
|
|
1206
1240
|
}, {
|
|
1207
|
-
Label:
|
|
1241
|
+
Label: "No",
|
|
1208
1242
|
Value: false,
|
|
1209
1243
|
onChange: function onChange() {
|
|
1210
1244
|
return _this5.setState({
|
|
@@ -1224,7 +1258,7 @@
|
|
|
1224
1258
|
value: function renderSelectedOption() {
|
|
1225
1259
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1226
1260
|
style: {
|
|
1227
|
-
display: this.state.selectedOption ===
|
|
1261
|
+
display: this.state.selectedOption === "visibility" ? "block" : "none"
|
|
1228
1262
|
}
|
|
1229
1263
|
}, this.renderVisibility()));
|
|
1230
1264
|
}
|
|
@@ -1232,14 +1266,14 @@
|
|
|
1232
1266
|
key: "renderOptionsSection",
|
|
1233
1267
|
value: function renderOptionsSection() {
|
|
1234
1268
|
var options = [{
|
|
1235
|
-
key:
|
|
1236
|
-
icon:
|
|
1237
|
-
text:
|
|
1269
|
+
key: "visibility",
|
|
1270
|
+
icon: "people3",
|
|
1271
|
+
text: "Visibility"
|
|
1238
1272
|
}];
|
|
1239
1273
|
|
|
1240
1274
|
if (!this.props.circleAllowPublicCircles) {
|
|
1241
1275
|
options = ___default['default'].filter(options, function (o) {
|
|
1242
|
-
return o.key !==
|
|
1276
|
+
return o.key !== "visibility";
|
|
1243
1277
|
});
|
|
1244
1278
|
}
|
|
1245
1279
|
|
|
@@ -1263,7 +1297,7 @@
|
|
|
1263
1297
|
}, /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
1264
1298
|
type: "formTitleLarge",
|
|
1265
1299
|
className: "marginBottom-24"
|
|
1266
|
-
}, this.state.circleId == null ?
|
|
1300
|
+
}, this.state.circleId == null ? "New" : "Edit", " ", ___default['default'].capitalize(values.entityName)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1267
1301
|
className: "flex flex-reverse"
|
|
1268
1302
|
}, /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
|
|
1269
1303
|
ref: function ref(_ref2) {
|
|
@@ -1447,7 +1481,7 @@
|
|
|
1447
1481
|
|
|
1448
1482
|
case 3:
|
|
1449
1483
|
res = _context.sent;
|
|
1450
|
-
console.log(
|
|
1484
|
+
console.log("getData", res.data);
|
|
1451
1485
|
circle = ___default['default'].find(res.data, function (c) {
|
|
1452
1486
|
return c.Id === _this.state.circleId;
|
|
1453
1487
|
});
|
|
@@ -1465,7 +1499,7 @@
|
|
|
1465
1499
|
case 10:
|
|
1466
1500
|
_context.prev = 10;
|
|
1467
1501
|
_context.t0 = _context["catch"](0);
|
|
1468
|
-
console.error(
|
|
1502
|
+
console.error("getData", _context.t0);
|
|
1469
1503
|
|
|
1470
1504
|
_this.setState({
|
|
1471
1505
|
loadingAll: false
|
|
@@ -1497,8 +1531,8 @@
|
|
|
1497
1531
|
while (1) {
|
|
1498
1532
|
switch (_context2.prev = _context2.next) {
|
|
1499
1533
|
case 0:
|
|
1500
|
-
startOf = moment__default['default'](date,
|
|
1501
|
-
endOf = moment__default['default'](date,
|
|
1534
|
+
startOf = moment__default['default'](date, "YYYY-MM-DD").startOf("d");
|
|
1535
|
+
endOf = moment__default['default'](date, "YYYY-MM-DD").endOf("d");
|
|
1502
1536
|
_context2.next = 4;
|
|
1503
1537
|
return circleActions.getMessages(_this.state.circleId, 10000, startOf.valueOf(), endOf.valueOf());
|
|
1504
1538
|
|
|
@@ -1552,13 +1586,13 @@
|
|
|
1552
1586
|
var circle = _this.state.circle;
|
|
1553
1587
|
|
|
1554
1588
|
if (!circle) {
|
|
1555
|
-
return
|
|
1589
|
+
return "";
|
|
1556
1590
|
}
|
|
1557
1591
|
|
|
1558
1592
|
if (circle.IsPrivate) {
|
|
1559
1593
|
return "PM: ".concat(circle.Audience.map(function (user) {
|
|
1560
1594
|
return user.displayName;
|
|
1561
|
-
}).join(
|
|
1595
|
+
}).join(", "));
|
|
1562
1596
|
}
|
|
1563
1597
|
|
|
1564
1598
|
return circle.Title;
|
|
@@ -1566,13 +1600,13 @@
|
|
|
1566
1600
|
|
|
1567
1601
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
1568
1602
|
var stateChange = {};
|
|
1569
|
-
stateChange[event.target.getAttribute(
|
|
1603
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
1570
1604
|
|
|
1571
1605
|
_this.setState(stateChange);
|
|
1572
1606
|
});
|
|
1573
1607
|
|
|
1574
1608
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onImageUpdated", function (image) {
|
|
1575
|
-
console.log(
|
|
1609
|
+
console.log("updated image");
|
|
1576
1610
|
console.log(image);
|
|
1577
1611
|
|
|
1578
1612
|
_this.setState({
|
|
@@ -1588,7 +1622,7 @@
|
|
|
1588
1622
|
});
|
|
1589
1623
|
|
|
1590
1624
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onFileUpdated", function (url) {
|
|
1591
|
-
console.log(
|
|
1625
|
+
console.log("updated url");
|
|
1592
1626
|
console.log(url);
|
|
1593
1627
|
|
|
1594
1628
|
_this.setState({
|
|
@@ -1609,7 +1643,7 @@
|
|
|
1609
1643
|
});
|
|
1610
1644
|
|
|
1611
1645
|
if (m) {
|
|
1612
|
-
var input = document.getElementById(
|
|
1646
|
+
var input = document.getElementById("messageInput");
|
|
1613
1647
|
if (input) input.focus();
|
|
1614
1648
|
}
|
|
1615
1649
|
});
|
|
@@ -1617,7 +1651,7 @@
|
|
|
1617
1651
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "handleMessageDateChange", function (date) {
|
|
1618
1652
|
_this.setState({
|
|
1619
1653
|
messageDate: date,
|
|
1620
|
-
messageDateText: moment__default['default'](date,
|
|
1654
|
+
messageDateText: moment__default['default'](date, "YYYY-MM-DD").format("DD/MM/YYYY"),
|
|
1621
1655
|
showMessageDate: false,
|
|
1622
1656
|
messages: []
|
|
1623
1657
|
});
|
|
@@ -1655,7 +1689,7 @@
|
|
|
1655
1689
|
});
|
|
1656
1690
|
|
|
1657
1691
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onKeyDown", function (event) {
|
|
1658
|
-
if (event.key ===
|
|
1692
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
1659
1693
|
event.preventDefault();
|
|
1660
1694
|
|
|
1661
1695
|
_this.sendMessage();
|
|
@@ -1690,7 +1724,7 @@
|
|
|
1690
1724
|
if (m._id === messageToDelete._id) {
|
|
1691
1725
|
return _objectSpread$3(_objectSpread$3({}, m), {}, {
|
|
1692
1726
|
deleted: true,
|
|
1693
|
-
text:
|
|
1727
|
+
text: " "
|
|
1694
1728
|
});
|
|
1695
1729
|
}
|
|
1696
1730
|
|
|
@@ -1720,7 +1754,7 @@
|
|
|
1720
1754
|
case 11:
|
|
1721
1755
|
_context4.prev = 11;
|
|
1722
1756
|
_context4.t0 = _context4["catch"](5);
|
|
1723
|
-
console.error(
|
|
1757
|
+
console.error("Failed to delete message:", _context4.t0); // Revert the optimistic update on failure
|
|
1724
1758
|
|
|
1725
1759
|
revertedMessages = _this.state.messages.map(function (m) {
|
|
1726
1760
|
if (m._id === messageToDelete._id) {
|
|
@@ -1735,7 +1769,7 @@
|
|
|
1735
1769
|
deletingMessageId: null
|
|
1736
1770
|
});
|
|
1737
1771
|
|
|
1738
|
-
alert(
|
|
1772
|
+
alert("Failed to delete message. Please try again.");
|
|
1739
1773
|
|
|
1740
1774
|
case 17:
|
|
1741
1775
|
case "end":
|
|
@@ -1793,7 +1827,7 @@
|
|
|
1793
1827
|
|
|
1794
1828
|
_this.setState({
|
|
1795
1829
|
messages: [].concat(_toConsumableArray__default['default'](_this.state.messages), [clonedMessage]),
|
|
1796
|
-
messageInput:
|
|
1830
|
+
messageInput: "",
|
|
1797
1831
|
imageInput: null,
|
|
1798
1832
|
imageInputShowing: false,
|
|
1799
1833
|
fileInput: null,
|
|
@@ -1805,18 +1839,18 @@
|
|
|
1805
1839
|
|
|
1806
1840
|
_this.scrollToBottom();
|
|
1807
1841
|
|
|
1808
|
-
_this.imageInput && _this.imageInput.
|
|
1809
|
-
_this.fileInput && _this.fileInput.
|
|
1842
|
+
_this.imageInput && _this.imageInput.setValue(null);
|
|
1843
|
+
_this.fileInput && _this.fileInput.setValue(null);
|
|
1810
1844
|
}, 100);
|
|
1811
1845
|
});
|
|
1812
1846
|
|
|
1813
|
-
var circleId = Helper.safeReadParams(props,
|
|
1847
|
+
var circleId = Helper.safeReadParams(props, "circleId");
|
|
1814
1848
|
_this.state = {
|
|
1815
1849
|
circleId: circleId,
|
|
1816
1850
|
circle: ___default['default'].find(props.circles, function (c) {
|
|
1817
1851
|
return c.Id === circleId;
|
|
1818
1852
|
}),
|
|
1819
|
-
messageInput:
|
|
1853
|
+
messageInput: "",
|
|
1820
1854
|
messages: [],
|
|
1821
1855
|
images: [],
|
|
1822
1856
|
files: [],
|
|
@@ -1865,7 +1899,7 @@
|
|
|
1865
1899
|
value: function mergeMessages(receivedMessages, excludePending) {
|
|
1866
1900
|
var _this2 = this;
|
|
1867
1901
|
|
|
1868
|
-
var newMessages = ___default['default'].sortBy(___default['default'].concat(this.state.messages, receivedMessages),
|
|
1902
|
+
var newMessages = ___default['default'].sortBy(___default['default'].concat(this.state.messages, receivedMessages), "createdAt");
|
|
1869
1903
|
|
|
1870
1904
|
this.setState({
|
|
1871
1905
|
messages: ___default['default'].filter(___default['default'].uniqBy(newMessages, function (m) {
|
|
@@ -1959,17 +1993,17 @@
|
|
|
1959
1993
|
},
|
|
1960
1994
|
onKeyDown: this.onKeyDown
|
|
1961
1995
|
}), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
1962
|
-
className: "chat_imageIcon".concat(this.state.imageInputShowing ?
|
|
1996
|
+
className: "chat_imageIcon".concat(this.state.imageInputShowing ? " chat_imageIcon-selected" : ""),
|
|
1963
1997
|
name: "camera",
|
|
1964
1998
|
onClick: this.showImageInput
|
|
1965
1999
|
}), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
1966
|
-
className: "chat_imageIcon".concat(this.state.fileInputShowing ?
|
|
2000
|
+
className: "chat_imageIcon".concat(this.state.fileInputShowing ? " chat_imageIcon-selected" : ""),
|
|
1967
2001
|
name: "paperclip",
|
|
1968
2002
|
onClick: this.showFileInput
|
|
1969
2003
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1970
2004
|
className: "overflow-x",
|
|
1971
2005
|
style: {
|
|
1972
|
-
display: this.state.imageInputShowing ?
|
|
2006
|
+
display: this.state.imageInputShowing ? "block" : "none"
|
|
1973
2007
|
}
|
|
1974
2008
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.ImageInput, {
|
|
1975
2009
|
ref: function ref(_ref5) {
|
|
@@ -1984,7 +2018,7 @@
|
|
|
1984
2018
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1985
2019
|
className: "overflow-x",
|
|
1986
2020
|
style: {
|
|
1987
|
-
display: this.state.fileInputShowing ?
|
|
2021
|
+
display: this.state.fileInputShowing ? "block" : "none"
|
|
1988
2022
|
}
|
|
1989
2023
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.FileInput, {
|
|
1990
2024
|
ref: function ref(_ref6) {
|
|
@@ -2018,11 +2052,11 @@
|
|
|
2018
2052
|
var isDeleting = this.state.deletingMessageId === m._id;
|
|
2019
2053
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2020
2054
|
key: m._id,
|
|
2021
|
-
className: "message".concat(isSelf ?
|
|
2055
|
+
className: "message".concat(isSelf ? " message-self" : "").concat(m.uploading ? " message-uploading" : "").concat(isDeleting ? " message-deleting" : "")
|
|
2022
2056
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
|
|
2023
2057
|
type: "h5-noUpper",
|
|
2024
2058
|
className: "message_time"
|
|
2025
|
-
}, moment__default['default'].utc(m.createdAt).local().format(
|
|
2059
|
+
}, moment__default['default'].utc(m.createdAt).local().format("D MMM YYYY • h:mma")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2026
2060
|
className: "message_inner"
|
|
2027
2061
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.ProfilePic, {
|
|
2028
2062
|
size: 40,
|
|
@@ -2033,17 +2067,17 @@
|
|
|
2033
2067
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
|
|
2034
2068
|
type: "body",
|
|
2035
2069
|
className: "message_name"
|
|
2036
|
-
}, m.user.name, m.replyingTo && !isDeleted ? " replied to ".concat(m.replyingTo.user.name) :
|
|
2070
|
+
}, m.user.name, m.replyingTo && !isDeleted ? " replied to ".concat(m.replyingTo.user.name) : ""), m.replyingTo && !isDeleted && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2037
2071
|
className: "message_replyBubble"
|
|
2038
2072
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
|
|
2039
2073
|
type: "body",
|
|
2040
2074
|
className: "message_text"
|
|
2041
|
-
}, Helper.toParagraphed((m.replyingTo.text ||
|
|
2075
|
+
}, Helper.toParagraphed((m.replyingTo.text || "").substr(0, 100)))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2042
2076
|
className: "message_bubble"
|
|
2043
2077
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
|
|
2044
2078
|
type: "body",
|
|
2045
2079
|
className: "message_text"
|
|
2046
|
-
}, isDeleted ?
|
|
2080
|
+
}, isDeleted ? "[Message deleted]" : Helper.toParagraphed(m.text)), !isDeleted && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", null, (m.image || []).map(function (url, i) {
|
|
2047
2081
|
return /*#__PURE__*/React__default['default'].createElement("a", {
|
|
2048
2082
|
href: url,
|
|
2049
2083
|
target: "_blank",
|
|
@@ -2062,8 +2096,8 @@
|
|
|
2062
2096
|
})))), !isDeleted && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2063
2097
|
className: "message_reply",
|
|
2064
2098
|
style: {
|
|
2065
|
-
display:
|
|
2066
|
-
gap:
|
|
2099
|
+
display: "flex",
|
|
2100
|
+
gap: "16px"
|
|
2067
2101
|
}
|
|
2068
2102
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
|
|
2069
2103
|
type: "button",
|
|
@@ -2100,7 +2134,7 @@
|
|
|
2100
2134
|
value: function renderEmptyDate() {
|
|
2101
2135
|
return this.renderMessage({
|
|
2102
2136
|
system: true,
|
|
2103
|
-
text:
|
|
2137
|
+
text: "No messages on this date"
|
|
2104
2138
|
});
|
|
2105
2139
|
}
|
|
2106
2140
|
}, {
|
|
@@ -2115,7 +2149,7 @@
|
|
|
2115
2149
|
className: "chat_section_titleSection"
|
|
2116
2150
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2117
2151
|
className: "chat_section_titleSection_caret",
|
|
2118
|
-
name: "chevron-".concat(this.state.membersExpanded ?
|
|
2152
|
+
name: "chevron-".concat(this.state.membersExpanded ? "up" : "down"),
|
|
2119
2153
|
onClick: this.toggleMembers
|
|
2120
2154
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2121
2155
|
className: "flex-1"
|
|
@@ -2133,7 +2167,7 @@
|
|
|
2133
2167
|
className: "chat_section_titleSection"
|
|
2134
2168
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2135
2169
|
className: "chat_section_titleSection_caret",
|
|
2136
|
-
name: "chevron-".concat(this.state.imagesExpanded ?
|
|
2170
|
+
name: "chevron-".concat(this.state.imagesExpanded ? "up" : "down"),
|
|
2137
2171
|
onClick: this.toggleImages
|
|
2138
2172
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2139
2173
|
className: "flex-1"
|
|
@@ -2156,7 +2190,7 @@
|
|
|
2156
2190
|
className: "chat_section_titleSection"
|
|
2157
2191
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2158
2192
|
className: "chat_section_titleSection_caret",
|
|
2159
|
-
name: "chevron-".concat(this.state.filesExpanded ?
|
|
2193
|
+
name: "chevron-".concat(this.state.filesExpanded ? "up" : "down"),
|
|
2160
2194
|
onClick: this.toggleFiles
|
|
2161
2195
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2162
2196
|
className: "flex-1"
|
|
@@ -2187,7 +2221,7 @@
|
|
|
2187
2221
|
className: "chat_replyTo_container"
|
|
2188
2222
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
|
|
2189
2223
|
type: "h5"
|
|
2190
|
-
}, "Replying to ", m && m.user && !___default['default'].isEmpty(m.user.displayName) ? m.user.displayName :
|
|
2224
|
+
}, "Replying to", " ", m && m.user && !___default['default'].isEmpty(m.user.displayName) ? m.user.displayName : ""), m && !___default['default'].isEmpty(m.text) && /*#__PURE__*/React__default['default'].createElement(Components$2.Text, {
|
|
2191
2225
|
type: "body"
|
|
2192
2226
|
}, m.text.substr(0, 50))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2193
2227
|
className: "chat_replyTo_remove"
|
|
@@ -2207,14 +2241,14 @@
|
|
|
2207
2241
|
return /*#__PURE__*/React__default['default'].createElement(Components$2.Popup, {
|
|
2208
2242
|
title: "Delete Message",
|
|
2209
2243
|
buttons: [{
|
|
2210
|
-
text:
|
|
2244
|
+
text: "Delete",
|
|
2211
2245
|
onClick: this.onConfirmDelete,
|
|
2212
|
-
type:
|
|
2246
|
+
type: "primary",
|
|
2213
2247
|
isActive: true
|
|
2214
2248
|
}, {
|
|
2215
|
-
text:
|
|
2249
|
+
text: "Cancel",
|
|
2216
2250
|
onClick: this.onCancelDelete,
|
|
2217
|
-
type:
|
|
2251
|
+
type: "tertiary",
|
|
2218
2252
|
isActive: true
|
|
2219
2253
|
}],
|
|
2220
2254
|
onClose: this.onCancelDelete,
|
|
@@ -2231,8 +2265,8 @@
|
|
|
2231
2265
|
return /*#__PURE__*/React__default['default'].createElement(Components$2.OverlayPage, {
|
|
2232
2266
|
fullPage: true,
|
|
2233
2267
|
fullPageStyle: {
|
|
2234
|
-
display:
|
|
2235
|
-
flexDirection:
|
|
2268
|
+
display: "flex",
|
|
2269
|
+
flexDirection: "column"
|
|
2236
2270
|
}
|
|
2237
2271
|
}, this.renderDeleteConfirmPopup(), /*#__PURE__*/React__default['default'].createElement(Components$2.Header, {
|
|
2238
2272
|
rightContent: this.renderHeaderRight()
|