@plusscommunities/pluss-maintenance-web 1.2.5-beta.0 → 1.3.1-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 +308 -160
- package/dist/index.js.map +1 -1
- package/package.json +6 -7
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import _ from 'lodash';
|
|
|
7
7
|
import moment from 'moment';
|
|
8
8
|
import { Icon } from '@plusscommunities/pluss-icons';
|
|
9
9
|
import * as PlussCore from '@plusscommunities/pluss-core-web';
|
|
10
|
-
import { PERMISSION_CATEGORIES, IMPORTANCE_LEVELS, Colours as Colours$
|
|
11
|
-
import { Table,
|
|
10
|
+
import { PERMISSION_CATEGORIES, IMPORTANCE_LEVELS, Colours as Colours$4 } from '@plusscommunities/pluss-core-web';
|
|
11
|
+
import { Table, MenuItem, DropdownButton } from 'react-bootstrap';
|
|
12
12
|
import { Link } from 'react-router-dom';
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import Textarea from 'react-textarea-autosize';
|
|
@@ -43,7 +43,7 @@ var values = {
|
|
|
43
43
|
screenAddJobType: "AddJobType",
|
|
44
44
|
screenJob: "Job",
|
|
45
45
|
screenJobTypes: "JobTypes",
|
|
46
|
-
menuIcon: "
|
|
46
|
+
menuIcon: "maintenance",
|
|
47
47
|
isFontAwesomeIcon: false,
|
|
48
48
|
isSVGIcon: false,
|
|
49
49
|
svgPathGridIcon: "M22.7072 2.33998C20.5868 2.30886 18.2156 3.43862 16.824 4.83022C15.1138 6.54042 15.1486 8.34584 15.7894 10.5065L13.2058 13.0901L7.7566 7.64089C7.75294 7.60976 7.75477 7.5768 7.74927 7.54567L7.48926 6.30605C7.43799 6.06435 7.28968 5.84645 7.08277 5.71279L3.77589 3.56313C3.40601 3.32509 2.91163 3.37636 2.60035 3.68764L1.81116 4.47682C1.50171 4.7881 1.44861 5.28066 1.68848 5.6487L3.80152 8.91713C3.93336 9.12221 4.13843 9.26686 4.3783 9.32179L5.66004 9.61659C5.69483 9.62392 5.72962 9.62209 5.76441 9.62575L11.2155 15.0786L8.03309 18.2647C6.23316 18.0907 4.52112 18.8396 3.417 20.2971C2.0254 22.1373 2.05836 24.7814 3.49756 26.5886C4.41858 27.7459 5.78821 28.4563 7.25123 28.5405C7.34827 28.546 7.44532 28.5479 7.54236 28.5479C8.9065 28.5479 10.2212 28.0059 11.1898 27.0372C12.2866 25.9404 12.8195 24.4445 12.6711 22.9027L14.7311 20.8446C14.8391 21.2035 15.0259 21.5386 15.2987 21.8114L21.5939 28.1102C22.0516 28.5662 22.6522 28.7932 23.2528 28.7932C23.8534 28.7932 24.454 28.5662 24.9099 28.1102L26.2356 26.7827C27.1493 25.869 27.1493 24.3822 26.2356 23.4685L19.9368 17.1697C19.6658 16.8987 19.3307 16.7138 18.9718 16.6039L20.4275 15.1464C22.5881 15.7854 24.3954 15.822 26.1056 14.1118C27.814 12.4035 29.1323 9.21559 28.3834 6.83522C28.3358 6.67958 28.2076 6.55873 28.0483 6.52028C27.889 6.48183 27.7206 6.52944 27.6052 6.64479L24.681 9.56899C24.5638 9.68801 24.3899 9.73561 24.2288 9.68984L23.7161 9.55251C22.5863 9.25038 21.6964 8.36049 21.3943 7.23256L21.257 6.71987C21.213 6.55873 21.2606 6.38478 21.3796 6.2676L24.3093 3.33608C24.4247 3.22072 24.4705 3.05409 24.4338 2.89479C24.3936 2.73549 24.2764 2.60732 24.1189 2.55788C23.6721 2.41506 23.1961 2.34731 22.7072 2.33998ZM22.6669 3.28115C22.7877 3.28298 22.9067 3.28664 23.0239 3.29579L20.7168 5.60292C20.3616 5.95815 20.2242 6.47817 20.3543 6.96157L20.4916 7.47609C20.8798 8.92629 22.0223 10.0689 23.4744 10.4589L23.9871 10.5962C24.4705 10.7262 24.9905 10.5871 25.3439 10.2318L27.6437 7.93202C27.7883 9.80702 26.7318 12.1599 25.4446 13.4472C23.9834 14.9083 22.5021 14.8168 20.4367 14.1686C20.27 14.1173 20.0888 14.1613 19.9661 14.284L11.849 22.401C11.7446 22.5054 11.6952 22.6519 11.7172 22.7984C11.9039 24.1277 11.47 25.4314 10.527 26.3744C9.67737 27.224 8.5055 27.6708 7.30433 27.6049C6.08851 27.5353 4.9972 26.9677 4.22999 26.0045C3.05445 24.5287 3.02698 22.3662 4.16407 20.8648C4.98438 19.7826 6.20936 19.1765 7.52588 19.1765C7.7273 19.1765 7.93238 19.1912 8.13746 19.2186C8.28211 19.2388 8.43043 19.1912 8.53296 19.0868L16.65 10.9716C16.7745 10.8471 16.8203 10.6658 16.7672 10.4973C16.119 8.43373 16.0275 6.95424 17.4887 5.49306C18.7008 4.2809 20.8541 3.27931 22.6669 3.28115ZM3.26319 4.35048L6.57191 6.49831L6.83191 7.73793L5.86695 8.70107L4.58704 8.4081L2.474 5.13967L3.26319 4.35048ZM7.34095 8.55275L12.543 13.7529L11.8801 14.4158L6.67994 9.21559L7.0077 8.88967L7.34095 8.55275ZM18.4811 8.66994C18.3621 8.66994 18.243 8.71572 18.1497 8.80727C17.9666 8.99037 17.9666 9.287 18.1497 9.47011L21.4657 12.7843C21.5573 12.8759 21.6763 12.9216 21.7971 12.9216C21.9161 12.9216 22.037 12.8759 22.1267 12.7843C22.3117 12.6012 22.3117 12.3046 22.1267 12.1215L18.8143 8.80727C18.721 8.71572 18.6019 8.66994 18.4811 8.66994ZM17.1554 12.647C17.0364 12.647 16.9155 12.6928 16.824 12.7843C16.6409 12.9674 16.6409 13.2641 16.824 13.4472L17.4887 14.11C17.5802 14.2016 17.6992 14.2473 17.8201 14.2473C17.9409 14.2473 18.0599 14.2016 18.1515 14.11C18.3346 13.9269 18.3346 13.6303 18.1515 13.4472L17.4887 12.7843C17.3953 12.6928 17.2763 12.647 17.1554 12.647ZM15.4983 14.3041C15.3793 14.3041 15.2603 14.3499 15.1687 14.4433C14.9838 14.6264 14.9838 14.9212 15.1687 15.1043L15.8297 15.7689C15.9213 15.8587 16.0421 15.9063 16.163 15.9063C16.282 15.9063 16.4028 15.8587 16.4944 15.7689C16.6775 15.584 16.6775 15.2892 16.4944 15.1043L15.8297 14.4433C15.7382 14.3499 15.6191 14.3041 15.4983 14.3041ZM13.843 15.9612C13.7222 15.9612 13.6032 16.007 13.5116 16.0985C13.3267 16.2816 13.3267 16.5783 13.5116 16.7632L14.1726 17.4242C14.2642 17.5158 14.385 17.5634 14.504 17.5634C14.6249 17.5634 14.7457 17.5158 14.8373 17.4242C15.0204 17.2429 15.0204 16.9463 14.8373 16.7632L14.1726 16.0985C14.0811 16.007 13.962 15.9612 13.843 15.9612ZM18.4426 17.4444C18.7539 17.4755 19.0487 17.6073 19.2758 17.8344L25.5728 24.1314C26.1221 24.6807 26.1221 25.5706 25.5728 26.1199L24.2452 27.4456C23.6978 27.9949 22.806 27.9949 22.2586 27.4456L15.9597 21.1467C15.6594 20.8465 15.5258 20.4216 15.5734 20.0023L18.1277 17.4462C18.2339 17.4352 18.3383 17.4334 18.4426 17.4444ZM12.1859 17.6201C12.0651 17.6201 11.9461 17.6641 11.8527 17.7556C11.6696 17.9406 11.6696 18.2354 11.8527 18.4203L12.5173 19.0813C12.6071 19.1729 12.7279 19.2186 12.8469 19.2186C12.9678 19.2186 13.0886 19.1729 13.1784 19.0813C13.3633 18.8982 13.3633 18.6034 13.1784 18.4203L12.5173 17.7556C12.424 17.6641 12.3049 17.6201 12.1859 17.6201ZM10.527 19.2772C10.408 19.2772 10.2889 19.323 10.1956 19.4146C10.0125 19.5977 10.0125 19.8925 10.1956 20.0756L10.8584 20.7403C10.95 20.83 11.069 20.8757 11.1898 20.8757C11.3107 20.8757 11.4297 20.83 11.5212 20.7403C11.7044 20.5553 11.7044 20.2605 11.5212 20.0756L10.8584 19.4146C10.7669 19.323 10.646 19.2772 10.527 19.2772ZM19.2758 19.3523C19.1549 19.3523 19.0359 19.3981 18.9425 19.4896C18.7594 19.6746 18.7594 19.9694 18.9425 20.1543L23.5842 24.7942C23.6758 24.8858 23.7948 24.9315 23.9157 24.9315C24.0365 24.9315 24.1555 24.8858 24.2471 24.7942C24.4302 24.6111 24.4302 24.3145 24.2471 24.1314L19.6072 19.4896C19.5138 19.3981 19.3948 19.3523 19.2758 19.3523ZM17.9501 20.678C17.8292 20.678 17.7102 20.7238 17.6168 20.8153C17.4337 21.0003 17.4337 21.2951 17.6168 21.48L22.2586 26.1199C22.3483 26.2114 22.4691 26.2572 22.5881 26.2572C22.709 26.2572 22.8298 26.2114 22.9196 26.1199C23.1045 25.9368 23.1045 25.6402 22.9196 25.457L18.2815 20.8153C18.1881 20.7238 18.0691 20.678 17.9501 20.678ZM8.11182 20.8373C8.07154 20.8373 8.03126 20.8428 7.99097 20.8538L5.89808 21.4141C5.73694 21.458 5.6106 21.5844 5.56666 21.7455L5.00818 23.8366C4.96424 23.9977 5.01002 24.1698 5.1272 24.2888L6.65796 25.8196C6.74769 25.9093 6.86671 25.9569 6.98939 25.9569C7.0315 25.9569 7.07178 25.9514 7.11207 25.9423L9.20313 25.3801C9.36426 25.338 9.49061 25.2117 9.53455 25.0487L10.0949 22.9595C10.1388 22.7965 10.0912 22.6244 9.974 22.5054L8.44324 20.9746C8.35352 20.8867 8.2345 20.8391 8.11182 20.8373ZM7.97083 21.8279L9.1189 22.976L8.69959 24.5452L7.13038 24.9663L5.98231 23.8183L6.40162 22.249L7.97083 21.8279Z",
|
|
@@ -82,7 +82,13 @@ var values = {
|
|
|
82
82
|
hasHelpButton: true,
|
|
83
83
|
helpGuideURL: "",
|
|
84
84
|
stringConfigJobStatus: "maintenanceJobStatus",
|
|
85
|
-
stringConfigHideSeen: "maintenanceDisableSeen"
|
|
85
|
+
stringConfigHideSeen: "maintenanceDisableSeen",
|
|
86
|
+
// Comment subscription notification preference
|
|
87
|
+
notificationPreference: {
|
|
88
|
+
key: "maintenancerequestComments",
|
|
89
|
+
label: "Maintenance comments",
|
|
90
|
+
permission: "maintenanceTracking"
|
|
91
|
+
}
|
|
86
92
|
};
|
|
87
93
|
|
|
88
94
|
// import * as PlussCore from '../../pluss-core/src';
|
|
@@ -220,7 +226,8 @@ var FeatureConfig = {
|
|
|
220
226
|
init: environment => {
|
|
221
227
|
FeatureConfig.env = environment;
|
|
222
228
|
PlussCore.Config.init(environment);
|
|
223
|
-
}
|
|
229
|
+
},
|
|
230
|
+
notificationPreference: values.notificationPreference
|
|
224
231
|
};
|
|
225
232
|
|
|
226
233
|
var JOBS_LOADED = values.actionJobsLoaded;
|
|
@@ -230,15 +237,15 @@ var JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
|
|
|
230
237
|
var JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
|
|
231
238
|
var JOBS_HIDE_SEEN = values.actionJobsHideSeen;
|
|
232
239
|
|
|
233
|
-
function ownKeys$
|
|
234
|
-
function _objectSpread$
|
|
240
|
+
function ownKeys$8(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; }
|
|
241
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
235
242
|
var {
|
|
236
|
-
Helper: Helper$
|
|
243
|
+
Helper: Helper$6,
|
|
237
244
|
Session: Session$9
|
|
238
245
|
} = PlussCore;
|
|
239
246
|
var maintenanceActions = {
|
|
240
247
|
getJobType: (site, typeId) => {
|
|
241
|
-
var url = Helper$
|
|
248
|
+
var url = Helper$6.getUrl(values.serviceKey, "getjobtype");
|
|
242
249
|
return Session$9.authedFunction({
|
|
243
250
|
method: "POST",
|
|
244
251
|
url,
|
|
@@ -249,7 +256,7 @@ var maintenanceActions = {
|
|
|
249
256
|
});
|
|
250
257
|
},
|
|
251
258
|
getJobTypes: (site, id) => {
|
|
252
|
-
var url = Helper$
|
|
259
|
+
var url = Helper$6.getUrl(values.serviceKey, "getjobtypes");
|
|
253
260
|
return Session$9.authedFunction({
|
|
254
261
|
method: "POST",
|
|
255
262
|
url,
|
|
@@ -259,7 +266,7 @@ var maintenanceActions = {
|
|
|
259
266
|
});
|
|
260
267
|
},
|
|
261
268
|
getJob: (site, id) => {
|
|
262
|
-
var url = Helper$
|
|
269
|
+
var url = Helper$6.getUrl(values.serviceKey, "getJob");
|
|
263
270
|
return Session$9.authedFunction({
|
|
264
271
|
method: "POST",
|
|
265
272
|
url,
|
|
@@ -270,7 +277,7 @@ var maintenanceActions = {
|
|
|
270
277
|
});
|
|
271
278
|
},
|
|
272
279
|
getJobByJobId: (site, jobId) => {
|
|
273
|
-
var url = Helper$
|
|
280
|
+
var url = Helper$6.getUrl(values.serviceKey, "getJob");
|
|
274
281
|
return Session$9.authedFunction({
|
|
275
282
|
method: "POST",
|
|
276
283
|
url,
|
|
@@ -285,7 +292,7 @@ var maintenanceActions = {
|
|
|
285
292
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
286
293
|
return Session$9.authedFunction({
|
|
287
294
|
method: "POST",
|
|
288
|
-
url: Helper$
|
|
295
|
+
url: Helper$6.getUrl(values.serviceKey, "getJobs"),
|
|
289
296
|
data: {
|
|
290
297
|
site,
|
|
291
298
|
status,
|
|
@@ -308,7 +315,7 @@ var maintenanceActions = {
|
|
|
308
315
|
}
|
|
309
316
|
return Session$9.authedFunction({
|
|
310
317
|
method: "GET",
|
|
311
|
-
url: Helper$
|
|
318
|
+
url: Helper$6.getUrl(values.serviceKey, "get/requests", query)
|
|
312
319
|
});
|
|
313
320
|
},
|
|
314
321
|
getJobsRecursive: function getJobsRecursive(site, status, type, lastKey) {
|
|
@@ -326,14 +333,14 @@ var maintenanceActions = {
|
|
|
326
333
|
createJob: job => {
|
|
327
334
|
return Session$9.authedFunction({
|
|
328
335
|
method: "POST",
|
|
329
|
-
url: Helper$
|
|
330
|
-
data: _objectSpread$
|
|
336
|
+
url: Helper$6.getUrl(values.serviceKey, "sendMaintenance"),
|
|
337
|
+
data: _objectSpread$8({}, job)
|
|
331
338
|
});
|
|
332
339
|
},
|
|
333
340
|
editJob: (job, site) => {
|
|
334
341
|
return Session$9.authedFunction({
|
|
335
342
|
method: "POST",
|
|
336
|
-
url: Helper$
|
|
343
|
+
url: Helper$6.getUrl(values.serviceKey, "editJob"),
|
|
337
344
|
data: {
|
|
338
345
|
job,
|
|
339
346
|
site
|
|
@@ -343,7 +350,7 @@ var maintenanceActions = {
|
|
|
343
350
|
deleteJob: (site, id) => {
|
|
344
351
|
return Session$9.authedFunction({
|
|
345
352
|
method: "POST",
|
|
346
|
-
url: Helper$
|
|
353
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/remove"),
|
|
347
354
|
data: {
|
|
348
355
|
site,
|
|
349
356
|
id
|
|
@@ -353,7 +360,7 @@ var maintenanceActions = {
|
|
|
353
360
|
editJobStatus: (id, status) => {
|
|
354
361
|
return Session$9.authedFunction({
|
|
355
362
|
method: "POST",
|
|
356
|
-
url: Helper$
|
|
363
|
+
url: Helper$6.getUrl(values.serviceKey, "editJobStatus"),
|
|
357
364
|
data: {
|
|
358
365
|
id,
|
|
359
366
|
status
|
|
@@ -363,7 +370,7 @@ var maintenanceActions = {
|
|
|
363
370
|
editJobPriority: (id, priority) => {
|
|
364
371
|
return Session$9.authedFunction({
|
|
365
372
|
method: "POST",
|
|
366
|
-
url: Helper$
|
|
373
|
+
url: Helper$6.getUrl(values.serviceKey, "update/priority"),
|
|
367
374
|
data: {
|
|
368
375
|
id,
|
|
369
376
|
priority
|
|
@@ -373,7 +380,7 @@ var maintenanceActions = {
|
|
|
373
380
|
assignJob: (jobId, userId) => {
|
|
374
381
|
return Session$9.authedFunction({
|
|
375
382
|
method: "POST",
|
|
376
|
-
url: Helper$
|
|
383
|
+
url: Helper$6.getUrl(values.serviceKey, "update/assign"),
|
|
377
384
|
data: {
|
|
378
385
|
id: jobId,
|
|
379
386
|
userId
|
|
@@ -383,7 +390,7 @@ var maintenanceActions = {
|
|
|
383
390
|
getAssignees: site => {
|
|
384
391
|
return Session$9.authedFunction({
|
|
385
392
|
method: "GET",
|
|
386
|
-
url: Helper$
|
|
393
|
+
url: Helper$6.getUrl(values.serviceKey, "get/assignees", {
|
|
387
394
|
site
|
|
388
395
|
})
|
|
389
396
|
});
|
|
@@ -391,7 +398,7 @@ var maintenanceActions = {
|
|
|
391
398
|
addNote: (jobId, note, attachments, images) => {
|
|
392
399
|
return Session$9.authedFunction({
|
|
393
400
|
method: "POST",
|
|
394
|
-
url: Helper$
|
|
401
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/note"),
|
|
395
402
|
data: {
|
|
396
403
|
id: jobId,
|
|
397
404
|
note,
|
|
@@ -404,7 +411,7 @@ var maintenanceActions = {
|
|
|
404
411
|
editNote: (jobId, noteId, note, attachments, images) => {
|
|
405
412
|
return Session$9.authedFunction({
|
|
406
413
|
method: "POST",
|
|
407
|
-
url: Helper$
|
|
414
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/note"),
|
|
408
415
|
data: {
|
|
409
416
|
id: jobId,
|
|
410
417
|
note,
|
|
@@ -418,7 +425,7 @@ var maintenanceActions = {
|
|
|
418
425
|
deleteNote: (jobId, noteId) => {
|
|
419
426
|
return Session$9.authedFunction({
|
|
420
427
|
method: "POST",
|
|
421
|
-
url: Helper$
|
|
428
|
+
url: Helper$6.getUrl(values.serviceKey, "requests/note"),
|
|
422
429
|
data: {
|
|
423
430
|
id: jobId,
|
|
424
431
|
noteId,
|
|
@@ -438,7 +445,7 @@ var maintenanceActions = {
|
|
|
438
445
|
};
|
|
439
446
|
return Session$9.authedFunction({
|
|
440
447
|
method: "POST",
|
|
441
|
-
url: Helper$
|
|
448
|
+
url: Helper$6.getUrl(values.serviceKey, "createJobType"),
|
|
442
449
|
data
|
|
443
450
|
});
|
|
444
451
|
},
|
|
@@ -456,14 +463,14 @@ var maintenanceActions = {
|
|
|
456
463
|
if (hasCustomFields && customFields) data.customFields = customFields;
|
|
457
464
|
return Session$9.authedFunction({
|
|
458
465
|
method: "POST",
|
|
459
|
-
url: Helper$
|
|
466
|
+
url: Helper$6.getUrl(values.serviceKey, "editJobType"),
|
|
460
467
|
data
|
|
461
468
|
});
|
|
462
469
|
},
|
|
463
470
|
deleteJobType: (site, id) => {
|
|
464
471
|
return Session$9.authedFunction({
|
|
465
472
|
method: "POST",
|
|
466
|
-
url: Helper$
|
|
473
|
+
url: Helper$6.getUrl(values.serviceKey, "deleteJobType"),
|
|
467
474
|
data: {
|
|
468
475
|
site,
|
|
469
476
|
id
|
|
@@ -473,7 +480,7 @@ var maintenanceActions = {
|
|
|
473
480
|
getExternalSync: jobId => {
|
|
474
481
|
return Session$9.authedFunction({
|
|
475
482
|
method: "GET",
|
|
476
|
-
url: Helper$
|
|
483
|
+
url: Helper$6.getUrl(values.serviceKey, "get/externalsync", {
|
|
477
484
|
id: jobId
|
|
478
485
|
})
|
|
479
486
|
});
|
|
@@ -481,7 +488,7 @@ var maintenanceActions = {
|
|
|
481
488
|
retrySync: jobId => {
|
|
482
489
|
return Session$9.authedFunction({
|
|
483
490
|
method: "POST",
|
|
484
|
-
url: Helper$
|
|
491
|
+
url: Helper$6.getUrl(values.serviceKey, "update/retrysync"),
|
|
485
492
|
data: {
|
|
486
493
|
id: jobId
|
|
487
494
|
}
|
|
@@ -490,7 +497,7 @@ var maintenanceActions = {
|
|
|
490
497
|
};
|
|
491
498
|
|
|
492
499
|
var {
|
|
493
|
-
Helper: Helper$
|
|
500
|
+
Helper: Helper$5,
|
|
494
501
|
Session: Session$8
|
|
495
502
|
} = PlussCore;
|
|
496
503
|
var reactionActions = {
|
|
@@ -508,7 +515,7 @@ var reactionActions = {
|
|
|
508
515
|
}
|
|
509
516
|
return Session$8.authedFunction({
|
|
510
517
|
method: "POST",
|
|
511
|
-
url: Helper$
|
|
518
|
+
url: Helper$5.getUrl("reactions", "comments/add"),
|
|
512
519
|
data
|
|
513
520
|
});
|
|
514
521
|
},
|
|
@@ -531,7 +538,7 @@ var reactionActions = {
|
|
|
531
538
|
}
|
|
532
539
|
return Session$8.authedFunction({
|
|
533
540
|
method: "GET",
|
|
534
|
-
url: Helper$
|
|
541
|
+
url: Helper$5.getUrl("reactions", "comments/get", query)
|
|
535
542
|
});
|
|
536
543
|
}
|
|
537
544
|
};
|
|
@@ -565,7 +572,7 @@ var jobStatusOptions = [
|
|
|
565
572
|
];
|
|
566
573
|
|
|
567
574
|
var {
|
|
568
|
-
Helper: Helper$
|
|
575
|
+
Helper: Helper$4
|
|
569
576
|
} = PlussCore;
|
|
570
577
|
var jobsUpdate = (site, isdashboard) => {
|
|
571
578
|
return dispatch => {
|
|
@@ -573,7 +580,7 @@ var jobsUpdate = (site, isdashboard) => {
|
|
|
573
580
|
type: JOBS_LOADING
|
|
574
581
|
});
|
|
575
582
|
maintenanceActions.getJobsRecursive(site).then(res => {
|
|
576
|
-
var currentSite = Helper$
|
|
583
|
+
var currentSite = Helper$4.readStorageWithCookie("site");
|
|
577
584
|
if (!_.isEmpty(res) && res[0].site === currentSite) {
|
|
578
585
|
dispatch({
|
|
579
586
|
type: JOBS_LOADED,
|
|
@@ -725,8 +732,8 @@ var getJobPriority = priority => {
|
|
|
725
732
|
return priorityOption || getDefaultPriority();
|
|
726
733
|
};
|
|
727
734
|
|
|
728
|
-
function ownKeys$
|
|
729
|
-
function _objectSpread$
|
|
735
|
+
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; }
|
|
736
|
+
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(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; }
|
|
730
737
|
var {
|
|
731
738
|
Session: Session$7,
|
|
732
739
|
Components: Components$7,
|
|
@@ -1099,7 +1106,7 @@ class JobList extends Component {
|
|
|
1099
1106
|
});
|
|
1100
1107
|
var customFieldValues = this.getCustomFields(r, customColumns);
|
|
1101
1108
|
var priority = r.priority || defaultPriority;
|
|
1102
|
-
return _objectSpread$
|
|
1109
|
+
return _objectSpread$7(_objectSpread$7(_objectSpread$7({}, r), customFieldValues), {}, {
|
|
1103
1110
|
notes,
|
|
1104
1111
|
progressTime,
|
|
1105
1112
|
completedTime,
|
|
@@ -1275,7 +1282,7 @@ class JobList extends Component {
|
|
|
1275
1282
|
isActive: this.isValidTimeFilter()
|
|
1276
1283
|
}],
|
|
1277
1284
|
children: /*#__PURE__*/jsx("div", {
|
|
1278
|
-
|
|
1285
|
+
iconStyle: {
|
|
1279
1286
|
minHeight: 150
|
|
1280
1287
|
},
|
|
1281
1288
|
children: /*#__PURE__*/jsx(Components$7.AnalyticsFilter, {
|
|
@@ -1298,7 +1305,7 @@ class JobList extends Component {
|
|
|
1298
1305
|
onClick: () => {
|
|
1299
1306
|
this.onSelectAssignee();
|
|
1300
1307
|
},
|
|
1301
|
-
colour: Colours$
|
|
1308
|
+
colour: Colours$4.COLOUR_DUSK
|
|
1302
1309
|
})
|
|
1303
1310
|
}, this.state.selectedAssignee.id)
|
|
1304
1311
|
});
|
|
@@ -1353,7 +1360,7 @@ class JobList extends Component {
|
|
|
1353
1360
|
onClick: () => {
|
|
1354
1361
|
this.onSelectRequester();
|
|
1355
1362
|
},
|
|
1356
|
-
colour: Colours$
|
|
1363
|
+
colour: Colours$4.COLOUR_DUSK
|
|
1357
1364
|
})
|
|
1358
1365
|
}, this.state.selectedRequester.id)
|
|
1359
1366
|
});
|
|
@@ -1469,7 +1476,7 @@ class JobList extends Component {
|
|
|
1469
1476
|
}), /*#__PURE__*/jsx("td", {
|
|
1470
1477
|
className: "table-options",
|
|
1471
1478
|
children: /*#__PURE__*/jsxs("div", {
|
|
1472
|
-
|
|
1479
|
+
iconStyle: {
|
|
1473
1480
|
display: "flex",
|
|
1474
1481
|
alignItems: "center"
|
|
1475
1482
|
},
|
|
@@ -1636,17 +1643,17 @@ class JobList extends Component {
|
|
|
1636
1643
|
},
|
|
1637
1644
|
children: ["Assigned To", this.renderSort("assigned")]
|
|
1638
1645
|
}), /*#__PURE__*/jsx("th", {
|
|
1639
|
-
|
|
1646
|
+
iconStyle: {
|
|
1640
1647
|
width: 120
|
|
1641
1648
|
},
|
|
1642
1649
|
children: "Status"
|
|
1643
1650
|
}), /*#__PURE__*/jsx("th", {
|
|
1644
|
-
|
|
1651
|
+
iconStyle: {
|
|
1645
1652
|
width: 120
|
|
1646
1653
|
},
|
|
1647
1654
|
children: "Priority"
|
|
1648
1655
|
}), /*#__PURE__*/jsx("th", {
|
|
1649
|
-
|
|
1656
|
+
iconStyle: {
|
|
1650
1657
|
width: 50
|
|
1651
1658
|
}
|
|
1652
1659
|
})]
|
|
@@ -1831,7 +1838,7 @@ class JobList extends Component {
|
|
|
1831
1838
|
}
|
|
1832
1839
|
render() {
|
|
1833
1840
|
return /*#__PURE__*/jsxs("div", {
|
|
1834
|
-
|
|
1841
|
+
iconStyle: {
|
|
1835
1842
|
minWidth: "100%"
|
|
1836
1843
|
},
|
|
1837
1844
|
children: [this.renderFilterPopup(), this.renderCSVPopup(), this.renderFilters(), this.renderContent()]
|
|
@@ -1956,7 +1963,7 @@ class JobTypes extends Component {
|
|
|
1956
1963
|
}), /*#__PURE__*/jsx("td", {
|
|
1957
1964
|
className: "table-options",
|
|
1958
1965
|
children: /*#__PURE__*/jsxs("div", {
|
|
1959
|
-
|
|
1966
|
+
iconStyle: {
|
|
1960
1967
|
display: "flex",
|
|
1961
1968
|
alignItems: "center"
|
|
1962
1969
|
},
|
|
@@ -2021,7 +2028,7 @@ class JobTypes extends Component {
|
|
|
2021
2028
|
onClick: () => this.sortByCol("email"),
|
|
2022
2029
|
children: "Email"
|
|
2023
2030
|
}), /*#__PURE__*/jsx("th", {
|
|
2024
|
-
|
|
2031
|
+
iconStyle: {
|
|
2025
2032
|
width: 70
|
|
2026
2033
|
}
|
|
2027
2034
|
})]
|
|
@@ -2074,7 +2081,7 @@ class JobTypes extends Component {
|
|
|
2074
2081
|
} = this.state;
|
|
2075
2082
|
if (jobList.length === 0 && loading) {
|
|
2076
2083
|
return /*#__PURE__*/jsx("div", {
|
|
2077
|
-
|
|
2084
|
+
iconStyle: {
|
|
2078
2085
|
minWidth: "100%"
|
|
2079
2086
|
},
|
|
2080
2087
|
children: /*#__PURE__*/jsx("div", {
|
|
@@ -2083,7 +2090,7 @@ class JobTypes extends Component {
|
|
|
2083
2090
|
textAlign: "center"
|
|
2084
2091
|
},
|
|
2085
2092
|
children: /*#__PURE__*/jsx(Icon, {
|
|
2086
|
-
|
|
2093
|
+
iconStyle: {
|
|
2087
2094
|
fontSize: 30,
|
|
2088
2095
|
color: FeatureConfig.env.colourBrandingOff
|
|
2089
2096
|
},
|
|
@@ -2095,7 +2102,7 @@ class JobTypes extends Component {
|
|
|
2095
2102
|
});
|
|
2096
2103
|
}
|
|
2097
2104
|
return /*#__PURE__*/jsxs("div", {
|
|
2098
|
-
|
|
2105
|
+
iconStyle: {
|
|
2099
2106
|
minWidth: "100%"
|
|
2100
2107
|
},
|
|
2101
2108
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -2109,7 +2116,7 @@ class JobTypes extends Component {
|
|
|
2109
2116
|
}
|
|
2110
2117
|
render() {
|
|
2111
2118
|
return /*#__PURE__*/jsxs("div", {
|
|
2112
|
-
|
|
2119
|
+
iconStyle: {
|
|
2113
2120
|
minWidth: "100%"
|
|
2114
2121
|
},
|
|
2115
2122
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -2134,12 +2141,12 @@ var JobTypes$1 = connect(mapStateToProps$6, {
|
|
|
2134
2141
|
jobTypesUpdate
|
|
2135
2142
|
})(withRouter(JobTypes));
|
|
2136
2143
|
|
|
2137
|
-
function ownKeys$
|
|
2138
|
-
function _objectSpread$
|
|
2144
|
+
function ownKeys$6(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; }
|
|
2145
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2139
2146
|
var {
|
|
2140
2147
|
Session: Session$5,
|
|
2141
2148
|
Components: Components$5,
|
|
2142
|
-
Colours: Colours$
|
|
2149
|
+
Colours: Colours$3
|
|
2143
2150
|
} = PlussCore;
|
|
2144
2151
|
class Configuration extends Component {
|
|
2145
2152
|
constructor(props) {
|
|
@@ -2342,7 +2349,7 @@ class Configuration extends Component {
|
|
|
2342
2349
|
style: styles$6.statusTypeContainer,
|
|
2343
2350
|
children: [/*#__PURE__*/jsx("div", {
|
|
2344
2351
|
className: "statusLabel",
|
|
2345
|
-
style: _objectSpread$
|
|
2352
|
+
style: _objectSpread$6(_objectSpread$6({}, styles$6.statusTextContainer), {}, {
|
|
2346
2353
|
backgroundColor: status.color
|
|
2347
2354
|
}),
|
|
2348
2355
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -2356,23 +2363,23 @@ class Configuration extends Component {
|
|
|
2356
2363
|
children: status.category
|
|
2357
2364
|
})
|
|
2358
2365
|
}), /*#__PURE__*/jsx(Icon, {
|
|
2359
|
-
style: _objectSpread$
|
|
2366
|
+
style: _objectSpread$6(_objectSpread$6({}, styles$6.statusIcon), {}, {
|
|
2360
2367
|
visibility: index === 0 ? "hidden" : "visible"
|
|
2361
2368
|
}),
|
|
2362
2369
|
name: "arrow-up",
|
|
2363
2370
|
onClick: () => this.onMoveStatus(index, true)
|
|
2364
2371
|
}), /*#__PURE__*/jsx(Icon, {
|
|
2365
|
-
style: _objectSpread$
|
|
2372
|
+
style: _objectSpread$6(_objectSpread$6({}, styles$6.statusIcon), {}, {
|
|
2366
2373
|
visibility: index === statusTypes.length - 1 ? "hidden" : "visible"
|
|
2367
2374
|
}),
|
|
2368
2375
|
name: "arrow-down",
|
|
2369
2376
|
onClick: () => this.onMoveStatus(index, false)
|
|
2370
2377
|
}), /*#__PURE__*/jsx(Icon, {
|
|
2371
|
-
style: _objectSpread$
|
|
2378
|
+
style: _objectSpread$6({}, styles$6.statusIcon),
|
|
2372
2379
|
icon: "pencil",
|
|
2373
2380
|
onClick: () => this.onEditStatus(index)
|
|
2374
2381
|
}), /*#__PURE__*/jsx(Icon, {
|
|
2375
|
-
style: _objectSpread$
|
|
2382
|
+
style: _objectSpread$6({}, styles$6.statusIcon),
|
|
2376
2383
|
icon: "circle-minus",
|
|
2377
2384
|
onClick: () => this.onDeleteStatus(index)
|
|
2378
2385
|
})]
|
|
@@ -2429,8 +2436,8 @@ class Configuration extends Component {
|
|
|
2429
2436
|
renderSuccess() {
|
|
2430
2437
|
if (!this.state.success) return null;
|
|
2431
2438
|
return /*#__PURE__*/jsx("span", {
|
|
2432
|
-
|
|
2433
|
-
color: Colours$
|
|
2439
|
+
iconStyle: _objectSpread$6(_objectSpread$6({}, styles$6.savedText), {}, {
|
|
2440
|
+
color: Colours$3.COLOUR_GREEN
|
|
2434
2441
|
}),
|
|
2435
2442
|
children: "Saved"
|
|
2436
2443
|
});
|
|
@@ -2542,11 +2549,11 @@ class Configuration extends Component {
|
|
|
2542
2549
|
}
|
|
2543
2550
|
render() {
|
|
2544
2551
|
return /*#__PURE__*/jsxs("div", {
|
|
2545
|
-
|
|
2552
|
+
iconStyle: {
|
|
2546
2553
|
minWidth: "100%"
|
|
2547
2554
|
},
|
|
2548
2555
|
children: [this.renderStatuses(), this.renderOtherOptions(), /*#__PURE__*/jsxs("div", {
|
|
2549
|
-
|
|
2556
|
+
iconStyle: {
|
|
2550
2557
|
paddingTop: 24,
|
|
2551
2558
|
paddingBottom: 24
|
|
2552
2559
|
},
|
|
@@ -2580,7 +2587,7 @@ var styles$6 = {
|
|
|
2580
2587
|
fontSize: 20,
|
|
2581
2588
|
padding: 5,
|
|
2582
2589
|
marginLeft: 10,
|
|
2583
|
-
color: Colours$
|
|
2590
|
+
color: Colours$3.COLOUR_BRANDING_ACTION,
|
|
2584
2591
|
visibility: "visible"
|
|
2585
2592
|
},
|
|
2586
2593
|
savedText: {
|
|
@@ -2761,7 +2768,7 @@ class RequestsHub extends Component {
|
|
|
2761
2768
|
sectionItems.push({
|
|
2762
2769
|
type: "navItem",
|
|
2763
2770
|
text: "Feature Configuration",
|
|
2764
|
-
icon: "
|
|
2771
|
+
icon: "settings",
|
|
2765
2772
|
isFontAwesome: false,
|
|
2766
2773
|
selected: this.state.selectedSection === "config",
|
|
2767
2774
|
onClick: () => {
|
|
@@ -2845,13 +2852,13 @@ var RequestsHub$1 = connect(mapStateToProps$4, {
|
|
|
2845
2852
|
jobsLoaded
|
|
2846
2853
|
})(withRouter(RequestsHub));
|
|
2847
2854
|
|
|
2848
|
-
function ownKeys$
|
|
2849
|
-
function _objectSpread$
|
|
2855
|
+
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; }
|
|
2856
|
+
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; }
|
|
2850
2857
|
var {
|
|
2851
2858
|
Apis: Apis$1,
|
|
2852
|
-
Helper: Helper$
|
|
2859
|
+
Helper: Helper$3,
|
|
2853
2860
|
Session: Session$3,
|
|
2854
|
-
Colours: Colours$
|
|
2861
|
+
Colours: Colours$2,
|
|
2855
2862
|
Components: Components$3
|
|
2856
2863
|
} = PlussCore;
|
|
2857
2864
|
var IMAGE_SIZE_NOTE = 72;
|
|
@@ -2935,7 +2942,7 @@ class Job extends Component {
|
|
|
2935
2942
|
var statusType = statusTypes.find(s => s.text === status);
|
|
2936
2943
|
if (!statusType) {
|
|
2937
2944
|
var defaultStatus = statusTypes.find(s => s.category === STATUS_NOT_ACTIONED);
|
|
2938
|
-
statusType = _objectSpread$
|
|
2945
|
+
statusType = _objectSpread$5(_objectSpread$5({}, defaultStatus), {}, {
|
|
2939
2946
|
text: status
|
|
2940
2947
|
});
|
|
2941
2948
|
}
|
|
@@ -3130,7 +3137,7 @@ class Job extends Component {
|
|
|
3130
3137
|
}
|
|
3131
3138
|
maintenanceActions.deleteNote(this.state.jobId, n.Id);
|
|
3132
3139
|
var newNotes = _.filter(this.state.job.Notes, note => note.Id !== n.Id);
|
|
3133
|
-
var newJob = _objectSpread$
|
|
3140
|
+
var newJob = _objectSpread$5({}, this.state.job);
|
|
3134
3141
|
newJob.Notes = newNotes;
|
|
3135
3142
|
this.setState({
|
|
3136
3143
|
job: newJob,
|
|
@@ -3215,7 +3222,7 @@ class Job extends Component {
|
|
|
3215
3222
|
_defineProperty(this, "onSelectPriority", /*#__PURE__*/function () {
|
|
3216
3223
|
var _ref0 = _asyncToGenerator(function* (priority) {
|
|
3217
3224
|
_this.setState({
|
|
3218
|
-
job: _objectSpread$
|
|
3225
|
+
job: _objectSpread$5(_objectSpread$5({}, _this.state.job), {}, {
|
|
3219
3226
|
priority
|
|
3220
3227
|
}),
|
|
3221
3228
|
priorityChangerOpen: false
|
|
@@ -3245,7 +3252,7 @@ class Job extends Component {
|
|
|
3245
3252
|
_defineProperty(this, "onSelectStatus", /*#__PURE__*/function () {
|
|
3246
3253
|
var _ref1 = _asyncToGenerator(function* (status) {
|
|
3247
3254
|
_this.setState({
|
|
3248
|
-
job: _objectSpread$
|
|
3255
|
+
job: _objectSpread$5(_objectSpread$5({}, _this.state.job), {}, {
|
|
3249
3256
|
status: status
|
|
3250
3257
|
}),
|
|
3251
3258
|
statusChangerOpen: false
|
|
@@ -3268,7 +3275,7 @@ class Job extends Component {
|
|
|
3268
3275
|
};
|
|
3269
3276
|
}());
|
|
3270
3277
|
this.state = {
|
|
3271
|
-
jobId: Helper$
|
|
3278
|
+
jobId: Helper$3.safeReadParams(props, "jobId") ? props.match.params.jobId : null,
|
|
3272
3279
|
job: null,
|
|
3273
3280
|
showingSelector: false,
|
|
3274
3281
|
updating: false,
|
|
@@ -3489,7 +3496,7 @@ class Job extends Component {
|
|
|
3489
3496
|
children: /*#__PURE__*/jsx("div", {
|
|
3490
3497
|
className: "imageGrid_image",
|
|
3491
3498
|
style: {
|
|
3492
|
-
backgroundImage: "url('".concat(Helper$
|
|
3499
|
+
backgroundImage: "url('".concat(Helper$3.get1400(image), "')"),
|
|
3493
3500
|
width: size,
|
|
3494
3501
|
height: size
|
|
3495
3502
|
}
|
|
@@ -3585,7 +3592,7 @@ class Job extends Component {
|
|
|
3585
3592
|
} = this.state.job;
|
|
3586
3593
|
var hasCustomFields = customFields && customFields.length > 0;
|
|
3587
3594
|
return /*#__PURE__*/jsxs("div", {
|
|
3588
|
-
|
|
3595
|
+
iconStyle: {
|
|
3589
3596
|
paddingBottom: 40
|
|
3590
3597
|
},
|
|
3591
3598
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -3734,7 +3741,7 @@ class Job extends Component {
|
|
|
3734
3741
|
children: [/*#__PURE__*/jsxs("div", {
|
|
3735
3742
|
className: "maintenanceNote_top",
|
|
3736
3743
|
children: [this.props.auth && this.props.auth.user && this.props.auth.user.Id === note.User.id && /*#__PURE__*/jsx(Icon, {
|
|
3737
|
-
colour: Colours$
|
|
3744
|
+
colour: Colours$2.COLOUR_DUSK_LIGHT,
|
|
3738
3745
|
icon: "ellipsis-vertical",
|
|
3739
3746
|
className: "maintenanceNote_moreIcon",
|
|
3740
3747
|
onClick: () => this.onOpenNoteMenu(index)
|
|
@@ -3754,7 +3761,7 @@ class Job extends Component {
|
|
|
3754
3761
|
})]
|
|
3755
3762
|
}), /*#__PURE__*/jsx("p", {
|
|
3756
3763
|
className: "maintenanceNote_text",
|
|
3757
|
-
children: Helper$
|
|
3764
|
+
children: Helper$3.toParagraphed(note.Note)
|
|
3758
3765
|
}), note.Attachments.map((a, i) => this.renderAttachment(a, i)), note.Images && note.Images.length > 0 ? this.renderImageGrid(note.Images, IMAGE_SIZE_NOTE) : null]
|
|
3759
3766
|
})]
|
|
3760
3767
|
}, index);
|
|
@@ -3798,7 +3805,7 @@ class Job extends Component {
|
|
|
3798
3805
|
}), /*#__PURE__*/jsx("div", {
|
|
3799
3806
|
className: "statusLabel statusLabel-large statusLabel-full",
|
|
3800
3807
|
style: {
|
|
3801
|
-
backgroundColor: Colours$
|
|
3808
|
+
backgroundColor: Colours$2.COLOUR_DUSK
|
|
3802
3809
|
},
|
|
3803
3810
|
children: /*#__PURE__*/jsxs("span", {
|
|
3804
3811
|
className: "statusLabel_text",
|
|
@@ -3809,7 +3816,7 @@ class Job extends Component {
|
|
|
3809
3816
|
}
|
|
3810
3817
|
renderExternalSyncEntry(e, i) {
|
|
3811
3818
|
var isSuccess = e.EntryType === "ExternalIDSet";
|
|
3812
|
-
var backgroundColor = isSuccess ? Colours$
|
|
3819
|
+
var backgroundColor = isSuccess ? Colours$2.COLOUR_GREEN : Colours$2.COLOUR_RED; // Green for success, red for failure
|
|
3813
3820
|
|
|
3814
3821
|
return /*#__PURE__*/jsxs("div", {
|
|
3815
3822
|
className: "ticketHistoryEntry",
|
|
@@ -3875,7 +3882,7 @@ class Job extends Component {
|
|
|
3875
3882
|
return /*#__PURE__*/jsx(Icon, {
|
|
3876
3883
|
style: {
|
|
3877
3884
|
fontSize: 20,
|
|
3878
|
-
color: Colours$
|
|
3885
|
+
color: Colours$2.COLOUR_DUSK_LIGHT,
|
|
3879
3886
|
marginLeft: 8
|
|
3880
3887
|
},
|
|
3881
3888
|
icon: "spinner",
|
|
@@ -3887,7 +3894,7 @@ class Job extends Component {
|
|
|
3887
3894
|
className: "statusLabel pointer",
|
|
3888
3895
|
onClick: this.onRetrySync,
|
|
3889
3896
|
style: {
|
|
3890
|
-
backgroundColor: Colours$
|
|
3897
|
+
backgroundColor: Colours$2.COLOUR_RED,
|
|
3891
3898
|
marginLeft: 8
|
|
3892
3899
|
},
|
|
3893
3900
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -3910,7 +3917,7 @@ class Job extends Component {
|
|
|
3910
3917
|
className: "userStatusIcon",
|
|
3911
3918
|
icon: "circle-xmark",
|
|
3912
3919
|
style: {
|
|
3913
|
-
color: Colours$
|
|
3920
|
+
color: Colours$2.COLOUR_RED
|
|
3914
3921
|
}
|
|
3915
3922
|
}), " ", retrySyncError]
|
|
3916
3923
|
});
|
|
@@ -3924,7 +3931,7 @@ class Job extends Component {
|
|
|
3924
3931
|
className: "userStatusIcon",
|
|
3925
3932
|
icon: "circle-check",
|
|
3926
3933
|
style: {
|
|
3927
|
-
color: Colours$
|
|
3934
|
+
color: Colours$2.COLOUR_GREEN
|
|
3928
3935
|
}
|
|
3929
3936
|
}), " ", "Sync retry initiated. Check back shortly for results."]
|
|
3930
3937
|
});
|
|
@@ -3938,7 +3945,7 @@ class Job extends Component {
|
|
|
3938
3945
|
className: "userStatusIcon",
|
|
3939
3946
|
icon: "circle-xmark",
|
|
3940
3947
|
style: {
|
|
3941
|
-
color: Colours$
|
|
3948
|
+
color: Colours$2.COLOUR_RED
|
|
3942
3949
|
}
|
|
3943
3950
|
}), " ", "External sync failed. Use the retry button to attempt again."]
|
|
3944
3951
|
});
|
|
@@ -3998,11 +4005,11 @@ class Job extends Component {
|
|
|
3998
4005
|
} = this.state;
|
|
3999
4006
|
if (!job || !job.history) return null;
|
|
4000
4007
|
var source = _.sortBy([...job.history.map(e => {
|
|
4001
|
-
return _objectSpread$
|
|
4008
|
+
return _objectSpread$5(_objectSpread$5({}, e), {}, {
|
|
4002
4009
|
EntryType: e.EntryType || "status"
|
|
4003
4010
|
});
|
|
4004
4011
|
}), ...(job.Notes || []).map(e => {
|
|
4005
|
-
return _objectSpread$
|
|
4012
|
+
return _objectSpread$5(_objectSpread$5({}, e), {}, {
|
|
4006
4013
|
timestamp: e.Timestamp,
|
|
4007
4014
|
EntryType: "note"
|
|
4008
4015
|
});
|
|
@@ -4169,7 +4176,7 @@ class Job extends Component {
|
|
|
4169
4176
|
onClick: () => {
|
|
4170
4177
|
this.onSelectAssignee();
|
|
4171
4178
|
},
|
|
4172
|
-
colour: Colours$
|
|
4179
|
+
colour: Colours$2.COLOUR_DUSK
|
|
4173
4180
|
})
|
|
4174
4181
|
}, this.state.selectedAssignee.id)
|
|
4175
4182
|
});
|
|
@@ -4256,14 +4263,14 @@ var Job$1 = connect(mapStateToProps$3, {
|
|
|
4256
4263
|
jobStatusesUpdate
|
|
4257
4264
|
})(withRouter(Job));
|
|
4258
4265
|
|
|
4259
|
-
function ownKeys$
|
|
4260
|
-
function _objectSpread$
|
|
4266
|
+
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; }
|
|
4267
|
+
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; }
|
|
4261
4268
|
var {
|
|
4262
4269
|
Actions,
|
|
4263
4270
|
Components: Components$2,
|
|
4264
|
-
Helper: Helper$
|
|
4271
|
+
Helper: Helper$2,
|
|
4265
4272
|
Session: Session$2,
|
|
4266
|
-
Colours,
|
|
4273
|
+
Colours: Colours$1,
|
|
4267
4274
|
Apis
|
|
4268
4275
|
} = PlussCore;
|
|
4269
4276
|
class AddJob extends Component {
|
|
@@ -4282,7 +4289,7 @@ class AddJob extends Component {
|
|
|
4282
4289
|
type,
|
|
4283
4290
|
customFields
|
|
4284
4291
|
} = res.data;
|
|
4285
|
-
_this.setState(_objectSpread$
|
|
4292
|
+
_this.setState(_objectSpread$4(_objectSpread$4({}, res.data), {}, {
|
|
4286
4293
|
prevType: type,
|
|
4287
4294
|
prevCustomFileds: customFields,
|
|
4288
4295
|
type,
|
|
@@ -4530,7 +4537,7 @@ class AddJob extends Component {
|
|
|
4530
4537
|
event.target.value = "";
|
|
4531
4538
|
});
|
|
4532
4539
|
_defineProperty(this, "onToggleDatePicker", qId => {
|
|
4533
|
-
var showDate = _objectSpread$
|
|
4540
|
+
var showDate = _objectSpread$4({}, this.state.showDate);
|
|
4534
4541
|
showDate[qId] = !showDate[qId];
|
|
4535
4542
|
this.setState({
|
|
4536
4543
|
showDate
|
|
@@ -4619,7 +4626,7 @@ class AddJob extends Component {
|
|
|
4619
4626
|
if (_.isNil(answer) || _.isEmpty(answer)) return true;
|
|
4620
4627
|
switch (type) {
|
|
4621
4628
|
case "email":
|
|
4622
|
-
return Helper$
|
|
4629
|
+
return Helper$2.isEmail(answer);
|
|
4623
4630
|
case "date":
|
|
4624
4631
|
return moment(answer, "YYYY-MM-DD", true).isValid();
|
|
4625
4632
|
case "time":
|
|
@@ -4640,7 +4647,7 @@ class AddJob extends Component {
|
|
|
4640
4647
|
this.customImageInputs = {};
|
|
4641
4648
|
this.customDocumentInputs = {};
|
|
4642
4649
|
this.state = {
|
|
4643
|
-
jobId: Helper$
|
|
4650
|
+
jobId: Helper$2.safeReadParams(this.props, "jobId") ? this.props.match.params.jobId : null,
|
|
4644
4651
|
job: null,
|
|
4645
4652
|
showingSelector: false,
|
|
4646
4653
|
updating: false,
|
|
@@ -4699,9 +4706,9 @@ class AddJob extends Component {
|
|
|
4699
4706
|
} = this.state;
|
|
4700
4707
|
return types.map(ev => {
|
|
4701
4708
|
if (ev != null) {
|
|
4702
|
-
return /*#__PURE__*/jsx(
|
|
4709
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
4703
4710
|
eventKey: ev.typeName,
|
|
4704
|
-
|
|
4711
|
+
active: type === ev.typeName,
|
|
4705
4712
|
children: ev.typeName
|
|
4706
4713
|
}, ev.typeName);
|
|
4707
4714
|
}
|
|
@@ -4957,7 +4964,7 @@ class AddJob extends Component {
|
|
|
4957
4964
|
className: "inputRequired "
|
|
4958
4965
|
}) : null, /*#__PURE__*/jsxs("div", {
|
|
4959
4966
|
className: "visitorSignIn_question",
|
|
4960
|
-
|
|
4967
|
+
iconStyle: {
|
|
4961
4968
|
flex: 1
|
|
4962
4969
|
},
|
|
4963
4970
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -5007,7 +5014,7 @@ class AddJob extends Component {
|
|
|
5007
5014
|
case "staticText":
|
|
5008
5015
|
return /*#__PURE__*/jsx("p", {
|
|
5009
5016
|
className: "visitorSignIn_text-staticText",
|
|
5010
|
-
children: Helper$
|
|
5017
|
+
children: Helper$2.toParagraphed(field.label, {
|
|
5011
5018
|
marginTop: 10
|
|
5012
5019
|
})
|
|
5013
5020
|
}, fieldId);
|
|
@@ -5026,7 +5033,7 @@ class AddJob extends Component {
|
|
|
5026
5033
|
alwaysShowLabel: true,
|
|
5027
5034
|
readOnly: true,
|
|
5028
5035
|
rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Icon, {
|
|
5029
|
-
colour: Colours.COLOUR_DUSK_LIGHT,
|
|
5036
|
+
colour: Colours$1.COLOUR_DUSK_LIGHT,
|
|
5030
5037
|
icon: "xmark",
|
|
5031
5038
|
className: "timepicker_clear",
|
|
5032
5039
|
onClick: () => this.onChangeDateAnswer(fieldId, undefined, false)
|
|
@@ -5059,7 +5066,7 @@ class AddJob extends Component {
|
|
|
5059
5066
|
}
|
|
5060
5067
|
}),
|
|
5061
5068
|
rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Icon, {
|
|
5062
|
-
colour: Colours.COLOUR_DUSK_LIGHT,
|
|
5069
|
+
colour: Colours$1.COLOUR_DUSK_LIGHT,
|
|
5063
5070
|
icon: "xmark",
|
|
5064
5071
|
className: "timepicker_clear",
|
|
5065
5072
|
onClick: () => this.onChangeTimeAnswer(fieldId, undefined)
|
|
@@ -5074,7 +5081,7 @@ class AddJob extends Component {
|
|
|
5074
5081
|
className: "inputRequired "
|
|
5075
5082
|
}) : null, /*#__PURE__*/jsxs("div", {
|
|
5076
5083
|
className: "visitorSignIn_question",
|
|
5077
|
-
|
|
5084
|
+
iconStyle: {
|
|
5078
5085
|
flex: 1
|
|
5079
5086
|
},
|
|
5080
5087
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
@@ -5097,7 +5104,7 @@ class AddJob extends Component {
|
|
|
5097
5104
|
className: "inputRequired "
|
|
5098
5105
|
}) : null, /*#__PURE__*/jsxs("div", {
|
|
5099
5106
|
className: "visitorSignIn_question",
|
|
5100
|
-
|
|
5107
|
+
iconStyle: {
|
|
5101
5108
|
flex: 1
|
|
5102
5109
|
},
|
|
5103
5110
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
@@ -5149,7 +5156,7 @@ class AddJob extends Component {
|
|
|
5149
5156
|
customFields
|
|
5150
5157
|
} = this.state;
|
|
5151
5158
|
return /*#__PURE__*/jsx("div", {
|
|
5152
|
-
|
|
5159
|
+
iconStyle: {
|
|
5153
5160
|
marginBottom: 15
|
|
5154
5161
|
},
|
|
5155
5162
|
children: /*#__PURE__*/jsxs("div", {
|
|
@@ -5184,7 +5191,7 @@ class AddJob extends Component {
|
|
|
5184
5191
|
return this.state.showWarnings && _.isEmpty(this.state.room);
|
|
5185
5192
|
}
|
|
5186
5193
|
}), /*#__PURE__*/jsxs("div", {
|
|
5187
|
-
|
|
5194
|
+
iconStyle: {
|
|
5188
5195
|
marginBottom: 15
|
|
5189
5196
|
},
|
|
5190
5197
|
children: [/*#__PURE__*/jsx(Components$2.Text, {
|
|
@@ -5284,7 +5291,7 @@ var mapStateToProps$2 = state => {
|
|
|
5284
5291
|
return {
|
|
5285
5292
|
auth,
|
|
5286
5293
|
strings: state.strings && state.strings.config || {},
|
|
5287
|
-
optionOnlyForResidents: Helper$
|
|
5294
|
+
optionOnlyForResidents: Helper$2.getSiteSettingFromState(state, values.optionOnlyForResidents)
|
|
5288
5295
|
};
|
|
5289
5296
|
};
|
|
5290
5297
|
var AddJob$1 = connect(mapStateToProps$2, {
|
|
@@ -5296,7 +5303,7 @@ var AddJob$1 = connect(mapStateToProps$2, {
|
|
|
5296
5303
|
var {
|
|
5297
5304
|
Components: Components$1,
|
|
5298
5305
|
Session: Session$1,
|
|
5299
|
-
Helper
|
|
5306
|
+
Helper: Helper$1
|
|
5300
5307
|
} = PlussCore;
|
|
5301
5308
|
var DEFAULT_FIELD = {
|
|
5302
5309
|
type: "text",
|
|
@@ -5341,7 +5348,7 @@ class AddJobType extends Component {
|
|
|
5341
5348
|
var {
|
|
5342
5349
|
jobTypeEmail
|
|
5343
5350
|
} = this.state;
|
|
5344
|
-
return !_.isEmpty(jobTypeEmail) && Helper.isEmail(jobTypeEmail);
|
|
5351
|
+
return !_.isEmpty(jobTypeEmail) && Helper$1.isEmail(jobTypeEmail);
|
|
5345
5352
|
});
|
|
5346
5353
|
_defineProperty(this, "isJobTypeValid", () => {
|
|
5347
5354
|
var {
|
|
@@ -5543,7 +5550,7 @@ class AddJobType extends Component {
|
|
|
5543
5550
|
}];
|
|
5544
5551
|
this.state = {
|
|
5545
5552
|
loading: false,
|
|
5546
|
-
jobTypeId: Helper.safeReadParams(this.props, "jobTypeId") ? this.props.match.params.jobTypeId : null,
|
|
5553
|
+
jobTypeId: Helper$1.safeReadParams(this.props, "jobTypeId") ? this.props.match.params.jobTypeId : null,
|
|
5547
5554
|
jobTypeName: "",
|
|
5548
5555
|
jobTypeEmail: "",
|
|
5549
5556
|
jobTypeDescription: "",
|
|
@@ -6079,7 +6086,7 @@ class AddJobType extends Component {
|
|
|
6079
6086
|
type: "bodyLarge",
|
|
6080
6087
|
className: "marginBottom-24 paddingLeft-40",
|
|
6081
6088
|
style: {
|
|
6082
|
-
color: Colours$
|
|
6089
|
+
color: Colours$4.COLOUR_LIGHTGREY
|
|
6083
6090
|
},
|
|
6084
6091
|
children: "By default, the form submission title will be the name of the person submitting the form. You can choose to select a different field to use as the title for the form submission."
|
|
6085
6092
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -6110,10 +6117,10 @@ class AddJobType extends Component {
|
|
|
6110
6117
|
return /*#__PURE__*/jsxs("div", {
|
|
6111
6118
|
className: "padding-60 paddingVertical-8 text-bodyLarge",
|
|
6112
6119
|
style: {
|
|
6113
|
-
color: Colours$
|
|
6120
|
+
color: Colours$4.COLOUR_RED
|
|
6114
6121
|
},
|
|
6115
6122
|
children: ["To save the form", /*#__PURE__*/jsx("ul", {
|
|
6116
|
-
|
|
6123
|
+
iconStyle: {
|
|
6117
6124
|
padding: 0,
|
|
6118
6125
|
paddingLeft: 16
|
|
6119
6126
|
},
|
|
@@ -6197,10 +6204,14 @@ var AddJobType$1 = connect(mapStateToProps$1, {
|
|
|
6197
6204
|
jobTypesUpdate
|
|
6198
6205
|
})(withRouter(AddJobType));
|
|
6199
6206
|
|
|
6207
|
+
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; }
|
|
6208
|
+
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; }
|
|
6200
6209
|
var {
|
|
6201
6210
|
Analytics: Analytics$1,
|
|
6202
6211
|
Session,
|
|
6203
|
-
Components
|
|
6212
|
+
Components,
|
|
6213
|
+
Helper,
|
|
6214
|
+
Colours
|
|
6204
6215
|
} = PlussCore;
|
|
6205
6216
|
var getInitialState = () => ({
|
|
6206
6217
|
requests: 0,
|
|
@@ -6220,10 +6231,21 @@ var AnalyticsHub = _ref => {
|
|
|
6220
6231
|
auth,
|
|
6221
6232
|
prevText,
|
|
6222
6233
|
dayCount,
|
|
6223
|
-
strings
|
|
6234
|
+
strings,
|
|
6235
|
+
userType,
|
|
6236
|
+
userCategory,
|
|
6237
|
+
selectedSites
|
|
6224
6238
|
} = _ref;
|
|
6225
6239
|
var [analyticsData, setAnalyticsData] = useState(getInitialState());
|
|
6226
6240
|
var [isExportOpen, setIsExportOpen] = useState(false);
|
|
6241
|
+
var [failedSites, setFailedSites] = useState([]);
|
|
6242
|
+
var [comparisonData, setComparisonData] = useState({
|
|
6243
|
+
requests: [],
|
|
6244
|
+
completedRequests: [],
|
|
6245
|
+
comments: [],
|
|
6246
|
+
isLoading: true
|
|
6247
|
+
});
|
|
6248
|
+
var comparisonMode = selectedSites && selectedSites.length > 1;
|
|
6227
6249
|
var hasAccess = Session.validateAccess(auth.site, values.permissionMaintenanceTracking, auth);
|
|
6228
6250
|
if (!hasAccess) {
|
|
6229
6251
|
return null;
|
|
@@ -6237,7 +6259,10 @@ var AnalyticsHub = _ref => {
|
|
|
6237
6259
|
var exportColumns = [{
|
|
6238
6260
|
label: "Select All",
|
|
6239
6261
|
key: ""
|
|
6240
|
-
}, {
|
|
6262
|
+
}, ...(comparisonMode ? [{
|
|
6263
|
+
label: "Site",
|
|
6264
|
+
key: "site"
|
|
6265
|
+
}] : []), {
|
|
6241
6266
|
label: "Start Date",
|
|
6242
6267
|
key: "startDate"
|
|
6243
6268
|
}, {
|
|
@@ -6255,32 +6280,114 @@ var AnalyticsHub = _ref => {
|
|
|
6255
6280
|
}];
|
|
6256
6281
|
useEffect(() => {
|
|
6257
6282
|
getData();
|
|
6258
|
-
}, [startTime, endTime]);
|
|
6283
|
+
}, [startTime, endTime, userType, userCategory, selectedSites]);
|
|
6259
6284
|
var getData = /*#__PURE__*/function () {
|
|
6260
6285
|
var _ref2 = _asyncToGenerator(function* () {
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6286
|
+
try {
|
|
6287
|
+
setFailedSites([]);
|
|
6288
|
+
if (comparisonMode) {
|
|
6289
|
+
setComparisonData({
|
|
6290
|
+
requests: [],
|
|
6291
|
+
completedRequests: [],
|
|
6292
|
+
comments: [],
|
|
6293
|
+
isLoading: true
|
|
6294
|
+
});
|
|
6295
|
+
var multiSiteResultsObj = yield Analytics$1.fetchMultiSiteData(selectedSites, /*#__PURE__*/function () {
|
|
6296
|
+
var _ref3 = _asyncToGenerator(function* (site) {
|
|
6297
|
+
var {
|
|
6298
|
+
data
|
|
6299
|
+
} = yield analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
|
|
6300
|
+
userType,
|
|
6301
|
+
userCategory
|
|
6302
|
+
});
|
|
6303
|
+
return data;
|
|
6304
|
+
});
|
|
6305
|
+
return function (_x) {
|
|
6306
|
+
return _ref3.apply(this, arguments);
|
|
6307
|
+
};
|
|
6308
|
+
}());
|
|
6309
|
+
var roles = auth.user.Roles;
|
|
6310
|
+
var failed = Object.entries(multiSiteResultsObj).filter(_ref4 => {
|
|
6311
|
+
var [, data] = _ref4;
|
|
6312
|
+
return data === null;
|
|
6313
|
+
}).map(_ref5 => {
|
|
6314
|
+
var [site] = _ref5;
|
|
6315
|
+
return Helper.getSiteNameFromRoles(site, roles);
|
|
6316
|
+
});
|
|
6317
|
+
setFailedSites(failed);
|
|
6318
|
+
var multiSiteResults = Object.entries(multiSiteResultsObj).filter(_ref6 => {
|
|
6319
|
+
var [, data] = _ref6;
|
|
6320
|
+
return data !== null;
|
|
6321
|
+
}).map(_ref7 => {
|
|
6322
|
+
var [site, data] = _ref7;
|
|
6323
|
+
return {
|
|
6324
|
+
site,
|
|
6325
|
+
data
|
|
6326
|
+
};
|
|
6327
|
+
});
|
|
6328
|
+
var buildComparison = (activityKey, countType) => multiSiteResults.map(result => ({
|
|
6329
|
+
name: Helper.getSiteNameFromRoles(result.site, roles),
|
|
6330
|
+
value: Analytics$1.countActivities(result.data, activityKey, countType)
|
|
6331
|
+
}));
|
|
6332
|
+
setComparisonData({
|
|
6333
|
+
requests: buildComparison("Request", "total"),
|
|
6334
|
+
completedRequests: buildComparison("RequestCompleted", "unique"),
|
|
6335
|
+
comments: buildComparison("Comment", "total"),
|
|
6336
|
+
isLoading: false
|
|
6337
|
+
});
|
|
6338
|
+
} else {
|
|
6339
|
+
setAnalyticsData(getInitialState());
|
|
6340
|
+
var site = selectedSites && selectedSites.length === 1 ? selectedSites[0] : auth.site;
|
|
6341
|
+
var timeDifference = endTime - startTime;
|
|
6342
|
+
var [currentStatsResponse, prevStatsResponse] = yield Promise.all([analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
|
|
6343
|
+
userType,
|
|
6344
|
+
userCategory
|
|
6345
|
+
}), analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime - timeDifference, startTime, true, {
|
|
6346
|
+
userType,
|
|
6347
|
+
userCategory
|
|
6348
|
+
})]);
|
|
6349
|
+
var data = {
|
|
6350
|
+
requests: Analytics$1.countActivities(currentStatsResponse.data, "Request", "total"),
|
|
6351
|
+
prevRequests: Analytics$1.countActivities(prevStatsResponse.data, "Request", "total"),
|
|
6352
|
+
completedRequests: Analytics$1.countActivities(currentStatsResponse.data, "RequestCompleted", "unique"),
|
|
6353
|
+
prevCompletedRequests: Analytics$1.countActivities(prevStatsResponse.data, "RequestCompleted", "unique"),
|
|
6354
|
+
comments: Analytics$1.countActivities(currentStatsResponse.data, "Comment", "total"),
|
|
6355
|
+
prevComments: Analytics$1.countActivities(prevStatsResponse.data, "Comment", "total"),
|
|
6356
|
+
isLoading: false
|
|
6357
|
+
};
|
|
6358
|
+
setAnalyticsData(data);
|
|
6359
|
+
}
|
|
6360
|
+
} catch (err) {
|
|
6361
|
+
if (comparisonMode) {
|
|
6362
|
+
setComparisonData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
|
|
6363
|
+
isLoading: false
|
|
6364
|
+
}));
|
|
6365
|
+
} else {
|
|
6366
|
+
setAnalyticsData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
|
|
6367
|
+
isLoading: false
|
|
6368
|
+
}));
|
|
6369
|
+
}
|
|
6370
|
+
}
|
|
6275
6371
|
});
|
|
6276
6372
|
return function getData() {
|
|
6277
6373
|
return _ref2.apply(this, arguments);
|
|
6278
6374
|
};
|
|
6279
6375
|
}();
|
|
6280
6376
|
var isReadyToOpenCSV = () => {
|
|
6281
|
-
return !analyticsData.isLoading;
|
|
6377
|
+
return comparisonMode ? !comparisonData.isLoading : !analyticsData.isLoading;
|
|
6282
6378
|
};
|
|
6283
6379
|
var getExportSource = () => {
|
|
6380
|
+
if (comparisonMode) {
|
|
6381
|
+
var sites = comparisonData.requests || [];
|
|
6382
|
+
return sites.map((site, i) => ({
|
|
6383
|
+
site: site.name,
|
|
6384
|
+
startDate: moment(startTime + 1).format("D-MM-YYYY"),
|
|
6385
|
+
endDate: moment(endTime).format("D-MM-YYYY"),
|
|
6386
|
+
requests: site.value,
|
|
6387
|
+
completedRequests: comparisonData.completedRequests[i] && comparisonData.completedRequests[i].value || 0,
|
|
6388
|
+
comments: comparisonData.comments[i] && comparisonData.comments[i].value || 0
|
|
6389
|
+
}));
|
|
6390
|
+
}
|
|
6284
6391
|
return [{
|
|
6285
6392
|
startDate: moment(startTime + 1).format("D-MM-YYYY"),
|
|
6286
6393
|
endDate: moment(endTime).format("D-MM-YYYY"),
|
|
@@ -6294,13 +6401,14 @@ var AnalyticsHub = _ref => {
|
|
|
6294
6401
|
return null;
|
|
6295
6402
|
}
|
|
6296
6403
|
var source = getExportSource();
|
|
6404
|
+
var filterSuffix = [userType, userCategory].filter(Boolean).map(f => f.toLowerCase().replace(/\s+/g, "-")).join("_");
|
|
6297
6405
|
return /*#__PURE__*/jsx(Components.ExportCsvPopup, {
|
|
6298
6406
|
onClose: () => {
|
|
6299
6407
|
setIsExportOpen(false);
|
|
6300
6408
|
},
|
|
6301
6409
|
columns: exportColumns,
|
|
6302
6410
|
source: source,
|
|
6303
|
-
filename: "".concat(values.analyticsKey, "
|
|
6411
|
+
filename: "".concat(values.analyticsKey, "analytics").concat(comparisonMode ? "_comparison" : "").concat(filterSuffix ? "_".concat(filterSuffix) : "", "_").concat(source[0].startDate, "_").concat(source[0].endDate, ".csv")
|
|
6304
6412
|
});
|
|
6305
6413
|
};
|
|
6306
6414
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -6321,33 +6429,73 @@ var AnalyticsHub = _ref => {
|
|
|
6321
6429
|
leftIcon: "file-code",
|
|
6322
6430
|
children: "Export CSV"
|
|
6323
6431
|
})]
|
|
6324
|
-
}), /*#__PURE__*/jsxs(
|
|
6432
|
+
}), failedSites.length > 0 && /*#__PURE__*/jsxs(Components.Text, {
|
|
6433
|
+
type: "help",
|
|
6434
|
+
style: {
|
|
6435
|
+
color: Colours.COLOUR_RED,
|
|
6436
|
+
marginTop: 8
|
|
6437
|
+
},
|
|
6438
|
+
children: ["Data unavailable for: ", failedSites.join(", ")]
|
|
6439
|
+
}), /*#__PURE__*/jsx("div", {
|
|
6325
6440
|
className: "analyticsSection dashboardSection_content",
|
|
6326
|
-
children:
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6441
|
+
children: (() => {
|
|
6442
|
+
var chartSuffix = [selectedSites && selectedSites.length > 0 ? "&sites=".concat(selectedSites.join(",")) : "", userType ? "&userType=".concat(encodeURIComponent(userType)) : "", userCategory ? "&userCategory=".concat(encodeURIComponent(userCategory)) : ""].join("");
|
|
6443
|
+
if (comparisonMode) {
|
|
6444
|
+
return /*#__PURE__*/jsxs("div", {
|
|
6445
|
+
style: {
|
|
6446
|
+
display: "flex",
|
|
6447
|
+
flexDirection: "column",
|
|
6448
|
+
gap: 16
|
|
6449
|
+
},
|
|
6450
|
+
children: [/*#__PURE__*/jsx(Components.ComparisonStatBox, {
|
|
6451
|
+
title: "".concat(featureTitle, " Requests"),
|
|
6452
|
+
data: comparisonData.requests,
|
|
6453
|
+
prevText: prevText,
|
|
6454
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6455
|
+
isLoading: comparisonData.isLoading
|
|
6456
|
+
}), /*#__PURE__*/jsx(Components.ComparisonStatBox, {
|
|
6457
|
+
title: "Completed ".concat(featureTitle, " Requests"),
|
|
6458
|
+
data: comparisonData.completedRequests,
|
|
6459
|
+
prevText: prevText,
|
|
6460
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6461
|
+
isLoading: comparisonData.isLoading
|
|
6462
|
+
}), /*#__PURE__*/jsx(Components.ComparisonStatBox, {
|
|
6463
|
+
title: "".concat(featureTitle, " Comments"),
|
|
6464
|
+
data: comparisonData.comments,
|
|
6465
|
+
prevText: prevText,
|
|
6466
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6467
|
+
isLoading: comparisonData.isLoading
|
|
6468
|
+
})]
|
|
6469
|
+
});
|
|
6470
|
+
}
|
|
6471
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
6472
|
+
children: [/*#__PURE__*/jsx(Components.StatBox, {
|
|
6473
|
+
title: "".concat(featureTitle, " Requests"),
|
|
6474
|
+
icon: "wrench",
|
|
6475
|
+
value: analyticsData.requests,
|
|
6476
|
+
previousValue: analyticsData.prevRequests,
|
|
6477
|
+
prevText: prevText,
|
|
6478
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6479
|
+
isLoading: analyticsData.isLoading
|
|
6480
|
+
}), /*#__PURE__*/jsx(Components.StatBox, {
|
|
6481
|
+
title: "Completed ".concat(featureTitle, " Requests"),
|
|
6482
|
+
icon: "circle-check",
|
|
6483
|
+
value: analyticsData.completedRequests,
|
|
6484
|
+
previousValue: analyticsData.prevCompletedRequests,
|
|
6485
|
+
prevText: prevText,
|
|
6486
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6487
|
+
isLoading: analyticsData.isLoading
|
|
6488
|
+
}), /*#__PURE__*/jsx(Components.StatBox, {
|
|
6489
|
+
title: "".concat(featureTitle, " Comments"),
|
|
6490
|
+
icon: "comment",
|
|
6491
|
+
value: analyticsData.comments,
|
|
6492
|
+
previousValue: analyticsData.prevComments,
|
|
6493
|
+
prevText: prevText,
|
|
6494
|
+
viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
|
|
6495
|
+
isLoading: analyticsData.isLoading
|
|
6496
|
+
})]
|
|
6497
|
+
});
|
|
6498
|
+
})()
|
|
6351
6499
|
})]
|
|
6352
6500
|
});
|
|
6353
6501
|
};
|