@plusscommunities/pluss-circles-web-groups 1.5.7-beta.0 → 1.5.7-beta.2
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 +209 -53
- package/dist/index.esm.js +209 -53
- package/dist/index.umd.js +209 -53
- package/package.json +1 -1
- package/src/apis/circleActions.js +10 -0
- package/src/screens/Circle.js +9 -0
- package/src/screens/Circles.js +92 -3
- package/src/screens/Circles.module.css +96 -0
package/dist/index.esm.js
CHANGED
|
@@ -21,30 +21,30 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
21
21
|
import { faUserGroup, faMessage, faUserTie, faUsers, faUsersRectangle, faPeopleArrows } from '@fortawesome/free-solid-svg-icons';
|
|
22
22
|
|
|
23
23
|
var values = {
|
|
24
|
-
featureKey: '
|
|
25
|
-
entityKey: '
|
|
26
|
-
entityName: '
|
|
27
|
-
serviceKey: '
|
|
28
|
-
permission: '
|
|
29
|
-
menuIcon: '
|
|
24
|
+
featureKey: 'groups',
|
|
25
|
+
entityKey: 'group',
|
|
26
|
+
entityName: 'group',
|
|
27
|
+
serviceKey: 'groups',
|
|
28
|
+
permission: 'groups',
|
|
29
|
+
menuIcon: 'comments',
|
|
30
30
|
isFontAwesome: true,
|
|
31
|
-
reducerKey: '
|
|
32
|
-
actionCircleKey: '
|
|
33
|
-
textFeatureTitle: '
|
|
34
|
-
textAddMenuTitle: '
|
|
35
|
-
textEmptyGroups: "You aren't in any
|
|
31
|
+
reducerKey: 'groups',
|
|
32
|
+
actionCircleKey: 'GROUP',
|
|
33
|
+
textFeatureTitle: 'Groups',
|
|
34
|
+
textAddMenuTitle: 'Group',
|
|
35
|
+
textEmptyGroups: "You aren't in any Groups",
|
|
36
36
|
textEmptyPeople: 'Contacts will show here',
|
|
37
|
-
componentCircles: '
|
|
38
|
-
componentAddCircle: '
|
|
39
|
-
componentCircle: '
|
|
40
|
-
inviteKey: '
|
|
41
|
-
messageKey: '
|
|
42
|
-
chatRoute: '
|
|
43
|
-
updateKeyUserCircles: '
|
|
44
|
-
allowPublicKey: '
|
|
45
|
-
allowPublicKeyDefault:
|
|
37
|
+
componentCircles: 'Groups',
|
|
38
|
+
componentAddCircle: 'AddGroup',
|
|
39
|
+
componentCircle: 'Group',
|
|
40
|
+
inviteKey: 'groupInvite',
|
|
41
|
+
messageKey: 'groupMessage',
|
|
42
|
+
chatRoute: 'groupChat',
|
|
43
|
+
updateKeyUserCircles: 'userGroups',
|
|
44
|
+
allowPublicKey: 'groupAllowPublicGroups',
|
|
45
|
+
allowPublicKeyDefault: true,
|
|
46
46
|
settings: {
|
|
47
|
-
allowAnyCreate:
|
|
47
|
+
allowAnyCreate: true
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
|
@@ -333,12 +333,46 @@ var circleActions = {
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
return deleteMessage;
|
|
336
|
+
}(),
|
|
337
|
+
markAsRead: function () {
|
|
338
|
+
var _markAsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(circleId, userId) {
|
|
339
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
340
|
+
while (1) {
|
|
341
|
+
switch (_context4.prev = _context4.next) {
|
|
342
|
+
case 0:
|
|
343
|
+
return _context4.abrupt("return", Session$4.authedFunction({
|
|
344
|
+
method: 'post',
|
|
345
|
+
url: Helper$3.getUrl('groups', 'resetunread'),
|
|
346
|
+
data: {
|
|
347
|
+
groupID: circleId,
|
|
348
|
+
userID: userId
|
|
349
|
+
}
|
|
350
|
+
}));
|
|
351
|
+
|
|
352
|
+
case 1:
|
|
353
|
+
case "end":
|
|
354
|
+
return _context4.stop();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}, _callee4);
|
|
358
|
+
}));
|
|
359
|
+
|
|
360
|
+
function markAsRead(_x9, _x10) {
|
|
361
|
+
return _markAsRead.apply(this, arguments);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
return markAsRead;
|
|
336
365
|
}()
|
|
337
366
|
};
|
|
338
367
|
|
|
339
368
|
var Apis$1 = PlussCore.Apis;
|
|
340
369
|
var analyticsActions = Apis$1.analyticsActions;
|
|
341
370
|
|
|
371
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
372
|
+
|
|
373
|
+
var css = "/* Badge styling for unread count */\n:root {\n --badge-bg-color: #597db4; /* COLOUR_BRANDING_OFF */\n}\n\n.badgeTag {\n font-size: 11px;\n font-weight: 400;\n padding: 3px 10px;\n background-color: var(--badge-bg-color) !important;\n color: #fff !important;\n border-radius: 999px !important;\n border: none !important;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n letter-spacing: 0.02em;\n}\n\n/* Unread filter info banner */\n.unreadFilterBanner {\n background-color: #f0f4f8;\n border-left: 3px solid var(--badge-bg-color);\n border-radius: 4px;\n padding: 12px 16px;\n margin-top: 16px;\n margin-bottom: 16px;\n display: flex;\n align-items: center;\n}\n\n.unreadFilterContent {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n}\n\n.unreadFilterIcon {\n font-size: 16px;\n color: var(--badge-bg-color);\n flex-shrink: 0;\n}\n\n.unreadFilterText {\n font-size: 14px;\n line-height: 1.5;\n color: #333333;\n}\n\n.unreadFilterButton {\n background: none;\n border: none;\n color: var(--badge-bg-color);\n font-size: 14px;\n font-weight: 500;\n text-decoration: underline;\n cursor: pointer;\n padding: 4px 8px;\n margin-left: 4px;\n min-height: 32px;\n min-width: 32px;\n transition: all 0.2s ease;\n}\n\n.unreadFilterButton:hover {\n background-color: rgba(89, 125, 180, 0.1);\n text-decoration: none;\n}\n\n.unreadFilterButton:focus {\n outline: 2px solid var(--badge-bg-color);\n outline-offset: 2px;\n border-radius: 2px;\n}\n\n/* Mobile responsiveness */\n@media (max-width: 768px) {\n .unreadFilterBanner {\n flex-direction: column;\n align-items: flex-start;\n padding: 12px;\n }\n\n .unreadFilterContent {\n flex-direction: column;\n align-items: flex-start;\n gap: 8px;\n }\n\n .unreadFilterText {\n font-size: 13px;\n }\n}\n\n";
|
|
374
|
+
n(css,{});
|
|
375
|
+
|
|
342
376
|
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); }; }
|
|
343
377
|
|
|
344
378
|
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; } }
|
|
@@ -404,6 +438,12 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
404
438
|
})));
|
|
405
439
|
});
|
|
406
440
|
|
|
441
|
+
_defineProperty(_assertThisInitialized(_this), "selectUnreadFilter", function (showUnreadOnly) {
|
|
442
|
+
_this.setState({
|
|
443
|
+
showUnreadOnly: showUnreadOnly
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
|
|
407
447
|
_defineProperty(_assertThisInitialized(_this), "canAddNew", function () {
|
|
408
448
|
var auth = _this.props.auth;
|
|
409
449
|
return Session$3.validateAccess(auth.site, values.permission, auth);
|
|
@@ -516,7 +556,9 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
516
556
|
|
|
517
557
|
_this.state = {
|
|
518
558
|
userSearch: "",
|
|
519
|
-
sortBy: "newest"
|
|
559
|
+
sortBy: "newest",
|
|
560
|
+
showUnreadOnly: false,
|
|
561
|
+
pollingInterval: null
|
|
520
562
|
};
|
|
521
563
|
return _this;
|
|
522
564
|
}
|
|
@@ -524,25 +566,60 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
524
566
|
_createClass(Circles, [{
|
|
525
567
|
key: "componentDidMount",
|
|
526
568
|
value: function componentDidMount() {
|
|
527
|
-
this
|
|
569
|
+
var _this2 = this;
|
|
570
|
+
|
|
571
|
+
this.getData(); // Poll for updates every 10 seconds
|
|
572
|
+
|
|
573
|
+
this.pollingInterval = setInterval(function () {
|
|
574
|
+
_this2.getData();
|
|
575
|
+
}, 10000);
|
|
576
|
+
}
|
|
577
|
+
}, {
|
|
578
|
+
key: "componentWillUnmount",
|
|
579
|
+
value: function componentWillUnmount() {
|
|
580
|
+
if (this.pollingInterval) {
|
|
581
|
+
clearInterval(this.pollingInterval);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}, {
|
|
585
|
+
key: "isCircleUnread",
|
|
586
|
+
value: function isCircleUnread(circle) {
|
|
587
|
+
var userId = this.props.user.Id;
|
|
588
|
+
|
|
589
|
+
if (!circle.Unread || !circle.Unread[userId]) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
return circle.Unread[userId] > 0;
|
|
594
|
+
}
|
|
595
|
+
}, {
|
|
596
|
+
key: "getUnreadCount",
|
|
597
|
+
value: function getUnreadCount(circle) {
|
|
598
|
+
var userId = this.props.user.Id;
|
|
599
|
+
|
|
600
|
+
if (!circle.Unread || !circle.Unread[userId]) {
|
|
601
|
+
return 0;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
return circle.Unread[userId];
|
|
528
605
|
}
|
|
529
606
|
}, {
|
|
530
607
|
key: "getCircles",
|
|
531
608
|
value: function getCircles() {
|
|
532
|
-
var
|
|
609
|
+
var _this3 = this;
|
|
533
610
|
|
|
534
611
|
var result = this.props.circles;
|
|
535
612
|
|
|
536
613
|
if (this.state.selectedTypeFilter) {
|
|
537
614
|
result = _.filter(result, function (circle) {
|
|
538
|
-
return
|
|
615
|
+
return _this3.state.selectedTypeFilter === "circle" ? !circle.IsPrivate : circle.IsPrivate;
|
|
539
616
|
});
|
|
540
617
|
}
|
|
541
618
|
|
|
542
619
|
if (this.state.selectedUserFilter) {
|
|
543
620
|
result = _.filter(result, function (circle) {
|
|
544
621
|
return _.some(circle.Audience, function (user) {
|
|
545
|
-
return user.userId ===
|
|
622
|
+
return user.userId === _this3.state.selectedUserFilter.userId;
|
|
546
623
|
});
|
|
547
624
|
});
|
|
548
625
|
} // Apply sorting
|
|
@@ -554,6 +631,12 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
554
631
|
|
|
555
632
|
if (this.state.sortBy === "newest") {
|
|
556
633
|
result.reverse();
|
|
634
|
+
|
|
635
|
+
if (this.state.showUnreadOnly) {
|
|
636
|
+
result = _.filter(result, function (circle) {
|
|
637
|
+
return _this3.isCircleUnread(circle);
|
|
638
|
+
});
|
|
639
|
+
}
|
|
557
640
|
}
|
|
558
641
|
|
|
559
642
|
return result;
|
|
@@ -561,7 +644,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
561
644
|
}, {
|
|
562
645
|
key: "getUsers",
|
|
563
646
|
value: function getUsers() {
|
|
564
|
-
var
|
|
647
|
+
var _this4 = this;
|
|
565
648
|
|
|
566
649
|
var users = [];
|
|
567
650
|
this.props.circles.forEach(function (circle) {
|
|
@@ -573,8 +656,8 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
573
656
|
return user.userId;
|
|
574
657
|
}), "displayName");
|
|
575
658
|
return _.filter(users, function (u) {
|
|
576
|
-
if (!_.isEmpty(
|
|
577
|
-
return (u.displayName || "").toLowerCase().indexOf(
|
|
659
|
+
if (!_.isEmpty(_this4.state.userSearch)) {
|
|
660
|
+
return (u.displayName || "").toLowerCase().indexOf(_this4.state.userSearch.toLowerCase()) > -1;
|
|
578
661
|
}
|
|
579
662
|
|
|
580
663
|
return true;
|
|
@@ -583,7 +666,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
583
666
|
}, {
|
|
584
667
|
key: "validateCircleAdmin",
|
|
585
668
|
value: function validateCircleAdmin(circle, onlyCreator) {
|
|
586
|
-
var
|
|
669
|
+
var _this5 = this;
|
|
587
670
|
|
|
588
671
|
if (Session$3.validateAccess(this.props.auth.site, values.permission, this.props.auth)) {
|
|
589
672
|
return true;
|
|
@@ -594,21 +677,31 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
594
677
|
}
|
|
595
678
|
|
|
596
679
|
return _.some(circle.Audience, function (user) {
|
|
597
|
-
return user.userId ===
|
|
680
|
+
return user.userId === _this5.props.user.Id && user.isAdmin;
|
|
598
681
|
});
|
|
599
682
|
}
|
|
600
683
|
}, {
|
|
601
684
|
key: "renderRow",
|
|
602
685
|
value: function renderRow(circle) {
|
|
603
|
-
var
|
|
686
|
+
var _this6 = this;
|
|
604
687
|
|
|
688
|
+
var unreadCount = this.getUnreadCount(circle);
|
|
689
|
+
var badge = unreadCount > 0 ? /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
690
|
+
className: css.badgeTag,
|
|
691
|
+
text: "".concat(unreadCount, " new")
|
|
692
|
+
}) : null;
|
|
605
693
|
return /*#__PURE__*/React.createElement("tr", {
|
|
606
694
|
key: circle.Id
|
|
607
695
|
}, /*#__PURE__*/React.createElement("td", {
|
|
608
696
|
className: "table-TitleColumn"
|
|
697
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
698
|
+
className: "flex flex-center",
|
|
699
|
+
style: {
|
|
700
|
+
gap: "8px"
|
|
701
|
+
}
|
|
609
702
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
610
703
|
to: "/".concat(values.featureKey, "/").concat(values.entityKey, "/").concat(circle.Id)
|
|
611
|
-
}, 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) {
|
|
704
|
+
}, this.getTitle(circle)), badge)), /*#__PURE__*/React.createElement("td", null, moment(circle.Changed).local().format("D MMM YYYY")), /*#__PURE__*/React.createElement("td", null, circle.Audience.map(function (user) {
|
|
612
705
|
return /*#__PURE__*/React.createElement(Components$4.ProfilePic, {
|
|
613
706
|
size: 30,
|
|
614
707
|
image: user.profilePic,
|
|
@@ -634,7 +727,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
634
727
|
name: "pencil"
|
|
635
728
|
})), this.validateCircleAdmin(circle, true) && !circle.IsPrivate && /*#__PURE__*/React.createElement("a", {
|
|
636
729
|
onClick: function onClick() {
|
|
637
|
-
|
|
730
|
+
_this6.removeCircle(circle);
|
|
638
731
|
}
|
|
639
732
|
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
640
733
|
style: {
|
|
@@ -646,16 +739,52 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
646
739
|
name: "minus-circle"
|
|
647
740
|
})))));
|
|
648
741
|
}
|
|
742
|
+
}, {
|
|
743
|
+
key: "renderUnreadFilterInfo",
|
|
744
|
+
value: function renderUnreadFilterInfo() {
|
|
745
|
+
var _this7 = this;
|
|
746
|
+
|
|
747
|
+
var showUnreadOnly = this.state.showUnreadOnly;
|
|
748
|
+
|
|
749
|
+
if (!showUnreadOnly) {
|
|
750
|
+
return null;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
754
|
+
className: css.unreadFilterBanner
|
|
755
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
756
|
+
className: css.unreadFilterContent
|
|
757
|
+
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
758
|
+
name: "info-circle",
|
|
759
|
+
className: css.unreadFilterIcon
|
|
760
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
761
|
+
className: css.unreadFilterText
|
|
762
|
+
}, "Showing only items with new messages.", " ", /*#__PURE__*/React.createElement("button", {
|
|
763
|
+
className: css.unreadFilterButton,
|
|
764
|
+
onClick: function onClick() {
|
|
765
|
+
return _this7.selectUnreadFilter(false);
|
|
766
|
+
},
|
|
767
|
+
"aria-label": "Turn off unread filter"
|
|
768
|
+
}, "Turn off filter"))));
|
|
769
|
+
}
|
|
649
770
|
}, {
|
|
650
771
|
key: "renderFilters",
|
|
651
772
|
value: function renderFilters() {
|
|
652
|
-
var
|
|
773
|
+
var _this8 = this;
|
|
653
774
|
|
|
654
775
|
var userFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
655
776
|
className: "marginRight-10",
|
|
656
777
|
onClick: this.openUserFilter,
|
|
657
778
|
text: "User"
|
|
658
779
|
});
|
|
780
|
+
var unreadFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
781
|
+
className: "marginRight-10",
|
|
782
|
+
onClick: function onClick() {
|
|
783
|
+
return _this8.selectUnreadFilter(!_this8.state.showUnreadOnly);
|
|
784
|
+
},
|
|
785
|
+
leftIcon: this.state.showUnreadOnly ? "check" : null,
|
|
786
|
+
text: "Unread Only"
|
|
787
|
+
});
|
|
659
788
|
var typeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
660
789
|
className: "marginRight-10",
|
|
661
790
|
onClick: this.openTypeFilter,
|
|
@@ -690,19 +819,19 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
690
819
|
}, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
691
820
|
type: "h5",
|
|
692
821
|
className: "marginRight-20"
|
|
693
|
-
}, "Filter by"), userFilter, typeFilter, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
822
|
+
}, "Filter by"), userFilter, typeFilter, unreadFilter, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
694
823
|
type: "h5",
|
|
695
824
|
className: "marginRight-20 marginLeft-20"
|
|
696
825
|
}, "Sort by:"), /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
697
826
|
className: "marginRight-10",
|
|
698
827
|
onClick: function onClick() {
|
|
699
|
-
return
|
|
828
|
+
return _this8.selectSort("newest");
|
|
700
829
|
},
|
|
701
830
|
leftIcon: this.state.sortBy === "newest" ? "check" : null,
|
|
702
831
|
text: "Newest first"
|
|
703
832
|
}), /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
704
833
|
onClick: function onClick() {
|
|
705
|
-
return
|
|
834
|
+
return _this8.selectSort("oldest");
|
|
706
835
|
},
|
|
707
836
|
leftIcon: this.state.sortBy === "oldest" ? "check" : null,
|
|
708
837
|
text: "Oldest first"
|
|
@@ -711,7 +840,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
711
840
|
}, {
|
|
712
841
|
key: "renderUserFilterPopup",
|
|
713
842
|
value: function renderUserFilterPopup() {
|
|
714
|
-
var
|
|
843
|
+
var _this9 = this;
|
|
715
844
|
|
|
716
845
|
if (!this.state.userFilterOpen) {
|
|
717
846
|
return null;
|
|
@@ -731,7 +860,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
731
860
|
placeholder: "Enter name",
|
|
732
861
|
value: this.state.userSearch,
|
|
733
862
|
onChange: function onChange(e) {
|
|
734
|
-
return
|
|
863
|
+
return _this9.onHandleChange(e);
|
|
735
864
|
},
|
|
736
865
|
alwaysShowLabel: true
|
|
737
866
|
}), this.getUsers().map(function (user) {
|
|
@@ -739,7 +868,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
739
868
|
key: user.userId,
|
|
740
869
|
user: user,
|
|
741
870
|
onClick: function onClick() {
|
|
742
|
-
|
|
871
|
+
_this9.selectUserFilter(user);
|
|
743
872
|
}
|
|
744
873
|
});
|
|
745
874
|
}));
|
|
@@ -747,7 +876,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
747
876
|
}, {
|
|
748
877
|
key: "renderTypeFilterPopup",
|
|
749
878
|
value: function renderTypeFilterPopup() {
|
|
750
|
-
var
|
|
879
|
+
var _this10 = this;
|
|
751
880
|
|
|
752
881
|
if (!this.state.typeFilterOpen) {
|
|
753
882
|
return null;
|
|
@@ -761,13 +890,13 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
761
890
|
onClose: this.closeTypeFilter
|
|
762
891
|
}, /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
763
892
|
onClick: function onClick() {
|
|
764
|
-
|
|
893
|
+
_this10.selectTypeFilter("circle");
|
|
765
894
|
},
|
|
766
895
|
text: _.capitalize(values.entityName),
|
|
767
896
|
className: "marginRight-10"
|
|
768
897
|
}), /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
769
898
|
onClick: function onClick() {
|
|
770
|
-
|
|
899
|
+
_this10.selectTypeFilter("private");
|
|
771
900
|
},
|
|
772
901
|
text: "Private Message"
|
|
773
902
|
}));
|
|
@@ -775,7 +904,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
775
904
|
}, {
|
|
776
905
|
key: "render",
|
|
777
906
|
value: function render() {
|
|
778
|
-
var
|
|
907
|
+
var _this11 = this;
|
|
779
908
|
|
|
780
909
|
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, {
|
|
781
910
|
onClick: this.onAddNew,
|
|
@@ -785,7 +914,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
785
914
|
}, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
786
915
|
type: "h1",
|
|
787
916
|
className: ""
|
|
788
|
-
}, values.textFeatureTitle), this.renderFilters(), /*#__PURE__*/React.createElement(Table, {
|
|
917
|
+
}, values.textFeatureTitle), this.renderFilters(), this.renderUnreadFilterInfo(), /*#__PURE__*/React.createElement(Table, {
|
|
789
918
|
className: "plussTable",
|
|
790
919
|
striped: true,
|
|
791
920
|
bordered: true,
|
|
@@ -799,7 +928,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
799
928
|
width: 50
|
|
800
929
|
}
|
|
801
930
|
}))), /*#__PURE__*/React.createElement("tbody", null, this.getCircles().map(function (circle) {
|
|
802
|
-
return
|
|
931
|
+
return _this11.renderRow(circle);
|
|
803
932
|
})))));
|
|
804
933
|
}
|
|
805
934
|
}]);
|
|
@@ -1763,6 +1892,32 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1763
1892
|
});
|
|
1764
1893
|
});
|
|
1765
1894
|
|
|
1895
|
+
_defineProperty(_assertThisInitialized(_this), "markCircleAsRead", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
1896
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1897
|
+
while (1) {
|
|
1898
|
+
switch (_context5.prev = _context5.next) {
|
|
1899
|
+
case 0:
|
|
1900
|
+
_context5.prev = 0;
|
|
1901
|
+
_context5.next = 3;
|
|
1902
|
+
return circleActions.markAsRead(_this.state.circleId, _this.props.user.Id);
|
|
1903
|
+
|
|
1904
|
+
case 3:
|
|
1905
|
+
_context5.next = 8;
|
|
1906
|
+
break;
|
|
1907
|
+
|
|
1908
|
+
case 5:
|
|
1909
|
+
_context5.prev = 5;
|
|
1910
|
+
_context5.t0 = _context5["catch"](0);
|
|
1911
|
+
console.error("Failed to mark circle as read:", _context5.t0);
|
|
1912
|
+
|
|
1913
|
+
case 8:
|
|
1914
|
+
case "end":
|
|
1915
|
+
return _context5.stop();
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
}, _callee5, null, [[0, 5]]);
|
|
1919
|
+
})));
|
|
1920
|
+
|
|
1766
1921
|
_defineProperty(_assertThisInitialized(_this), "sendMessage", function () {
|
|
1767
1922
|
var message = {
|
|
1768
1923
|
_id: Helper.randomString(),
|
|
@@ -1847,6 +2002,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1847
2002
|
_createClass(Circle, [{
|
|
1848
2003
|
key: "componentDidMount",
|
|
1849
2004
|
value: function componentDidMount() {
|
|
2005
|
+
this.markCircleAsRead();
|
|
1850
2006
|
this.checkGetData();
|
|
1851
2007
|
this.connect();
|
|
1852
2008
|
this.props.setNavData({
|
|
@@ -1983,8 +2139,8 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1983
2139
|
display: this.state.imageInputShowing ? "block" : "none"
|
|
1984
2140
|
}
|
|
1985
2141
|
}, /*#__PURE__*/React.createElement(Components$2.ImageInput, {
|
|
1986
|
-
ref: function ref(
|
|
1987
|
-
_this5.imageInput =
|
|
2142
|
+
ref: function ref(_ref6) {
|
|
2143
|
+
_this5.imageInput = _ref6;
|
|
1988
2144
|
},
|
|
1989
2145
|
multiple: true,
|
|
1990
2146
|
limit: 10,
|
|
@@ -1998,8 +2154,8 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1998
2154
|
display: this.state.fileInputShowing ? "block" : "none"
|
|
1999
2155
|
}
|
|
2000
2156
|
}, /*#__PURE__*/React.createElement(Components$2.FileInput, {
|
|
2001
|
-
ref: function ref(
|
|
2002
|
-
_this5.fileInput =
|
|
2157
|
+
ref: function ref(_ref7) {
|
|
2158
|
+
_this5.fileInput = _ref7;
|
|
2003
2159
|
},
|
|
2004
2160
|
multiple: true,
|
|
2005
2161
|
limit: 10,
|
|
@@ -2293,8 +2449,8 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
2293
2449
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2294
2450
|
className: "chat_newMessage"
|
|
2295
2451
|
}, this.renderChatInput()), this.renderReplyTo(), /*#__PURE__*/React.createElement("div", {
|
|
2296
|
-
ref: function ref(
|
|
2297
|
-
return _this8.chat =
|
|
2452
|
+
ref: function ref(_ref8) {
|
|
2453
|
+
return _this8.chat = _ref8;
|
|
2298
2454
|
},
|
|
2299
2455
|
className: "chat_messages"
|
|
2300
2456
|
}, _.isEmpty(this.state.messages) && !_.isEmpty(this.state.messageDate) && this.renderEmptyDate(), this.state.messages.map(function (m) {
|