@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.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: 'groups',
|
|
48
|
+
entityKey: 'group',
|
|
49
|
+
entityName: 'group',
|
|
50
|
+
serviceKey: 'groups',
|
|
51
|
+
permission: 'groups',
|
|
52
|
+
menuIcon: 'comments',
|
|
53
53
|
isFontAwesome: true,
|
|
54
|
-
reducerKey: '
|
|
55
|
-
actionCircleKey: '
|
|
56
|
-
textFeatureTitle: '
|
|
57
|
-
textAddMenuTitle: '
|
|
58
|
-
textEmptyGroups: "You aren't in any
|
|
54
|
+
reducerKey: 'groups',
|
|
55
|
+
actionCircleKey: 'GROUP',
|
|
56
|
+
textFeatureTitle: 'Groups',
|
|
57
|
+
textAddMenuTitle: 'Group',
|
|
58
|
+
textEmptyGroups: "You aren't in any Groups",
|
|
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: 'Groups',
|
|
61
|
+
componentAddCircle: 'AddGroup',
|
|
62
|
+
componentCircle: 'Group',
|
|
63
|
+
inviteKey: 'groupInvite',
|
|
64
|
+
messageKey: 'groupMessage',
|
|
65
|
+
chatRoute: 'groupChat',
|
|
66
|
+
updateKeyUserCircles: 'userGroups',
|
|
67
|
+
allowPublicKey: 'groupAllowPublicGroups',
|
|
68
|
+
allowPublicKeyDefault: true,
|
|
69
69
|
settings: {
|
|
70
|
-
allowAnyCreate:
|
|
70
|
+
allowAnyCreate: true
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
|
|
@@ -356,12 +356,46 @@
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
return deleteMessage;
|
|
359
|
+
}(),
|
|
360
|
+
markAsRead: function () {
|
|
361
|
+
var _markAsRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(circleId, userId) {
|
|
362
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
363
|
+
while (1) {
|
|
364
|
+
switch (_context4.prev = _context4.next) {
|
|
365
|
+
case 0:
|
|
366
|
+
return _context4.abrupt("return", Session$4.authedFunction({
|
|
367
|
+
method: 'post',
|
|
368
|
+
url: Helper$3.getUrl('groups', 'resetunread'),
|
|
369
|
+
data: {
|
|
370
|
+
groupID: circleId,
|
|
371
|
+
userID: userId
|
|
372
|
+
}
|
|
373
|
+
}));
|
|
374
|
+
|
|
375
|
+
case 1:
|
|
376
|
+
case "end":
|
|
377
|
+
return _context4.stop();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}, _callee4);
|
|
381
|
+
}));
|
|
382
|
+
|
|
383
|
+
function markAsRead(_x9, _x10) {
|
|
384
|
+
return _markAsRead.apply(this, arguments);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
return markAsRead;
|
|
359
388
|
}()
|
|
360
389
|
};
|
|
361
390
|
|
|
362
391
|
var Apis$1 = PlussCore__namespace.Apis;
|
|
363
392
|
var analyticsActions = Apis$1.analyticsActions;
|
|
364
393
|
|
|
394
|
+
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}}
|
|
395
|
+
|
|
396
|
+
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";
|
|
397
|
+
n(css,{});
|
|
398
|
+
|
|
365
399
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
366
400
|
|
|
367
401
|
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; } }
|
|
@@ -427,6 +461,12 @@
|
|
|
427
461
|
})));
|
|
428
462
|
});
|
|
429
463
|
|
|
464
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "selectUnreadFilter", function (showUnreadOnly) {
|
|
465
|
+
_this.setState({
|
|
466
|
+
showUnreadOnly: showUnreadOnly
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
|
|
430
470
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "canAddNew", function () {
|
|
431
471
|
var auth = _this.props.auth;
|
|
432
472
|
return Session$3.validateAccess(auth.site, values.permission, auth);
|
|
@@ -539,7 +579,9 @@
|
|
|
539
579
|
|
|
540
580
|
_this.state = {
|
|
541
581
|
userSearch: "",
|
|
542
|
-
sortBy: "newest"
|
|
582
|
+
sortBy: "newest",
|
|
583
|
+
showUnreadOnly: false,
|
|
584
|
+
pollingInterval: null
|
|
543
585
|
};
|
|
544
586
|
return _this;
|
|
545
587
|
}
|
|
@@ -547,25 +589,60 @@
|
|
|
547
589
|
_createClass__default['default'](Circles, [{
|
|
548
590
|
key: "componentDidMount",
|
|
549
591
|
value: function componentDidMount() {
|
|
550
|
-
this
|
|
592
|
+
var _this2 = this;
|
|
593
|
+
|
|
594
|
+
this.getData(); // Poll for updates every 10 seconds
|
|
595
|
+
|
|
596
|
+
this.pollingInterval = setInterval(function () {
|
|
597
|
+
_this2.getData();
|
|
598
|
+
}, 10000);
|
|
599
|
+
}
|
|
600
|
+
}, {
|
|
601
|
+
key: "componentWillUnmount",
|
|
602
|
+
value: function componentWillUnmount() {
|
|
603
|
+
if (this.pollingInterval) {
|
|
604
|
+
clearInterval(this.pollingInterval);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}, {
|
|
608
|
+
key: "isCircleUnread",
|
|
609
|
+
value: function isCircleUnread(circle) {
|
|
610
|
+
var userId = this.props.user.Id;
|
|
611
|
+
|
|
612
|
+
if (!circle.Unread || !circle.Unread[userId]) {
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
return circle.Unread[userId] > 0;
|
|
617
|
+
}
|
|
618
|
+
}, {
|
|
619
|
+
key: "getUnreadCount",
|
|
620
|
+
value: function getUnreadCount(circle) {
|
|
621
|
+
var userId = this.props.user.Id;
|
|
622
|
+
|
|
623
|
+
if (!circle.Unread || !circle.Unread[userId]) {
|
|
624
|
+
return 0;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
return circle.Unread[userId];
|
|
551
628
|
}
|
|
552
629
|
}, {
|
|
553
630
|
key: "getCircles",
|
|
554
631
|
value: function getCircles() {
|
|
555
|
-
var
|
|
632
|
+
var _this3 = this;
|
|
556
633
|
|
|
557
634
|
var result = this.props.circles;
|
|
558
635
|
|
|
559
636
|
if (this.state.selectedTypeFilter) {
|
|
560
637
|
result = ___default['default'].filter(result, function (circle) {
|
|
561
|
-
return
|
|
638
|
+
return _this3.state.selectedTypeFilter === "circle" ? !circle.IsPrivate : circle.IsPrivate;
|
|
562
639
|
});
|
|
563
640
|
}
|
|
564
641
|
|
|
565
642
|
if (this.state.selectedUserFilter) {
|
|
566
643
|
result = ___default['default'].filter(result, function (circle) {
|
|
567
644
|
return ___default['default'].some(circle.Audience, function (user) {
|
|
568
|
-
return user.userId ===
|
|
645
|
+
return user.userId === _this3.state.selectedUserFilter.userId;
|
|
569
646
|
});
|
|
570
647
|
});
|
|
571
648
|
} // Apply sorting
|
|
@@ -577,6 +654,12 @@
|
|
|
577
654
|
|
|
578
655
|
if (this.state.sortBy === "newest") {
|
|
579
656
|
result.reverse();
|
|
657
|
+
|
|
658
|
+
if (this.state.showUnreadOnly) {
|
|
659
|
+
result = ___default['default'].filter(result, function (circle) {
|
|
660
|
+
return _this3.isCircleUnread(circle);
|
|
661
|
+
});
|
|
662
|
+
}
|
|
580
663
|
}
|
|
581
664
|
|
|
582
665
|
return result;
|
|
@@ -584,7 +667,7 @@
|
|
|
584
667
|
}, {
|
|
585
668
|
key: "getUsers",
|
|
586
669
|
value: function getUsers() {
|
|
587
|
-
var
|
|
670
|
+
var _this4 = this;
|
|
588
671
|
|
|
589
672
|
var users = [];
|
|
590
673
|
this.props.circles.forEach(function (circle) {
|
|
@@ -596,8 +679,8 @@
|
|
|
596
679
|
return user.userId;
|
|
597
680
|
}), "displayName");
|
|
598
681
|
return ___default['default'].filter(users, function (u) {
|
|
599
|
-
if (!___default['default'].isEmpty(
|
|
600
|
-
return (u.displayName || "").toLowerCase().indexOf(
|
|
682
|
+
if (!___default['default'].isEmpty(_this4.state.userSearch)) {
|
|
683
|
+
return (u.displayName || "").toLowerCase().indexOf(_this4.state.userSearch.toLowerCase()) > -1;
|
|
601
684
|
}
|
|
602
685
|
|
|
603
686
|
return true;
|
|
@@ -606,7 +689,7 @@
|
|
|
606
689
|
}, {
|
|
607
690
|
key: "validateCircleAdmin",
|
|
608
691
|
value: function validateCircleAdmin(circle, onlyCreator) {
|
|
609
|
-
var
|
|
692
|
+
var _this5 = this;
|
|
610
693
|
|
|
611
694
|
if (Session$3.validateAccess(this.props.auth.site, values.permission, this.props.auth)) {
|
|
612
695
|
return true;
|
|
@@ -617,21 +700,31 @@
|
|
|
617
700
|
}
|
|
618
701
|
|
|
619
702
|
return ___default['default'].some(circle.Audience, function (user) {
|
|
620
|
-
return user.userId ===
|
|
703
|
+
return user.userId === _this5.props.user.Id && user.isAdmin;
|
|
621
704
|
});
|
|
622
705
|
}
|
|
623
706
|
}, {
|
|
624
707
|
key: "renderRow",
|
|
625
708
|
value: function renderRow(circle) {
|
|
626
|
-
var
|
|
709
|
+
var _this6 = this;
|
|
627
710
|
|
|
711
|
+
var unreadCount = this.getUnreadCount(circle);
|
|
712
|
+
var badge = unreadCount > 0 ? /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
713
|
+
className: css.badgeTag,
|
|
714
|
+
text: "".concat(unreadCount, " new")
|
|
715
|
+
}) : null;
|
|
628
716
|
return /*#__PURE__*/React__default['default'].createElement("tr", {
|
|
629
717
|
key: circle.Id
|
|
630
718
|
}, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
631
719
|
className: "table-TitleColumn"
|
|
720
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
721
|
+
className: "flex flex-center",
|
|
722
|
+
style: {
|
|
723
|
+
gap: "8px"
|
|
724
|
+
}
|
|
632
725
|
}, /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
|
|
633
726
|
to: "/".concat(values.featureKey, "/").concat(values.entityKey, "/").concat(circle.Id)
|
|
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) {
|
|
727
|
+
}, this.getTitle(circle)), badge)), /*#__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) {
|
|
635
728
|
return /*#__PURE__*/React__default['default'].createElement(Components$4.ProfilePic, {
|
|
636
729
|
size: 30,
|
|
637
730
|
image: user.profilePic,
|
|
@@ -657,7 +750,7 @@
|
|
|
657
750
|
name: "pencil"
|
|
658
751
|
})), this.validateCircleAdmin(circle, true) && !circle.IsPrivate && /*#__PURE__*/React__default['default'].createElement("a", {
|
|
659
752
|
onClick: function onClick() {
|
|
660
|
-
|
|
753
|
+
_this6.removeCircle(circle);
|
|
661
754
|
}
|
|
662
755
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
663
756
|
style: {
|
|
@@ -669,16 +762,52 @@
|
|
|
669
762
|
name: "minus-circle"
|
|
670
763
|
})))));
|
|
671
764
|
}
|
|
765
|
+
}, {
|
|
766
|
+
key: "renderUnreadFilterInfo",
|
|
767
|
+
value: function renderUnreadFilterInfo() {
|
|
768
|
+
var _this7 = this;
|
|
769
|
+
|
|
770
|
+
var showUnreadOnly = this.state.showUnreadOnly;
|
|
771
|
+
|
|
772
|
+
if (!showUnreadOnly) {
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
777
|
+
className: css.unreadFilterBanner
|
|
778
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
779
|
+
className: css.unreadFilterContent
|
|
780
|
+
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
781
|
+
name: "info-circle",
|
|
782
|
+
className: css.unreadFilterIcon
|
|
783
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
784
|
+
className: css.unreadFilterText
|
|
785
|
+
}, "Showing only items with new messages.", " ", /*#__PURE__*/React__default['default'].createElement("button", {
|
|
786
|
+
className: css.unreadFilterButton,
|
|
787
|
+
onClick: function onClick() {
|
|
788
|
+
return _this7.selectUnreadFilter(false);
|
|
789
|
+
},
|
|
790
|
+
"aria-label": "Turn off unread filter"
|
|
791
|
+
}, "Turn off filter"))));
|
|
792
|
+
}
|
|
672
793
|
}, {
|
|
673
794
|
key: "renderFilters",
|
|
674
795
|
value: function renderFilters() {
|
|
675
|
-
var
|
|
796
|
+
var _this8 = this;
|
|
676
797
|
|
|
677
798
|
var userFilter = /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
678
799
|
className: "marginRight-10",
|
|
679
800
|
onClick: this.openUserFilter,
|
|
680
801
|
text: "User"
|
|
681
802
|
});
|
|
803
|
+
var unreadFilter = /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
804
|
+
className: "marginRight-10",
|
|
805
|
+
onClick: function onClick() {
|
|
806
|
+
return _this8.selectUnreadFilter(!_this8.state.showUnreadOnly);
|
|
807
|
+
},
|
|
808
|
+
leftIcon: this.state.showUnreadOnly ? "check" : null,
|
|
809
|
+
text: "Unread Only"
|
|
810
|
+
});
|
|
682
811
|
var typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
683
812
|
className: "marginRight-10",
|
|
684
813
|
onClick: this.openTypeFilter,
|
|
@@ -713,19 +842,19 @@
|
|
|
713
842
|
}, /*#__PURE__*/React__default['default'].createElement(Components$4.Text, {
|
|
714
843
|
type: "h5",
|
|
715
844
|
className: "marginRight-20"
|
|
716
|
-
}, "Filter by"), userFilter, typeFilter, /*#__PURE__*/React__default['default'].createElement(Components$4.Text, {
|
|
845
|
+
}, "Filter by"), userFilter, typeFilter, unreadFilter, /*#__PURE__*/React__default['default'].createElement(Components$4.Text, {
|
|
717
846
|
type: "h5",
|
|
718
847
|
className: "marginRight-20 marginLeft-20"
|
|
719
848
|
}, "Sort by:"), /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
720
849
|
className: "marginRight-10",
|
|
721
850
|
onClick: function onClick() {
|
|
722
|
-
return
|
|
851
|
+
return _this8.selectSort("newest");
|
|
723
852
|
},
|
|
724
853
|
leftIcon: this.state.sortBy === "newest" ? "check" : null,
|
|
725
854
|
text: "Newest first"
|
|
726
855
|
}), /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
727
856
|
onClick: function onClick() {
|
|
728
|
-
return
|
|
857
|
+
return _this8.selectSort("oldest");
|
|
729
858
|
},
|
|
730
859
|
leftIcon: this.state.sortBy === "oldest" ? "check" : null,
|
|
731
860
|
text: "Oldest first"
|
|
@@ -734,7 +863,7 @@
|
|
|
734
863
|
}, {
|
|
735
864
|
key: "renderUserFilterPopup",
|
|
736
865
|
value: function renderUserFilterPopup() {
|
|
737
|
-
var
|
|
866
|
+
var _this9 = this;
|
|
738
867
|
|
|
739
868
|
if (!this.state.userFilterOpen) {
|
|
740
869
|
return null;
|
|
@@ -754,7 +883,7 @@
|
|
|
754
883
|
placeholder: "Enter name",
|
|
755
884
|
value: this.state.userSearch,
|
|
756
885
|
onChange: function onChange(e) {
|
|
757
|
-
return
|
|
886
|
+
return _this9.onHandleChange(e);
|
|
758
887
|
},
|
|
759
888
|
alwaysShowLabel: true
|
|
760
889
|
}), this.getUsers().map(function (user) {
|
|
@@ -762,7 +891,7 @@
|
|
|
762
891
|
key: user.userId,
|
|
763
892
|
user: user,
|
|
764
893
|
onClick: function onClick() {
|
|
765
|
-
|
|
894
|
+
_this9.selectUserFilter(user);
|
|
766
895
|
}
|
|
767
896
|
});
|
|
768
897
|
}));
|
|
@@ -770,7 +899,7 @@
|
|
|
770
899
|
}, {
|
|
771
900
|
key: "renderTypeFilterPopup",
|
|
772
901
|
value: function renderTypeFilterPopup() {
|
|
773
|
-
var
|
|
902
|
+
var _this10 = this;
|
|
774
903
|
|
|
775
904
|
if (!this.state.typeFilterOpen) {
|
|
776
905
|
return null;
|
|
@@ -784,13 +913,13 @@
|
|
|
784
913
|
onClose: this.closeTypeFilter
|
|
785
914
|
}, /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
786
915
|
onClick: function onClick() {
|
|
787
|
-
|
|
916
|
+
_this10.selectTypeFilter("circle");
|
|
788
917
|
},
|
|
789
918
|
text: ___default['default'].capitalize(values.entityName),
|
|
790
919
|
className: "marginRight-10"
|
|
791
920
|
}), /*#__PURE__*/React__default['default'].createElement(Components$4.Tag, {
|
|
792
921
|
onClick: function onClick() {
|
|
793
|
-
|
|
922
|
+
_this10.selectTypeFilter("private");
|
|
794
923
|
},
|
|
795
924
|
text: "Private Message"
|
|
796
925
|
}));
|
|
@@ -798,7 +927,7 @@
|
|
|
798
927
|
}, {
|
|
799
928
|
key: "render",
|
|
800
929
|
value: function render() {
|
|
801
|
-
var
|
|
930
|
+
var _this11 = this;
|
|
802
931
|
|
|
803
932
|
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, {
|
|
804
933
|
onClick: this.onAddNew,
|
|
@@ -808,7 +937,7 @@
|
|
|
808
937
|
}, /*#__PURE__*/React__default['default'].createElement(Components$4.Text, {
|
|
809
938
|
type: "h1",
|
|
810
939
|
className: ""
|
|
811
|
-
}, values.textFeatureTitle), this.renderFilters(), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.Table, {
|
|
940
|
+
}, values.textFeatureTitle), this.renderFilters(), this.renderUnreadFilterInfo(), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.Table, {
|
|
812
941
|
className: "plussTable",
|
|
813
942
|
striped: true,
|
|
814
943
|
bordered: true,
|
|
@@ -822,7 +951,7 @@
|
|
|
822
951
|
width: 50
|
|
823
952
|
}
|
|
824
953
|
}))), /*#__PURE__*/React__default['default'].createElement("tbody", null, this.getCircles().map(function (circle) {
|
|
825
|
-
return
|
|
954
|
+
return _this11.renderRow(circle);
|
|
826
955
|
})))));
|
|
827
956
|
}
|
|
828
957
|
}]);
|
|
@@ -1786,6 +1915,32 @@
|
|
|
1786
1915
|
});
|
|
1787
1916
|
});
|
|
1788
1917
|
|
|
1918
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "markCircleAsRead", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5() {
|
|
1919
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
1920
|
+
while (1) {
|
|
1921
|
+
switch (_context5.prev = _context5.next) {
|
|
1922
|
+
case 0:
|
|
1923
|
+
_context5.prev = 0;
|
|
1924
|
+
_context5.next = 3;
|
|
1925
|
+
return circleActions.markAsRead(_this.state.circleId, _this.props.user.Id);
|
|
1926
|
+
|
|
1927
|
+
case 3:
|
|
1928
|
+
_context5.next = 8;
|
|
1929
|
+
break;
|
|
1930
|
+
|
|
1931
|
+
case 5:
|
|
1932
|
+
_context5.prev = 5;
|
|
1933
|
+
_context5.t0 = _context5["catch"](0);
|
|
1934
|
+
console.error("Failed to mark circle as read:", _context5.t0);
|
|
1935
|
+
|
|
1936
|
+
case 8:
|
|
1937
|
+
case "end":
|
|
1938
|
+
return _context5.stop();
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}, _callee5, null, [[0, 5]]);
|
|
1942
|
+
})));
|
|
1943
|
+
|
|
1789
1944
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "sendMessage", function () {
|
|
1790
1945
|
var message = {
|
|
1791
1946
|
_id: Helper.randomString(),
|
|
@@ -1870,6 +2025,7 @@
|
|
|
1870
2025
|
_createClass__default['default'](Circle, [{
|
|
1871
2026
|
key: "componentDidMount",
|
|
1872
2027
|
value: function componentDidMount() {
|
|
2028
|
+
this.markCircleAsRead();
|
|
1873
2029
|
this.checkGetData();
|
|
1874
2030
|
this.connect();
|
|
1875
2031
|
this.props.setNavData({
|
|
@@ -2006,8 +2162,8 @@
|
|
|
2006
2162
|
display: this.state.imageInputShowing ? "block" : "none"
|
|
2007
2163
|
}
|
|
2008
2164
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.ImageInput, {
|
|
2009
|
-
ref: function ref(
|
|
2010
|
-
_this5.imageInput =
|
|
2165
|
+
ref: function ref(_ref6) {
|
|
2166
|
+
_this5.imageInput = _ref6;
|
|
2011
2167
|
},
|
|
2012
2168
|
multiple: true,
|
|
2013
2169
|
limit: 10,
|
|
@@ -2021,8 +2177,8 @@
|
|
|
2021
2177
|
display: this.state.fileInputShowing ? "block" : "none"
|
|
2022
2178
|
}
|
|
2023
2179
|
}, /*#__PURE__*/React__default['default'].createElement(Components$2.FileInput, {
|
|
2024
|
-
ref: function ref(
|
|
2025
|
-
_this5.fileInput =
|
|
2180
|
+
ref: function ref(_ref7) {
|
|
2181
|
+
_this5.fileInput = _ref7;
|
|
2026
2182
|
},
|
|
2027
2183
|
multiple: true,
|
|
2028
2184
|
limit: 10,
|
|
@@ -2316,8 +2472,8 @@
|
|
|
2316
2472
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2317
2473
|
className: "chat_newMessage"
|
|
2318
2474
|
}, this.renderChatInput()), this.renderReplyTo(), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2319
|
-
ref: function ref(
|
|
2320
|
-
return _this8.chat =
|
|
2475
|
+
ref: function ref(_ref8) {
|
|
2476
|
+
return _this8.chat = _ref8;
|
|
2321
2477
|
},
|
|
2322
2478
|
className: "chat_messages"
|
|
2323
2479
|
}, ___default['default'].isEmpty(this.state.messages) && !___default['default'].isEmpty(this.state.messageDate) && this.renderEmptyDate(), this.state.messages.map(function (m) {
|
package/package.json
CHANGED
|
@@ -113,4 +113,14 @@ export const circleActions = {
|
|
|
113
113
|
},
|
|
114
114
|
});
|
|
115
115
|
},
|
|
116
|
+
markAsRead: async (circleId, userId) => {
|
|
117
|
+
return Session.authedFunction({
|
|
118
|
+
method: 'post',
|
|
119
|
+
url: Helper.getUrl('groups', 'resetunread'),
|
|
120
|
+
data: {
|
|
121
|
+
groupID: circleId,
|
|
122
|
+
userID: userId,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
},
|
|
116
126
|
};
|
package/src/screens/Circle.js
CHANGED
|
@@ -37,6 +37,7 @@ class Circle extends Component {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
componentDidMount() {
|
|
40
|
+
this.markCircleAsRead();
|
|
40
41
|
this.checkGetData();
|
|
41
42
|
this.connect();
|
|
42
43
|
this.props.setNavData({ hideSideMenu: true });
|
|
@@ -332,6 +333,14 @@ class Circle extends Component {
|
|
|
332
333
|
});
|
|
333
334
|
};
|
|
334
335
|
|
|
336
|
+
|
|
337
|
+
markCircleAsRead = async () => {
|
|
338
|
+
try {
|
|
339
|
+
await circleActions.markAsRead(this.state.circleId, this.props.user.Id);
|
|
340
|
+
} catch (error) {
|
|
341
|
+
console.error("Failed to mark circle as read:", error);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
335
344
|
sendMessage = () => {
|
|
336
345
|
const message = {
|
|
337
346
|
_id: Helper.randomString(),
|