@plusscommunities/pluss-circles-web-groups 1.6.3-beta.0 → 1.6.6-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.js +490 -373
- package/dist/index.js.map +1 -1
- package/package.json +4 -6
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
2
|
import { Component, useState, useEffect } from 'react';
|
|
4
3
|
import { connect } from 'react-redux';
|
|
@@ -12,7 +11,7 @@ import { Table } from 'react-bootstrap';
|
|
|
12
11
|
import { Icon } from '@plusscommunities/pluss-icons';
|
|
13
12
|
import { withRouter } from 'react-router';
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
const values = {
|
|
16
15
|
featureKey: "groups",
|
|
17
16
|
entityKey: "group",
|
|
18
17
|
entityName: "group",
|
|
@@ -40,7 +39,7 @@ var values = {
|
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
// import * as PlussCore from '../../pluss-core/src';
|
|
43
|
-
|
|
42
|
+
const FeatureConfig = {
|
|
44
43
|
key: values.featureKey,
|
|
45
44
|
singularName: _.capitalize(values.entityName),
|
|
46
45
|
description: "App users can create ".concat(values.entityName, "s and message each other."),
|
|
@@ -130,38 +129,38 @@ var FeatureConfig = {
|
|
|
130
129
|
}
|
|
131
130
|
};
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
const CIRCLES_LOADED = "".concat(values.actionCircleKey, "S_LOADED");
|
|
133
|
+
const CIRCLE_UPDATED = "".concat(values.actionCircleKey, "_UPDATED");
|
|
134
|
+
const CIRCLE_REMOVED = "".concat(values.actionCircleKey, "_REMOVED");
|
|
136
135
|
|
|
137
|
-
|
|
136
|
+
const circlesLoaded = circles => {
|
|
138
137
|
return {
|
|
139
138
|
type: CIRCLES_LOADED,
|
|
140
139
|
payload: circles
|
|
141
140
|
};
|
|
142
141
|
};
|
|
143
|
-
|
|
142
|
+
const circleUpdated = circle => {
|
|
144
143
|
return {
|
|
145
144
|
type: CIRCLE_UPDATED,
|
|
146
145
|
payload: circle
|
|
147
146
|
};
|
|
148
147
|
};
|
|
149
|
-
|
|
148
|
+
const circleRemoved = circleId => {
|
|
150
149
|
return {
|
|
151
150
|
type: CIRCLE_REMOVED,
|
|
152
151
|
payload: circleId
|
|
153
152
|
};
|
|
154
153
|
};
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
Helper: Helper$
|
|
155
|
+
const {
|
|
156
|
+
Helper: Helper$4,
|
|
158
157
|
Session: Session$4
|
|
159
158
|
} = PlussCore;
|
|
160
|
-
|
|
159
|
+
const circleActions = {
|
|
161
160
|
getAll: site => {
|
|
162
161
|
return Session$4.authedFunction({
|
|
163
162
|
method: "GET",
|
|
164
|
-
url: Helper$
|
|
163
|
+
url: Helper$4.getUrl(values.serviceKey, "get/all", {
|
|
165
164
|
site
|
|
166
165
|
})
|
|
167
166
|
});
|
|
@@ -169,7 +168,7 @@ var circleActions = {
|
|
|
169
168
|
getFiles: circleId => {
|
|
170
169
|
return Session$4.authedFunction({
|
|
171
170
|
method: "GET",
|
|
172
|
-
url: Helper$
|
|
171
|
+
url: Helper$4.getUrl(values.serviceKey, "get/files", {
|
|
173
172
|
circleId
|
|
174
173
|
})
|
|
175
174
|
});
|
|
@@ -177,7 +176,7 @@ var circleActions = {
|
|
|
177
176
|
getImages: circleId => {
|
|
178
177
|
return Session$4.authedFunction({
|
|
179
178
|
method: "GET",
|
|
180
|
-
url: Helper$
|
|
179
|
+
url: Helper$4.getUrl(values.serviceKey, "get/images", {
|
|
181
180
|
circleId
|
|
182
181
|
})
|
|
183
182
|
});
|
|
@@ -185,7 +184,7 @@ var circleActions = {
|
|
|
185
184
|
add: (site, title, image, audience, isPublic) => {
|
|
186
185
|
return Session$4.authedFunction({
|
|
187
186
|
method: "POST",
|
|
188
|
-
url: Helper$
|
|
187
|
+
url: Helper$4.getUrl(values.serviceKey, "update/add"),
|
|
189
188
|
data: {
|
|
190
189
|
site,
|
|
191
190
|
title,
|
|
@@ -198,7 +197,7 @@ var circleActions = {
|
|
|
198
197
|
edit: (circleId, title, image, audience, isPublic) => {
|
|
199
198
|
return Session$4.authedFunction({
|
|
200
199
|
method: "POST",
|
|
201
|
-
url: Helper$
|
|
200
|
+
url: Helper$4.getUrl(values.serviceKey, "update/edit"),
|
|
202
201
|
data: {
|
|
203
202
|
circleId,
|
|
204
203
|
title,
|
|
@@ -211,7 +210,7 @@ var circleActions = {
|
|
|
211
210
|
delete: circleId => {
|
|
212
211
|
return Session$4.authedFunction({
|
|
213
212
|
method: "POST",
|
|
214
|
-
url: Helper$
|
|
213
|
+
url: Helper$4.getUrl(values.serviceKey, "update/delete"),
|
|
215
214
|
data: {
|
|
216
215
|
circleId
|
|
217
216
|
}
|
|
@@ -220,7 +219,7 @@ var circleActions = {
|
|
|
220
219
|
addAdmin: (circleId, userId) => {
|
|
221
220
|
return Session$4.authedFunction({
|
|
222
221
|
method: "POST",
|
|
223
|
-
url: Helper$
|
|
222
|
+
url: Helper$4.getUrl(values.serviceKey, "update/addadmin"),
|
|
224
223
|
data: {
|
|
225
224
|
circleId,
|
|
226
225
|
userId
|
|
@@ -230,129 +229,102 @@ var circleActions = {
|
|
|
230
229
|
removeAdmin: (circleId, userId) => {
|
|
231
230
|
return Session$4.authedFunction({
|
|
232
231
|
method: "POST",
|
|
233
|
-
url: Helper$
|
|
232
|
+
url: Helper$4.getUrl(values.serviceKey, "update/removeadmin"),
|
|
234
233
|
data: {
|
|
235
234
|
circleId,
|
|
236
235
|
userId
|
|
237
236
|
}
|
|
238
237
|
});
|
|
239
238
|
},
|
|
240
|
-
getMessages:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
query.minTime = minTime;
|
|
247
|
-
}
|
|
248
|
-
if (!_.isUndefined(maxTime)) {
|
|
249
|
-
query.maxTime = maxTime;
|
|
250
|
-
}
|
|
251
|
-
if (limit) {
|
|
252
|
-
query.limit = limit;
|
|
253
|
-
}
|
|
254
|
-
return Session$4.authedFunction({
|
|
255
|
-
method: "GET",
|
|
256
|
-
url: Helper$3.getUrl(values.serviceKey, "getMessages", query)
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
function getMessages(_x, _x2, _x3, _x4) {
|
|
260
|
-
return _getMessages.apply(this, arguments);
|
|
239
|
+
getMessages: async (groupId, limit, minTime, maxTime) => {
|
|
240
|
+
const query = {
|
|
241
|
+
groupId
|
|
242
|
+
};
|
|
243
|
+
if (!_.isUndefined(minTime)) {
|
|
244
|
+
query.minTime = minTime;
|
|
261
245
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
sendMessage: function () {
|
|
265
|
-
var _sendMessage = _asyncToGenerator(function* (circleId, message) {
|
|
266
|
-
return Session$4.authedFunction({
|
|
267
|
-
method: "post",
|
|
268
|
-
url: Helper$3.getUrl(values.serviceKey, "sendMessage"),
|
|
269
|
-
data: {
|
|
270
|
-
groupId: circleId,
|
|
271
|
-
message
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
});
|
|
275
|
-
function sendMessage(_x5, _x6) {
|
|
276
|
-
return _sendMessage.apply(this, arguments);
|
|
246
|
+
if (!_.isUndefined(maxTime)) {
|
|
247
|
+
query.maxTime = maxTime;
|
|
277
248
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
deleteMessage: function () {
|
|
281
|
-
var _deleteMessage = _asyncToGenerator(function* (messageId, groupId) {
|
|
282
|
-
return Session$4.authedFunction({
|
|
283
|
-
method: "POST",
|
|
284
|
-
url: Helper$3.getUrl(values.serviceKey, "update/deletemessage"),
|
|
285
|
-
data: {
|
|
286
|
-
messageId,
|
|
287
|
-
groupId
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
function deleteMessage(_x7, _x8) {
|
|
292
|
-
return _deleteMessage.apply(this, arguments);
|
|
249
|
+
if (limit) {
|
|
250
|
+
query.limit = limit;
|
|
293
251
|
}
|
|
294
|
-
return
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
var _markAsRead = _asyncToGenerator(function* (circleId, userId) {
|
|
298
|
-
return Session$4.authedFunction({
|
|
299
|
-
method: "post",
|
|
300
|
-
url: Helper$3.getUrl("groups", "resetunread"),
|
|
301
|
-
data: {
|
|
302
|
-
groupID: circleId,
|
|
303
|
-
userID: userId
|
|
304
|
-
}
|
|
305
|
-
});
|
|
252
|
+
return Session$4.authedFunction({
|
|
253
|
+
method: "GET",
|
|
254
|
+
url: Helper$4.getUrl(values.serviceKey, "getMessages", query)
|
|
306
255
|
});
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
256
|
+
},
|
|
257
|
+
sendMessage: async (circleId, message) => {
|
|
258
|
+
return Session$4.authedFunction({
|
|
259
|
+
method: "post",
|
|
260
|
+
url: Helper$4.getUrl(values.serviceKey, "sendMessage"),
|
|
261
|
+
data: {
|
|
262
|
+
groupId: circleId,
|
|
263
|
+
message
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
deleteMessage: async (messageId, groupId) => {
|
|
268
|
+
return Session$4.authedFunction({
|
|
269
|
+
method: "POST",
|
|
270
|
+
url: Helper$4.getUrl(values.serviceKey, "update/deletemessage"),
|
|
271
|
+
data: {
|
|
272
|
+
messageId,
|
|
273
|
+
groupId
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
markAsRead: async (circleId, userId) => {
|
|
278
|
+
return Session$4.authedFunction({
|
|
279
|
+
method: "post",
|
|
280
|
+
url: Helper$4.getUrl("groups", "resetunread"),
|
|
281
|
+
data: {
|
|
282
|
+
groupID: circleId,
|
|
283
|
+
userID: userId
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
312
287
|
};
|
|
313
288
|
|
|
314
|
-
|
|
289
|
+
const {
|
|
315
290
|
Apis: Apis$1
|
|
316
291
|
} = PlussCore;
|
|
317
|
-
|
|
292
|
+
const analyticsActions = Apis$1.analyticsActions;
|
|
318
293
|
|
|
319
294
|
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}}
|
|
320
295
|
|
|
321
|
-
var css = "/* Badge styling for unread count */\n:root {\n\t--badge-bg-color: #597db4; /* COLOUR_BRANDING_OFF */\n}\n\n.
|
|
322
|
-
var modules_208c68ad = {"badgeTag":"Circles_module_badgeTag__11115bc9","unreadFilterBanner":"Circles_module_unreadFilterBanner__11115bc9","unreadFilterContent":"Circles_module_unreadFilterContent__11115bc9","unreadFilterIcon":"Circles_module_unreadFilterIcon__11115bc9","unreadFilterText":"Circles_module_unreadFilterText__11115bc9","unreadFilterButton":"Circles_module_unreadFilterButton__11115bc9"};
|
|
296
|
+
var css = "/* Badge styling for unread count */\n:root {\n\t--badge-bg-color: #597db4; /* COLOUR_BRANDING_OFF */\n}\n\n.badgeTag {\n\tfont-size: 11px;\n\tfont-weight: 400;\n\tpadding: 3px 10px;\n\tbackground-color: var(--badge-bg-color) !important;\n\tcolor: #fff !important;\n\tborder-radius: 999px !important;\n\tborder: none !important;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tline-height: 1;\n\tletter-spacing: 0.02em;\n}\n\n/* Unread filter info banner */\n.unreadFilterBanner {\n\tbackground-color: #f0f4f8;\n\tborder-left: 3px solid var(--badge-bg-color);\n\tborder-radius: 4px;\n\tpadding: 12px 16px;\n\tmargin-top: 16px;\n\tmargin-bottom: 16px;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.unreadFilterContent {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\twidth: 100%;\n}\n\n.unreadFilterIcon {\n\tfont-size: 16px;\n\tcolor: var(--badge-bg-color);\n\tflex-shrink: 0;\n}\n\n.unreadFilterText {\n\tfont-size: 14px;\n\tline-height: 1.5;\n\tcolor: #333333;\n}\n\n.unreadFilterButton {\n\tbackground: none;\n\tborder: none;\n\tcolor: var(--badge-bg-color);\n\tfont-size: 14px;\n\tfont-weight: 500;\n\ttext-decoration: underline;\n\tcursor: pointer;\n\tpadding: 4px 8px;\n\tmargin-left: 4px;\n\tmin-height: 32px;\n\tmin-width: 32px;\n\ttransition: all 0.2s ease;\n}\n\n.unreadFilterButton:hover {\n\tbackground-color: rgba(89, 125, 180, 0.1);\n\ttext-decoration: none;\n}\n\n.unreadFilterButton:focus {\n\toutline: 2px solid var(--badge-bg-color);\n\toutline-offset: 2px;\n\tborder-radius: 2px;\n}\n\n/* Mobile responsiveness */\n@media (max-width: 768px) {\n\t.unreadFilterBanner {\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tpadding: 12px;\n\t}\n\n\t.unreadFilterContent {\n\t\tflex-direction: column;\n\t\talign-items: flex-start;\n\t\tgap: 8px;\n\t}\n\n\t.unreadFilterText {\n\t\tfont-size: 13px;\n\t}\n}\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9zY3JlZW5zL0NpcmNsZXMubW9kdWxlLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtQ0FBbUM7QUFDbkM7Q0FDQyx5QkFBeUIsRUFBRSx3QkFBd0I7QUFDcEQ7O0FBRUE7Q0FDQyxlQUFlO0NBQ2YsZ0JBQWdCO0NBQ2hCLGlCQUFpQjtDQUNqQixrREFBa0Q7Q0FDbEQsc0JBQXNCO0NBQ3RCLCtCQUErQjtDQUMvQix1QkFBdUI7Q0FDdkIsb0JBQW9CO0NBQ3BCLG1CQUFtQjtDQUNuQix1QkFBdUI7Q0FDdkIsY0FBYztDQUNkLHNCQUFzQjtBQUN2Qjs7QUFFQSw4QkFBOEI7QUFDOUI7Q0FDQyx5QkFBeUI7Q0FDekIsNENBQTRDO0NBQzVDLGtCQUFrQjtDQUNsQixrQkFBa0I7Q0FDbEIsZ0JBQWdCO0NBQ2hCLG1CQUFtQjtDQUNuQixhQUFhO0NBQ2IsbUJBQW1CO0FBQ3BCOztBQUVBO0NBQ0MsYUFBYTtDQUNiLG1CQUFtQjtDQUNuQixTQUFTO0NBQ1QsV0FBVztBQUNaOztBQUVBO0NBQ0MsZUFBZTtDQUNmLDRCQUE0QjtDQUM1QixjQUFjO0FBQ2Y7O0FBRUE7Q0FDQyxlQUFlO0NBQ2YsZ0JBQWdCO0NBQ2hCLGNBQWM7QUFDZjs7QUFFQTtDQUNDLGdCQUFnQjtDQUNoQixZQUFZO0NBQ1osNEJBQTRCO0NBQzVCLGVBQWU7Q0FDZixnQkFBZ0I7Q0FDaEIsMEJBQTBCO0NBQzFCLGVBQWU7Q0FDZixnQkFBZ0I7Q0FDaEIsZ0JBQWdCO0NBQ2hCLGdCQUFnQjtDQUNoQixlQUFlO0NBQ2YseUJBQXlCO0FBQzFCOztBQUVBO0NBQ0MseUNBQXlDO0NBQ3pDLHFCQUFxQjtBQUN0Qjs7QUFFQTtDQUNDLHdDQUF3QztDQUN4QyxtQkFBbUI7Q0FDbkIsa0JBQWtCO0FBQ25COztBQUVBLDBCQUEwQjtBQUMxQjtDQUNDO0VBQ0Msc0JBQXNCO0VBQ3RCLHVCQUF1QjtFQUN2QixhQUFhO0NBQ2Q7O0NBRUE7RUFDQyxzQkFBc0I7RUFDdEIsdUJBQXVCO0VBQ3ZCLFFBQVE7Q0FDVDs7Q0FFQTtFQUNDLGVBQWU7Q0FDaEI7QUFDRCIsInNvdXJjZXNDb250ZW50IjpbIi8qIEJhZGdlIHN0eWxpbmcgZm9yIHVucmVhZCBjb3VudCAqL1xuOnJvb3Qge1xuXHQtLWJhZGdlLWJnLWNvbG9yOiAjNTk3ZGI0OyAvKiBDT0xPVVJfQlJBTkRJTkdfT0ZGICovXG59XG5cbi5iYWRnZVRhZyB7XG5cdGZvbnQtc2l6ZTogMTFweDtcblx0Zm9udC13ZWlnaHQ6IDQwMDtcblx0cGFkZGluZzogM3B4IDEwcHg7XG5cdGJhY2tncm91bmQtY29sb3I6IHZhcigtLWJhZGdlLWJnLWNvbG9yKSAhaW1wb3J0YW50O1xuXHRjb2xvcjogI2ZmZiAhaW1wb3J0YW50O1xuXHRib3JkZXItcmFkaXVzOiA5OTlweCAhaW1wb3J0YW50O1xuXHRib3JkZXI6IG5vbmUgIWltcG9ydGFudDtcblx0ZGlzcGxheTogaW5saW5lLWZsZXg7XG5cdGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5cdGp1c3RpZnktY29udGVudDogY2VudGVyO1xuXHRsaW5lLWhlaWdodDogMTtcblx0bGV0dGVyLXNwYWNpbmc6IDAuMDJlbTtcbn1cblxuLyogVW5yZWFkIGZpbHRlciBpbmZvIGJhbm5lciAqL1xuLnVucmVhZEZpbHRlckJhbm5lciB7XG5cdGJhY2tncm91bmQtY29sb3I6ICNmMGY0Zjg7XG5cdGJvcmRlci1sZWZ0OiAzcHggc29saWQgdmFyKC0tYmFkZ2UtYmctY29sb3IpO1xuXHRib3JkZXItcmFkaXVzOiA0cHg7XG5cdHBhZGRpbmc6IDEycHggMTZweDtcblx0bWFyZ2luLXRvcDogMTZweDtcblx0bWFyZ2luLWJvdHRvbTogMTZweDtcblx0ZGlzcGxheTogZmxleDtcblx0YWxpZ24taXRlbXM6IGNlbnRlcjtcbn1cblxuLnVucmVhZEZpbHRlckNvbnRlbnQge1xuXHRkaXNwbGF5OiBmbGV4O1xuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRnYXA6IDEwcHg7XG5cdHdpZHRoOiAxMDAlO1xufVxuXG4udW5yZWFkRmlsdGVySWNvbiB7XG5cdGZvbnQtc2l6ZTogMTZweDtcblx0Y29sb3I6IHZhcigtLWJhZGdlLWJnLWNvbG9yKTtcblx0ZmxleC1zaHJpbms6IDA7XG59XG5cbi51bnJlYWRGaWx0ZXJUZXh0IHtcblx0Zm9udC1zaXplOiAxNHB4O1xuXHRsaW5lLWhlaWdodDogMS41O1xuXHRjb2xvcjogIzMzMzMzMztcbn1cblxuLnVucmVhZEZpbHRlckJ1dHRvbiB7XG5cdGJhY2tncm91bmQ6IG5vbmU7XG5cdGJvcmRlcjogbm9uZTtcblx0Y29sb3I6IHZhcigtLWJhZGdlLWJnLWNvbG9yKTtcblx0Zm9udC1zaXplOiAxNHB4O1xuXHRmb250LXdlaWdodDogNTAwO1xuXHR0ZXh0LWRlY29yYXRpb246IHVuZGVybGluZTtcblx0Y3Vyc29yOiBwb2ludGVyO1xuXHRwYWRkaW5nOiA0cHggOHB4O1xuXHRtYXJnaW4tbGVmdDogNHB4O1xuXHRtaW4taGVpZ2h0OiAzMnB4O1xuXHRtaW4td2lkdGg6IDMycHg7XG5cdHRyYW5zaXRpb246IGFsbCAwLjJzIGVhc2U7XG59XG5cbi51bnJlYWRGaWx0ZXJCdXR0b246aG92ZXIge1xuXHRiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDg5LCAxMjUsIDE4MCwgMC4xKTtcblx0dGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuXG4udW5yZWFkRmlsdGVyQnV0dG9uOmZvY3VzIHtcblx0b3V0bGluZTogMnB4IHNvbGlkIHZhcigtLWJhZGdlLWJnLWNvbG9yKTtcblx0b3V0bGluZS1vZmZzZXQ6IDJweDtcblx0Ym9yZGVyLXJhZGl1czogMnB4O1xufVxuXG4vKiBNb2JpbGUgcmVzcG9uc2l2ZW5lc3MgKi9cbkBtZWRpYSAobWF4LXdpZHRoOiA3NjhweCkge1xuXHQudW5yZWFkRmlsdGVyQmFubmVyIHtcblx0XHRmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuXHRcdGFsaWduLWl0ZW1zOiBmbGV4LXN0YXJ0O1xuXHRcdHBhZGRpbmc6IDEycHg7XG5cdH1cblxuXHQudW5yZWFkRmlsdGVyQ29udGVudCB7XG5cdFx0ZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcblx0XHRhbGlnbi1pdGVtczogZmxleC1zdGFydDtcblx0XHRnYXA6IDhweDtcblx0fVxuXG5cdC51bnJlYWRGaWx0ZXJUZXh0IHtcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdH1cbn1cbiJdfQ== */";
|
|
323
297
|
n(css,{});
|
|
324
298
|
|
|
325
|
-
|
|
299
|
+
const {
|
|
326
300
|
Components: Components$4,
|
|
327
301
|
Session: Session$3,
|
|
328
|
-
Helper: Helper$
|
|
302
|
+
Helper: Helper$3
|
|
329
303
|
} = PlussCore;
|
|
330
304
|
class Circles extends Component {
|
|
331
305
|
constructor(props) {
|
|
332
|
-
var _this;
|
|
333
306
|
super(props);
|
|
334
|
-
_this = this;
|
|
335
307
|
_defineProperty(this, "getData", () => {
|
|
336
|
-
|
|
308
|
+
const {
|
|
337
309
|
auth
|
|
338
310
|
} = this.props;
|
|
339
311
|
this.setState({
|
|
340
312
|
loadingAll: true
|
|
341
|
-
},
|
|
313
|
+
}, async () => {
|
|
342
314
|
try {
|
|
343
|
-
|
|
315
|
+
const res = await circleActions.getAll(auth.site);
|
|
344
316
|
console.log("getData", res.data);
|
|
345
|
-
|
|
346
|
-
|
|
317
|
+
this.props.circlesLoaded(res.data);
|
|
318
|
+
this.setState({
|
|
347
319
|
loadingAll: false
|
|
348
320
|
});
|
|
349
321
|
} catch (error) {
|
|
350
322
|
console.error("getData", error);
|
|
351
|
-
|
|
323
|
+
this.setState({
|
|
352
324
|
loadingAll: false
|
|
353
325
|
});
|
|
354
326
|
}
|
|
355
|
-
})
|
|
327
|
+
});
|
|
356
328
|
});
|
|
357
329
|
_defineProperty(this, "selectUnreadFilter", showUnreadOnly => {
|
|
358
330
|
this.setState({
|
|
@@ -360,13 +332,13 @@ class Circles extends Component {
|
|
|
360
332
|
});
|
|
361
333
|
});
|
|
362
334
|
_defineProperty(this, "canAddNew", () => {
|
|
363
|
-
|
|
335
|
+
const {
|
|
364
336
|
auth
|
|
365
337
|
} = this.props;
|
|
366
338
|
return Session$3.validateAccess(auth.site, values.permission, auth);
|
|
367
339
|
});
|
|
368
340
|
_defineProperty(this, "onAddNew", () => {
|
|
369
|
-
|
|
341
|
+
const {
|
|
370
342
|
auth
|
|
371
343
|
} = this.props;
|
|
372
344
|
if (Session$3.validateAccess(auth.site, values.permission, auth)) {
|
|
@@ -471,21 +443,21 @@ class Circles extends Component {
|
|
|
471
443
|
}
|
|
472
444
|
}
|
|
473
445
|
isCircleUnread(circle) {
|
|
474
|
-
|
|
446
|
+
const userId = this.props.user.Id;
|
|
475
447
|
if (!circle.Unread || !circle.Unread[userId]) {
|
|
476
448
|
return false;
|
|
477
449
|
}
|
|
478
450
|
return circle.Unread[userId] > 0;
|
|
479
451
|
}
|
|
480
452
|
getUnreadCount(circle) {
|
|
481
|
-
|
|
453
|
+
const userId = this.props.user.Id;
|
|
482
454
|
if (!circle.Unread || !circle.Unread[userId]) {
|
|
483
455
|
return 0;
|
|
484
456
|
}
|
|
485
457
|
return circle.Unread[userId];
|
|
486
458
|
}
|
|
487
459
|
getCircles() {
|
|
488
|
-
|
|
460
|
+
let result = this.props.circles;
|
|
489
461
|
if (this.state.selectedTypeFilter) {
|
|
490
462
|
result = _.filter(result, circle => {
|
|
491
463
|
return this.state.selectedTypeFilter === "circle" ? !circle.IsPrivate : circle.IsPrivate;
|
|
@@ -513,7 +485,7 @@ class Circles extends Component {
|
|
|
513
485
|
return result;
|
|
514
486
|
}
|
|
515
487
|
getUsers() {
|
|
516
|
-
|
|
488
|
+
let users = [];
|
|
517
489
|
this.props.circles.forEach(circle => {
|
|
518
490
|
circle.Audience.forEach(user => {
|
|
519
491
|
users.push(user);
|
|
@@ -541,9 +513,9 @@ class Circles extends Component {
|
|
|
541
513
|
});
|
|
542
514
|
}
|
|
543
515
|
renderRow(circle) {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
className:
|
|
516
|
+
const unreadCount = this.getUnreadCount(circle);
|
|
517
|
+
const badge = unreadCount > 0 ? /*#__PURE__*/jsx(Components$4.Tag, {
|
|
518
|
+
className: css.badgeTag,
|
|
547
519
|
text: "".concat(unreadCount, " new")
|
|
548
520
|
}) : null;
|
|
549
521
|
return /*#__PURE__*/jsxs("tr", {
|
|
@@ -551,7 +523,7 @@ class Circles extends Component {
|
|
|
551
523
|
className: "table-TitleColumn",
|
|
552
524
|
children: /*#__PURE__*/jsxs("div", {
|
|
553
525
|
className: "flex flex-center",
|
|
554
|
-
|
|
526
|
+
iconStyle: {
|
|
555
527
|
gap: "8px"
|
|
556
528
|
},
|
|
557
529
|
children: [/*#__PURE__*/jsx(Link, {
|
|
@@ -573,14 +545,14 @@ class Circles extends Component {
|
|
|
573
545
|
}), /*#__PURE__*/jsx("td", {
|
|
574
546
|
className: "table-options",
|
|
575
547
|
children: /*#__PURE__*/jsxs("div", {
|
|
576
|
-
|
|
548
|
+
iconStyle: {
|
|
577
549
|
display: "flex",
|
|
578
550
|
alignItems: "center"
|
|
579
551
|
},
|
|
580
552
|
children: [this.validateCircleAdmin(circle) && !circle.IsPrivate && /*#__PURE__*/jsx(Link, {
|
|
581
553
|
to: "/".concat(values.featureKey, "/edit/").concat(circle.Id),
|
|
582
554
|
children: /*#__PURE__*/jsx(Icon, {
|
|
583
|
-
|
|
555
|
+
iconStyle: {
|
|
584
556
|
fontSize: 20,
|
|
585
557
|
padding: 5,
|
|
586
558
|
marginLeft: 12,
|
|
@@ -593,7 +565,7 @@ class Circles extends Component {
|
|
|
593
565
|
this.removeCircle(circle);
|
|
594
566
|
},
|
|
595
567
|
children: /*#__PURE__*/jsx(Icon, {
|
|
596
|
-
|
|
568
|
+
iconStyle: {
|
|
597
569
|
fontSize: 20,
|
|
598
570
|
padding: 5,
|
|
599
571
|
marginLeft: 12,
|
|
@@ -607,23 +579,23 @@ class Circles extends Component {
|
|
|
607
579
|
}, circle.Id);
|
|
608
580
|
}
|
|
609
581
|
renderUnreadFilterInfo() {
|
|
610
|
-
|
|
582
|
+
const {
|
|
611
583
|
showUnreadOnly
|
|
612
584
|
} = this.state;
|
|
613
585
|
if (!showUnreadOnly) {
|
|
614
586
|
return null;
|
|
615
587
|
}
|
|
616
588
|
return /*#__PURE__*/jsx("div", {
|
|
617
|
-
className:
|
|
589
|
+
className: css.unreadFilterBanner,
|
|
618
590
|
children: /*#__PURE__*/jsxs("div", {
|
|
619
|
-
className:
|
|
591
|
+
className: css.unreadFilterContent,
|
|
620
592
|
children: [/*#__PURE__*/jsx(Icon, {
|
|
621
593
|
icon: "circle-info",
|
|
622
|
-
className:
|
|
594
|
+
className: css.unreadFilterIcon
|
|
623
595
|
}), /*#__PURE__*/jsxs("span", {
|
|
624
|
-
className:
|
|
596
|
+
className: css.unreadFilterText,
|
|
625
597
|
children: ["Showing only items with new messages.", " ", /*#__PURE__*/jsx("button", {
|
|
626
|
-
className:
|
|
598
|
+
className: css.unreadFilterButton,
|
|
627
599
|
onClick: () => this.selectUnreadFilter(false),
|
|
628
600
|
"aria-label": "Turn off unread filter",
|
|
629
601
|
children: "Turn off filter"
|
|
@@ -633,18 +605,18 @@ class Circles extends Component {
|
|
|
633
605
|
});
|
|
634
606
|
}
|
|
635
607
|
renderFilters() {
|
|
636
|
-
|
|
608
|
+
let userFilter = /*#__PURE__*/jsx(Components$4.Tag, {
|
|
637
609
|
className: "marginRight-10",
|
|
638
610
|
onClick: this.openUserFilter,
|
|
639
611
|
text: "User"
|
|
640
612
|
});
|
|
641
|
-
|
|
613
|
+
let unreadFilter = /*#__PURE__*/jsx(Components$4.Tag, {
|
|
642
614
|
className: "marginRight-10",
|
|
643
615
|
onClick: () => this.selectUnreadFilter(!this.state.showUnreadOnly),
|
|
644
616
|
leftIcon: this.state.showUnreadOnly ? "check" : null,
|
|
645
617
|
text: "Unread Only"
|
|
646
618
|
});
|
|
647
|
-
|
|
619
|
+
let typeFilter = /*#__PURE__*/jsx(Components$4.Tag, {
|
|
648
620
|
className: "marginRight-10",
|
|
649
621
|
onClick: this.openTypeFilter,
|
|
650
622
|
text: "Type"
|
|
@@ -777,7 +749,7 @@ class Circles extends Component {
|
|
|
777
749
|
}), /*#__PURE__*/jsx("th", {
|
|
778
750
|
children: "Members"
|
|
779
751
|
}), /*#__PURE__*/jsx("th", {
|
|
780
|
-
|
|
752
|
+
iconStyle: {
|
|
781
753
|
width: 50
|
|
782
754
|
}
|
|
783
755
|
})]
|
|
@@ -792,17 +764,17 @@ class Circles extends Component {
|
|
|
792
764
|
});
|
|
793
765
|
}
|
|
794
766
|
}
|
|
795
|
-
|
|
796
|
-
|
|
767
|
+
const mapStateToProps$3 = state => {
|
|
768
|
+
const {
|
|
797
769
|
circles
|
|
798
770
|
} = state[values.reducerKey];
|
|
799
|
-
|
|
771
|
+
const {
|
|
800
772
|
auth
|
|
801
773
|
} = state;
|
|
802
774
|
return {
|
|
803
775
|
circles,
|
|
804
776
|
auth,
|
|
805
|
-
user: Helper$
|
|
777
|
+
user: Helper$3.getUserFromState(state)
|
|
806
778
|
};
|
|
807
779
|
};
|
|
808
780
|
var Circles$1 = connect(mapStateToProps$3, {
|
|
@@ -810,21 +782,19 @@ var Circles$1 = connect(mapStateToProps$3, {
|
|
|
810
782
|
circleRemoved
|
|
811
783
|
})(Circles);
|
|
812
784
|
|
|
813
|
-
function ownKeys$
|
|
814
|
-
function _objectSpread$
|
|
815
|
-
|
|
785
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
786
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
787
|
+
const {
|
|
816
788
|
Actions: Actions$1,
|
|
817
789
|
Components: Components$3,
|
|
818
790
|
Session: Session$2,
|
|
819
791
|
Apis,
|
|
820
|
-
Colours: Colours$
|
|
821
|
-
Helper: Helper$
|
|
792
|
+
Colours: Colours$3,
|
|
793
|
+
Helper: Helper$2
|
|
822
794
|
} = PlussCore;
|
|
823
795
|
class AddCircle extends Component {
|
|
824
796
|
constructor(props) {
|
|
825
|
-
var _this;
|
|
826
797
|
super(props);
|
|
827
|
-
_this = this;
|
|
828
798
|
_defineProperty(this, "getUsers", () => {
|
|
829
799
|
Apis.userActions.fetchUsers(this.props.auth.site).then(res => {
|
|
830
800
|
this.setState({
|
|
@@ -838,7 +808,7 @@ class AddCircle extends Component {
|
|
|
838
808
|
users: _.sortBy(res.data.results.Items, u => {
|
|
839
809
|
return (u.displayName || "").toLowerCase();
|
|
840
810
|
}).map(u => {
|
|
841
|
-
return _objectSpread$
|
|
811
|
+
return _objectSpread$5(_objectSpread$5({}, u), {}, {
|
|
842
812
|
userId: u.userId || u.Id
|
|
843
813
|
});
|
|
844
814
|
})
|
|
@@ -864,7 +834,7 @@ class AddCircle extends Component {
|
|
|
864
834
|
});
|
|
865
835
|
});
|
|
866
836
|
_defineProperty(this, "parseCircle", circle => {
|
|
867
|
-
|
|
837
|
+
const selectedUsers = circle.Audience.map(user => {
|
|
868
838
|
return {
|
|
869
839
|
userId: user.userId,
|
|
870
840
|
profilePic: user.profilePic,
|
|
@@ -872,7 +842,7 @@ class AddCircle extends Component {
|
|
|
872
842
|
isAdmin: user.isAdmin
|
|
873
843
|
};
|
|
874
844
|
});
|
|
875
|
-
|
|
845
|
+
const newState = {
|
|
876
846
|
title: circle.Title,
|
|
877
847
|
isPublic: !!circle.IsPublic,
|
|
878
848
|
selectedUsers
|
|
@@ -889,31 +859,31 @@ class AddCircle extends Component {
|
|
|
889
859
|
if (this.state.circle) {
|
|
890
860
|
return this.parseCircle(this.state.circle);
|
|
891
861
|
}
|
|
892
|
-
|
|
862
|
+
const {
|
|
893
863
|
auth
|
|
894
864
|
} = this.props;
|
|
895
865
|
this.setState({
|
|
896
866
|
loadingAll: true
|
|
897
|
-
},
|
|
867
|
+
}, async () => {
|
|
898
868
|
try {
|
|
899
|
-
|
|
869
|
+
const res = await circleActions.getAll(auth.site);
|
|
900
870
|
console.log("getData", res.data);
|
|
901
|
-
|
|
902
|
-
return c.Id ===
|
|
871
|
+
const circle = _.find(res.data, c => {
|
|
872
|
+
return c.Id === this.state.circleId;
|
|
903
873
|
});
|
|
904
|
-
|
|
905
|
-
|
|
874
|
+
this.props.circlesLoaded(res.data);
|
|
875
|
+
this.setState({
|
|
906
876
|
loadingAll: false,
|
|
907
877
|
circle
|
|
908
878
|
});
|
|
909
|
-
|
|
879
|
+
this.parseCircle(circle);
|
|
910
880
|
} catch (error) {
|
|
911
881
|
console.error("getData", error);
|
|
912
|
-
|
|
882
|
+
this.setState({
|
|
913
883
|
loadingAll: false
|
|
914
884
|
});
|
|
915
885
|
}
|
|
916
|
-
})
|
|
886
|
+
});
|
|
917
887
|
});
|
|
918
888
|
_defineProperty(this, "onHandleChange", event => {
|
|
919
889
|
var stateChange = {};
|
|
@@ -931,7 +901,7 @@ class AddCircle extends Component {
|
|
|
931
901
|
});
|
|
932
902
|
});
|
|
933
903
|
_defineProperty(this, "onSelectUser", user => {
|
|
934
|
-
|
|
904
|
+
const newState = {
|
|
935
905
|
selectedUsers: _.xor(this.state.selectedUsers, [user])
|
|
936
906
|
};
|
|
937
907
|
if (_.isEmpty(this.state.title) && _.includes(newState.selectedUsers, user)) {
|
|
@@ -953,7 +923,7 @@ class AddCircle extends Component {
|
|
|
953
923
|
this.setState({
|
|
954
924
|
updating: true
|
|
955
925
|
});
|
|
956
|
-
|
|
926
|
+
const audience = this.state.selectedUsers.map(user => {
|
|
957
927
|
return {
|
|
958
928
|
userId: user.userId,
|
|
959
929
|
profilePic: user.profilePic,
|
|
@@ -1005,7 +975,7 @@ class AddCircle extends Component {
|
|
|
1005
975
|
selectedUsers: [...this.state.selectedUsers]
|
|
1006
976
|
});
|
|
1007
977
|
});
|
|
1008
|
-
|
|
978
|
+
const circleId = Helper$2.safeReadParams(props, "circleId");
|
|
1009
979
|
this.state = {
|
|
1010
980
|
circleId,
|
|
1011
981
|
circle: _.find(props.circles, c => {
|
|
@@ -1113,7 +1083,7 @@ class AddCircle extends Component {
|
|
|
1113
1083
|
}]
|
|
1114
1084
|
}), /*#__PURE__*/jsx("div", {
|
|
1115
1085
|
className: "genericInput-help",
|
|
1116
|
-
|
|
1086
|
+
iconStyle: {
|
|
1117
1087
|
marginTop: 4
|
|
1118
1088
|
},
|
|
1119
1089
|
children: "This will allow anyone in the community to view and join the ".concat(values.entityName, ".")
|
|
@@ -1131,7 +1101,7 @@ class AddCircle extends Component {
|
|
|
1131
1101
|
});
|
|
1132
1102
|
}
|
|
1133
1103
|
renderOptionsSection() {
|
|
1134
|
-
|
|
1104
|
+
let options = [{
|
|
1135
1105
|
key: "visibility",
|
|
1136
1106
|
icon: "people3",
|
|
1137
1107
|
text: "Visibility"
|
|
@@ -1162,8 +1132,8 @@ class AddCircle extends Component {
|
|
|
1162
1132
|
}), /*#__PURE__*/jsxs("div", {
|
|
1163
1133
|
className: "flex flex-reverse",
|
|
1164
1134
|
children: [/*#__PURE__*/jsx(Components$3.ImageInput, {
|
|
1165
|
-
ref:
|
|
1166
|
-
this.imageInput =
|
|
1135
|
+
ref: ref => {
|
|
1136
|
+
this.imageInput = ref;
|
|
1167
1137
|
},
|
|
1168
1138
|
label: "IMAGE",
|
|
1169
1139
|
limit: 1,
|
|
@@ -1231,10 +1201,10 @@ class AddCircle extends Component {
|
|
|
1231
1201
|
user: user,
|
|
1232
1202
|
rightContent: /*#__PURE__*/jsxs("div", {
|
|
1233
1203
|
className: "flex flex-reverse flex-center",
|
|
1234
|
-
children: [/*#__PURE__*/jsx(Icon, {
|
|
1204
|
+
children: [/*#__PURE__*/jsx(Components$3.Icon, {
|
|
1235
1205
|
className: "removeIcon marginLeft-8",
|
|
1236
1206
|
icon: "xmark",
|
|
1237
|
-
colour: Colours$
|
|
1207
|
+
colour: Colours$3.COLOUR_DUSK,
|
|
1238
1208
|
onClick: () => {
|
|
1239
1209
|
this.onSelectUser(user);
|
|
1240
1210
|
}
|
|
@@ -1260,7 +1230,7 @@ class AddCircle extends Component {
|
|
|
1260
1230
|
});
|
|
1261
1231
|
}
|
|
1262
1232
|
render() {
|
|
1263
|
-
|
|
1233
|
+
const {
|
|
1264
1234
|
success
|
|
1265
1235
|
} = this.state;
|
|
1266
1236
|
return /*#__PURE__*/jsxs(Components$3.OverlayPage, {
|
|
@@ -1278,17 +1248,17 @@ class AddCircle extends Component {
|
|
|
1278
1248
|
});
|
|
1279
1249
|
}
|
|
1280
1250
|
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1251
|
+
const mapStateToProps$2 = state => {
|
|
1252
|
+
const {
|
|
1283
1253
|
circles
|
|
1284
1254
|
} = state[values.reducerKey];
|
|
1285
|
-
|
|
1255
|
+
const {
|
|
1286
1256
|
auth
|
|
1287
1257
|
} = state;
|
|
1288
1258
|
return {
|
|
1289
1259
|
circles,
|
|
1290
1260
|
auth,
|
|
1291
|
-
circleAllowPublicCircles: Helper$
|
|
1261
|
+
circleAllowPublicCircles: Helper$2.getSiteSettingFromState(state, values.allowPublicKey)
|
|
1292
1262
|
};
|
|
1293
1263
|
};
|
|
1294
1264
|
var AddCircle$1 = connect(mapStateToProps$2, {
|
|
@@ -1297,20 +1267,18 @@ var AddCircle$1 = connect(mapStateToProps$2, {
|
|
|
1297
1267
|
addRecentlyCreated: Actions$1.addRecentlyCreated
|
|
1298
1268
|
})(withRouter(AddCircle));
|
|
1299
1269
|
|
|
1300
|
-
function ownKeys$
|
|
1301
|
-
function _objectSpread$
|
|
1302
|
-
|
|
1270
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1271
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1272
|
+
const {
|
|
1303
1273
|
Components: Components$2,
|
|
1304
|
-
Helper,
|
|
1274
|
+
Helper: Helper$1,
|
|
1305
1275
|
Actions,
|
|
1306
1276
|
Session: Session$1,
|
|
1307
|
-
Colours: Colours$
|
|
1277
|
+
Colours: Colours$2
|
|
1308
1278
|
} = PlussCore;
|
|
1309
1279
|
class Circle extends Component {
|
|
1310
1280
|
constructor(props) {
|
|
1311
|
-
var _this;
|
|
1312
1281
|
super(props);
|
|
1313
|
-
_this = this;
|
|
1314
1282
|
_defineProperty(this, "getFiles", () => {
|
|
1315
1283
|
circleActions.getFiles(this.state.circleId).then(res => {
|
|
1316
1284
|
this.setState({
|
|
@@ -1327,30 +1295,30 @@ class Circle extends Component {
|
|
|
1327
1295
|
if (this.state.circle) {
|
|
1328
1296
|
return;
|
|
1329
1297
|
}
|
|
1330
|
-
|
|
1298
|
+
const {
|
|
1331
1299
|
auth
|
|
1332
1300
|
} = this.props;
|
|
1333
1301
|
this.setState({
|
|
1334
1302
|
loadingAll: true
|
|
1335
|
-
},
|
|
1303
|
+
}, async () => {
|
|
1336
1304
|
try {
|
|
1337
|
-
|
|
1305
|
+
const res = await circleActions.getAll(auth.site);
|
|
1338
1306
|
console.log("getData", res.data);
|
|
1339
|
-
|
|
1340
|
-
return c.Id ===
|
|
1307
|
+
const circle = _.find(res.data, c => {
|
|
1308
|
+
return c.Id === this.state.circleId;
|
|
1341
1309
|
});
|
|
1342
|
-
|
|
1343
|
-
|
|
1310
|
+
this.props.circlesLoaded(res.data);
|
|
1311
|
+
this.setState({
|
|
1344
1312
|
loadingAll: false,
|
|
1345
1313
|
circle
|
|
1346
1314
|
});
|
|
1347
1315
|
} catch (error) {
|
|
1348
1316
|
console.error("getData", error);
|
|
1349
|
-
|
|
1317
|
+
this.setState({
|
|
1350
1318
|
loadingAll: false
|
|
1351
1319
|
});
|
|
1352
1320
|
}
|
|
1353
|
-
})
|
|
1321
|
+
});
|
|
1354
1322
|
});
|
|
1355
1323
|
_defineProperty(this, "connect", () => {
|
|
1356
1324
|
this.getMessages();
|
|
@@ -1359,28 +1327,18 @@ class Circle extends Component {
|
|
|
1359
1327
|
_defineProperty(this, "disconnect", () => {
|
|
1360
1328
|
clearInterval(this.interval);
|
|
1361
1329
|
});
|
|
1362
|
-
_defineProperty(this, "getDateMessages",
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
}());
|
|
1373
|
-
_defineProperty(this, "getMessages", /*#__PURE__*/function () {
|
|
1374
|
-
var _ref3 = _asyncToGenerator(function* (excludePending) {
|
|
1375
|
-
var res = yield circleActions.getMessages(_this.state.circleId, 50, _this.getMaxTime() + 1);
|
|
1376
|
-
_this.mergeMessages(res.data, excludePending);
|
|
1377
|
-
});
|
|
1378
|
-
return function (_x2) {
|
|
1379
|
-
return _ref3.apply(this, arguments);
|
|
1380
|
-
};
|
|
1381
|
-
}());
|
|
1330
|
+
_defineProperty(this, "getDateMessages", async date => {
|
|
1331
|
+
const startOf = moment(date, "YYYY-MM-DD").startOf("d");
|
|
1332
|
+
const endOf = moment(date, "YYYY-MM-DD").endOf("d");
|
|
1333
|
+
const res = await circleActions.getMessages(this.state.circleId, 10000, startOf.valueOf(), endOf.valueOf());
|
|
1334
|
+
this.mergeMessages(res.data);
|
|
1335
|
+
});
|
|
1336
|
+
_defineProperty(this, "getMessages", async excludePending => {
|
|
1337
|
+
const res = await circleActions.getMessages(this.state.circleId, 50, this.getMaxTime() + 1);
|
|
1338
|
+
this.mergeMessages(res.data, excludePending);
|
|
1339
|
+
});
|
|
1382
1340
|
_defineProperty(this, "getTitle", () => {
|
|
1383
|
-
|
|
1341
|
+
const {
|
|
1384
1342
|
circle
|
|
1385
1343
|
} = this.state;
|
|
1386
1344
|
if (!circle) {
|
|
@@ -1429,7 +1387,7 @@ class Circle extends Component {
|
|
|
1429
1387
|
replyingTo: m
|
|
1430
1388
|
});
|
|
1431
1389
|
if (m) {
|
|
1432
|
-
|
|
1390
|
+
const input = document.getElementById("messageInput");
|
|
1433
1391
|
if (input) input.focus();
|
|
1434
1392
|
}
|
|
1435
1393
|
});
|
|
@@ -1478,66 +1436,66 @@ class Circle extends Component {
|
|
|
1478
1436
|
messageToDelete: message
|
|
1479
1437
|
});
|
|
1480
1438
|
});
|
|
1481
|
-
_defineProperty(this, "onConfirmDelete",
|
|
1482
|
-
|
|
1439
|
+
_defineProperty(this, "onConfirmDelete", async () => {
|
|
1440
|
+
const {
|
|
1483
1441
|
messageToDelete
|
|
1484
|
-
} =
|
|
1442
|
+
} = this.state;
|
|
1485
1443
|
if (!messageToDelete) return;
|
|
1486
1444
|
|
|
1487
1445
|
// Optimistically update UI - mark as deleted immediately
|
|
1488
|
-
|
|
1446
|
+
const updatedMessages = this.state.messages.map(m => {
|
|
1489
1447
|
if (m._id === messageToDelete._id) {
|
|
1490
|
-
return _objectSpread$
|
|
1448
|
+
return _objectSpread$4(_objectSpread$4({}, m), {}, {
|
|
1491
1449
|
deleted: true,
|
|
1492
1450
|
text: " "
|
|
1493
1451
|
});
|
|
1494
1452
|
}
|
|
1495
1453
|
return m;
|
|
1496
1454
|
});
|
|
1497
|
-
|
|
1455
|
+
this.setState({
|
|
1498
1456
|
messages: updatedMessages,
|
|
1499
1457
|
showDeleteConfirm: false,
|
|
1500
1458
|
deletingMessageId: messageToDelete._id,
|
|
1501
1459
|
messageToDelete: null
|
|
1502
1460
|
});
|
|
1503
1461
|
try {
|
|
1504
|
-
|
|
1462
|
+
await circleActions.deleteMessage(messageToDelete._id, this.state.circleId);
|
|
1505
1463
|
// Message already marked as deleted, just clear the deleting state
|
|
1506
|
-
|
|
1464
|
+
this.setState({
|
|
1507
1465
|
deletingMessageId: null
|
|
1508
1466
|
});
|
|
1509
1467
|
} catch (error) {
|
|
1510
1468
|
console.error("Failed to delete message:", error);
|
|
1511
1469
|
// Revert the optimistic update on failure
|
|
1512
|
-
|
|
1470
|
+
const revertedMessages = this.state.messages.map(m => {
|
|
1513
1471
|
if (m._id === messageToDelete._id) {
|
|
1514
1472
|
return messageToDelete;
|
|
1515
1473
|
}
|
|
1516
1474
|
return m;
|
|
1517
1475
|
});
|
|
1518
|
-
|
|
1476
|
+
this.setState({
|
|
1519
1477
|
messages: revertedMessages,
|
|
1520
1478
|
deletingMessageId: null
|
|
1521
1479
|
});
|
|
1522
1480
|
alert("Failed to delete message. Please try again.");
|
|
1523
1481
|
}
|
|
1524
|
-
})
|
|
1482
|
+
});
|
|
1525
1483
|
_defineProperty(this, "onCancelDelete", () => {
|
|
1526
1484
|
this.setState({
|
|
1527
1485
|
showDeleteConfirm: false,
|
|
1528
1486
|
messageToDelete: null
|
|
1529
1487
|
});
|
|
1530
1488
|
});
|
|
1531
|
-
_defineProperty(this, "markCircleAsRead",
|
|
1489
|
+
_defineProperty(this, "markCircleAsRead", async () => {
|
|
1532
1490
|
try {
|
|
1533
|
-
|
|
1491
|
+
await circleActions.markAsRead(this.state.circleId, this.props.user.Id);
|
|
1534
1492
|
} catch (error) {
|
|
1535
1493
|
console.error("Failed to mark circle as read:", error);
|
|
1536
1494
|
}
|
|
1537
|
-
})
|
|
1495
|
+
});
|
|
1538
1496
|
_defineProperty(this, "sendMessage", () => {
|
|
1539
|
-
|
|
1540
|
-
_id: Helper.randomString(),
|
|
1497
|
+
const message = {
|
|
1498
|
+
_id: Helper$1.randomString(),
|
|
1541
1499
|
text: this.state.messageInput,
|
|
1542
1500
|
user: {
|
|
1543
1501
|
_id: this.props.user.Id,
|
|
@@ -1557,7 +1515,7 @@ class Circle extends Component {
|
|
|
1557
1515
|
if (this.state.replyingTo) {
|
|
1558
1516
|
message.replyingTo = this.state.replyingTo;
|
|
1559
1517
|
}
|
|
1560
|
-
|
|
1518
|
+
const clonedMessage = _.cloneDeep(message);
|
|
1561
1519
|
clonedMessage.uploading = true;
|
|
1562
1520
|
circleActions.sendMessage(this.state.circleId, message).then(res => {
|
|
1563
1521
|
Object.keys(res.data).forEach(key => {
|
|
@@ -1581,7 +1539,7 @@ class Circle extends Component {
|
|
|
1581
1539
|
this.fileInput && this.fileInput.setValue(null);
|
|
1582
1540
|
}, 100);
|
|
1583
1541
|
});
|
|
1584
|
-
|
|
1542
|
+
const circleId = Helper$1.safeReadParams(props, "circleId");
|
|
1585
1543
|
this.state = {
|
|
1586
1544
|
circleId,
|
|
1587
1545
|
circle: _.find(props.circles, c => {
|
|
@@ -1619,13 +1577,13 @@ class Circle extends Component {
|
|
|
1619
1577
|
}
|
|
1620
1578
|
scrollToBottom() {
|
|
1621
1579
|
if (!this.chat) return;
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1580
|
+
const scrollHeight = this.chat.scrollHeight;
|
|
1581
|
+
const height = this.chat.clientHeight;
|
|
1582
|
+
const maxScrollTop = scrollHeight - height;
|
|
1625
1583
|
this.chat.scrollTop = maxScrollTop > 0 ? maxScrollTop : 0;
|
|
1626
1584
|
}
|
|
1627
1585
|
mergeMessages(receivedMessages, excludePending) {
|
|
1628
|
-
|
|
1586
|
+
const newMessages = _.sortBy(_.concat(this.state.messages, receivedMessages), "createdAt");
|
|
1629
1587
|
this.setState({
|
|
1630
1588
|
messages: _.filter(_.uniqBy(newMessages, m => {
|
|
1631
1589
|
return m._id;
|
|
@@ -1640,7 +1598,7 @@ class Circle extends Component {
|
|
|
1640
1598
|
}
|
|
1641
1599
|
}
|
|
1642
1600
|
getMaxTime() {
|
|
1643
|
-
|
|
1601
|
+
const maxMessage = _.maxBy(this.state.messages, m => {
|
|
1644
1602
|
return m.createdAt;
|
|
1645
1603
|
});
|
|
1646
1604
|
if (maxMessage) {
|
|
@@ -1654,7 +1612,7 @@ class Circle extends Component {
|
|
|
1654
1612
|
};
|
|
1655
1613
|
}
|
|
1656
1614
|
isMember() {
|
|
1657
|
-
|
|
1615
|
+
const audience = this.getCircle().Audience || [];
|
|
1658
1616
|
return _.some(audience, u => {
|
|
1659
1617
|
return u.userId === this.props.user.Id;
|
|
1660
1618
|
});
|
|
@@ -1711,8 +1669,8 @@ class Circle extends Component {
|
|
|
1711
1669
|
display: this.state.imageInputShowing ? "block" : "none"
|
|
1712
1670
|
},
|
|
1713
1671
|
children: /*#__PURE__*/jsx(Components$2.ImageInput, {
|
|
1714
|
-
ref:
|
|
1715
|
-
this.imageInput =
|
|
1672
|
+
ref: ref => {
|
|
1673
|
+
this.imageInput = ref;
|
|
1716
1674
|
},
|
|
1717
1675
|
multiple: true,
|
|
1718
1676
|
limit: 10,
|
|
@@ -1727,8 +1685,8 @@ class Circle extends Component {
|
|
|
1727
1685
|
display: this.state.fileInputShowing ? "block" : "none"
|
|
1728
1686
|
},
|
|
1729
1687
|
children: /*#__PURE__*/jsx(Components$2.FileInput, {
|
|
1730
|
-
ref:
|
|
1731
|
-
this.fileInput =
|
|
1688
|
+
ref: ref => {
|
|
1689
|
+
this.fileInput = ref;
|
|
1732
1690
|
},
|
|
1733
1691
|
multiple: true,
|
|
1734
1692
|
limit: 10,
|
|
@@ -1752,9 +1710,9 @@ class Circle extends Component {
|
|
|
1752
1710
|
})
|
|
1753
1711
|
}, m._id);
|
|
1754
1712
|
}
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1713
|
+
const isSelf = m.user._id === this.props.user.Id;
|
|
1714
|
+
const isDeleted = m.deleted === true;
|
|
1715
|
+
const isDeleting = this.state.deletingMessageId === m._id;
|
|
1758
1716
|
return /*#__PURE__*/jsxs("div", {
|
|
1759
1717
|
className: "message".concat(isSelf ? " message-self" : "").concat(m.uploading ? " message-uploading" : "").concat(isDeleting ? " message-deleting" : ""),
|
|
1760
1718
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
@@ -1778,14 +1736,14 @@ class Circle extends Component {
|
|
|
1778
1736
|
children: /*#__PURE__*/jsx(Components$2.Text, {
|
|
1779
1737
|
type: "body",
|
|
1780
1738
|
className: "message_text",
|
|
1781
|
-
children: Helper.toParagraphed((m.replyingTo.text || "").substr(0, 100))
|
|
1739
|
+
children: Helper$1.toParagraphed((m.replyingTo.text || "").substr(0, 100))
|
|
1782
1740
|
})
|
|
1783
1741
|
}), /*#__PURE__*/jsxs("div", {
|
|
1784
1742
|
className: "message_bubble",
|
|
1785
1743
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
1786
1744
|
type: "body",
|
|
1787
1745
|
className: "message_text",
|
|
1788
|
-
children: isDeleted ? "[Message deleted]" : Helper.toParagraphed(m.text)
|
|
1746
|
+
children: isDeleted ? "[Message deleted]" : Helper$1.toParagraphed(m.text)
|
|
1789
1747
|
}), !isDeleted && /*#__PURE__*/jsxs(Fragment, {
|
|
1790
1748
|
children: [/*#__PURE__*/jsx("div", {
|
|
1791
1749
|
children: (m.image || []).map((url, i) => {
|
|
@@ -1795,7 +1753,7 @@ class Circle extends Component {
|
|
|
1795
1753
|
children: /*#__PURE__*/jsx("img", {
|
|
1796
1754
|
className: "message_image",
|
|
1797
1755
|
src: url,
|
|
1798
|
-
alt: Helper.getFileName(url)
|
|
1756
|
+
alt: Helper$1.getFileName(url)
|
|
1799
1757
|
})
|
|
1800
1758
|
}, i);
|
|
1801
1759
|
})
|
|
@@ -1856,7 +1814,7 @@ class Circle extends Component {
|
|
|
1856
1814
|
});
|
|
1857
1815
|
}
|
|
1858
1816
|
renderSideBar() {
|
|
1859
|
-
|
|
1817
|
+
const members = this.getCircle().Audience || [];
|
|
1860
1818
|
return /*#__PURE__*/jsxs("div", {
|
|
1861
1819
|
className: "chat_sideBar",
|
|
1862
1820
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -1871,7 +1829,7 @@ class Circle extends Component {
|
|
|
1871
1829
|
className: "flex-1",
|
|
1872
1830
|
children: /*#__PURE__*/jsxs(Components$2.Text, {
|
|
1873
1831
|
type: "formTitleMedium",
|
|
1874
|
-
children: ["Member", Helper.getPluralS(members.length), " (", members.length, ")"]
|
|
1832
|
+
children: ["Member", Helper$1.getPluralS(members.length), " (", members.length, ")"]
|
|
1875
1833
|
})
|
|
1876
1834
|
})]
|
|
1877
1835
|
}), this.state.membersExpanded && /*#__PURE__*/jsx("div", {
|
|
@@ -1894,7 +1852,7 @@ class Circle extends Component {
|
|
|
1894
1852
|
className: "flex-1",
|
|
1895
1853
|
children: /*#__PURE__*/jsxs(Components$2.Text, {
|
|
1896
1854
|
type: "formTitleMedium",
|
|
1897
|
-
children: ["Image", Helper.getPluralS(this.state.images.length), " (", this.state.images.length, ")"]
|
|
1855
|
+
children: ["Image", Helper$1.getPluralS(this.state.images.length), " (", this.state.images.length, ")"]
|
|
1898
1856
|
})
|
|
1899
1857
|
})]
|
|
1900
1858
|
}), this.state.imagesExpanded && /*#__PURE__*/jsx("div", {
|
|
@@ -1906,7 +1864,7 @@ class Circle extends Component {
|
|
|
1906
1864
|
children: /*#__PURE__*/jsx("img", {
|
|
1907
1865
|
src: image.Url,
|
|
1908
1866
|
className: "chat_section_image",
|
|
1909
|
-
alt: Helper.getFileName(image.Url)
|
|
1867
|
+
alt: Helper$1.getFileName(image.Url)
|
|
1910
1868
|
})
|
|
1911
1869
|
});
|
|
1912
1870
|
})
|
|
@@ -1923,7 +1881,7 @@ class Circle extends Component {
|
|
|
1923
1881
|
className: "flex-1",
|
|
1924
1882
|
children: /*#__PURE__*/jsxs(Components$2.Text, {
|
|
1925
1883
|
type: "formTitleMedium",
|
|
1926
|
-
children: ["File", Helper.getPluralS(this.state.files.length), " (", this.state.files.length, ")"]
|
|
1884
|
+
children: ["File", Helper$1.getPluralS(this.state.files.length), " (", this.state.files.length, ")"]
|
|
1927
1885
|
})
|
|
1928
1886
|
})]
|
|
1929
1887
|
}), this.state.filesExpanded && /*#__PURE__*/jsx("div", {
|
|
@@ -1941,7 +1899,7 @@ class Circle extends Component {
|
|
|
1941
1899
|
if (!this.state.replyingTo) {
|
|
1942
1900
|
return null;
|
|
1943
1901
|
}
|
|
1944
|
-
|
|
1902
|
+
const m = this.state.replyingTo;
|
|
1945
1903
|
return /*#__PURE__*/jsxs("div", {
|
|
1946
1904
|
className: "chat_replyTo",
|
|
1947
1905
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -1955,13 +1913,13 @@ class Circle extends Component {
|
|
|
1955
1913
|
})]
|
|
1956
1914
|
}), /*#__PURE__*/jsx("div", {
|
|
1957
1915
|
className: "chat_replyTo_remove",
|
|
1958
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
1916
|
+
children: /*#__PURE__*/jsx(Components$2.Icon, {
|
|
1959
1917
|
className: "removeIcon",
|
|
1960
1918
|
icon: "xmark",
|
|
1961
1919
|
onClick: () => {
|
|
1962
1920
|
this.onReply(null);
|
|
1963
1921
|
},
|
|
1964
|
-
colour: Colours$
|
|
1922
|
+
colour: Colours$2.COLOUR_DUSK
|
|
1965
1923
|
})
|
|
1966
1924
|
})]
|
|
1967
1925
|
});
|
|
@@ -2031,8 +1989,8 @@ class Circle extends Component {
|
|
|
2031
1989
|
onClick: () => this.setState({
|
|
2032
1990
|
showMessageDate: !this.state.showMessageDate
|
|
2033
1991
|
}),
|
|
2034
|
-
rightContent: !_.isEmpty(this.state.messageDate) && /*#__PURE__*/jsx(Icon, {
|
|
2035
|
-
colour: Colours$
|
|
1992
|
+
rightContent: !_.isEmpty(this.state.messageDate) && /*#__PURE__*/jsx(Components$2.Icon, {
|
|
1993
|
+
colour: Colours$2.COLOUR_DUSK_LIGHT,
|
|
2036
1994
|
icon: "xmark",
|
|
2037
1995
|
className: "timepicker_clear",
|
|
2038
1996
|
onClick: this.onClearDate
|
|
@@ -2050,7 +2008,7 @@ class Circle extends Component {
|
|
|
2050
2008
|
className: "chat_newMessage",
|
|
2051
2009
|
children: this.renderChatInput()
|
|
2052
2010
|
}), this.renderReplyTo(), /*#__PURE__*/jsxs("div", {
|
|
2053
|
-
ref:
|
|
2011
|
+
ref: ref => this.chat = ref,
|
|
2054
2012
|
className: "chat_messages",
|
|
2055
2013
|
children: [_.isEmpty(this.state.messages) && !_.isEmpty(this.state.messageDate) && this.renderEmptyDate(), this.state.messages.map(m => {
|
|
2056
2014
|
return this.renderMessage(m);
|
|
@@ -2062,17 +2020,17 @@ class Circle extends Component {
|
|
|
2062
2020
|
});
|
|
2063
2021
|
}
|
|
2064
2022
|
}
|
|
2065
|
-
|
|
2066
|
-
|
|
2023
|
+
const mapStateToProps$1 = state => {
|
|
2024
|
+
const {
|
|
2067
2025
|
circles
|
|
2068
2026
|
} = state[values.reducerKey];
|
|
2069
|
-
|
|
2027
|
+
const {
|
|
2070
2028
|
auth
|
|
2071
2029
|
} = state;
|
|
2072
2030
|
return {
|
|
2073
2031
|
circles,
|
|
2074
2032
|
auth,
|
|
2075
|
-
user: Helper.getUserFromState(state)
|
|
2033
|
+
user: Helper$1.getUserFromState(state)
|
|
2076
2034
|
};
|
|
2077
2035
|
};
|
|
2078
2036
|
var Circle$1 = connect(mapStateToProps$1, {
|
|
@@ -2080,12 +2038,16 @@ var Circle$1 = connect(mapStateToProps$1, {
|
|
|
2080
2038
|
setNavData: Actions.setNavData
|
|
2081
2039
|
})(Circle);
|
|
2082
2040
|
|
|
2083
|
-
var {
|
|
2041
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2042
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2043
|
+
const {
|
|
2084
2044
|
Analytics: Analytics$1,
|
|
2085
2045
|
Session,
|
|
2086
|
-
Components: Components$1
|
|
2046
|
+
Components: Components$1,
|
|
2047
|
+
Helper,
|
|
2048
|
+
Colours: Colours$1
|
|
2087
2049
|
} = PlussCore;
|
|
2088
|
-
|
|
2050
|
+
const getInitialState = () => ({
|
|
2089
2051
|
isLoading: true,
|
|
2090
2052
|
messages: 0,
|
|
2091
2053
|
prevMessages: 0,
|
|
@@ -2102,31 +2064,48 @@ var getInitialState = () => ({
|
|
|
2102
2064
|
});
|
|
2103
2065
|
|
|
2104
2066
|
// AnalyticsHub Component
|
|
2105
|
-
|
|
2106
|
-
|
|
2067
|
+
const AnalyticsHub = _ref => {
|
|
2068
|
+
let {
|
|
2107
2069
|
startTime,
|
|
2108
2070
|
endTime,
|
|
2109
2071
|
auth,
|
|
2110
2072
|
prevText,
|
|
2111
2073
|
dayCount,
|
|
2112
|
-
strings
|
|
2074
|
+
strings,
|
|
2075
|
+
userType,
|
|
2076
|
+
userCategory,
|
|
2077
|
+
selectedSites
|
|
2113
2078
|
} = _ref;
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2079
|
+
const [analyticsData, setAnalyticsData] = useState(getInitialState());
|
|
2080
|
+
const [isExportOpen, setIsExportOpen] = useState(false);
|
|
2081
|
+
const [failedSites, setFailedSites] = useState([]);
|
|
2082
|
+
const [comparisonData, setComparisonData] = useState({
|
|
2083
|
+
messages: [],
|
|
2084
|
+
staffMessages: [],
|
|
2085
|
+
residentMessages: [],
|
|
2086
|
+
groupMessages: [],
|
|
2087
|
+
privateMessages: [],
|
|
2088
|
+
activeGroups: [],
|
|
2089
|
+
isLoading: true
|
|
2090
|
+
});
|
|
2091
|
+
const comparisonMode = selectedSites && selectedSites.length > 1;
|
|
2092
|
+
const hasAccess = Session.validateAccess(auth.site, values.permissionNewsletter, auth);
|
|
2117
2093
|
if (!hasAccess) {
|
|
2118
2094
|
return null;
|
|
2119
2095
|
}
|
|
2120
|
-
|
|
2096
|
+
const featureTitle = (key => {
|
|
2121
2097
|
if (!strings || !strings.sideNav || !strings.sideNav[key]) {
|
|
2122
2098
|
return values.textFeatureTitle;
|
|
2123
2099
|
}
|
|
2124
2100
|
return strings.sideNav[key];
|
|
2125
2101
|
})();
|
|
2126
|
-
|
|
2102
|
+
const exportColumns = [{
|
|
2127
2103
|
label: "Select All",
|
|
2128
2104
|
key: ""
|
|
2129
|
-
}, {
|
|
2105
|
+
}, ...(comparisonMode ? [{
|
|
2106
|
+
label: "Site",
|
|
2107
|
+
key: "site"
|
|
2108
|
+
}] : []), {
|
|
2130
2109
|
label: "Start Date",
|
|
2131
2110
|
key: "startDate"
|
|
2132
2111
|
}, {
|
|
@@ -2153,40 +2132,119 @@ var AnalyticsHub = _ref => {
|
|
|
2153
2132
|
}];
|
|
2154
2133
|
useEffect(() => {
|
|
2155
2134
|
getData();
|
|
2156
|
-
}, [startTime, endTime]);
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2135
|
+
}, [startTime, endTime, userType, userCategory, selectedSites]);
|
|
2136
|
+
const getData = async () => {
|
|
2137
|
+
try {
|
|
2138
|
+
setFailedSites([]);
|
|
2139
|
+
if (comparisonMode) {
|
|
2140
|
+
setComparisonData({
|
|
2141
|
+
messages: [],
|
|
2142
|
+
staffMessages: [],
|
|
2143
|
+
residentMessages: [],
|
|
2144
|
+
groupMessages: [],
|
|
2145
|
+
privateMessages: [],
|
|
2146
|
+
activeGroups: [],
|
|
2147
|
+
isLoading: true
|
|
2148
|
+
});
|
|
2149
|
+
const multiSiteResultsObj = await Analytics$1.fetchMultiSiteData(selectedSites, async site => {
|
|
2150
|
+
const {
|
|
2151
|
+
data
|
|
2152
|
+
} = await analyticsActions.getAggregateEntityStats(site, values.entityKey, startTime, endTime, true, {
|
|
2153
|
+
userType,
|
|
2154
|
+
userCategory
|
|
2155
|
+
});
|
|
2156
|
+
return data;
|
|
2157
|
+
});
|
|
2158
|
+
const roles = auth.user.Roles;
|
|
2159
|
+
const failed = Object.entries(multiSiteResultsObj).filter(_ref2 => {
|
|
2160
|
+
let [, data] = _ref2;
|
|
2161
|
+
return data === null;
|
|
2162
|
+
}).map(_ref3 => {
|
|
2163
|
+
let [site] = _ref3;
|
|
2164
|
+
return Helper.getSiteNameFromRoles(site, roles);
|
|
2165
|
+
});
|
|
2166
|
+
setFailedSites(failed);
|
|
2167
|
+
const multiSiteResults = Object.entries(multiSiteResultsObj).filter(_ref4 => {
|
|
2168
|
+
let [, data] = _ref4;
|
|
2169
|
+
return data !== null;
|
|
2170
|
+
}).map(_ref5 => {
|
|
2171
|
+
let [site, data] = _ref5;
|
|
2172
|
+
return {
|
|
2173
|
+
site,
|
|
2174
|
+
data
|
|
2175
|
+
};
|
|
2176
|
+
});
|
|
2177
|
+
const buildComparison = (activityKey, countType) => multiSiteResults.map(result => ({
|
|
2178
|
+
name: Helper.getSiteNameFromRoles(result.site, roles),
|
|
2179
|
+
value: Analytics$1.countActivities(result.data, activityKey, countType)
|
|
2180
|
+
}));
|
|
2181
|
+
setComparisonData({
|
|
2182
|
+
messages: buildComparison("Message", "total"),
|
|
2183
|
+
staffMessages: buildComparison("StaffMessage", "total"),
|
|
2184
|
+
residentMessages: buildComparison("ResidentMessage", "total"),
|
|
2185
|
+
groupMessages: buildComparison("GroupMessage", "total"),
|
|
2186
|
+
privateMessages: buildComparison("PrivateMessage", "total"),
|
|
2187
|
+
activeGroups: buildComparison("GroupMessage", "unique"),
|
|
2188
|
+
isLoading: false
|
|
2189
|
+
});
|
|
2190
|
+
} else {
|
|
2191
|
+
setAnalyticsData(getInitialState());
|
|
2192
|
+
const site = selectedSites && selectedSites.length === 1 ? selectedSites[0] : auth.site;
|
|
2193
|
+
const timeDifference = endTime - startTime;
|
|
2194
|
+
const [currentStatsResponse, prevStatsResponse] = await Promise.all([analyticsActions.getAggregateEntityStats(site, values.entityKey, startTime, endTime, true, {
|
|
2195
|
+
userType,
|
|
2196
|
+
userCategory
|
|
2197
|
+
}), analyticsActions.getAggregateEntityStats(site, values.entityKey, startTime - timeDifference, startTime, true, {
|
|
2198
|
+
userType,
|
|
2199
|
+
userCategory
|
|
2200
|
+
})]);
|
|
2201
|
+
const data = {
|
|
2202
|
+
messages: Analytics$1.countActivities(currentStatsResponse.data, "Message", "total"),
|
|
2203
|
+
prevMessages: Analytics$1.countActivities(prevStatsResponse.data, "Message", "total"),
|
|
2204
|
+
staffMessages: Analytics$1.countActivities(currentStatsResponse.data, "StaffMessage", "total"),
|
|
2205
|
+
prevStaffMessages: Analytics$1.countActivities(prevStatsResponse.data, "StaffMessage", "total"),
|
|
2206
|
+
residentMessages: Analytics$1.countActivities(currentStatsResponse.data, "ResidentMessage", "total"),
|
|
2207
|
+
prevResidentMessages: Analytics$1.countActivities(prevStatsResponse.data, "ResidentMessage", "total"),
|
|
2208
|
+
groupMessages: Analytics$1.countActivities(currentStatsResponse.data, "GroupMessage", "total"),
|
|
2209
|
+
prevGroupMessages: Analytics$1.countActivities(prevStatsResponse.data, "GroupMessage", "total"),
|
|
2210
|
+
privateMessages: Analytics$1.countActivities(currentStatsResponse.data, "PrivateMessage", "total"),
|
|
2211
|
+
prevPrivateMessages: Analytics$1.countActivities(prevStatsResponse.data, "PrivateMessage", "total"),
|
|
2212
|
+
activeGroups: Analytics$1.countActivities(currentStatsResponse.data, "GroupMessage", "unique"),
|
|
2213
|
+
prevActiveGroups: Analytics$1.countActivities(prevStatsResponse.data, "GroupMessage", "unique"),
|
|
2214
|
+
isLoading: false
|
|
2215
|
+
};
|
|
2216
|
+
setAnalyticsData(data);
|
|
2217
|
+
}
|
|
2218
|
+
} catch (err) {
|
|
2219
|
+
if (comparisonMode) {
|
|
2220
|
+
setComparisonData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
|
|
2221
|
+
isLoading: false
|
|
2222
|
+
}));
|
|
2223
|
+
} else {
|
|
2224
|
+
setAnalyticsData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
|
|
2225
|
+
isLoading: false
|
|
2226
|
+
}));
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2188
2229
|
};
|
|
2189
|
-
|
|
2230
|
+
const isReadyToOpenCSV = () => {
|
|
2231
|
+
return comparisonMode ? !comparisonData.isLoading : !analyticsData.isLoading;
|
|
2232
|
+
};
|
|
2233
|
+
const getExportSource = () => {
|
|
2234
|
+
if (comparisonMode) {
|
|
2235
|
+
const sites = comparisonData.messages || [];
|
|
2236
|
+
return sites.map((site, i) => ({
|
|
2237
|
+
site: site.name,
|
|
2238
|
+
startDate: moment(startTime + 1).format("D-MM-YYYY"),
|
|
2239
|
+
endDate: moment(endTime).format("D-MM-YYYY"),
|
|
2240
|
+
messages: site.value,
|
|
2241
|
+
staffMessages: comparisonData.staffMessages[i] && comparisonData.staffMessages[i].value || 0,
|
|
2242
|
+
residentMessages: comparisonData.residentMessages[i] && comparisonData.residentMessages[i].value || 0,
|
|
2243
|
+
groupMessages: comparisonData.groupMessages[i] && comparisonData.groupMessages[i].value || 0,
|
|
2244
|
+
privateMessages: comparisonData.privateMessages[i] && comparisonData.privateMessages[i].value || 0,
|
|
2245
|
+
activeGroups: comparisonData.activeGroups[i] && comparisonData.activeGroups[i].value || 0
|
|
2246
|
+
}));
|
|
2247
|
+
}
|
|
2190
2248
|
return [{
|
|
2191
2249
|
startDate: moment(startTime + 1).format("D-MM-YYYY"),
|
|
2192
2250
|
endDate: moment(endTime).format("D-MM-YYYY"),
|
|
@@ -2198,18 +2256,19 @@ var AnalyticsHub = _ref => {
|
|
|
2198
2256
|
activeGroups: analyticsData.activeGroups
|
|
2199
2257
|
}];
|
|
2200
2258
|
};
|
|
2201
|
-
|
|
2259
|
+
const csvPopup = () => {
|
|
2202
2260
|
if (!isExportOpen) {
|
|
2203
2261
|
return null;
|
|
2204
2262
|
}
|
|
2205
|
-
|
|
2263
|
+
const source = getExportSource();
|
|
2264
|
+
const filterSuffix = [userType, userCategory].filter(Boolean).map(f => f.toLowerCase().replace(/\s+/g, "-")).join("_");
|
|
2206
2265
|
return /*#__PURE__*/jsx(Components$1.ExportCsvPopup, {
|
|
2207
2266
|
onClose: () => {
|
|
2208
2267
|
setIsExportOpen(false);
|
|
2209
2268
|
},
|
|
2210
2269
|
columns: exportColumns,
|
|
2211
2270
|
source: source,
|
|
2212
|
-
filename: "".concat(values.analyticsKey, "
|
|
2271
|
+
filename: "".concat(values.analyticsKey, "analytics").concat(comparisonMode ? "_comparison" : "").concat(filterSuffix ? "_".concat(filterSuffix) : "", "_").concat(source[0].startDate, "_").concat(source[0].endDate, ".csv")
|
|
2213
2272
|
});
|
|
2214
2273
|
};
|
|
2215
2274
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -2230,62 +2289,120 @@ var AnalyticsHub = _ref => {
|
|
|
2230
2289
|
leftIcon: "file-code",
|
|
2231
2290
|
children: "Export CSV"
|
|
2232
2291
|
})]
|
|
2233
|
-
}), /*#__PURE__*/jsxs(
|
|
2292
|
+
}), failedSites.length > 0 && /*#__PURE__*/jsxs(Components$1.Text, {
|
|
2293
|
+
type: "help",
|
|
2294
|
+
style: {
|
|
2295
|
+
color: Colours$1.COLOUR_RED,
|
|
2296
|
+
marginTop: 8
|
|
2297
|
+
},
|
|
2298
|
+
children: ["Data unavailable for: ", failedSites.join(", ")]
|
|
2299
|
+
}), /*#__PURE__*/jsx("div", {
|
|
2234
2300
|
className: "analyticsSection dashboardSection_content",
|
|
2235
|
-
children:
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2301
|
+
children: (() => {
|
|
2302
|
+
const chartSuffix = [selectedSites && selectedSites.length > 0 ? "&sites=".concat(selectedSites.join(",")) : "", userType ? "&userType=".concat(encodeURIComponent(userType)) : "", userCategory ? "&userCategory=".concat(encodeURIComponent(userCategory)) : ""].join("");
|
|
2303
|
+
if (comparisonMode) {
|
|
2304
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2305
|
+
style: {
|
|
2306
|
+
display: "flex",
|
|
2307
|
+
flexDirection: "column",
|
|
2308
|
+
gap: 16
|
|
2309
|
+
},
|
|
2310
|
+
children: [/*#__PURE__*/jsx(Components$1.ComparisonStatBox, {
|
|
2311
|
+
title: "Groups with Messages",
|
|
2312
|
+
data: comparisonData.activeGroups,
|
|
2313
|
+
prevText: prevText,
|
|
2314
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=GroupMessage&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2315
|
+
isLoading: comparisonData.isLoading
|
|
2316
|
+
}), /*#__PURE__*/jsx(Components$1.ComparisonStatBox, {
|
|
2317
|
+
title: "Messages",
|
|
2318
|
+
data: comparisonData.messages,
|
|
2319
|
+
prevText: prevText,
|
|
2320
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Message&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2321
|
+
isLoading: comparisonData.isLoading
|
|
2322
|
+
}), /*#__PURE__*/jsx(Components$1.ComparisonStatBox, {
|
|
2323
|
+
title: "Messages by Staff",
|
|
2324
|
+
data: comparisonData.staffMessages,
|
|
2325
|
+
prevText: prevText,
|
|
2326
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=StaffMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2327
|
+
isLoading: comparisonData.isLoading
|
|
2328
|
+
}), /*#__PURE__*/jsx(Components$1.ComparisonStatBox, {
|
|
2329
|
+
title: "Messages by Primary Users",
|
|
2330
|
+
data: comparisonData.residentMessages,
|
|
2331
|
+
prevText: prevText,
|
|
2332
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=ResidentMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2333
|
+
isLoading: comparisonData.isLoading
|
|
2334
|
+
}), /*#__PURE__*/jsx(Components$1.ComparisonStatBox, {
|
|
2335
|
+
title: "Group Messages",
|
|
2336
|
+
data: comparisonData.groupMessages,
|
|
2337
|
+
prevText: prevText,
|
|
2338
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=GroupMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2339
|
+
isLoading: comparisonData.isLoading
|
|
2340
|
+
}), /*#__PURE__*/jsx(Components$1.ComparisonStatBox, {
|
|
2341
|
+
title: "Private Messages",
|
|
2342
|
+
data: comparisonData.privateMessages,
|
|
2343
|
+
prevText: prevText,
|
|
2344
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=PrivateMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2345
|
+
isLoading: comparisonData.isLoading
|
|
2346
|
+
})]
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2350
|
+
children: [/*#__PURE__*/jsx(Components$1.StatBox, {
|
|
2351
|
+
title: "Groups with Messages",
|
|
2352
|
+
icon: "user-group",
|
|
2353
|
+
value: analyticsData.activeGroups,
|
|
2354
|
+
previousValue: analyticsData.prevActiveGroups,
|
|
2355
|
+
prevText: prevText,
|
|
2356
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=GroupMessage&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2357
|
+
isLoading: analyticsData.isLoading
|
|
2358
|
+
}), /*#__PURE__*/jsx(Components$1.StatBox, {
|
|
2359
|
+
title: "Messages",
|
|
2360
|
+
icon: "message",
|
|
2361
|
+
value: analyticsData.messages,
|
|
2362
|
+
previousValue: analyticsData.prevMessages,
|
|
2363
|
+
prevText: prevText,
|
|
2364
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Message&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2365
|
+
isLoading: analyticsData.isLoading
|
|
2366
|
+
}), /*#__PURE__*/jsx(Components$1.StatBox, {
|
|
2367
|
+
title: "Messages by Staff",
|
|
2368
|
+
icon: "user-tie",
|
|
2369
|
+
value: analyticsData.staffMessages,
|
|
2370
|
+
previousValue: analyticsData.prevStaffMessages,
|
|
2371
|
+
prevText: prevText,
|
|
2372
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=StaffMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2373
|
+
isLoading: analyticsData.isLoading
|
|
2374
|
+
}), /*#__PURE__*/jsx(Components$1.StatBox, {
|
|
2375
|
+
title: "Messages by Primary Users",
|
|
2376
|
+
icon: "users",
|
|
2377
|
+
value: analyticsData.residentMessages,
|
|
2378
|
+
previousValue: analyticsData.prevResidentMessages,
|
|
2379
|
+
prevText: prevText,
|
|
2380
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=ResidentMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2381
|
+
isLoading: analyticsData.isLoading
|
|
2382
|
+
}), /*#__PURE__*/jsx(Components$1.StatBox, {
|
|
2383
|
+
title: "Group Messages",
|
|
2384
|
+
icon: "users-rectangle",
|
|
2385
|
+
value: analyticsData.groupMessages,
|
|
2386
|
+
previousValue: analyticsData.prevGroupMessages,
|
|
2387
|
+
prevText: prevText,
|
|
2388
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=GroupMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2389
|
+
isLoading: analyticsData.isLoading
|
|
2390
|
+
}), /*#__PURE__*/jsx(Components$1.StatBox, {
|
|
2391
|
+
title: "Private Messages",
|
|
2392
|
+
icon: "people-arrows",
|
|
2393
|
+
value: analyticsData.privateMessages,
|
|
2394
|
+
previousValue: analyticsData.prevPrivateMessages,
|
|
2395
|
+
prevText: prevText,
|
|
2396
|
+
viewGraphLink: "/chart?entity=".concat(values.entityKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=PrivateMessage&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
2397
|
+
isLoading: analyticsData.isLoading
|
|
2398
|
+
})]
|
|
2399
|
+
});
|
|
2400
|
+
})()
|
|
2284
2401
|
})]
|
|
2285
2402
|
});
|
|
2286
2403
|
};
|
|
2287
|
-
|
|
2288
|
-
|
|
2404
|
+
const mapStateToProps = state => {
|
|
2405
|
+
const {
|
|
2289
2406
|
auth
|
|
2290
2407
|
} = state;
|
|
2291
2408
|
return {
|
|
@@ -2293,16 +2410,16 @@ var mapStateToProps = state => {
|
|
|
2293
2410
|
strings: state.strings && state.strings.config || {}
|
|
2294
2411
|
};
|
|
2295
2412
|
};
|
|
2296
|
-
|
|
2413
|
+
const toExport = connect(mapStateToProps, {})(AnalyticsHub);
|
|
2297
2414
|
|
|
2298
2415
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2299
2416
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2300
|
-
|
|
2417
|
+
const INITIAL_STATE = {
|
|
2301
2418
|
circles: []
|
|
2302
2419
|
};
|
|
2303
2420
|
var CircleReducer = (function () {
|
|
2304
|
-
|
|
2305
|
-
|
|
2421
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
|
|
2422
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
2306
2423
|
switch (action.type) {
|
|
2307
2424
|
case CIRCLES_LOADED:
|
|
2308
2425
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
@@ -2334,7 +2451,7 @@ class ViewWidget extends Component {
|
|
|
2334
2451
|
});
|
|
2335
2452
|
}
|
|
2336
2453
|
}
|
|
2337
|
-
|
|
2454
|
+
const styles$3 = {
|
|
2338
2455
|
image: {
|
|
2339
2456
|
width: 80
|
|
2340
2457
|
}
|
|
@@ -2351,7 +2468,7 @@ class ViewFull extends Component {
|
|
|
2351
2468
|
});
|
|
2352
2469
|
}
|
|
2353
2470
|
}
|
|
2354
|
-
|
|
2471
|
+
const styles$2 = {
|
|
2355
2472
|
image: {
|
|
2356
2473
|
width: "100%",
|
|
2357
2474
|
height: "100%",
|
|
@@ -2365,7 +2482,7 @@ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
2365
2482
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2366
2483
|
class PreviewWidget extends Component {
|
|
2367
2484
|
render() {
|
|
2368
|
-
|
|
2485
|
+
const {
|
|
2369
2486
|
backgroundColor,
|
|
2370
2487
|
widgetTitle,
|
|
2371
2488
|
titleClassName
|
|
@@ -2386,7 +2503,7 @@ class PreviewWidget extends Component {
|
|
|
2386
2503
|
});
|
|
2387
2504
|
}
|
|
2388
2505
|
}
|
|
2389
|
-
|
|
2506
|
+
const styles$1 = {
|
|
2390
2507
|
container: {
|
|
2391
2508
|
position: "relative"
|
|
2392
2509
|
},
|
|
@@ -2401,7 +2518,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
2401
2518
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2402
2519
|
class PreviewFull extends Component {
|
|
2403
2520
|
render() {
|
|
2404
|
-
|
|
2521
|
+
const {
|
|
2405
2522
|
backgroundColor,
|
|
2406
2523
|
widgetTitle,
|
|
2407
2524
|
titleClassName
|
|
@@ -2421,7 +2538,7 @@ class PreviewFull extends Component {
|
|
|
2421
2538
|
});
|
|
2422
2539
|
}
|
|
2423
2540
|
}
|
|
2424
|
-
|
|
2541
|
+
const styles = {
|
|
2425
2542
|
container: {
|
|
2426
2543
|
position: "relative"
|
|
2427
2544
|
},
|
|
@@ -2432,10 +2549,10 @@ var styles = {
|
|
|
2432
2549
|
|
|
2433
2550
|
class PreviewGrid extends Component {
|
|
2434
2551
|
render() {
|
|
2435
|
-
|
|
2552
|
+
const {
|
|
2436
2553
|
colour
|
|
2437
2554
|
} = this.props;
|
|
2438
|
-
|
|
2555
|
+
const path = "M12.1875 0.9375C11.1548 0.9375 9.67896 1.25977 8.7616 1.87866C7.0166 1.94275 5.82275 3.16772 5.62683 5.11047C5.50781 6.30981 5.61768 7.16858 5.68909 7.73621C5.71472 7.93396 5.74219 8.15735 5.73303 8.22327C5.71838 8.31116 5.70374 8.39905 5.69092 8.48694C5.61401 8.4906 5.54626 8.50159 5.48584 8.51807C4.71313 8.72498 4.38904 9.85474 4.73511 11.1456C4.98596 12.0813 5.51147 12.7844 6.08643 13.0005C6.38306 13.9087 6.81885 14.8114 7.36084 15.6244L3.03955 18.1274C1.16455 19.2114 0 21.2329 0 23.399V26.7188C0 27.4933 0.631714 28.125 1.40625 28.125H19.519C20.6287 29.2786 22.1832 30 23.9062 30C27.2662 30 30 27.2662 30 23.9062C30 21.2402 28.2751 18.9734 25.8856 18.1494L21.8115 15.5127C22.4158 14.7931 22.9193 13.8977 23.2397 12.9419C23.6847 12.7478 24.0765 12.2168 24.267 11.4972C24.3823 11.0669 24.4061 10.6329 24.3311 10.274C24.2377 9.80896 23.9777 9.48669 23.6224 9.39148C23.5986 9.38416 23.573 9.37866 23.5455 9.375C23.4979 9.06738 23.4174 8.76709 23.2892 8.39905C23.3734 8.42102 23.465 8.45032 23.5437 8.48145C23.703 8.54919 23.8898 8.52173 24.0234 8.4082C24.1589 8.29651 24.2194 8.1189 24.1827 7.94861C23.606 5.31006 21.6467 3.73535 18.9441 3.73535H18.5962C18.5248 3.73535 18.446 3.74084 18.371 3.74634C17.1332 1.9519 15.1355 0.9375 12.6562 0.9375H12.1875ZM12.1875 1.875H12.6562C15.5017 1.875 17.5562 3.32886 18.3984 5.89783C18.0743 5.86121 17.7393 5.90149 17.5104 6.12305C17.3309 6.29333 17.1625 6.62109 17.3749 7.19971C17.6642 7.98523 17.7667 8.45032 17.7979 9.1095C17.8052 9.27795 17.9041 9.4281 18.0524 9.505C18.2007 9.58008 18.3801 9.57092 18.5211 9.47937C18.598 9.42993 18.6383 9.42444 18.6475 9.42444C18.761 9.46289 18.9661 10.0342 18.7335 10.9039C18.5028 11.7664 18.0597 12.1307 17.9224 12.1307C17.7136 12.1252 17.5323 12.2681 17.4738 12.4658C16.6827 15.1227 14.6155 17.8125 12.1875 17.8125C9.75952 17.8125 7.69226 15.1227 6.90125 12.4658C6.84265 12.2681 6.66138 12.1307 6.45264 12.1307C6.31531 12.1307 5.87219 11.7664 5.64148 10.9039C5.4071 10.0269 5.61768 9.45374 5.72571 9.42444C5.72754 9.42444 5.76782 9.42444 5.85205 9.47937C5.99487 9.57092 6.17432 9.58008 6.32263 9.505C6.47278 9.4281 6.56799 9.27795 6.57715 9.1095C6.58813 8.86414 6.61377 8.62061 6.65588 8.38623C6.69067 8.18481 6.66321 7.95959 6.61926 7.61719C6.55151 7.09167 6.45081 6.297 6.56067 5.20386C6.70898 3.70789 7.58606 2.8125 8.91357 2.8125C9.01611 2.8125 9.11316 2.77954 9.19556 2.71912C9.83826 2.23755 11.1237 1.875 12.1875 1.875ZM18.913 4.67285H18.9459C20.9491 4.67285 22.4121 5.66528 23.0566 7.42676C22.8461 7.43042 22.6392 7.48352 22.4835 7.63367C22.3224 7.78564 22.1704 8.07312 22.3535 8.56384C22.5641 9.13879 22.6392 9.47571 22.6611 9.95361C22.6685 10.1221 22.7655 10.2722 22.9156 10.3491C23.0621 10.4224 23.2361 10.415 23.3752 10.329C23.4338 10.4608 23.4851 10.7977 23.3624 11.2555C23.2178 11.792 22.9486 12.0612 22.8735 12.0831H22.8717C22.6648 12.0831 22.4817 12.2186 22.4231 12.4182C22.0312 13.7366 21.2512 14.9469 20.3394 15.6537C20.1343 15.813 20.0958 16.1078 20.2551 16.311C20.3467 16.4319 20.4858 16.4941 20.625 16.4941C20.7257 16.4941 20.8264 16.463 20.9125 16.3971C20.9912 16.3348 21.0681 16.2653 21.145 16.1993L23.6591 17.8253C22.9193 17.8546 22.2144 18.0103 21.5643 18.2812C21.4856 18.2318 21.416 18.1732 21.3354 18.1274L17.0142 15.6244C17.5562 14.8114 17.9901 13.9087 18.2886 13.0005C18.8617 12.7844 19.389 12.0831 19.6381 11.1456C19.9841 9.85474 19.6619 8.72498 18.8892 8.51807C18.8306 8.50342 18.761 8.4906 18.6841 8.48694C18.62 7.98523 18.4918 7.51648 18.2538 6.87561C18.2483 6.8573 18.2428 6.84082 18.2373 6.82617C18.4021 6.83899 18.6676 6.90674 18.8837 6.99463C19.0466 7.06238 19.2316 7.03491 19.3652 6.92139C19.4989 6.80969 19.5593 6.63208 19.5209 6.46179C19.3799 5.81543 19.1748 5.21667 18.913 4.67285ZM9.62219 4.74609C9.28711 4.7168 8.9502 4.86877 8.75793 5.16357L8.00537 6.30432C7.86255 6.52039 7.92297 6.81152 8.13904 6.95435C8.2196 7.00745 8.3075 7.03125 8.39539 7.03125C8.54919 7.03125 8.69751 6.95801 8.78906 6.82068L9.53979 5.67993L10.2722 6.03699C11.6071 6.68701 13.0994 7.03125 14.5844 7.03125H15.7819C16.04 7.03125 16.2506 6.82068 16.2506 6.5625C16.2506 6.30432 16.04 6.09375 15.7819 6.09375H14.5844C13.2404 6.09375 11.8909 5.78247 10.6842 5.19287L9.95178 4.83582C9.84558 4.78455 9.73389 4.75525 9.62219 4.74609ZM7.9248 16.3788C9.06555 17.7704 10.5487 18.75 12.1875 18.75C13.8263 18.75 15.3094 17.7722 16.4502 16.3806L20.6104 18.7885C18.9294 19.8761 17.8125 21.7621 17.8125 23.9062C17.8125 25.1147 18.1696 26.239 18.7793 27.1875H1.40625C1.14807 27.1875 0.9375 26.9769 0.9375 26.7188V23.399C0.9375 21.5662 1.92261 19.856 3.51013 18.9368L7.9248 16.3788ZM23.9062 18.75C26.7499 18.75 29.0625 21.0626 29.0625 23.9062C29.0625 26.7499 26.7499 29.0625 23.9062 29.0625C21.0626 29.0625 18.75 26.7499 18.75 23.9062C18.75 21.0626 21.0626 18.75 23.9062 18.75ZM8.4668 18.75C8.28369 18.739 8.10425 18.8361 8.01819 19.0082C7.90283 19.2407 7.99622 19.5227 8.22693 19.6381L11.9769 21.5131C12.0447 21.546 12.1161 21.5625 12.1875 21.5625C12.2589 21.5625 12.3322 21.546 12.3981 21.5131L16.1481 19.6381C16.3788 19.5227 16.4722 19.2407 16.3568 19.0082C16.2415 18.7775 15.9595 18.6841 15.7269 18.7994L12.1875 20.5701L8.64807 18.7994C8.58948 18.7701 8.52722 18.7555 8.4668 18.75ZM23.9062 20.625C23.6481 20.625 23.4375 20.8356 23.4375 21.0938V23.4375H21.0938C20.8356 23.4375 20.625 23.6481 20.625 23.9062C20.625 24.1644 20.8356 24.375 21.0938 24.375H23.4375V26.7188C23.4375 26.9769 23.6481 27.1875 23.9062 27.1875C24.1644 27.1875 24.375 26.9769 24.375 26.7188V24.375H26.7188C26.9769 24.375 27.1875 24.1644 27.1875 23.9062C27.1875 23.6481 26.9769 23.4375 26.7188 23.4375H24.375V21.0938C24.375 20.8356 24.1644 20.625 23.9062 20.625ZM2.8125 24.375C2.55432 24.375 2.34375 24.5856 2.34375 24.8438V25.7812C2.34375 26.0394 2.55432 26.25 2.8125 26.25C3.07068 26.25 3.28125 26.0394 3.28125 25.7812V24.8438C3.28125 24.5856 3.07068 24.375 2.8125 24.375ZM5.15625 24.375C4.89807 24.375 4.6875 24.5856 4.6875 24.8438V25.7812C4.6875 26.0394 4.89807 26.25 5.15625 26.25C5.41443 26.25 5.625 26.0394 5.625 25.7812V24.8438C5.625 24.5856 5.41443 24.375 5.15625 24.375ZM7.5 24.375C7.24182 24.375 7.03125 24.5856 7.03125 24.8438V25.7812C7.03125 26.0394 7.24182 26.25 7.5 26.25C7.75818 26.25 7.96875 26.0394 7.96875 25.7812V24.8438C7.96875 24.5856 7.75818 24.375 7.5 24.375ZM9.84375 24.375C9.58557 24.375 9.375 24.5856 9.375 24.8438V25.7812C9.375 26.0394 9.58557 26.25 9.84375 26.25C10.1019 26.25 10.3125 26.0394 10.3125 25.7812V24.8438C10.3125 24.5856 10.1019 24.375 9.84375 24.375ZM12.1875 24.375C11.9293 24.375 11.7188 24.5856 11.7188 24.8438V25.7812C11.7188 26.0394 11.9293 26.25 12.1875 26.25C12.4457 26.25 12.6562 26.0394 12.6562 25.7812V24.8438C12.6562 24.5856 12.4457 24.375 12.1875 24.375ZM14.5312 24.375C14.2731 24.375 14.0625 24.5856 14.0625 24.8438V25.7812C14.0625 26.0394 14.2731 26.25 14.5312 26.25C14.7894 26.25 15 26.0394 15 25.7812V24.8438C15 24.5856 14.7894 24.375 14.5312 24.375ZM16.875 24.375C16.6168 24.375 16.4062 24.5856 16.4062 24.8438V25.7812C16.4062 26.0394 16.6168 26.25 16.875 26.25C17.1332 26.25 17.3438 26.0394 17.3438 25.7812V24.8438C17.3438 24.5856 17.1332 24.375 16.875 24.375Z";
|
|
2439
2556
|
return /*#__PURE__*/jsxs("svg", {
|
|
2440
2557
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2441
2558
|
viewBox: "0 0 30 30",
|
|
@@ -2447,7 +2564,7 @@ class PreviewGrid extends Component {
|
|
|
2447
2564
|
}
|
|
2448
2565
|
}
|
|
2449
2566
|
|
|
2450
|
-
|
|
2567
|
+
const {
|
|
2451
2568
|
Components,
|
|
2452
2569
|
Colours
|
|
2453
2570
|
} = PlussCore;
|
|
@@ -2458,8 +2575,8 @@ var FeaturePickerContent = () => {
|
|
|
2458
2575
|
className: "fp2_widget_content_vListing",
|
|
2459
2576
|
children: [/*#__PURE__*/jsx("div", {
|
|
2460
2577
|
className: "fp2_widget_silhouette fp2_widget_silhouette-circle",
|
|
2461
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
2462
|
-
icon: "comments",
|
|
2578
|
+
children: /*#__PURE__*/jsx(Components.Icon, {
|
|
2579
|
+
icon: "fa-comments",
|
|
2463
2580
|
colour: Colours.hexToRGBAstring(Colours.COLOUR_BRANDING_MAIN, 0.5)
|
|
2464
2581
|
})
|
|
2465
2582
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -2474,8 +2591,8 @@ var FeaturePickerContent = () => {
|
|
|
2474
2591
|
className: "fp2_widget_content_vListing",
|
|
2475
2592
|
children: [/*#__PURE__*/jsx("div", {
|
|
2476
2593
|
className: "fp2_widget_silhouette fp2_widget_silhouette-circle",
|
|
2477
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
2478
|
-
icon: "comments",
|
|
2594
|
+
children: /*#__PURE__*/jsx(Components.Icon, {
|
|
2595
|
+
icon: "fa-comments",
|
|
2479
2596
|
colour: Colours.hexToRGBAstring(Colours.COLOUR_BRANDING_MAIN, 0.5)
|
|
2480
2597
|
})
|
|
2481
2598
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -2490,8 +2607,8 @@ var FeaturePickerContent = () => {
|
|
|
2490
2607
|
className: "fp2_widget_content_vListing",
|
|
2491
2608
|
children: [/*#__PURE__*/jsx("div", {
|
|
2492
2609
|
className: "fp2_widget_silhouette fp2_widget_silhouette-circle",
|
|
2493
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
2494
|
-
icon: "comments",
|
|
2610
|
+
children: /*#__PURE__*/jsx(Components.Icon, {
|
|
2611
|
+
icon: "fa-comments",
|
|
2495
2612
|
colour: Colours.hexToRGBAstring(Colours.COLOUR_BRANDING_MAIN, 0.5)
|
|
2496
2613
|
})
|
|
2497
2614
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -2506,15 +2623,15 @@ var FeaturePickerContent = () => {
|
|
|
2506
2623
|
});
|
|
2507
2624
|
};
|
|
2508
2625
|
|
|
2509
|
-
|
|
2626
|
+
const Reducers = {
|
|
2510
2627
|
[values.reducerKey]: CircleReducer
|
|
2511
2628
|
};
|
|
2512
|
-
|
|
2629
|
+
const Screens = {
|
|
2513
2630
|
[values.componentCircles]: Circles$1,
|
|
2514
2631
|
[values.componentAddCircle]: AddCircle$1,
|
|
2515
2632
|
[values.componentCircle]: Circle$1
|
|
2516
2633
|
};
|
|
2517
|
-
|
|
2634
|
+
const Analytics = [toExport];
|
|
2518
2635
|
|
|
2519
2636
|
export { Analytics, FeatureConfig as Config, FeaturePickerContent, PreviewFull, PreviewGrid, PreviewWidget, Reducers, Screens, ViewFull, ViewWidget };
|
|
2520
2637
|
//# sourceMappingURL=index.js.map
|