@plusscommunities/pluss-newsletter-web-sharing 1.4.19 → 1.4.20
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 +57 -2
- package/dist/index.esm.js +58 -3
- package/dist/index.umd.js +57 -2
- package/package.json +4 -1
- package/src/components/AnalyticsHub.js +52 -2
package/dist/index.cjs.js
CHANGED
|
@@ -7210,10 +7210,16 @@ var Analytics$1 = PlussCore__namespace.Analytics,
|
|
|
7210
7210
|
|
|
7211
7211
|
var getInitialState = function getInitialState() {
|
|
7212
7212
|
return {
|
|
7213
|
+
posts: 0,
|
|
7214
|
+
prevPosts: 0,
|
|
7213
7215
|
pageViews: 0,
|
|
7214
7216
|
prevPageViews: 0,
|
|
7215
7217
|
uniquePageView: 0,
|
|
7216
7218
|
prevUniquePageView: 0,
|
|
7219
|
+
comments: 0,
|
|
7220
|
+
prevComments: 0,
|
|
7221
|
+
reactions: 0,
|
|
7222
|
+
prevReactions: 0,
|
|
7217
7223
|
isLoading: true
|
|
7218
7224
|
};
|
|
7219
7225
|
}; // AnalyticsHub Component
|
|
@@ -7243,7 +7249,14 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7243
7249
|
return null;
|
|
7244
7250
|
}
|
|
7245
7251
|
|
|
7246
|
-
var featureTitle =
|
|
7252
|
+
var featureTitle = function (key) {
|
|
7253
|
+
if (!strings || !strings.sideNav || !strings.sideNav[key]) {
|
|
7254
|
+
return values.textMenuTitle;
|
|
7255
|
+
}
|
|
7256
|
+
|
|
7257
|
+
return strings.sideNav[key];
|
|
7258
|
+
}();
|
|
7259
|
+
|
|
7247
7260
|
var exportColumns = [{
|
|
7248
7261
|
label: 'Select All',
|
|
7249
7262
|
key: ''
|
|
@@ -7253,12 +7266,21 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7253
7266
|
}, {
|
|
7254
7267
|
label: 'End Date',
|
|
7255
7268
|
key: 'endDate'
|
|
7269
|
+
}, {
|
|
7270
|
+
label: 'Posts',
|
|
7271
|
+
key: 'posts'
|
|
7256
7272
|
}, {
|
|
7257
7273
|
label: 'Page Views',
|
|
7258
7274
|
key: 'pageViews'
|
|
7259
7275
|
}, {
|
|
7260
7276
|
label: 'Unique Visitors',
|
|
7261
7277
|
key: 'uniquePageView'
|
|
7278
|
+
}, {
|
|
7279
|
+
label: 'Comments',
|
|
7280
|
+
key: 'comments'
|
|
7281
|
+
}, {
|
|
7282
|
+
label: 'Reactions',
|
|
7283
|
+
key: 'reactions'
|
|
7262
7284
|
}];
|
|
7263
7285
|
React.useEffect(function () {
|
|
7264
7286
|
getData();
|
|
@@ -7284,10 +7306,16 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7284
7306
|
currentStatsResponse = _yield$Promise$all2[0];
|
|
7285
7307
|
prevStatsResponse = _yield$Promise$all2[1];
|
|
7286
7308
|
data = {
|
|
7309
|
+
posts: Analytics$1.countActivities(currentStatsResponse.data, 'Post', 'total'),
|
|
7310
|
+
prevPosts: Analytics$1.countActivities(prevStatsResponse.data, 'Post', 'total'),
|
|
7287
7311
|
pageViews: Analytics$1.countActivities(currentStatsResponse.data, 'PageView', 'total'),
|
|
7288
7312
|
prevPageViews: Analytics$1.countActivities(prevStatsResponse.data, 'PageView', 'total'),
|
|
7289
7313
|
uniquePageView: Analytics$1.countActivities(currentStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
7290
7314
|
prevUniquePageView: Analytics$1.countActivities(prevStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
7315
|
+
comments: Analytics$1.countActivities(currentStatsResponse.data, 'Comment', 'total'),
|
|
7316
|
+
prevComments: Analytics$1.countActivities(prevStatsResponse.data, 'Comment', 'total'),
|
|
7317
|
+
reactions: Analytics$1.countActivities(currentStatsResponse.data, 'Reaction', 'total'),
|
|
7318
|
+
prevReactions: Analytics$1.countActivities(prevStatsResponse.data, 'Reaction', 'total'),
|
|
7291
7319
|
isLoading: false
|
|
7292
7320
|
};
|
|
7293
7321
|
setAnalyticsData(data);
|
|
@@ -7313,8 +7341,11 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7313
7341
|
return [{
|
|
7314
7342
|
startDate: moment__default['default'](startTime + 1).format('D-MM-YYYY'),
|
|
7315
7343
|
endDate: moment__default['default'](endTime).format('D-MM-YYYY'),
|
|
7344
|
+
posts: analyticsData.posts,
|
|
7316
7345
|
pageViews: analyticsData.pageViews,
|
|
7317
|
-
uniquePageView: analyticsData.uniquePageView
|
|
7346
|
+
uniquePageView: analyticsData.uniquePageView,
|
|
7347
|
+
comments: analyticsData.comments,
|
|
7348
|
+
reactions: analyticsData.reactions
|
|
7318
7349
|
}];
|
|
7319
7350
|
};
|
|
7320
7351
|
|
|
@@ -7351,6 +7382,14 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7351
7382
|
}, "Export CSV")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7352
7383
|
className: "analyticsSection dashboardSection_content"
|
|
7353
7384
|
}, /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7385
|
+
title: "".concat(featureTitle, " Posts"),
|
|
7386
|
+
icon: freeSolidSvgIcons.faNewspaper,
|
|
7387
|
+
value: analyticsData.posts,
|
|
7388
|
+
previousValue: analyticsData.prevPosts,
|
|
7389
|
+
prevText: prevText,
|
|
7390
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Post&countType=total&dayCount=").concat(dayCount),
|
|
7391
|
+
isLoading: analyticsData.isLoading
|
|
7392
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7354
7393
|
title: "".concat(featureTitle, " Page Views"),
|
|
7355
7394
|
icon: freeSolidSvgIcons.faEye,
|
|
7356
7395
|
value: analyticsData.pageViews,
|
|
@@ -7366,6 +7405,22 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7366
7405
|
prevText: prevText,
|
|
7367
7406
|
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=UniquePageView&countType=uniquearray&dayCount=").concat(dayCount),
|
|
7368
7407
|
isLoading: analyticsData.isLoading
|
|
7408
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7409
|
+
title: "".concat(featureTitle, " Comments"),
|
|
7410
|
+
icon: freeSolidSvgIcons.faComment,
|
|
7411
|
+
value: analyticsData.comments,
|
|
7412
|
+
previousValue: analyticsData.prevComments,
|
|
7413
|
+
prevText: prevText,
|
|
7414
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount),
|
|
7415
|
+
isLoading: analyticsData.isLoading
|
|
7416
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7417
|
+
title: "".concat(featureTitle, " Reactions"),
|
|
7418
|
+
icon: freeSolidSvgIcons.faFaceSmile,
|
|
7419
|
+
value: analyticsData.reactions,
|
|
7420
|
+
previousValue: analyticsData.prevReactions,
|
|
7421
|
+
prevText: prevText,
|
|
7422
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Reaction&countType=total&dayCount=").concat(dayCount),
|
|
7423
|
+
isLoading: analyticsData.isLoading
|
|
7369
7424
|
})));
|
|
7370
7425
|
};
|
|
7371
7426
|
|
package/dist/index.esm.js
CHANGED
|
@@ -22,7 +22,7 @@ import NewsletterPreview from 'make-pluss-newsletter';
|
|
|
22
22
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
23
23
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
24
24
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
25
|
-
import { faEye, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
25
|
+
import { faNewspaper, faEye, faUser, faComment, faFaceSmile } from '@fortawesome/free-solid-svg-icons';
|
|
26
26
|
|
|
27
27
|
var values = {
|
|
28
28
|
featureKey: 'sharing',
|
|
@@ -7164,10 +7164,16 @@ var Analytics$1 = PlussCore.Analytics,
|
|
|
7164
7164
|
|
|
7165
7165
|
var getInitialState = function getInitialState() {
|
|
7166
7166
|
return {
|
|
7167
|
+
posts: 0,
|
|
7168
|
+
prevPosts: 0,
|
|
7167
7169
|
pageViews: 0,
|
|
7168
7170
|
prevPageViews: 0,
|
|
7169
7171
|
uniquePageView: 0,
|
|
7170
7172
|
prevUniquePageView: 0,
|
|
7173
|
+
comments: 0,
|
|
7174
|
+
prevComments: 0,
|
|
7175
|
+
reactions: 0,
|
|
7176
|
+
prevReactions: 0,
|
|
7171
7177
|
isLoading: true
|
|
7172
7178
|
};
|
|
7173
7179
|
}; // AnalyticsHub Component
|
|
@@ -7197,7 +7203,14 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7197
7203
|
return null;
|
|
7198
7204
|
}
|
|
7199
7205
|
|
|
7200
|
-
var featureTitle =
|
|
7206
|
+
var featureTitle = function (key) {
|
|
7207
|
+
if (!strings || !strings.sideNav || !strings.sideNav[key]) {
|
|
7208
|
+
return values.textMenuTitle;
|
|
7209
|
+
}
|
|
7210
|
+
|
|
7211
|
+
return strings.sideNav[key];
|
|
7212
|
+
}();
|
|
7213
|
+
|
|
7201
7214
|
var exportColumns = [{
|
|
7202
7215
|
label: 'Select All',
|
|
7203
7216
|
key: ''
|
|
@@ -7207,12 +7220,21 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7207
7220
|
}, {
|
|
7208
7221
|
label: 'End Date',
|
|
7209
7222
|
key: 'endDate'
|
|
7223
|
+
}, {
|
|
7224
|
+
label: 'Posts',
|
|
7225
|
+
key: 'posts'
|
|
7210
7226
|
}, {
|
|
7211
7227
|
label: 'Page Views',
|
|
7212
7228
|
key: 'pageViews'
|
|
7213
7229
|
}, {
|
|
7214
7230
|
label: 'Unique Visitors',
|
|
7215
7231
|
key: 'uniquePageView'
|
|
7232
|
+
}, {
|
|
7233
|
+
label: 'Comments',
|
|
7234
|
+
key: 'comments'
|
|
7235
|
+
}, {
|
|
7236
|
+
label: 'Reactions',
|
|
7237
|
+
key: 'reactions'
|
|
7216
7238
|
}];
|
|
7217
7239
|
useEffect(function () {
|
|
7218
7240
|
getData();
|
|
@@ -7238,10 +7260,16 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7238
7260
|
currentStatsResponse = _yield$Promise$all2[0];
|
|
7239
7261
|
prevStatsResponse = _yield$Promise$all2[1];
|
|
7240
7262
|
data = {
|
|
7263
|
+
posts: Analytics$1.countActivities(currentStatsResponse.data, 'Post', 'total'),
|
|
7264
|
+
prevPosts: Analytics$1.countActivities(prevStatsResponse.data, 'Post', 'total'),
|
|
7241
7265
|
pageViews: Analytics$1.countActivities(currentStatsResponse.data, 'PageView', 'total'),
|
|
7242
7266
|
prevPageViews: Analytics$1.countActivities(prevStatsResponse.data, 'PageView', 'total'),
|
|
7243
7267
|
uniquePageView: Analytics$1.countActivities(currentStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
7244
7268
|
prevUniquePageView: Analytics$1.countActivities(prevStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
7269
|
+
comments: Analytics$1.countActivities(currentStatsResponse.data, 'Comment', 'total'),
|
|
7270
|
+
prevComments: Analytics$1.countActivities(prevStatsResponse.data, 'Comment', 'total'),
|
|
7271
|
+
reactions: Analytics$1.countActivities(currentStatsResponse.data, 'Reaction', 'total'),
|
|
7272
|
+
prevReactions: Analytics$1.countActivities(prevStatsResponse.data, 'Reaction', 'total'),
|
|
7245
7273
|
isLoading: false
|
|
7246
7274
|
};
|
|
7247
7275
|
setAnalyticsData(data);
|
|
@@ -7267,8 +7295,11 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7267
7295
|
return [{
|
|
7268
7296
|
startDate: moment(startTime + 1).format('D-MM-YYYY'),
|
|
7269
7297
|
endDate: moment(endTime).format('D-MM-YYYY'),
|
|
7298
|
+
posts: analyticsData.posts,
|
|
7270
7299
|
pageViews: analyticsData.pageViews,
|
|
7271
|
-
uniquePageView: analyticsData.uniquePageView
|
|
7300
|
+
uniquePageView: analyticsData.uniquePageView,
|
|
7301
|
+
comments: analyticsData.comments,
|
|
7302
|
+
reactions: analyticsData.reactions
|
|
7272
7303
|
}];
|
|
7273
7304
|
};
|
|
7274
7305
|
|
|
@@ -7305,6 +7336,14 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7305
7336
|
}, "Export CSV")), /*#__PURE__*/React.createElement("div", {
|
|
7306
7337
|
className: "analyticsSection dashboardSection_content"
|
|
7307
7338
|
}, /*#__PURE__*/React.createElement(Components.StatBox, {
|
|
7339
|
+
title: "".concat(featureTitle, " Posts"),
|
|
7340
|
+
icon: faNewspaper,
|
|
7341
|
+
value: analyticsData.posts,
|
|
7342
|
+
previousValue: analyticsData.prevPosts,
|
|
7343
|
+
prevText: prevText,
|
|
7344
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Post&countType=total&dayCount=").concat(dayCount),
|
|
7345
|
+
isLoading: analyticsData.isLoading
|
|
7346
|
+
}), /*#__PURE__*/React.createElement(Components.StatBox, {
|
|
7308
7347
|
title: "".concat(featureTitle, " Page Views"),
|
|
7309
7348
|
icon: faEye,
|
|
7310
7349
|
value: analyticsData.pageViews,
|
|
@@ -7320,6 +7359,22 @@ var AnalyticsHub = function AnalyticsHub(_ref) {
|
|
|
7320
7359
|
prevText: prevText,
|
|
7321
7360
|
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=UniquePageView&countType=uniquearray&dayCount=").concat(dayCount),
|
|
7322
7361
|
isLoading: analyticsData.isLoading
|
|
7362
|
+
}), /*#__PURE__*/React.createElement(Components.StatBox, {
|
|
7363
|
+
title: "".concat(featureTitle, " Comments"),
|
|
7364
|
+
icon: faComment,
|
|
7365
|
+
value: analyticsData.comments,
|
|
7366
|
+
previousValue: analyticsData.prevComments,
|
|
7367
|
+
prevText: prevText,
|
|
7368
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount),
|
|
7369
|
+
isLoading: analyticsData.isLoading
|
|
7370
|
+
}), /*#__PURE__*/React.createElement(Components.StatBox, {
|
|
7371
|
+
title: "".concat(featureTitle, " Reactions"),
|
|
7372
|
+
icon: faFaceSmile,
|
|
7373
|
+
value: analyticsData.reactions,
|
|
7374
|
+
previousValue: analyticsData.prevReactions,
|
|
7375
|
+
prevText: prevText,
|
|
7376
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Reaction&countType=total&dayCount=").concat(dayCount),
|
|
7377
|
+
isLoading: analyticsData.isLoading
|
|
7323
7378
|
})));
|
|
7324
7379
|
};
|
|
7325
7380
|
|
package/dist/index.umd.js
CHANGED
|
@@ -7186,10 +7186,16 @@
|
|
|
7186
7186
|
|
|
7187
7187
|
var getInitialState = function getInitialState() {
|
|
7188
7188
|
return {
|
|
7189
|
+
posts: 0,
|
|
7190
|
+
prevPosts: 0,
|
|
7189
7191
|
pageViews: 0,
|
|
7190
7192
|
prevPageViews: 0,
|
|
7191
7193
|
uniquePageView: 0,
|
|
7192
7194
|
prevUniquePageView: 0,
|
|
7195
|
+
comments: 0,
|
|
7196
|
+
prevComments: 0,
|
|
7197
|
+
reactions: 0,
|
|
7198
|
+
prevReactions: 0,
|
|
7193
7199
|
isLoading: true
|
|
7194
7200
|
};
|
|
7195
7201
|
}; // AnalyticsHub Component
|
|
@@ -7219,7 +7225,14 @@
|
|
|
7219
7225
|
return null;
|
|
7220
7226
|
}
|
|
7221
7227
|
|
|
7222
|
-
var featureTitle =
|
|
7228
|
+
var featureTitle = function (key) {
|
|
7229
|
+
if (!strings || !strings.sideNav || !strings.sideNav[key]) {
|
|
7230
|
+
return values.textMenuTitle;
|
|
7231
|
+
}
|
|
7232
|
+
|
|
7233
|
+
return strings.sideNav[key];
|
|
7234
|
+
}();
|
|
7235
|
+
|
|
7223
7236
|
var exportColumns = [{
|
|
7224
7237
|
label: 'Select All',
|
|
7225
7238
|
key: ''
|
|
@@ -7229,12 +7242,21 @@
|
|
|
7229
7242
|
}, {
|
|
7230
7243
|
label: 'End Date',
|
|
7231
7244
|
key: 'endDate'
|
|
7245
|
+
}, {
|
|
7246
|
+
label: 'Posts',
|
|
7247
|
+
key: 'posts'
|
|
7232
7248
|
}, {
|
|
7233
7249
|
label: 'Page Views',
|
|
7234
7250
|
key: 'pageViews'
|
|
7235
7251
|
}, {
|
|
7236
7252
|
label: 'Unique Visitors',
|
|
7237
7253
|
key: 'uniquePageView'
|
|
7254
|
+
}, {
|
|
7255
|
+
label: 'Comments',
|
|
7256
|
+
key: 'comments'
|
|
7257
|
+
}, {
|
|
7258
|
+
label: 'Reactions',
|
|
7259
|
+
key: 'reactions'
|
|
7238
7260
|
}];
|
|
7239
7261
|
React.useEffect(function () {
|
|
7240
7262
|
getData();
|
|
@@ -7260,10 +7282,16 @@
|
|
|
7260
7282
|
currentStatsResponse = _yield$Promise$all2[0];
|
|
7261
7283
|
prevStatsResponse = _yield$Promise$all2[1];
|
|
7262
7284
|
data = {
|
|
7285
|
+
posts: Analytics$1.countActivities(currentStatsResponse.data, 'Post', 'total'),
|
|
7286
|
+
prevPosts: Analytics$1.countActivities(prevStatsResponse.data, 'Post', 'total'),
|
|
7263
7287
|
pageViews: Analytics$1.countActivities(currentStatsResponse.data, 'PageView', 'total'),
|
|
7264
7288
|
prevPageViews: Analytics$1.countActivities(prevStatsResponse.data, 'PageView', 'total'),
|
|
7265
7289
|
uniquePageView: Analytics$1.countActivities(currentStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
7266
7290
|
prevUniquePageView: Analytics$1.countActivities(prevStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
7291
|
+
comments: Analytics$1.countActivities(currentStatsResponse.data, 'Comment', 'total'),
|
|
7292
|
+
prevComments: Analytics$1.countActivities(prevStatsResponse.data, 'Comment', 'total'),
|
|
7293
|
+
reactions: Analytics$1.countActivities(currentStatsResponse.data, 'Reaction', 'total'),
|
|
7294
|
+
prevReactions: Analytics$1.countActivities(prevStatsResponse.data, 'Reaction', 'total'),
|
|
7267
7295
|
isLoading: false
|
|
7268
7296
|
};
|
|
7269
7297
|
setAnalyticsData(data);
|
|
@@ -7289,8 +7317,11 @@
|
|
|
7289
7317
|
return [{
|
|
7290
7318
|
startDate: moment__default['default'](startTime + 1).format('D-MM-YYYY'),
|
|
7291
7319
|
endDate: moment__default['default'](endTime).format('D-MM-YYYY'),
|
|
7320
|
+
posts: analyticsData.posts,
|
|
7292
7321
|
pageViews: analyticsData.pageViews,
|
|
7293
|
-
uniquePageView: analyticsData.uniquePageView
|
|
7322
|
+
uniquePageView: analyticsData.uniquePageView,
|
|
7323
|
+
comments: analyticsData.comments,
|
|
7324
|
+
reactions: analyticsData.reactions
|
|
7294
7325
|
}];
|
|
7295
7326
|
};
|
|
7296
7327
|
|
|
@@ -7327,6 +7358,14 @@
|
|
|
7327
7358
|
}, "Export CSV")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7328
7359
|
className: "analyticsSection dashboardSection_content"
|
|
7329
7360
|
}, /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7361
|
+
title: "".concat(featureTitle, " Posts"),
|
|
7362
|
+
icon: freeSolidSvgIcons.faNewspaper,
|
|
7363
|
+
value: analyticsData.posts,
|
|
7364
|
+
previousValue: analyticsData.prevPosts,
|
|
7365
|
+
prevText: prevText,
|
|
7366
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Post&countType=total&dayCount=").concat(dayCount),
|
|
7367
|
+
isLoading: analyticsData.isLoading
|
|
7368
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7330
7369
|
title: "".concat(featureTitle, " Page Views"),
|
|
7331
7370
|
icon: freeSolidSvgIcons.faEye,
|
|
7332
7371
|
value: analyticsData.pageViews,
|
|
@@ -7342,6 +7381,22 @@
|
|
|
7342
7381
|
prevText: prevText,
|
|
7343
7382
|
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=UniquePageView&countType=uniquearray&dayCount=").concat(dayCount),
|
|
7344
7383
|
isLoading: analyticsData.isLoading
|
|
7384
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7385
|
+
title: "".concat(featureTitle, " Comments"),
|
|
7386
|
+
icon: freeSolidSvgIcons.faComment,
|
|
7387
|
+
value: analyticsData.comments,
|
|
7388
|
+
previousValue: analyticsData.prevComments,
|
|
7389
|
+
prevText: prevText,
|
|
7390
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount),
|
|
7391
|
+
isLoading: analyticsData.isLoading
|
|
7392
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components.StatBox, {
|
|
7393
|
+
title: "".concat(featureTitle, " Reactions"),
|
|
7394
|
+
icon: freeSolidSvgIcons.faFaceSmile,
|
|
7395
|
+
value: analyticsData.reactions,
|
|
7396
|
+
previousValue: analyticsData.prevReactions,
|
|
7397
|
+
prevText: prevText,
|
|
7398
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Reaction&countType=total&dayCount=").concat(dayCount),
|
|
7399
|
+
isLoading: analyticsData.isLoading
|
|
7345
7400
|
})));
|
|
7346
7401
|
};
|
|
7347
7402
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-newsletter-web-sharing",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.20",
|
|
4
4
|
"description": "Extension package to enable newsletter on Pluss Communities Platform",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/runtime": "^7.14.0",
|
|
38
38
|
"@plusscommunities/pluss-core-web": "1.4.22",
|
|
39
|
+
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
|
40
|
+
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
|
41
|
+
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
39
42
|
"lodash": "^4.17.4",
|
|
40
43
|
"moment": "^2.18.1",
|
|
41
44
|
"react": "^16.14.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import moment from 'moment';
|
|
3
|
-
import { faCalendarCheck, faCalendarTimes, faEye, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { faCalendarCheck, faCalendarTimes, faComment, faEye, faFaceSmile, faNewspaper, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
5
|
import { analyticsActions } from '../webapi';
|
|
6
6
|
import { values } from '../values.config';
|
|
@@ -9,10 +9,16 @@ import { PlussCore } from '../feature.config';
|
|
|
9
9
|
const { Analytics, Session, Components } = PlussCore;
|
|
10
10
|
|
|
11
11
|
const getInitialState = () => ({
|
|
12
|
+
posts: 0,
|
|
13
|
+
prevPosts: 0,
|
|
12
14
|
pageViews: 0,
|
|
13
15
|
prevPageViews: 0,
|
|
14
16
|
uniquePageView: 0,
|
|
15
17
|
prevUniquePageView: 0,
|
|
18
|
+
comments: 0,
|
|
19
|
+
prevComments: 0,
|
|
20
|
+
reactions: 0,
|
|
21
|
+
prevReactions: 0,
|
|
16
22
|
isLoading: true,
|
|
17
23
|
});
|
|
18
24
|
|
|
@@ -26,14 +32,22 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount, strings })
|
|
|
26
32
|
return null;
|
|
27
33
|
}
|
|
28
34
|
|
|
29
|
-
const featureTitle =
|
|
35
|
+
const featureTitle = ((key) => {
|
|
36
|
+
if (!strings || !strings.sideNav || !strings.sideNav[key]) {
|
|
37
|
+
return values.textMenuTitle;
|
|
38
|
+
}
|
|
39
|
+
return strings.sideNav[key];
|
|
40
|
+
})();
|
|
30
41
|
|
|
31
42
|
const exportColumns = [
|
|
32
43
|
{ label: 'Select All', key: '' },
|
|
33
44
|
{ label: 'Start Date', key: 'startDate' },
|
|
34
45
|
{ label: 'End Date', key: 'endDate' },
|
|
46
|
+
{ label: 'Posts', key: 'posts' },
|
|
35
47
|
{ label: 'Page Views', key: 'pageViews' },
|
|
36
48
|
{ label: 'Unique Visitors', key: 'uniquePageView' },
|
|
49
|
+
{ label: 'Comments', key: 'comments' },
|
|
50
|
+
{ label: 'Reactions', key: 'reactions' },
|
|
37
51
|
];
|
|
38
52
|
|
|
39
53
|
useEffect(() => {
|
|
@@ -50,10 +64,16 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount, strings })
|
|
|
50
64
|
]);
|
|
51
65
|
|
|
52
66
|
const data = {
|
|
67
|
+
posts: Analytics.countActivities(currentStatsResponse.data, 'Post', 'total'),
|
|
68
|
+
prevPosts: Analytics.countActivities(prevStatsResponse.data, 'Post', 'total'),
|
|
53
69
|
pageViews: Analytics.countActivities(currentStatsResponse.data, 'PageView', 'total'),
|
|
54
70
|
prevPageViews: Analytics.countActivities(prevStatsResponse.data, 'PageView', 'total'),
|
|
55
71
|
uniquePageView: Analytics.countActivities(currentStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
56
72
|
prevUniquePageView: Analytics.countActivities(prevStatsResponse.data, 'UniquePageView', 'uniquearray'),
|
|
73
|
+
comments: Analytics.countActivities(currentStatsResponse.data, 'Comment', 'total'),
|
|
74
|
+
prevComments: Analytics.countActivities(prevStatsResponse.data, 'Comment', 'total'),
|
|
75
|
+
reactions: Analytics.countActivities(currentStatsResponse.data, 'Reaction', 'total'),
|
|
76
|
+
prevReactions: Analytics.countActivities(prevStatsResponse.data, 'Reaction', 'total'),
|
|
57
77
|
isLoading: false,
|
|
58
78
|
};
|
|
59
79
|
setAnalyticsData(data);
|
|
@@ -68,8 +88,11 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount, strings })
|
|
|
68
88
|
{
|
|
69
89
|
startDate: moment(startTime + 1).format('D-MM-YYYY'),
|
|
70
90
|
endDate: moment(endTime).format('D-MM-YYYY'),
|
|
91
|
+
posts: analyticsData.posts,
|
|
71
92
|
pageViews: analyticsData.pageViews,
|
|
72
93
|
uniquePageView: analyticsData.uniquePageView,
|
|
94
|
+
comments: analyticsData.comments,
|
|
95
|
+
reactions: analyticsData.reactions,
|
|
73
96
|
},
|
|
74
97
|
];
|
|
75
98
|
};
|
|
@@ -112,6 +135,15 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount, strings })
|
|
|
112
135
|
</Components.Button>
|
|
113
136
|
</div>
|
|
114
137
|
<div className="analyticsSection dashboardSection_content">
|
|
138
|
+
<Components.StatBox
|
|
139
|
+
title={`${featureTitle} Posts`}
|
|
140
|
+
icon={faNewspaper}
|
|
141
|
+
value={analyticsData.posts}
|
|
142
|
+
previousValue={analyticsData.prevPosts}
|
|
143
|
+
prevText={prevText}
|
|
144
|
+
viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=Post&countType=total&dayCount=${dayCount}`}
|
|
145
|
+
isLoading={analyticsData.isLoading}
|
|
146
|
+
/>
|
|
115
147
|
<Components.StatBox
|
|
116
148
|
title={`${featureTitle} Page Views`}
|
|
117
149
|
icon={faEye}
|
|
@@ -130,6 +162,24 @@ const AnalyticsHub = ({ startTime, endTime, auth, prevText, dayCount, strings })
|
|
|
130
162
|
viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=UniquePageView&countType=uniquearray&dayCount=${dayCount}`}
|
|
131
163
|
isLoading={analyticsData.isLoading}
|
|
132
164
|
/>
|
|
165
|
+
<Components.StatBox
|
|
166
|
+
title={`${featureTitle} Comments`}
|
|
167
|
+
icon={faComment}
|
|
168
|
+
value={analyticsData.comments}
|
|
169
|
+
previousValue={analyticsData.prevComments}
|
|
170
|
+
prevText={prevText}
|
|
171
|
+
viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=Comment&countType=total&dayCount=${dayCount}`}
|
|
172
|
+
isLoading={analyticsData.isLoading}
|
|
173
|
+
/>
|
|
174
|
+
<Components.StatBox
|
|
175
|
+
title={`${featureTitle} Reactions`}
|
|
176
|
+
icon={faFaceSmile}
|
|
177
|
+
value={analyticsData.reactions}
|
|
178
|
+
previousValue={analyticsData.prevReactions}
|
|
179
|
+
prevText={prevText}
|
|
180
|
+
viewGraphLink={`/chart?entity=${values.analyticsKey}&startTime=${startTime}&endTime=${endTime}&key=Reaction&countType=total&dayCount=${dayCount}`}
|
|
181
|
+
isLoading={analyticsData.isLoading}
|
|
182
|
+
/>
|
|
133
183
|
</div>
|
|
134
184
|
</div>
|
|
135
185
|
);
|