@plusscommunities/pluss-maintenance-web-forms 1.1.35 → 1.1.37-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.cjs.js +177 -94
- package/dist/index.esm.js +177 -94
- package/dist/index.umd.js +177 -94
- package/package.json +1 -1
- package/src/components/AnalyticsHub.js +308 -154
package/dist/index.umd.js
CHANGED
|
@@ -237,12 +237,12 @@
|
|
|
237
237
|
function ownKeys$7(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; }
|
|
238
238
|
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
239
239
|
const {
|
|
240
|
-
Helper: Helper$
|
|
240
|
+
Helper: Helper$6,
|
|
241
241
|
Session: Session$9
|
|
242
242
|
} = PlussCore__namespace;
|
|
243
243
|
const maintenanceActions = {
|
|
244
244
|
getJobType: (site, typeId) => {
|
|
245
|
-
let url = Helper$
|
|
245
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getjobtype');
|
|
246
246
|
return Session$9.authedFunction({
|
|
247
247
|
method: 'POST',
|
|
248
248
|
url,
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
});
|
|
254
254
|
},
|
|
255
255
|
getJobTypes: (site, id) => {
|
|
256
|
-
let url = Helper$
|
|
256
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getjobtypes');
|
|
257
257
|
return Session$9.authedFunction({
|
|
258
258
|
method: 'POST',
|
|
259
259
|
url,
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
});
|
|
264
264
|
},
|
|
265
265
|
getJob: (site, id) => {
|
|
266
|
-
let url = Helper$
|
|
266
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getJob');
|
|
267
267
|
return Session$9.authedFunction({
|
|
268
268
|
method: 'POST',
|
|
269
269
|
url,
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
});
|
|
275
275
|
},
|
|
276
276
|
getJobByJobId: (site, jobId) => {
|
|
277
|
-
let url = Helper$
|
|
277
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getJob');
|
|
278
278
|
return Session$9.authedFunction({
|
|
279
279
|
method: 'POST',
|
|
280
280
|
url,
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
290
290
|
return Session$9.authedFunction({
|
|
291
291
|
method: 'POST',
|
|
292
|
-
url: Helper$
|
|
292
|
+
url: Helper$6.getUrl(values.serviceKey, 'getJobs'),
|
|
293
293
|
data: {
|
|
294
294
|
site,
|
|
295
295
|
status,
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
}
|
|
313
313
|
return Session$9.authedFunction({
|
|
314
314
|
method: 'GET',
|
|
315
|
-
url: Helper$
|
|
315
|
+
url: Helper$6.getUrl(values.serviceKey, 'get/requests', query)
|
|
316
316
|
});
|
|
317
317
|
},
|
|
318
318
|
getJobsRecursive: function (site, status, type, lastKey) {
|
|
@@ -330,14 +330,14 @@
|
|
|
330
330
|
createJob: job => {
|
|
331
331
|
return Session$9.authedFunction({
|
|
332
332
|
method: 'POST',
|
|
333
|
-
url: Helper$
|
|
333
|
+
url: Helper$6.getUrl(values.serviceKey, 'sendMaintenance'),
|
|
334
334
|
data: _objectSpread$7({}, job)
|
|
335
335
|
});
|
|
336
336
|
},
|
|
337
337
|
editJob: (job, site) => {
|
|
338
338
|
return Session$9.authedFunction({
|
|
339
339
|
method: 'POST',
|
|
340
|
-
url: Helper$
|
|
340
|
+
url: Helper$6.getUrl(values.serviceKey, 'editJob'),
|
|
341
341
|
data: {
|
|
342
342
|
job,
|
|
343
343
|
site
|
|
@@ -347,7 +347,7 @@
|
|
|
347
347
|
deleteJob: (site, id) => {
|
|
348
348
|
return Session$9.authedFunction({
|
|
349
349
|
method: 'POST',
|
|
350
|
-
url: Helper$
|
|
350
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/remove'),
|
|
351
351
|
data: {
|
|
352
352
|
site,
|
|
353
353
|
id
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
editJobStatus: (id, status) => {
|
|
358
358
|
return Session$9.authedFunction({
|
|
359
359
|
method: 'POST',
|
|
360
|
-
url: Helper$
|
|
360
|
+
url: Helper$6.getUrl(values.serviceKey, 'editJobStatus'),
|
|
361
361
|
data: {
|
|
362
362
|
id,
|
|
363
363
|
status
|
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
editJobPriority: (id, priority) => {
|
|
368
368
|
return Session$9.authedFunction({
|
|
369
369
|
method: 'POST',
|
|
370
|
-
url: Helper$
|
|
370
|
+
url: Helper$6.getUrl(values.serviceKey, 'update/priority'),
|
|
371
371
|
data: {
|
|
372
372
|
id,
|
|
373
373
|
priority
|
|
@@ -377,7 +377,7 @@
|
|
|
377
377
|
assignJob: (jobId, userId) => {
|
|
378
378
|
return Session$9.authedFunction({
|
|
379
379
|
method: 'POST',
|
|
380
|
-
url: Helper$
|
|
380
|
+
url: Helper$6.getUrl(values.serviceKey, 'update/assign'),
|
|
381
381
|
data: {
|
|
382
382
|
id: jobId,
|
|
383
383
|
userId
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
getAssignees: site => {
|
|
388
388
|
return Session$9.authedFunction({
|
|
389
389
|
method: 'GET',
|
|
390
|
-
url: Helper$
|
|
390
|
+
url: Helper$6.getUrl(values.serviceKey, 'get/assignees', {
|
|
391
391
|
site
|
|
392
392
|
})
|
|
393
393
|
});
|
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
addNote: (jobId, note, attachments, images) => {
|
|
396
396
|
return Session$9.authedFunction({
|
|
397
397
|
method: 'POST',
|
|
398
|
-
url: Helper$
|
|
398
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/note'),
|
|
399
399
|
data: {
|
|
400
400
|
id: jobId,
|
|
401
401
|
note,
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
editNote: (jobId, noteId, note, attachments, images) => {
|
|
409
409
|
return Session$9.authedFunction({
|
|
410
410
|
method: 'POST',
|
|
411
|
-
url: Helper$
|
|
411
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/note'),
|
|
412
412
|
data: {
|
|
413
413
|
id: jobId,
|
|
414
414
|
note,
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
deleteNote: (jobId, noteId) => {
|
|
423
423
|
return Session$9.authedFunction({
|
|
424
424
|
method: 'POST',
|
|
425
|
-
url: Helper$
|
|
425
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/note'),
|
|
426
426
|
data: {
|
|
427
427
|
id: jobId,
|
|
428
428
|
noteId,
|
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
};
|
|
443
443
|
return Session$9.authedFunction({
|
|
444
444
|
method: 'POST',
|
|
445
|
-
url: Helper$
|
|
445
|
+
url: Helper$6.getUrl(values.serviceKey, 'createJobType'),
|
|
446
446
|
data
|
|
447
447
|
});
|
|
448
448
|
},
|
|
@@ -460,14 +460,14 @@
|
|
|
460
460
|
if (hasCustomFields && customFields) data.customFields = customFields;
|
|
461
461
|
return Session$9.authedFunction({
|
|
462
462
|
method: 'POST',
|
|
463
|
-
url: Helper$
|
|
463
|
+
url: Helper$6.getUrl(values.serviceKey, 'editJobType'),
|
|
464
464
|
data
|
|
465
465
|
});
|
|
466
466
|
},
|
|
467
467
|
deleteJobType: (site, id) => {
|
|
468
468
|
return Session$9.authedFunction({
|
|
469
469
|
method: 'POST',
|
|
470
|
-
url: Helper$
|
|
470
|
+
url: Helper$6.getUrl(values.serviceKey, 'deleteJobType'),
|
|
471
471
|
data: {
|
|
472
472
|
site,
|
|
473
473
|
id
|
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
getExternalSync: jobId => {
|
|
478
478
|
return Session$9.authedFunction({
|
|
479
479
|
method: 'GET',
|
|
480
|
-
url: Helper$
|
|
480
|
+
url: Helper$6.getUrl(values.serviceKey, 'get/externalsync', {
|
|
481
481
|
id: jobId
|
|
482
482
|
})
|
|
483
483
|
});
|
|
@@ -485,7 +485,7 @@
|
|
|
485
485
|
retrySync: jobId => {
|
|
486
486
|
return Session$9.authedFunction({
|
|
487
487
|
method: 'POST',
|
|
488
|
-
url: Helper$
|
|
488
|
+
url: Helper$6.getUrl(values.serviceKey, 'update/retrysync'),
|
|
489
489
|
data: {
|
|
490
490
|
id: jobId
|
|
491
491
|
}
|
|
@@ -494,7 +494,7 @@
|
|
|
494
494
|
};
|
|
495
495
|
|
|
496
496
|
const {
|
|
497
|
-
Helper: Helper$
|
|
497
|
+
Helper: Helper$5,
|
|
498
498
|
Session: Session$8
|
|
499
499
|
} = PlussCore__namespace;
|
|
500
500
|
const reactionActions = {
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
}
|
|
513
513
|
return Session$8.authedFunction({
|
|
514
514
|
method: 'POST',
|
|
515
|
-
url: Helper$
|
|
515
|
+
url: Helper$5.getUrl('reactions', 'comments/add'),
|
|
516
516
|
data
|
|
517
517
|
});
|
|
518
518
|
},
|
|
@@ -535,7 +535,7 @@
|
|
|
535
535
|
}
|
|
536
536
|
return Session$8.authedFunction({
|
|
537
537
|
method: 'GET',
|
|
538
|
-
url: Helper$
|
|
538
|
+
url: Helper$5.getUrl('reactions', 'comments/get', query)
|
|
539
539
|
});
|
|
540
540
|
}
|
|
541
541
|
};
|
|
@@ -569,7 +569,7 @@
|
|
|
569
569
|
];
|
|
570
570
|
|
|
571
571
|
const {
|
|
572
|
-
Helper: Helper$
|
|
572
|
+
Helper: Helper$4
|
|
573
573
|
} = PlussCore__namespace;
|
|
574
574
|
const jobsUpdate = (site, isdashboard) => {
|
|
575
575
|
return dispatch => {
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
type: JOBS_LOADING
|
|
578
578
|
});
|
|
579
579
|
maintenanceActions.getJobsRecursive(site).then(res => {
|
|
580
|
-
const currentSite = Helper$
|
|
580
|
+
const currentSite = Helper$4.readStorageWithCookie('site');
|
|
581
581
|
if (!___default["default"].isEmpty(res) && res[0].site === currentSite) {
|
|
582
582
|
dispatch({
|
|
583
583
|
type: JOBS_LOADED,
|
|
@@ -2714,7 +2714,7 @@
|
|
|
2714
2714
|
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__default["default"](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; }
|
|
2715
2715
|
const {
|
|
2716
2716
|
Apis: Apis$1,
|
|
2717
|
-
Helper: Helper$
|
|
2717
|
+
Helper: Helper$3,
|
|
2718
2718
|
Session: Session$3,
|
|
2719
2719
|
Colours: Colours$1,
|
|
2720
2720
|
Components: Components$3
|
|
@@ -3116,7 +3116,7 @@
|
|
|
3116
3116
|
}
|
|
3117
3117
|
});
|
|
3118
3118
|
this.state = {
|
|
3119
|
-
jobId: Helper$
|
|
3119
|
+
jobId: Helper$3.safeReadParams(props, "jobId") ? props.match.params.jobId : null,
|
|
3120
3120
|
job: null,
|
|
3121
3121
|
showingSelector: false,
|
|
3122
3122
|
updating: false,
|
|
@@ -3319,7 +3319,7 @@
|
|
|
3319
3319
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3320
3320
|
className: "imageGrid_image",
|
|
3321
3321
|
style: {
|
|
3322
|
-
backgroundImage: "url('".concat(Helper$
|
|
3322
|
+
backgroundImage: "url('".concat(Helper$3.get1400(image), "')"),
|
|
3323
3323
|
width: size,
|
|
3324
3324
|
height: size
|
|
3325
3325
|
}
|
|
@@ -3534,7 +3534,7 @@
|
|
|
3534
3534
|
}]
|
|
3535
3535
|
})), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
3536
3536
|
className: "maintenanceNote_text"
|
|
3537
|
-
}, Helper$
|
|
3537
|
+
}, Helper$3.toParagraphed(note.Note)), note.Attachments.map((a, i) => this.renderAttachment(a, i)), note.Images && note.Images.length > 0 ? this.renderImageGrid(note.Images, IMAGE_SIZE_NOTE) : null));
|
|
3538
3538
|
}
|
|
3539
3539
|
renderAssignment() {
|
|
3540
3540
|
const {
|
|
@@ -3968,7 +3968,7 @@
|
|
|
3968
3968
|
const {
|
|
3969
3969
|
Actions,
|
|
3970
3970
|
Components: Components$2,
|
|
3971
|
-
Helper: Helper$
|
|
3971
|
+
Helper: Helper$2,
|
|
3972
3972
|
Session: Session$2,
|
|
3973
3973
|
Colours,
|
|
3974
3974
|
Apis
|
|
@@ -4326,7 +4326,7 @@
|
|
|
4326
4326
|
if (___default["default"].isNil(answer) || ___default["default"].isEmpty(answer)) return true;
|
|
4327
4327
|
switch (type) {
|
|
4328
4328
|
case "email":
|
|
4329
|
-
return Helper$
|
|
4329
|
+
return Helper$2.isEmail(answer);
|
|
4330
4330
|
case "date":
|
|
4331
4331
|
return moment__default["default"](answer, "YYYY-MM-DD", true).isValid();
|
|
4332
4332
|
case "time":
|
|
@@ -4347,7 +4347,7 @@
|
|
|
4347
4347
|
this.customImageInputs = {};
|
|
4348
4348
|
this.customDocumentInputs = {};
|
|
4349
4349
|
this.state = {
|
|
4350
|
-
jobId: Helper$
|
|
4350
|
+
jobId: Helper$2.safeReadParams(this.props, "jobId") ? this.props.match.params.jobId : null,
|
|
4351
4351
|
job: null,
|
|
4352
4352
|
showingSelector: false,
|
|
4353
4353
|
updating: false,
|
|
@@ -4699,7 +4699,7 @@
|
|
|
4699
4699
|
return /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4700
4700
|
className: "visitorSignIn_text-staticText",
|
|
4701
4701
|
key: fieldId
|
|
4702
|
-
}, Helper$
|
|
4702
|
+
}, Helper$2.toParagraphed(field.label, {
|
|
4703
4703
|
marginTop: 10
|
|
4704
4704
|
}));
|
|
4705
4705
|
case "date":
|
|
@@ -4954,7 +4954,7 @@
|
|
|
4954
4954
|
return {
|
|
4955
4955
|
auth,
|
|
4956
4956
|
strings: state.strings && state.strings.config || {},
|
|
4957
|
-
optionOnlyForResidents: Helper$
|
|
4957
|
+
optionOnlyForResidents: Helper$2.getSiteSettingFromState(state, values.optionOnlyForResidents)
|
|
4958
4958
|
};
|
|
4959
4959
|
};
|
|
4960
4960
|
var AddJob$1 = reactRedux.connect(mapStateToProps$2, {
|
|
@@ -4966,7 +4966,7 @@
|
|
|
4966
4966
|
const {
|
|
4967
4967
|
Components: Components$1,
|
|
4968
4968
|
Session: Session$1,
|
|
4969
|
-
Helper
|
|
4969
|
+
Helper: Helper$1
|
|
4970
4970
|
} = PlussCore__namespace;
|
|
4971
4971
|
const DEFAULT_FIELD = {
|
|
4972
4972
|
type: 'text',
|
|
@@ -5009,7 +5009,7 @@
|
|
|
5009
5009
|
const {
|
|
5010
5010
|
jobTypeEmail
|
|
5011
5011
|
} = this.state;
|
|
5012
|
-
return !___default["default"].isEmpty(jobTypeEmail) && Helper.isEmail(jobTypeEmail);
|
|
5012
|
+
return !___default["default"].isEmpty(jobTypeEmail) && Helper$1.isEmail(jobTypeEmail);
|
|
5013
5013
|
});
|
|
5014
5014
|
_defineProperty__default["default"](this, "isJobTypeValid", () => {
|
|
5015
5015
|
const {
|
|
@@ -5211,7 +5211,7 @@
|
|
|
5211
5211
|
}];
|
|
5212
5212
|
this.state = {
|
|
5213
5213
|
loading: false,
|
|
5214
|
-
jobTypeId: Helper.safeReadParams(this.props, 'jobTypeId') ? this.props.match.params.jobTypeId : null,
|
|
5214
|
+
jobTypeId: Helper$1.safeReadParams(this.props, 'jobTypeId') ? this.props.match.params.jobTypeId : null,
|
|
5215
5215
|
jobTypeName: '',
|
|
5216
5216
|
jobTypeEmail: '',
|
|
5217
5217
|
jobTypeDescription: '',
|
|
@@ -5763,7 +5763,8 @@
|
|
|
5763
5763
|
const {
|
|
5764
5764
|
Analytics: Analytics$1,
|
|
5765
5765
|
Session,
|
|
5766
|
-
Components
|
|
5766
|
+
Components,
|
|
5767
|
+
Helper
|
|
5767
5768
|
} = PlussCore__namespace;
|
|
5768
5769
|
const getInitialState = () => ({
|
|
5769
5770
|
requests: 0,
|
|
@@ -5783,10 +5784,20 @@
|
|
|
5783
5784
|
auth,
|
|
5784
5785
|
prevText,
|
|
5785
5786
|
dayCount,
|
|
5786
|
-
strings
|
|
5787
|
+
strings,
|
|
5788
|
+
userType,
|
|
5789
|
+
userCategory,
|
|
5790
|
+
selectedSites
|
|
5787
5791
|
} = _ref;
|
|
5788
5792
|
const [analyticsData, setAnalyticsData] = React.useState(getInitialState());
|
|
5789
5793
|
const [isExportOpen, setIsExportOpen] = React.useState(false);
|
|
5794
|
+
const [comparisonData, setComparisonData] = React.useState({
|
|
5795
|
+
requests: [],
|
|
5796
|
+
completedRequests: [],
|
|
5797
|
+
comments: [],
|
|
5798
|
+
isLoading: true
|
|
5799
|
+
});
|
|
5800
|
+
const comparisonMode = selectedSites && selectedSites.length > 1;
|
|
5790
5801
|
const hasAccess = Session.validateAccess(auth.site, values.permissionMaintenanceTracking, auth);
|
|
5791
5802
|
if (!hasAccess) {
|
|
5792
5803
|
return null;
|
|
@@ -5798,50 +5809,92 @@
|
|
|
5798
5809
|
return strings.sideNav[key];
|
|
5799
5810
|
})();
|
|
5800
5811
|
const exportColumns = [{
|
|
5801
|
-
label:
|
|
5802
|
-
key:
|
|
5812
|
+
label: "Select All",
|
|
5813
|
+
key: ""
|
|
5803
5814
|
}, {
|
|
5804
|
-
label:
|
|
5805
|
-
key:
|
|
5815
|
+
label: "Start Date",
|
|
5816
|
+
key: "startDate"
|
|
5806
5817
|
}, {
|
|
5807
|
-
label:
|
|
5808
|
-
key:
|
|
5818
|
+
label: "End Date",
|
|
5819
|
+
key: "endDate"
|
|
5809
5820
|
}, {
|
|
5810
5821
|
label: "".concat(values.textSingularName, "s"),
|
|
5811
|
-
key:
|
|
5822
|
+
key: "requests"
|
|
5812
5823
|
}, {
|
|
5813
5824
|
label: "Completed ".concat(values.textSingularName, "s"),
|
|
5814
|
-
key:
|
|
5825
|
+
key: "completedRequests"
|
|
5815
5826
|
}, {
|
|
5816
|
-
label:
|
|
5817
|
-
key:
|
|
5827
|
+
label: "Comments",
|
|
5828
|
+
key: "comments"
|
|
5818
5829
|
}];
|
|
5819
5830
|
React.useEffect(() => {
|
|
5820
5831
|
getData();
|
|
5821
|
-
}, [startTime, endTime]);
|
|
5832
|
+
}, [startTime, endTime, userType, userCategory, selectedSites]);
|
|
5822
5833
|
const getData = async () => {
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5834
|
+
if (comparisonMode) {
|
|
5835
|
+
setComparisonData({
|
|
5836
|
+
requests: [],
|
|
5837
|
+
completedRequests: [],
|
|
5838
|
+
comments: [],
|
|
5839
|
+
isLoading: true
|
|
5840
|
+
});
|
|
5841
|
+
const multiSiteResultsObj = await Analytics$1.fetchMultiSiteData(selectedSites, async site => {
|
|
5842
|
+
const {
|
|
5843
|
+
data
|
|
5844
|
+
} = await analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
|
|
5845
|
+
userType,
|
|
5846
|
+
userCategory
|
|
5847
|
+
});
|
|
5848
|
+
return data;
|
|
5849
|
+
});
|
|
5850
|
+
const multiSiteResults = Object.entries(multiSiteResultsObj).map(_ref2 => {
|
|
5851
|
+
let [site, data] = _ref2;
|
|
5852
|
+
return {
|
|
5853
|
+
site,
|
|
5854
|
+
data
|
|
5855
|
+
};
|
|
5856
|
+
});
|
|
5857
|
+
const roles = auth.user.Roles;
|
|
5858
|
+
const buildComparison = (activityKey, countType) => multiSiteResults.map(result => ({
|
|
5859
|
+
name: Helper.getSiteNameFromRoles(result.site, roles),
|
|
5860
|
+
value: Analytics$1.countActivities(result.data, activityKey, countType)
|
|
5861
|
+
}));
|
|
5862
|
+
setComparisonData({
|
|
5863
|
+
requests: buildComparison("Request", "total"),
|
|
5864
|
+
completedRequests: buildComparison("RequestCompleted", "unique"),
|
|
5865
|
+
comments: buildComparison("Comment", "total"),
|
|
5866
|
+
isLoading: false
|
|
5867
|
+
});
|
|
5868
|
+
} else {
|
|
5869
|
+
setAnalyticsData(getInitialState());
|
|
5870
|
+
const site = selectedSites && selectedSites.length === 1 ? selectedSites[0] : auth.site;
|
|
5871
|
+
const timeDifference = endTime - startTime;
|
|
5872
|
+
const [currentStatsResponse, prevStatsResponse] = await Promise.all([analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
|
|
5873
|
+
userType,
|
|
5874
|
+
userCategory
|
|
5875
|
+
}), analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime - timeDifference, startTime, true, {
|
|
5876
|
+
userType,
|
|
5877
|
+
userCategory
|
|
5878
|
+
})]);
|
|
5879
|
+
const data = {
|
|
5880
|
+
requests: Analytics$1.countActivities(currentStatsResponse.data, "Request", "total"),
|
|
5881
|
+
prevRequests: Analytics$1.countActivities(prevStatsResponse.data, "Request", "total"),
|
|
5882
|
+
completedRequests: Analytics$1.countActivities(currentStatsResponse.data, "RequestCompleted", "unique"),
|
|
5883
|
+
prevCompletedRequests: Analytics$1.countActivities(prevStatsResponse.data, "RequestCompleted", "unique"),
|
|
5884
|
+
comments: Analytics$1.countActivities(currentStatsResponse.data, "Comment", "total"),
|
|
5885
|
+
prevComments: Analytics$1.countActivities(prevStatsResponse.data, "Comment", "total"),
|
|
5886
|
+
isLoading: false
|
|
5887
|
+
};
|
|
5888
|
+
setAnalyticsData(data);
|
|
5889
|
+
}
|
|
5837
5890
|
};
|
|
5838
5891
|
const isReadyToOpenCSV = () => {
|
|
5839
|
-
return !analyticsData.isLoading;
|
|
5892
|
+
return comparisonMode ? !comparisonData.isLoading : !analyticsData.isLoading;
|
|
5840
5893
|
};
|
|
5841
5894
|
const getExportSource = () => {
|
|
5842
5895
|
return [{
|
|
5843
|
-
startDate: moment__default["default"](startTime + 1).format(
|
|
5844
|
-
endDate: moment__default["default"](endTime).format(
|
|
5896
|
+
startDate: moment__default["default"](startTime + 1).format("D-MM-YYYY"),
|
|
5897
|
+
endDate: moment__default["default"](endTime).format("D-MM-YYYY"),
|
|
5845
5898
|
requests: analyticsData.requests,
|
|
5846
5899
|
completedRequests: analyticsData.completedRequests,
|
|
5847
5900
|
comments: analyticsData.comments
|
|
@@ -5877,31 +5930,61 @@
|
|
|
5877
5930
|
leftIcon: "file-code-o"
|
|
5878
5931
|
}, "Export CSV")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
5879
5932
|
className: "analyticsSection dashboardSection_content"
|
|
5880
|
-
},
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5933
|
+
}, (() => {
|
|
5934
|
+
const chartSuffix = [selectedSites && selectedSites.length > 0 ? "&sites=".concat(selectedSites.join(",")) : "", userType ? "&userType=".concat(encodeURIComponent(userType)) : "", userCategory ? "&userCategory=".concat(encodeURIComponent(userCategory)) : ""].join("");
|
|
5935
|
+
if (comparisonMode) {
|
|
5936
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
5937
|
+
style: {
|
|
5938
|
+
display: "flex",
|
|
5939
|
+
flexDirection: "column",
|
|
5940
|
+
gap: 16
|
|
5941
|
+
}
|
|
5942
|
+
}, /*#__PURE__*/React__default["default"].createElement(Components.ComparisonStatBox, {
|
|
5943
|
+
title: "".concat(featureTitle, " Requests"),
|
|
5944
|
+
data: comparisonData.requests,
|
|
5945
|
+
prevText: prevText,
|
|
5946
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
5947
|
+
isLoading: comparisonData.isLoading
|
|
5948
|
+
}), /*#__PURE__*/React__default["default"].createElement(Components.ComparisonStatBox, {
|
|
5949
|
+
title: "Completed ".concat(featureTitle, " Requests"),
|
|
5950
|
+
data: comparisonData.completedRequests,
|
|
5951
|
+
prevText: prevText,
|
|
5952
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
5953
|
+
isLoading: comparisonData.isLoading
|
|
5954
|
+
}), /*#__PURE__*/React__default["default"].createElement(Components.ComparisonStatBox, {
|
|
5955
|
+
title: "".concat(featureTitle, " Comments"),
|
|
5956
|
+
data: comparisonData.comments,
|
|
5957
|
+
prevText: prevText,
|
|
5958
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
5959
|
+
isLoading: comparisonData.isLoading
|
|
5960
|
+
}));
|
|
5961
|
+
}
|
|
5962
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Components.StatBox, {
|
|
5963
|
+
title: "".concat(featureTitle, " Requests"),
|
|
5964
|
+
icon: freeSolidSvgIcons.faWrench,
|
|
5965
|
+
value: analyticsData.requests,
|
|
5966
|
+
previousValue: analyticsData.prevRequests,
|
|
5967
|
+
prevText: prevText,
|
|
5968
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
5969
|
+
isLoading: analyticsData.isLoading
|
|
5970
|
+
}), /*#__PURE__*/React__default["default"].createElement(Components.StatBox, {
|
|
5971
|
+
title: "Completed ".concat(featureTitle, " Requests"),
|
|
5972
|
+
icon: freeSolidSvgIcons.faCircleCheck,
|
|
5973
|
+
value: analyticsData.completedRequests,
|
|
5974
|
+
previousValue: analyticsData.prevCompletedRequests,
|
|
5975
|
+
prevText: prevText,
|
|
5976
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
5977
|
+
isLoading: analyticsData.isLoading
|
|
5978
|
+
}), /*#__PURE__*/React__default["default"].createElement(Components.StatBox, {
|
|
5979
|
+
title: "".concat(featureTitle, " Comments"),
|
|
5980
|
+
icon: freeSolidSvgIcons.faComment,
|
|
5981
|
+
value: analyticsData.comments,
|
|
5982
|
+
previousValue: analyticsData.prevComments,
|
|
5983
|
+
prevText: prevText,
|
|
5984
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
5985
|
+
isLoading: analyticsData.isLoading
|
|
5986
|
+
}));
|
|
5987
|
+
})()));
|
|
5905
5988
|
};
|
|
5906
5989
|
const mapStateToProps = state => {
|
|
5907
5990
|
const {
|
package/package.json
CHANGED