@plusscommunities/pluss-circles-web 1.5.6 → 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 +232 -42
- package/dist/index.esm.js +232 -42
- package/dist/index.umd.js +232 -42
- package/package.json +1 -1
- package/src/apis/circleActions.js +10 -0
- package/src/screens/Circle.js +9 -0
- package/src/screens/Circles.js +558 -376
- package/src/screens/Circles.module.css +96 -0
package/dist/index.esm.js
CHANGED
|
@@ -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; } }
|
|
@@ -375,7 +409,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
375
409
|
|
|
376
410
|
case 3:
|
|
377
411
|
res = _context.sent;
|
|
378
|
-
console.log(
|
|
412
|
+
console.log("getData", res.data);
|
|
379
413
|
|
|
380
414
|
_this.props.circlesLoaded(res.data);
|
|
381
415
|
|
|
@@ -389,7 +423,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
389
423
|
case 9:
|
|
390
424
|
_context.prev = 9;
|
|
391
425
|
_context.t0 = _context["catch"](0);
|
|
392
|
-
console.error(
|
|
426
|
+
console.error("getData", _context.t0);
|
|
393
427
|
|
|
394
428
|
_this.setState({
|
|
395
429
|
loadingAll: 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);
|
|
@@ -471,9 +511,15 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
471
511
|
});
|
|
472
512
|
});
|
|
473
513
|
|
|
514
|
+
_defineProperty(_assertThisInitialized(_this), "selectSort", function (sortType) {
|
|
515
|
+
_this.setState({
|
|
516
|
+
sortBy: sortType
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
|
|
474
520
|
_defineProperty(_assertThisInitialized(_this), "onHandleChange", function (event) {
|
|
475
521
|
var stateChange = {};
|
|
476
|
-
stateChange[event.target.getAttribute(
|
|
522
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
477
523
|
|
|
478
524
|
_this.setState(stateChange);
|
|
479
525
|
});
|
|
@@ -485,14 +531,14 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
485
531
|
circleActions.delete(circle.Id).then(function (res) {
|
|
486
532
|
_this.getData();
|
|
487
533
|
}).catch(function (res) {
|
|
488
|
-
alert(
|
|
534
|
+
alert("Something went wrong with the request. Please try again.");
|
|
489
535
|
});
|
|
490
536
|
}
|
|
491
537
|
});
|
|
492
538
|
|
|
493
539
|
_defineProperty(_assertThisInitialized(_this), "getTypeFilterText", function (type) {
|
|
494
|
-
if (type ===
|
|
495
|
-
return
|
|
540
|
+
if (type === "private") {
|
|
541
|
+
return "Private Message";
|
|
496
542
|
}
|
|
497
543
|
|
|
498
544
|
return _.capitalize(values.entityName);
|
|
@@ -502,14 +548,17 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
502
548
|
if (circle.IsPrivate) {
|
|
503
549
|
return "PM: ".concat(circle.Audience.map(function (user) {
|
|
504
550
|
return user.displayName;
|
|
505
|
-
}).join(
|
|
551
|
+
}).join(", "));
|
|
506
552
|
}
|
|
507
553
|
|
|
508
554
|
return circle.Title;
|
|
509
555
|
});
|
|
510
556
|
|
|
511
557
|
_this.state = {
|
|
512
|
-
userSearch:
|
|
558
|
+
userSearch: "",
|
|
559
|
+
sortBy: "newest",
|
|
560
|
+
showUnreadOnly: false,
|
|
561
|
+
pollingInterval: null
|
|
513
562
|
};
|
|
514
563
|
return _this;
|
|
515
564
|
}
|
|
@@ -517,27 +566,77 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
517
566
|
_createClass(Circles, [{
|
|
518
567
|
key: "componentDidMount",
|
|
519
568
|
value: function componentDidMount() {
|
|
520
|
-
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];
|
|
521
605
|
}
|
|
522
606
|
}, {
|
|
523
607
|
key: "getCircles",
|
|
524
608
|
value: function getCircles() {
|
|
525
|
-
var
|
|
609
|
+
var _this3 = this;
|
|
526
610
|
|
|
527
611
|
var result = this.props.circles;
|
|
528
612
|
|
|
529
613
|
if (this.state.selectedTypeFilter) {
|
|
530
614
|
result = _.filter(result, function (circle) {
|
|
531
|
-
return
|
|
615
|
+
return _this3.state.selectedTypeFilter === "circle" ? !circle.IsPrivate : circle.IsPrivate;
|
|
532
616
|
});
|
|
533
617
|
}
|
|
534
618
|
|
|
535
619
|
if (this.state.selectedUserFilter) {
|
|
536
620
|
result = _.filter(result, function (circle) {
|
|
537
621
|
return _.some(circle.Audience, function (user) {
|
|
538
|
-
return user.userId ===
|
|
622
|
+
return user.userId === _this3.state.selectedUserFilter.userId;
|
|
539
623
|
});
|
|
540
624
|
});
|
|
625
|
+
} // Apply sorting
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
result = _.sortBy(result, function (circle) {
|
|
629
|
+
return moment(circle.Changed).valueOf();
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
if (this.state.sortBy === "newest") {
|
|
633
|
+
result.reverse();
|
|
634
|
+
|
|
635
|
+
if (this.state.showUnreadOnly) {
|
|
636
|
+
result = _.filter(result, function (circle) {
|
|
637
|
+
return _this3.isCircleUnread(circle);
|
|
638
|
+
});
|
|
639
|
+
}
|
|
541
640
|
}
|
|
542
641
|
|
|
543
642
|
return result;
|
|
@@ -545,7 +644,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
545
644
|
}, {
|
|
546
645
|
key: "getUsers",
|
|
547
646
|
value: function getUsers() {
|
|
548
|
-
var
|
|
647
|
+
var _this4 = this;
|
|
549
648
|
|
|
550
649
|
var users = [];
|
|
551
650
|
this.props.circles.forEach(function (circle) {
|
|
@@ -555,10 +654,10 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
555
654
|
});
|
|
556
655
|
users = _.sortBy(_.uniqBy(users, function (user) {
|
|
557
656
|
return user.userId;
|
|
558
|
-
}),
|
|
657
|
+
}), "displayName");
|
|
559
658
|
return _.filter(users, function (u) {
|
|
560
|
-
if (!_.isEmpty(
|
|
561
|
-
return (u.displayName ||
|
|
659
|
+
if (!_.isEmpty(_this4.state.userSearch)) {
|
|
660
|
+
return (u.displayName || "").toLowerCase().indexOf(_this4.state.userSearch.toLowerCase()) > -1;
|
|
562
661
|
}
|
|
563
662
|
|
|
564
663
|
return true;
|
|
@@ -567,7 +666,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
567
666
|
}, {
|
|
568
667
|
key: "validateCircleAdmin",
|
|
569
668
|
value: function validateCircleAdmin(circle, onlyCreator) {
|
|
570
|
-
var
|
|
669
|
+
var _this5 = this;
|
|
571
670
|
|
|
572
671
|
if (Session$3.validateAccess(this.props.auth.site, values.permission, this.props.auth)) {
|
|
573
672
|
return true;
|
|
@@ -578,21 +677,31 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
578
677
|
}
|
|
579
678
|
|
|
580
679
|
return _.some(circle.Audience, function (user) {
|
|
581
|
-
return user.userId ===
|
|
680
|
+
return user.userId === _this5.props.user.Id && user.isAdmin;
|
|
582
681
|
});
|
|
583
682
|
}
|
|
584
683
|
}, {
|
|
585
684
|
key: "renderRow",
|
|
586
685
|
value: function renderRow(circle) {
|
|
587
|
-
var
|
|
686
|
+
var _this6 = this;
|
|
588
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;
|
|
589
693
|
return /*#__PURE__*/React.createElement("tr", {
|
|
590
694
|
key: circle.Id
|
|
591
695
|
}, /*#__PURE__*/React.createElement("td", {
|
|
592
696
|
className: "table-TitleColumn"
|
|
697
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
698
|
+
className: "flex flex-center",
|
|
699
|
+
style: {
|
|
700
|
+
gap: "8px"
|
|
701
|
+
}
|
|
593
702
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
594
703
|
to: "/".concat(values.featureKey, "/").concat(values.entityKey, "/").concat(circle.Id)
|
|
595
|
-
}, this.getTitle(circle))), /*#__PURE__*/React.createElement("td", null, moment(circle.Changed).local().format(
|
|
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) {
|
|
596
705
|
return /*#__PURE__*/React.createElement(Components$4.ProfilePic, {
|
|
597
706
|
size: 30,
|
|
598
707
|
image: user.profilePic,
|
|
@@ -603,8 +712,8 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
603
712
|
className: "table-options"
|
|
604
713
|
}, /*#__PURE__*/React.createElement("div", {
|
|
605
714
|
style: {
|
|
606
|
-
display:
|
|
607
|
-
alignItems:
|
|
715
|
+
display: "flex",
|
|
716
|
+
alignItems: "center"
|
|
608
717
|
}
|
|
609
718
|
}, this.validateCircleAdmin(circle) && !circle.IsPrivate && /*#__PURE__*/React.createElement(Link, {
|
|
610
719
|
to: "/".concat(values.featureKey, "/edit/").concat(circle.Id)
|
|
@@ -613,31 +722,69 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
613
722
|
fontSize: 20,
|
|
614
723
|
padding: 5,
|
|
615
724
|
marginLeft: 12,
|
|
616
|
-
cursor:
|
|
725
|
+
cursor: "pointer"
|
|
617
726
|
},
|
|
618
727
|
name: "pencil"
|
|
619
728
|
})), this.validateCircleAdmin(circle, true) && !circle.IsPrivate && /*#__PURE__*/React.createElement("a", {
|
|
620
729
|
onClick: function onClick() {
|
|
621
|
-
|
|
730
|
+
_this6.removeCircle(circle);
|
|
622
731
|
}
|
|
623
732
|
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
624
733
|
style: {
|
|
625
734
|
fontSize: 20,
|
|
626
735
|
padding: 5,
|
|
627
736
|
marginLeft: 12,
|
|
628
|
-
cursor:
|
|
737
|
+
cursor: "pointer"
|
|
629
738
|
},
|
|
630
739
|
name: "minus-circle"
|
|
631
740
|
})))));
|
|
632
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
|
+
}
|
|
633
770
|
}, {
|
|
634
771
|
key: "renderFilters",
|
|
635
772
|
value: function renderFilters() {
|
|
773
|
+
var _this8 = this;
|
|
774
|
+
|
|
636
775
|
var userFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
637
776
|
className: "marginRight-10",
|
|
638
777
|
onClick: this.openUserFilter,
|
|
639
778
|
text: "User"
|
|
640
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
|
+
});
|
|
641
788
|
var typeFilter = /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
642
789
|
className: "marginRight-10",
|
|
643
790
|
onClick: this.openTypeFilter,
|
|
@@ -672,12 +819,28 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
672
819
|
}, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
673
820
|
type: "h5",
|
|
674
821
|
className: "marginRight-20"
|
|
675
|
-
}, "Filter by"), userFilter, typeFilter
|
|
822
|
+
}, "Filter by"), userFilter, typeFilter, unreadFilter, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
823
|
+
type: "h5",
|
|
824
|
+
className: "marginRight-20 marginLeft-20"
|
|
825
|
+
}, "Sort by:"), /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
826
|
+
className: "marginRight-10",
|
|
827
|
+
onClick: function onClick() {
|
|
828
|
+
return _this8.selectSort("newest");
|
|
829
|
+
},
|
|
830
|
+
leftIcon: this.state.sortBy === "newest" ? "check" : null,
|
|
831
|
+
text: "Newest first"
|
|
832
|
+
}), /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
833
|
+
onClick: function onClick() {
|
|
834
|
+
return _this8.selectSort("oldest");
|
|
835
|
+
},
|
|
836
|
+
leftIcon: this.state.sortBy === "oldest" ? "check" : null,
|
|
837
|
+
text: "Oldest first"
|
|
838
|
+
}));
|
|
676
839
|
}
|
|
677
840
|
}, {
|
|
678
841
|
key: "renderUserFilterPopup",
|
|
679
842
|
value: function renderUserFilterPopup() {
|
|
680
|
-
var
|
|
843
|
+
var _this9 = this;
|
|
681
844
|
|
|
682
845
|
if (!this.state.userFilterOpen) {
|
|
683
846
|
return null;
|
|
@@ -697,7 +860,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
697
860
|
placeholder: "Enter name",
|
|
698
861
|
value: this.state.userSearch,
|
|
699
862
|
onChange: function onChange(e) {
|
|
700
|
-
return
|
|
863
|
+
return _this9.onHandleChange(e);
|
|
701
864
|
},
|
|
702
865
|
alwaysShowLabel: true
|
|
703
866
|
}), this.getUsers().map(function (user) {
|
|
@@ -705,7 +868,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
705
868
|
key: user.userId,
|
|
706
869
|
user: user,
|
|
707
870
|
onClick: function onClick() {
|
|
708
|
-
|
|
871
|
+
_this9.selectUserFilter(user);
|
|
709
872
|
}
|
|
710
873
|
});
|
|
711
874
|
}));
|
|
@@ -713,7 +876,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
713
876
|
}, {
|
|
714
877
|
key: "renderTypeFilterPopup",
|
|
715
878
|
value: function renderTypeFilterPopup() {
|
|
716
|
-
var
|
|
879
|
+
var _this10 = this;
|
|
717
880
|
|
|
718
881
|
if (!this.state.typeFilterOpen) {
|
|
719
882
|
return null;
|
|
@@ -727,13 +890,13 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
727
890
|
onClose: this.closeTypeFilter
|
|
728
891
|
}, /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
729
892
|
onClick: function onClick() {
|
|
730
|
-
|
|
893
|
+
_this10.selectTypeFilter("circle");
|
|
731
894
|
},
|
|
732
895
|
text: _.capitalize(values.entityName),
|
|
733
896
|
className: "marginRight-10"
|
|
734
897
|
}), /*#__PURE__*/React.createElement(Components$4.Tag, {
|
|
735
898
|
onClick: function onClick() {
|
|
736
|
-
|
|
899
|
+
_this10.selectTypeFilter("private");
|
|
737
900
|
},
|
|
738
901
|
text: "Private Message"
|
|
739
902
|
}));
|
|
@@ -741,7 +904,7 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
741
904
|
}, {
|
|
742
905
|
key: "render",
|
|
743
906
|
value: function render() {
|
|
744
|
-
var
|
|
907
|
+
var _this11 = this;
|
|
745
908
|
|
|
746
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, {
|
|
747
910
|
onClick: this.onAddNew,
|
|
@@ -751,21 +914,21 @@ var Circles = /*#__PURE__*/function (_Component) {
|
|
|
751
914
|
}, /*#__PURE__*/React.createElement(Components$4.Text, {
|
|
752
915
|
type: "h1",
|
|
753
916
|
className: ""
|
|
754
|
-
}, values.textFeatureTitle), this.renderFilters(), /*#__PURE__*/React.createElement(Table, {
|
|
917
|
+
}, values.textFeatureTitle), this.renderFilters(), this.renderUnreadFilterInfo(), /*#__PURE__*/React.createElement(Table, {
|
|
755
918
|
className: "plussTable",
|
|
756
919
|
striped: true,
|
|
757
920
|
bordered: true,
|
|
758
921
|
condensed: true,
|
|
759
922
|
hover: true,
|
|
760
923
|
style: {
|
|
761
|
-
minWidth:
|
|
924
|
+
minWidth: "100%"
|
|
762
925
|
}
|
|
763
926
|
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, "Title"), /*#__PURE__*/React.createElement("th", null, "Last updated"), /*#__PURE__*/React.createElement("th", null, "Members"), /*#__PURE__*/React.createElement("th", {
|
|
764
927
|
style: {
|
|
765
928
|
width: 50
|
|
766
929
|
}
|
|
767
930
|
}))), /*#__PURE__*/React.createElement("tbody", null, this.getCircles().map(function (circle) {
|
|
768
|
-
return
|
|
931
|
+
return _this11.renderRow(circle);
|
|
769
932
|
})))));
|
|
770
933
|
}
|
|
771
934
|
}]);
|
|
@@ -1729,6 +1892,32 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1729
1892
|
});
|
|
1730
1893
|
});
|
|
1731
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
|
+
|
|
1732
1921
|
_defineProperty(_assertThisInitialized(_this), "sendMessage", function () {
|
|
1733
1922
|
var message = {
|
|
1734
1923
|
_id: Helper.randomString(),
|
|
@@ -1813,6 +2002,7 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1813
2002
|
_createClass(Circle, [{
|
|
1814
2003
|
key: "componentDidMount",
|
|
1815
2004
|
value: function componentDidMount() {
|
|
2005
|
+
this.markCircleAsRead();
|
|
1816
2006
|
this.checkGetData();
|
|
1817
2007
|
this.connect();
|
|
1818
2008
|
this.props.setNavData({
|
|
@@ -1949,8 +2139,8 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1949
2139
|
display: this.state.imageInputShowing ? "block" : "none"
|
|
1950
2140
|
}
|
|
1951
2141
|
}, /*#__PURE__*/React.createElement(Components$2.ImageInput, {
|
|
1952
|
-
ref: function ref(
|
|
1953
|
-
_this5.imageInput =
|
|
2142
|
+
ref: function ref(_ref6) {
|
|
2143
|
+
_this5.imageInput = _ref6;
|
|
1954
2144
|
},
|
|
1955
2145
|
multiple: true,
|
|
1956
2146
|
limit: 10,
|
|
@@ -1964,8 +2154,8 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
1964
2154
|
display: this.state.fileInputShowing ? "block" : "none"
|
|
1965
2155
|
}
|
|
1966
2156
|
}, /*#__PURE__*/React.createElement(Components$2.FileInput, {
|
|
1967
|
-
ref: function ref(
|
|
1968
|
-
_this5.fileInput =
|
|
2157
|
+
ref: function ref(_ref7) {
|
|
2158
|
+
_this5.fileInput = _ref7;
|
|
1969
2159
|
},
|
|
1970
2160
|
multiple: true,
|
|
1971
2161
|
limit: 10,
|
|
@@ -2259,8 +2449,8 @@ var Circle = /*#__PURE__*/function (_Component) {
|
|
|
2259
2449
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2260
2450
|
className: "chat_newMessage"
|
|
2261
2451
|
}, this.renderChatInput()), this.renderReplyTo(), /*#__PURE__*/React.createElement("div", {
|
|
2262
|
-
ref: function ref(
|
|
2263
|
-
return _this8.chat =
|
|
2452
|
+
ref: function ref(_ref8) {
|
|
2453
|
+
return _this8.chat = _ref8;
|
|
2264
2454
|
},
|
|
2265
2455
|
className: "chat_messages"
|
|
2266
2456
|
}, _.isEmpty(this.state.messages) && !_.isEmpty(this.state.messageDate) && this.renderEmptyDate(), this.state.messages.map(function (m) {
|