@plusscommunities/pluss-maintenance-web-forms 1.1.36 → 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 +179 -103
- package/dist/index.esm.js +179 -103
- package/dist/index.umd.js +179 -103
- package/package.json +1 -1
- package/src/components/AnalyticsHub.js +308 -154
- package/src/feature.config.js +0 -1
- package/src/values.config.a.js +0 -6
- package/src/values.config.default.js +0 -6
- package/src/values.config.forms.js +0 -6
- package/src/values.config.js +0 -6
package/dist/index.umd.js
CHANGED
|
@@ -101,13 +101,7 @@
|
|
|
101
101
|
hasHelpButton: true,
|
|
102
102
|
helpGuideURL: 'https://www.plusscommunities.com/forms-feature',
|
|
103
103
|
stringConfigJobStatus: 'maintenanceJobStatusForms',
|
|
104
|
-
stringConfigHideSeen: 'maintenanceDisableSeenForms'
|
|
105
|
-
// Comment subscription notification preference
|
|
106
|
-
notificationPreference: {
|
|
107
|
-
key: 'maintenancerequestFormsComments',
|
|
108
|
-
label: 'Forms comments',
|
|
109
|
-
permission: 'maintenanceTrackingForms'
|
|
110
|
-
}
|
|
104
|
+
stringConfigHideSeen: 'maintenanceDisableSeenForms'
|
|
111
105
|
};
|
|
112
106
|
|
|
113
107
|
// import * as PlussCore from '../../pluss-core/src';
|
|
@@ -230,8 +224,7 @@
|
|
|
230
224
|
init: environment => {
|
|
231
225
|
FeatureConfig.env = environment;
|
|
232
226
|
PlussCore__namespace.Config.init(environment);
|
|
233
|
-
}
|
|
234
|
-
notificationPreference: values.notificationPreference
|
|
227
|
+
}
|
|
235
228
|
};
|
|
236
229
|
|
|
237
230
|
const JOBS_LOADED = values.actionJobsLoaded;
|
|
@@ -244,12 +237,12 @@
|
|
|
244
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; }
|
|
245
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; }
|
|
246
239
|
const {
|
|
247
|
-
Helper: Helper$
|
|
240
|
+
Helper: Helper$6,
|
|
248
241
|
Session: Session$9
|
|
249
242
|
} = PlussCore__namespace;
|
|
250
243
|
const maintenanceActions = {
|
|
251
244
|
getJobType: (site, typeId) => {
|
|
252
|
-
let url = Helper$
|
|
245
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getjobtype');
|
|
253
246
|
return Session$9.authedFunction({
|
|
254
247
|
method: 'POST',
|
|
255
248
|
url,
|
|
@@ -260,7 +253,7 @@
|
|
|
260
253
|
});
|
|
261
254
|
},
|
|
262
255
|
getJobTypes: (site, id) => {
|
|
263
|
-
let url = Helper$
|
|
256
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getjobtypes');
|
|
264
257
|
return Session$9.authedFunction({
|
|
265
258
|
method: 'POST',
|
|
266
259
|
url,
|
|
@@ -270,7 +263,7 @@
|
|
|
270
263
|
});
|
|
271
264
|
},
|
|
272
265
|
getJob: (site, id) => {
|
|
273
|
-
let url = Helper$
|
|
266
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getJob');
|
|
274
267
|
return Session$9.authedFunction({
|
|
275
268
|
method: 'POST',
|
|
276
269
|
url,
|
|
@@ -281,7 +274,7 @@
|
|
|
281
274
|
});
|
|
282
275
|
},
|
|
283
276
|
getJobByJobId: (site, jobId) => {
|
|
284
|
-
let url = Helper$
|
|
277
|
+
let url = Helper$6.getUrl(values.serviceKey, 'getJob');
|
|
285
278
|
return Session$9.authedFunction({
|
|
286
279
|
method: 'POST',
|
|
287
280
|
url,
|
|
@@ -296,7 +289,7 @@
|
|
|
296
289
|
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
297
290
|
return Session$9.authedFunction({
|
|
298
291
|
method: 'POST',
|
|
299
|
-
url: Helper$
|
|
292
|
+
url: Helper$6.getUrl(values.serviceKey, 'getJobs'),
|
|
300
293
|
data: {
|
|
301
294
|
site,
|
|
302
295
|
status,
|
|
@@ -319,7 +312,7 @@
|
|
|
319
312
|
}
|
|
320
313
|
return Session$9.authedFunction({
|
|
321
314
|
method: 'GET',
|
|
322
|
-
url: Helper$
|
|
315
|
+
url: Helper$6.getUrl(values.serviceKey, 'get/requests', query)
|
|
323
316
|
});
|
|
324
317
|
},
|
|
325
318
|
getJobsRecursive: function (site, status, type, lastKey) {
|
|
@@ -337,14 +330,14 @@
|
|
|
337
330
|
createJob: job => {
|
|
338
331
|
return Session$9.authedFunction({
|
|
339
332
|
method: 'POST',
|
|
340
|
-
url: Helper$
|
|
333
|
+
url: Helper$6.getUrl(values.serviceKey, 'sendMaintenance'),
|
|
341
334
|
data: _objectSpread$7({}, job)
|
|
342
335
|
});
|
|
343
336
|
},
|
|
344
337
|
editJob: (job, site) => {
|
|
345
338
|
return Session$9.authedFunction({
|
|
346
339
|
method: 'POST',
|
|
347
|
-
url: Helper$
|
|
340
|
+
url: Helper$6.getUrl(values.serviceKey, 'editJob'),
|
|
348
341
|
data: {
|
|
349
342
|
job,
|
|
350
343
|
site
|
|
@@ -354,7 +347,7 @@
|
|
|
354
347
|
deleteJob: (site, id) => {
|
|
355
348
|
return Session$9.authedFunction({
|
|
356
349
|
method: 'POST',
|
|
357
|
-
url: Helper$
|
|
350
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/remove'),
|
|
358
351
|
data: {
|
|
359
352
|
site,
|
|
360
353
|
id
|
|
@@ -364,7 +357,7 @@
|
|
|
364
357
|
editJobStatus: (id, status) => {
|
|
365
358
|
return Session$9.authedFunction({
|
|
366
359
|
method: 'POST',
|
|
367
|
-
url: Helper$
|
|
360
|
+
url: Helper$6.getUrl(values.serviceKey, 'editJobStatus'),
|
|
368
361
|
data: {
|
|
369
362
|
id,
|
|
370
363
|
status
|
|
@@ -374,7 +367,7 @@
|
|
|
374
367
|
editJobPriority: (id, priority) => {
|
|
375
368
|
return Session$9.authedFunction({
|
|
376
369
|
method: 'POST',
|
|
377
|
-
url: Helper$
|
|
370
|
+
url: Helper$6.getUrl(values.serviceKey, 'update/priority'),
|
|
378
371
|
data: {
|
|
379
372
|
id,
|
|
380
373
|
priority
|
|
@@ -384,7 +377,7 @@
|
|
|
384
377
|
assignJob: (jobId, userId) => {
|
|
385
378
|
return Session$9.authedFunction({
|
|
386
379
|
method: 'POST',
|
|
387
|
-
url: Helper$
|
|
380
|
+
url: Helper$6.getUrl(values.serviceKey, 'update/assign'),
|
|
388
381
|
data: {
|
|
389
382
|
id: jobId,
|
|
390
383
|
userId
|
|
@@ -394,7 +387,7 @@
|
|
|
394
387
|
getAssignees: site => {
|
|
395
388
|
return Session$9.authedFunction({
|
|
396
389
|
method: 'GET',
|
|
397
|
-
url: Helper$
|
|
390
|
+
url: Helper$6.getUrl(values.serviceKey, 'get/assignees', {
|
|
398
391
|
site
|
|
399
392
|
})
|
|
400
393
|
});
|
|
@@ -402,7 +395,7 @@
|
|
|
402
395
|
addNote: (jobId, note, attachments, images) => {
|
|
403
396
|
return Session$9.authedFunction({
|
|
404
397
|
method: 'POST',
|
|
405
|
-
url: Helper$
|
|
398
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/note'),
|
|
406
399
|
data: {
|
|
407
400
|
id: jobId,
|
|
408
401
|
note,
|
|
@@ -415,7 +408,7 @@
|
|
|
415
408
|
editNote: (jobId, noteId, note, attachments, images) => {
|
|
416
409
|
return Session$9.authedFunction({
|
|
417
410
|
method: 'POST',
|
|
418
|
-
url: Helper$
|
|
411
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/note'),
|
|
419
412
|
data: {
|
|
420
413
|
id: jobId,
|
|
421
414
|
note,
|
|
@@ -429,7 +422,7 @@
|
|
|
429
422
|
deleteNote: (jobId, noteId) => {
|
|
430
423
|
return Session$9.authedFunction({
|
|
431
424
|
method: 'POST',
|
|
432
|
-
url: Helper$
|
|
425
|
+
url: Helper$6.getUrl(values.serviceKey, 'requests/note'),
|
|
433
426
|
data: {
|
|
434
427
|
id: jobId,
|
|
435
428
|
noteId,
|
|
@@ -449,7 +442,7 @@
|
|
|
449
442
|
};
|
|
450
443
|
return Session$9.authedFunction({
|
|
451
444
|
method: 'POST',
|
|
452
|
-
url: Helper$
|
|
445
|
+
url: Helper$6.getUrl(values.serviceKey, 'createJobType'),
|
|
453
446
|
data
|
|
454
447
|
});
|
|
455
448
|
},
|
|
@@ -467,14 +460,14 @@
|
|
|
467
460
|
if (hasCustomFields && customFields) data.customFields = customFields;
|
|
468
461
|
return Session$9.authedFunction({
|
|
469
462
|
method: 'POST',
|
|
470
|
-
url: Helper$
|
|
463
|
+
url: Helper$6.getUrl(values.serviceKey, 'editJobType'),
|
|
471
464
|
data
|
|
472
465
|
});
|
|
473
466
|
},
|
|
474
467
|
deleteJobType: (site, id) => {
|
|
475
468
|
return Session$9.authedFunction({
|
|
476
469
|
method: 'POST',
|
|
477
|
-
url: Helper$
|
|
470
|
+
url: Helper$6.getUrl(values.serviceKey, 'deleteJobType'),
|
|
478
471
|
data: {
|
|
479
472
|
site,
|
|
480
473
|
id
|
|
@@ -484,7 +477,7 @@
|
|
|
484
477
|
getExternalSync: jobId => {
|
|
485
478
|
return Session$9.authedFunction({
|
|
486
479
|
method: 'GET',
|
|
487
|
-
url: Helper$
|
|
480
|
+
url: Helper$6.getUrl(values.serviceKey, 'get/externalsync', {
|
|
488
481
|
id: jobId
|
|
489
482
|
})
|
|
490
483
|
});
|
|
@@ -492,7 +485,7 @@
|
|
|
492
485
|
retrySync: jobId => {
|
|
493
486
|
return Session$9.authedFunction({
|
|
494
487
|
method: 'POST',
|
|
495
|
-
url: Helper$
|
|
488
|
+
url: Helper$6.getUrl(values.serviceKey, 'update/retrysync'),
|
|
496
489
|
data: {
|
|
497
490
|
id: jobId
|
|
498
491
|
}
|
|
@@ -501,7 +494,7 @@
|
|
|
501
494
|
};
|
|
502
495
|
|
|
503
496
|
const {
|
|
504
|
-
Helper: Helper$
|
|
497
|
+
Helper: Helper$5,
|
|
505
498
|
Session: Session$8
|
|
506
499
|
} = PlussCore__namespace;
|
|
507
500
|
const reactionActions = {
|
|
@@ -519,7 +512,7 @@
|
|
|
519
512
|
}
|
|
520
513
|
return Session$8.authedFunction({
|
|
521
514
|
method: 'POST',
|
|
522
|
-
url: Helper$
|
|
515
|
+
url: Helper$5.getUrl('reactions', 'comments/add'),
|
|
523
516
|
data
|
|
524
517
|
});
|
|
525
518
|
},
|
|
@@ -542,7 +535,7 @@
|
|
|
542
535
|
}
|
|
543
536
|
return Session$8.authedFunction({
|
|
544
537
|
method: 'GET',
|
|
545
|
-
url: Helper$
|
|
538
|
+
url: Helper$5.getUrl('reactions', 'comments/get', query)
|
|
546
539
|
});
|
|
547
540
|
}
|
|
548
541
|
};
|
|
@@ -576,7 +569,7 @@
|
|
|
576
569
|
];
|
|
577
570
|
|
|
578
571
|
const {
|
|
579
|
-
Helper: Helper$
|
|
572
|
+
Helper: Helper$4
|
|
580
573
|
} = PlussCore__namespace;
|
|
581
574
|
const jobsUpdate = (site, isdashboard) => {
|
|
582
575
|
return dispatch => {
|
|
@@ -584,7 +577,7 @@
|
|
|
584
577
|
type: JOBS_LOADING
|
|
585
578
|
});
|
|
586
579
|
maintenanceActions.getJobsRecursive(site).then(res => {
|
|
587
|
-
const currentSite = Helper$
|
|
580
|
+
const currentSite = Helper$4.readStorageWithCookie('site');
|
|
588
581
|
if (!___default["default"].isEmpty(res) && res[0].site === currentSite) {
|
|
589
582
|
dispatch({
|
|
590
583
|
type: JOBS_LOADED,
|
|
@@ -2721,7 +2714,7 @@
|
|
|
2721
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; }
|
|
2722
2715
|
const {
|
|
2723
2716
|
Apis: Apis$1,
|
|
2724
|
-
Helper: Helper$
|
|
2717
|
+
Helper: Helper$3,
|
|
2725
2718
|
Session: Session$3,
|
|
2726
2719
|
Colours: Colours$1,
|
|
2727
2720
|
Components: Components$3
|
|
@@ -3123,7 +3116,7 @@
|
|
|
3123
3116
|
}
|
|
3124
3117
|
});
|
|
3125
3118
|
this.state = {
|
|
3126
|
-
jobId: Helper$
|
|
3119
|
+
jobId: Helper$3.safeReadParams(props, "jobId") ? props.match.params.jobId : null,
|
|
3127
3120
|
job: null,
|
|
3128
3121
|
showingSelector: false,
|
|
3129
3122
|
updating: false,
|
|
@@ -3326,7 +3319,7 @@
|
|
|
3326
3319
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3327
3320
|
className: "imageGrid_image",
|
|
3328
3321
|
style: {
|
|
3329
|
-
backgroundImage: "url('".concat(Helper$
|
|
3322
|
+
backgroundImage: "url('".concat(Helper$3.get1400(image), "')"),
|
|
3330
3323
|
width: size,
|
|
3331
3324
|
height: size
|
|
3332
3325
|
}
|
|
@@ -3541,7 +3534,7 @@
|
|
|
3541
3534
|
}]
|
|
3542
3535
|
})), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
3543
3536
|
className: "maintenanceNote_text"
|
|
3544
|
-
}, 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));
|
|
3545
3538
|
}
|
|
3546
3539
|
renderAssignment() {
|
|
3547
3540
|
const {
|
|
@@ -3975,7 +3968,7 @@
|
|
|
3975
3968
|
const {
|
|
3976
3969
|
Actions,
|
|
3977
3970
|
Components: Components$2,
|
|
3978
|
-
Helper: Helper$
|
|
3971
|
+
Helper: Helper$2,
|
|
3979
3972
|
Session: Session$2,
|
|
3980
3973
|
Colours,
|
|
3981
3974
|
Apis
|
|
@@ -4333,7 +4326,7 @@
|
|
|
4333
4326
|
if (___default["default"].isNil(answer) || ___default["default"].isEmpty(answer)) return true;
|
|
4334
4327
|
switch (type) {
|
|
4335
4328
|
case "email":
|
|
4336
|
-
return Helper$
|
|
4329
|
+
return Helper$2.isEmail(answer);
|
|
4337
4330
|
case "date":
|
|
4338
4331
|
return moment__default["default"](answer, "YYYY-MM-DD", true).isValid();
|
|
4339
4332
|
case "time":
|
|
@@ -4354,7 +4347,7 @@
|
|
|
4354
4347
|
this.customImageInputs = {};
|
|
4355
4348
|
this.customDocumentInputs = {};
|
|
4356
4349
|
this.state = {
|
|
4357
|
-
jobId: Helper$
|
|
4350
|
+
jobId: Helper$2.safeReadParams(this.props, "jobId") ? this.props.match.params.jobId : null,
|
|
4358
4351
|
job: null,
|
|
4359
4352
|
showingSelector: false,
|
|
4360
4353
|
updating: false,
|
|
@@ -4706,7 +4699,7 @@
|
|
|
4706
4699
|
return /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4707
4700
|
className: "visitorSignIn_text-staticText",
|
|
4708
4701
|
key: fieldId
|
|
4709
|
-
}, Helper$
|
|
4702
|
+
}, Helper$2.toParagraphed(field.label, {
|
|
4710
4703
|
marginTop: 10
|
|
4711
4704
|
}));
|
|
4712
4705
|
case "date":
|
|
@@ -4961,7 +4954,7 @@
|
|
|
4961
4954
|
return {
|
|
4962
4955
|
auth,
|
|
4963
4956
|
strings: state.strings && state.strings.config || {},
|
|
4964
|
-
optionOnlyForResidents: Helper$
|
|
4957
|
+
optionOnlyForResidents: Helper$2.getSiteSettingFromState(state, values.optionOnlyForResidents)
|
|
4965
4958
|
};
|
|
4966
4959
|
};
|
|
4967
4960
|
var AddJob$1 = reactRedux.connect(mapStateToProps$2, {
|
|
@@ -4973,7 +4966,7 @@
|
|
|
4973
4966
|
const {
|
|
4974
4967
|
Components: Components$1,
|
|
4975
4968
|
Session: Session$1,
|
|
4976
|
-
Helper
|
|
4969
|
+
Helper: Helper$1
|
|
4977
4970
|
} = PlussCore__namespace;
|
|
4978
4971
|
const DEFAULT_FIELD = {
|
|
4979
4972
|
type: 'text',
|
|
@@ -5016,7 +5009,7 @@
|
|
|
5016
5009
|
const {
|
|
5017
5010
|
jobTypeEmail
|
|
5018
5011
|
} = this.state;
|
|
5019
|
-
return !___default["default"].isEmpty(jobTypeEmail) && Helper.isEmail(jobTypeEmail);
|
|
5012
|
+
return !___default["default"].isEmpty(jobTypeEmail) && Helper$1.isEmail(jobTypeEmail);
|
|
5020
5013
|
});
|
|
5021
5014
|
_defineProperty__default["default"](this, "isJobTypeValid", () => {
|
|
5022
5015
|
const {
|
|
@@ -5218,7 +5211,7 @@
|
|
|
5218
5211
|
}];
|
|
5219
5212
|
this.state = {
|
|
5220
5213
|
loading: false,
|
|
5221
|
-
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,
|
|
5222
5215
|
jobTypeName: '',
|
|
5223
5216
|
jobTypeEmail: '',
|
|
5224
5217
|
jobTypeDescription: '',
|
|
@@ -5770,7 +5763,8 @@
|
|
|
5770
5763
|
const {
|
|
5771
5764
|
Analytics: Analytics$1,
|
|
5772
5765
|
Session,
|
|
5773
|
-
Components
|
|
5766
|
+
Components,
|
|
5767
|
+
Helper
|
|
5774
5768
|
} = PlussCore__namespace;
|
|
5775
5769
|
const getInitialState = () => ({
|
|
5776
5770
|
requests: 0,
|
|
@@ -5790,10 +5784,20 @@
|
|
|
5790
5784
|
auth,
|
|
5791
5785
|
prevText,
|
|
5792
5786
|
dayCount,
|
|
5793
|
-
strings
|
|
5787
|
+
strings,
|
|
5788
|
+
userType,
|
|
5789
|
+
userCategory,
|
|
5790
|
+
selectedSites
|
|
5794
5791
|
} = _ref;
|
|
5795
5792
|
const [analyticsData, setAnalyticsData] = React.useState(getInitialState());
|
|
5796
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;
|
|
5797
5801
|
const hasAccess = Session.validateAccess(auth.site, values.permissionMaintenanceTracking, auth);
|
|
5798
5802
|
if (!hasAccess) {
|
|
5799
5803
|
return null;
|
|
@@ -5805,50 +5809,92 @@
|
|
|
5805
5809
|
return strings.sideNav[key];
|
|
5806
5810
|
})();
|
|
5807
5811
|
const exportColumns = [{
|
|
5808
|
-
label:
|
|
5809
|
-
key:
|
|
5812
|
+
label: "Select All",
|
|
5813
|
+
key: ""
|
|
5810
5814
|
}, {
|
|
5811
|
-
label:
|
|
5812
|
-
key:
|
|
5815
|
+
label: "Start Date",
|
|
5816
|
+
key: "startDate"
|
|
5813
5817
|
}, {
|
|
5814
|
-
label:
|
|
5815
|
-
key:
|
|
5818
|
+
label: "End Date",
|
|
5819
|
+
key: "endDate"
|
|
5816
5820
|
}, {
|
|
5817
5821
|
label: "".concat(values.textSingularName, "s"),
|
|
5818
|
-
key:
|
|
5822
|
+
key: "requests"
|
|
5819
5823
|
}, {
|
|
5820
5824
|
label: "Completed ".concat(values.textSingularName, "s"),
|
|
5821
|
-
key:
|
|
5825
|
+
key: "completedRequests"
|
|
5822
5826
|
}, {
|
|
5823
|
-
label:
|
|
5824
|
-
key:
|
|
5827
|
+
label: "Comments",
|
|
5828
|
+
key: "comments"
|
|
5825
5829
|
}];
|
|
5826
5830
|
React.useEffect(() => {
|
|
5827
5831
|
getData();
|
|
5828
|
-
}, [startTime, endTime]);
|
|
5832
|
+
}, [startTime, endTime, userType, userCategory, selectedSites]);
|
|
5829
5833
|
const getData = async () => {
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
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
|
+
}
|
|
5844
5890
|
};
|
|
5845
5891
|
const isReadyToOpenCSV = () => {
|
|
5846
|
-
return !analyticsData.isLoading;
|
|
5892
|
+
return comparisonMode ? !comparisonData.isLoading : !analyticsData.isLoading;
|
|
5847
5893
|
};
|
|
5848
5894
|
const getExportSource = () => {
|
|
5849
5895
|
return [{
|
|
5850
|
-
startDate: moment__default["default"](startTime + 1).format(
|
|
5851
|
-
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"),
|
|
5852
5898
|
requests: analyticsData.requests,
|
|
5853
5899
|
completedRequests: analyticsData.completedRequests,
|
|
5854
5900
|
comments: analyticsData.comments
|
|
@@ -5884,31 +5930,61 @@
|
|
|
5884
5930
|
leftIcon: "file-code-o"
|
|
5885
5931
|
}, "Export CSV")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
5886
5932
|
className: "analyticsSection dashboardSection_content"
|
|
5887
|
-
},
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
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
|
+
})()));
|
|
5912
5988
|
};
|
|
5913
5989
|
const mapStateToProps = state => {
|
|
5914
5990
|
const {
|
package/package.json
CHANGED