@plusscommunities/pluss-maintenance-web 1.1.23 → 1.1.24-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 +1324 -244
- package/dist/index.esm.js +1328 -248
- package/dist/index.umd.js +1324 -244
- package/package.json +2 -2
- package/src/actions/JobsActions.js +62 -10
- package/src/actions/types.js +3 -1
- package/src/apis/index.js +1 -0
- package/src/apis/maintenanceActions.js +11 -2
- package/src/components/Configuration.js +392 -0
- package/src/components/JobList.js +283 -18
- package/src/helper/index.js +26 -0
- package/src/maintenancePriority.json +5 -0
- package/src/maintenanceStatus.json +11 -8
- package/src/reducers/MaintenanceReducer.js +11 -36
- package/src/screens/Job.js +140 -27
- package/src/screens/RequestsHub.js +16 -0
- package/src/values.config.a.js +4 -0
- package/src/values.config.default.js +4 -0
- package/src/values.config.forms.js +4 -0
- package/src/values.config.js +4 -0
- package/src/values.config.b.js +0 -58
- package/src/values.config.c.js +0 -58
- package/src/values.config.d.js +0 -58
package/dist/index.umd.js
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
actionJobsLoaded: 'JOBS_LOADED',
|
|
55
55
|
actionJobsRemoved: 'JOBS_REMOVED',
|
|
56
56
|
actionJobsTypesLoaded: 'JOBS_TYPES_LOADED',
|
|
57
|
+
actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADED',
|
|
58
|
+
actionJobsHideSeen: 'JOBS_HIDE_SEEN',
|
|
57
59
|
actionJobsLoading: 'JOBS_LOADING',
|
|
58
60
|
permissionMaintenanceTracking: 'maintenanceTracking',
|
|
59
61
|
permissionMaintenanceTypes: 'maintenanceTypes',
|
|
@@ -107,7 +109,9 @@
|
|
|
107
109
|
hiddenKeyMoreSectionMaintenance: 'maintenanceRequest',
|
|
108
110
|
forceCustomFields: false,
|
|
109
111
|
textEntityName: 'Job',
|
|
110
|
-
hasHelpButton: true
|
|
112
|
+
hasHelpButton: true,
|
|
113
|
+
stringConfigJobStatus: 'maintenanceJobStatus',
|
|
114
|
+
stringConfigHideSeen: 'maintenanceDisableSeen'
|
|
111
115
|
};
|
|
112
116
|
|
|
113
117
|
// import * as PlussCore from '../../pluss-core/src';
|
|
@@ -228,19 +232,21 @@
|
|
|
228
232
|
};
|
|
229
233
|
|
|
230
234
|
var JOBS_LOADED = values.actionJobsLoaded;
|
|
235
|
+
var JOBS_LOADING = values.actionJobsLoading;
|
|
231
236
|
var JOBS_REMOVED = values.actionJobsRemoved;
|
|
232
237
|
var JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
|
|
233
|
-
var
|
|
238
|
+
var JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
|
|
239
|
+
var JOBS_HIDE_SEEN = values.actionJobsHideSeen;
|
|
234
240
|
|
|
235
|
-
function ownKeys$
|
|
241
|
+
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
236
242
|
|
|
237
|
-
function _objectSpread$
|
|
243
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
238
244
|
var Helper$5 = PlussCore__namespace.Helper,
|
|
239
|
-
Session$
|
|
245
|
+
Session$9 = PlussCore__namespace.Session;
|
|
240
246
|
var maintenanceActions = {
|
|
241
247
|
getJobType: function getJobType(site, typeId) {
|
|
242
248
|
var url = Helper$5.getUrl(values.serviceKey, 'getjobtype');
|
|
243
|
-
return Session$
|
|
249
|
+
return Session$9.authedFunction({
|
|
244
250
|
method: 'POST',
|
|
245
251
|
url: url,
|
|
246
252
|
data: {
|
|
@@ -251,7 +257,7 @@
|
|
|
251
257
|
},
|
|
252
258
|
getJobTypes: function getJobTypes(site, id) {
|
|
253
259
|
var url = Helper$5.getUrl(values.serviceKey, 'getjobtypes');
|
|
254
|
-
return Session$
|
|
260
|
+
return Session$9.authedFunction({
|
|
255
261
|
method: 'POST',
|
|
256
262
|
url: url,
|
|
257
263
|
data: {
|
|
@@ -261,7 +267,7 @@
|
|
|
261
267
|
},
|
|
262
268
|
getJob: function getJob(site, id) {
|
|
263
269
|
var url = Helper$5.getUrl(values.serviceKey, 'getJob');
|
|
264
|
-
return Session$
|
|
270
|
+
return Session$9.authedFunction({
|
|
265
271
|
method: 'POST',
|
|
266
272
|
url: url,
|
|
267
273
|
data: {
|
|
@@ -272,7 +278,7 @@
|
|
|
272
278
|
},
|
|
273
279
|
getJobByJobId: function getJobByJobId(site, jobId) {
|
|
274
280
|
var url = Helper$5.getUrl(values.serviceKey, 'getJob');
|
|
275
|
-
return Session$
|
|
281
|
+
return Session$9.authedFunction({
|
|
276
282
|
method: 'POST',
|
|
277
283
|
url: url,
|
|
278
284
|
data: {
|
|
@@ -284,7 +290,7 @@
|
|
|
284
290
|
getJobs: function getJobs(site) {
|
|
285
291
|
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
286
292
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
287
|
-
return Session$
|
|
293
|
+
return Session$9.authedFunction({
|
|
288
294
|
method: 'POST',
|
|
289
295
|
url: Helper$5.getUrl(values.serviceKey, 'getJobs'),
|
|
290
296
|
data: {
|
|
@@ -311,7 +317,7 @@
|
|
|
311
317
|
query.lastKey = JSON.stringify(lastKey);
|
|
312
318
|
}
|
|
313
319
|
|
|
314
|
-
return Session$
|
|
320
|
+
return Session$9.authedFunction({
|
|
315
321
|
method: 'GET',
|
|
316
322
|
url: Helper$5.getUrl(values.serviceKey, 'get/requests', query)
|
|
317
323
|
});
|
|
@@ -331,14 +337,14 @@
|
|
|
331
337
|
});
|
|
332
338
|
},
|
|
333
339
|
createJob: function createJob(job) {
|
|
334
|
-
return Session$
|
|
340
|
+
return Session$9.authedFunction({
|
|
335
341
|
method: 'POST',
|
|
336
342
|
url: Helper$5.getUrl(values.serviceKey, 'sendMaintenance'),
|
|
337
|
-
data: _objectSpread$
|
|
343
|
+
data: _objectSpread$7({}, job)
|
|
338
344
|
});
|
|
339
345
|
},
|
|
340
346
|
editJob: function editJob(job, site) {
|
|
341
|
-
return Session$
|
|
347
|
+
return Session$9.authedFunction({
|
|
342
348
|
method: 'POST',
|
|
343
349
|
url: Helper$5.getUrl(values.serviceKey, 'editJob'),
|
|
344
350
|
data: {
|
|
@@ -348,7 +354,7 @@
|
|
|
348
354
|
});
|
|
349
355
|
},
|
|
350
356
|
deleteJob: function deleteJob(site, id) {
|
|
351
|
-
return Session$
|
|
357
|
+
return Session$9.authedFunction({
|
|
352
358
|
method: 'POST',
|
|
353
359
|
url: Helper$5.getUrl(values.serviceKey, 'requests/remove'),
|
|
354
360
|
data: {
|
|
@@ -358,7 +364,7 @@
|
|
|
358
364
|
});
|
|
359
365
|
},
|
|
360
366
|
editJobStatus: function editJobStatus(id, status) {
|
|
361
|
-
return Session$
|
|
367
|
+
return Session$9.authedFunction({
|
|
362
368
|
method: 'POST',
|
|
363
369
|
url: Helper$5.getUrl(values.serviceKey, 'editJobStatus'),
|
|
364
370
|
data: {
|
|
@@ -367,8 +373,18 @@
|
|
|
367
373
|
}
|
|
368
374
|
});
|
|
369
375
|
},
|
|
376
|
+
editJobPriority: function editJobPriority(id, priority) {
|
|
377
|
+
return Session$9.authedFunction({
|
|
378
|
+
method: 'POST',
|
|
379
|
+
url: Helper$5.getUrl(values.serviceKey, 'update/priority'),
|
|
380
|
+
data: {
|
|
381
|
+
id: id,
|
|
382
|
+
priority: priority
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
},
|
|
370
386
|
assignJob: function assignJob(jobId, userId) {
|
|
371
|
-
return Session$
|
|
387
|
+
return Session$9.authedFunction({
|
|
372
388
|
method: 'POST',
|
|
373
389
|
url: Helper$5.getUrl(values.serviceKey, 'update/assign'),
|
|
374
390
|
data: {
|
|
@@ -378,40 +394,42 @@
|
|
|
378
394
|
});
|
|
379
395
|
},
|
|
380
396
|
getAssignees: function getAssignees(site) {
|
|
381
|
-
return Session$
|
|
397
|
+
return Session$9.authedFunction({
|
|
382
398
|
method: 'GET',
|
|
383
399
|
url: Helper$5.getUrl(values.serviceKey, 'get/assignees', {
|
|
384
400
|
site: site
|
|
385
401
|
})
|
|
386
402
|
});
|
|
387
403
|
},
|
|
388
|
-
addNote: function addNote(jobId, note, attachments) {
|
|
389
|
-
return Session$
|
|
404
|
+
addNote: function addNote(jobId, note, attachments, images) {
|
|
405
|
+
return Session$9.authedFunction({
|
|
390
406
|
method: 'POST',
|
|
391
407
|
url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
|
|
392
408
|
data: {
|
|
393
409
|
id: jobId,
|
|
394
410
|
note: note,
|
|
395
411
|
attachments: attachments,
|
|
412
|
+
images: images,
|
|
396
413
|
action: 'AddNote'
|
|
397
414
|
}
|
|
398
415
|
});
|
|
399
416
|
},
|
|
400
|
-
editNote: function editNote(jobId, noteId, note, attachments) {
|
|
401
|
-
return Session$
|
|
417
|
+
editNote: function editNote(jobId, noteId, note, attachments, images) {
|
|
418
|
+
return Session$9.authedFunction({
|
|
402
419
|
method: 'POST',
|
|
403
420
|
url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
|
|
404
421
|
data: {
|
|
405
422
|
id: jobId,
|
|
406
423
|
note: note,
|
|
407
424
|
attachments: attachments,
|
|
425
|
+
images: images,
|
|
408
426
|
noteId: noteId,
|
|
409
427
|
action: 'EditNote'
|
|
410
428
|
}
|
|
411
429
|
});
|
|
412
430
|
},
|
|
413
431
|
deleteNote: function deleteNote(jobId, noteId) {
|
|
414
|
-
return Session$
|
|
432
|
+
return Session$9.authedFunction({
|
|
415
433
|
method: 'POST',
|
|
416
434
|
url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
|
|
417
435
|
data: {
|
|
@@ -431,7 +449,7 @@
|
|
|
431
449
|
hasCustomFields: hasCustomFields,
|
|
432
450
|
customFields: customFields || []
|
|
433
451
|
};
|
|
434
|
-
return Session$
|
|
452
|
+
return Session$9.authedFunction({
|
|
435
453
|
method: 'POST',
|
|
436
454
|
url: Helper$5.getUrl(values.serviceKey, 'createJobType'),
|
|
437
455
|
data: data
|
|
@@ -449,14 +467,14 @@
|
|
|
449
467
|
customFields: customFields || []
|
|
450
468
|
};
|
|
451
469
|
if (hasCustomFields && customFields) data.customFields = customFields;
|
|
452
|
-
return Session$
|
|
470
|
+
return Session$9.authedFunction({
|
|
453
471
|
method: 'POST',
|
|
454
472
|
url: Helper$5.getUrl(values.serviceKey, 'editJobType'),
|
|
455
473
|
data: data
|
|
456
474
|
});
|
|
457
475
|
},
|
|
458
476
|
deleteJobType: function deleteJobType(site, id) {
|
|
459
|
-
return Session$
|
|
477
|
+
return Session$9.authedFunction({
|
|
460
478
|
method: 'POST',
|
|
461
479
|
url: Helper$5.getUrl(values.serviceKey, 'deleteJobType'),
|
|
462
480
|
data: {
|
|
@@ -468,7 +486,7 @@
|
|
|
468
486
|
};
|
|
469
487
|
|
|
470
488
|
var Helper$4 = PlussCore__namespace.Helper,
|
|
471
|
-
Session$
|
|
489
|
+
Session$8 = PlussCore__namespace.Session;
|
|
472
490
|
var reactionActions = {
|
|
473
491
|
addComment: function addComment(entityId, entityType, entityName, site, comment, image, parentId) {
|
|
474
492
|
var data = {
|
|
@@ -484,7 +502,7 @@
|
|
|
484
502
|
data.image = image;
|
|
485
503
|
}
|
|
486
504
|
|
|
487
|
-
return Session$
|
|
505
|
+
return Session$8.authedFunction({
|
|
488
506
|
method: 'POST',
|
|
489
507
|
url: Helper$4.getUrl('reactions', 'comments/add'),
|
|
490
508
|
data: data
|
|
@@ -509,7 +527,7 @@
|
|
|
509
527
|
query.minTime = minTime;
|
|
510
528
|
}
|
|
511
529
|
|
|
512
|
-
return Session$
|
|
530
|
+
return Session$8.authedFunction({
|
|
513
531
|
method: 'GET',
|
|
514
532
|
url: Helper$4.getUrl('reactions', 'comments/get', query)
|
|
515
533
|
});
|
|
@@ -519,6 +537,28 @@
|
|
|
519
537
|
var Apis$1 = PlussCore__namespace.Apis;
|
|
520
538
|
var analyticsActions = Apis$1.analyticsActions;
|
|
521
539
|
var userActions = Apis$1.userActions;
|
|
540
|
+
var stringActions = Apis$1.stringActions;
|
|
541
|
+
|
|
542
|
+
var jobStatusOptions = [
|
|
543
|
+
{
|
|
544
|
+
text: "Open",
|
|
545
|
+
order: 0,
|
|
546
|
+
color: "#d5dde4",
|
|
547
|
+
category: "Not Actioned"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
text: "In Progress",
|
|
551
|
+
order: 1,
|
|
552
|
+
color: "#82d6e5",
|
|
553
|
+
category: "In Progress"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
text: "Completed",
|
|
557
|
+
order: 2,
|
|
558
|
+
color: "#58dba4",
|
|
559
|
+
category: "Completed"
|
|
560
|
+
}
|
|
561
|
+
];
|
|
522
562
|
|
|
523
563
|
var Helper$3 = PlussCore__namespace.Helper;
|
|
524
564
|
var jobsUpdate = function jobsUpdate(site, isdashboard) {
|
|
@@ -570,6 +610,54 @@
|
|
|
570
610
|
type: JOBS_TYPES_LOADED,
|
|
571
611
|
payload: events
|
|
572
612
|
};
|
|
613
|
+
};
|
|
614
|
+
var jobStatusesUpdate = function jobStatusesUpdate(site) {
|
|
615
|
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
616
|
+
return function (dispatch) {
|
|
617
|
+
stringActions.getString(site, values.stringConfigJobStatus).then(function (res) {
|
|
618
|
+
dispatch({
|
|
619
|
+
type: JOBS_STATUSES_LOADED,
|
|
620
|
+
payload: res.data
|
|
621
|
+
});
|
|
622
|
+
if (callback) callback(res.data);
|
|
623
|
+
}).catch(function (_error) {
|
|
624
|
+
dispatch({
|
|
625
|
+
type: JOBS_STATUSES_LOADED,
|
|
626
|
+
payload: jobStatusOptions
|
|
627
|
+
});
|
|
628
|
+
if (callback) callback(jobStatusOptions);
|
|
629
|
+
});
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
var jobStatusesLoaded = function jobStatusesLoaded(statuses) {
|
|
633
|
+
return {
|
|
634
|
+
type: JOBS_STATUSES_LOADED,
|
|
635
|
+
payload: statuses
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
var jobHideSeenUpdate = function jobHideSeenUpdate(site) {
|
|
639
|
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
640
|
+
return function (dispatch) {
|
|
641
|
+
stringActions.getString(site, values.stringConfigHideSeen).then(function (res) {
|
|
642
|
+
dispatch({
|
|
643
|
+
type: JOBS_HIDE_SEEN,
|
|
644
|
+
payload: res.data
|
|
645
|
+
});
|
|
646
|
+
if (callback) callback(res.data);
|
|
647
|
+
}).catch(function (_error) {
|
|
648
|
+
dispatch({
|
|
649
|
+
type: JOBS_HIDE_SEEN,
|
|
650
|
+
payload: false
|
|
651
|
+
});
|
|
652
|
+
if (callback) callback(false);
|
|
653
|
+
});
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
var jobHideSeenLoaded = function jobHideSeenLoaded(hide) {
|
|
657
|
+
return {
|
|
658
|
+
type: JOBS_HIDE_SEEN,
|
|
659
|
+
payload: hide
|
|
660
|
+
};
|
|
573
661
|
}; // export const removeJobType = (id) => {
|
|
574
662
|
// return {
|
|
575
663
|
// type: JOBS_TYPES_REMOVED,
|
|
@@ -600,41 +688,56 @@
|
|
|
600
688
|
// };
|
|
601
689
|
// };
|
|
602
690
|
|
|
603
|
-
var
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
691
|
+
var jobPriorityOptions = [
|
|
692
|
+
{
|
|
693
|
+
name: "Low",
|
|
694
|
+
color: "green",
|
|
695
|
+
"default": true
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
name: "Medium",
|
|
699
|
+
color: "orange"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "High",
|
|
703
|
+
color: "red"
|
|
704
|
+
}
|
|
705
|
+
];
|
|
706
|
+
|
|
707
|
+
var STATUS_IMCOMPLETE = 'All Incomplete';
|
|
708
|
+
var STATUS_NOT_ACTIONED = 'Not Actioned';
|
|
709
|
+
var STATUS_IN_PROGRESS = 'In Progress';
|
|
710
|
+
var STATUS_COMPLETED = 'Completed';
|
|
711
|
+
|
|
712
|
+
var getDefaultPriority = function getDefaultPriority() {
|
|
713
|
+
return jobPriorityOptions.find(function (p) {
|
|
714
|
+
return p.default;
|
|
715
|
+
});
|
|
612
716
|
};
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
Completed: Completed
|
|
717
|
+
|
|
718
|
+
var getJobPriority = function getJobPriority(priority) {
|
|
719
|
+
var priorityOption = null;
|
|
720
|
+
if (priority) priorityOption = jobPriorityOptions.find(function (p) {
|
|
721
|
+
return p.name === priority;
|
|
722
|
+
});
|
|
723
|
+
return priorityOption || getDefaultPriority();
|
|
621
724
|
};
|
|
622
725
|
|
|
623
|
-
function ownKeys$
|
|
726
|
+
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
624
727
|
|
|
625
|
-
function _objectSpread$
|
|
728
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
626
729
|
|
|
627
|
-
function _createSuper$
|
|
730
|
+
function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
628
731
|
|
|
629
|
-
function _isNativeReflectConstruct$
|
|
630
|
-
var Session$
|
|
631
|
-
Components$
|
|
732
|
+
function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
733
|
+
var Session$7 = PlussCore__namespace.Session,
|
|
734
|
+
Components$7 = PlussCore__namespace.Components,
|
|
632
735
|
Analytics$2 = PlussCore__namespace.Analytics;
|
|
633
736
|
|
|
634
737
|
var JobList = /*#__PURE__*/function (_Component) {
|
|
635
738
|
_inherits__default['default'](JobList, _Component);
|
|
636
739
|
|
|
637
|
-
var _super = _createSuper$
|
|
740
|
+
var _super = _createSuper$c(JobList);
|
|
638
741
|
|
|
639
742
|
function JobList(props) {
|
|
640
743
|
var _this;
|
|
@@ -643,6 +746,20 @@
|
|
|
643
746
|
|
|
644
747
|
_this = _super.call(this, props);
|
|
645
748
|
|
|
749
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "setRequesters", function (jobs) {
|
|
750
|
+
var requesters = ___default['default'].orderBy(___default['default'].uniqBy(jobs.map(function (j) {
|
|
751
|
+
return {
|
|
752
|
+
id: j.userID,
|
|
753
|
+
displayName: j.userName,
|
|
754
|
+
profilePic: j.userProfilePic
|
|
755
|
+
};
|
|
756
|
+
}), 'id'), 'displayName', 'asc');
|
|
757
|
+
|
|
758
|
+
_this.setState({
|
|
759
|
+
requesters: requesters
|
|
760
|
+
});
|
|
761
|
+
});
|
|
762
|
+
|
|
646
763
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getJobs", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
647
764
|
var auth, res;
|
|
648
765
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
@@ -658,6 +775,8 @@
|
|
|
658
775
|
res = _context.sent;
|
|
659
776
|
|
|
660
777
|
if (!___default['default'].isEmpty(res) && res[0].site === auth.site) {
|
|
778
|
+
_this.setRequesters(res);
|
|
779
|
+
|
|
661
780
|
_this.props.jobsLoaded(res);
|
|
662
781
|
}
|
|
663
782
|
|
|
@@ -789,6 +908,14 @@
|
|
|
789
908
|
_this.closeFilter();
|
|
790
909
|
});
|
|
791
910
|
|
|
911
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "selectPriorityFilter", function (filter) {
|
|
912
|
+
_this.setState({
|
|
913
|
+
selectedPriorityFilter: filter
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
_this.closeFilter();
|
|
917
|
+
});
|
|
918
|
+
|
|
792
919
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "selectStatusFilter", function (filter) {
|
|
793
920
|
_this.setState({
|
|
794
921
|
selectedStatusFilter: filter
|
|
@@ -893,6 +1020,33 @@
|
|
|
893
1020
|
_this.closeFilter();
|
|
894
1021
|
});
|
|
895
1022
|
|
|
1023
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectRequester", function (user) {
|
|
1024
|
+
_this.setState({
|
|
1025
|
+
selectedRequester: user
|
|
1026
|
+
});
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "removeRequesterFilter", function () {
|
|
1030
|
+
_this.setState({
|
|
1031
|
+
selectedRequesterFilter: null,
|
|
1032
|
+
selectedRequesterFilterText: null
|
|
1033
|
+
});
|
|
1034
|
+
});
|
|
1035
|
+
|
|
1036
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "saveRequesterFilter", function () {
|
|
1037
|
+
if (!_this.state.selectedRequester) {
|
|
1038
|
+
_this.removeRequesterFilter();
|
|
1039
|
+
} else {
|
|
1040
|
+
_this.setState({
|
|
1041
|
+
selectedRequesterFilter: _this.state.selectedRequester.id,
|
|
1042
|
+
selectedRequesterFilterText: _this.state.selectedRequester.displayName,
|
|
1043
|
+
selectedRequester: null
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
_this.closeFilter();
|
|
1048
|
+
});
|
|
1049
|
+
|
|
896
1050
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleSearchChange", function (event) {
|
|
897
1051
|
var thisSearchTime = moment__default['default']().valueOf();
|
|
898
1052
|
|
|
@@ -925,18 +1079,32 @@
|
|
|
925
1079
|
source = ___default['default'].filter(source, function (r) {
|
|
926
1080
|
return r.type === _this.state.selectedTypeFilter;
|
|
927
1081
|
});
|
|
1082
|
+
} // filter by priority
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
if (_this.state.selectedPriorityFilter) {
|
|
1086
|
+
var defaultPriority = getDefaultPriority().name;
|
|
1087
|
+
source = ___default['default'].filter(source, function (r) {
|
|
1088
|
+
return r.priority === _this.state.selectedPriorityFilter || _this.state.selectedPriorityFilter === defaultPriority && ___default['default'].isNil(r.priority);
|
|
1089
|
+
});
|
|
928
1090
|
} // filter by status
|
|
929
1091
|
|
|
930
1092
|
|
|
931
1093
|
if (_this.state.selectedStatusFilter) {
|
|
1094
|
+
var statusTypes = _this.props.statusTypes;
|
|
1095
|
+
var defaultStatus = statusTypes.find(function (s) {
|
|
1096
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
1097
|
+
});
|
|
932
1098
|
source = ___default['default'].filter(source, function (r) {
|
|
933
|
-
var status =
|
|
1099
|
+
var status = statusTypes.find(function (s) {
|
|
1100
|
+
return s.text === r.status;
|
|
1101
|
+
}) || defaultStatus;
|
|
934
1102
|
|
|
935
|
-
if (_this.state.selectedStatusFilter ===
|
|
936
|
-
return status !==
|
|
1103
|
+
if (_this.state.selectedStatusFilter === STATUS_IMCOMPLETE) {
|
|
1104
|
+
return status.category !== STATUS_COMPLETED;
|
|
937
1105
|
}
|
|
938
1106
|
|
|
939
|
-
return status === _this.state.selectedStatusFilter;
|
|
1107
|
+
return status.text === _this.state.selectedStatusFilter;
|
|
940
1108
|
});
|
|
941
1109
|
}
|
|
942
1110
|
|
|
@@ -946,6 +1114,12 @@
|
|
|
946
1114
|
});
|
|
947
1115
|
}
|
|
948
1116
|
|
|
1117
|
+
if (_this.state.selectedRequesterFilter) {
|
|
1118
|
+
source = ___default['default'].filter(source, function (r) {
|
|
1119
|
+
return r.userID === _this.state.selectedRequesterFilter;
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
|
|
949
1123
|
if (!___default['default'].isEmpty(_this.state.searchTerm)) {
|
|
950
1124
|
source = ___default['default'].filter(source, function (r) {
|
|
951
1125
|
if (r.jobId && r.jobId === _this.state.searchTerm) {
|
|
@@ -1027,6 +1201,7 @@
|
|
|
1027
1201
|
|
|
1028
1202
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getExportSource", function () {
|
|
1029
1203
|
var customColumns = [];
|
|
1204
|
+
var defaultPriority = getDefaultPriority().name;
|
|
1030
1205
|
|
|
1031
1206
|
var source = _this.getSource().map(function (r) {
|
|
1032
1207
|
var history = r.history || [];
|
|
@@ -1073,12 +1248,14 @@
|
|
|
1073
1248
|
|
|
1074
1249
|
var customFieldValues = _this.getCustomFields(r, customColumns);
|
|
1075
1250
|
|
|
1076
|
-
|
|
1251
|
+
var priority = r.priority || defaultPriority;
|
|
1252
|
+
return _objectSpread$6(_objectSpread$6(_objectSpread$6({}, r), customFieldValues), {}, {
|
|
1077
1253
|
notes: notes,
|
|
1078
1254
|
progressTime: progressTime,
|
|
1079
1255
|
completedTime: completedTime,
|
|
1080
1256
|
progressDuration: progressDuration,
|
|
1081
|
-
completedDuration: completedDuration
|
|
1257
|
+
completedDuration: completedDuration,
|
|
1258
|
+
priority: priority
|
|
1082
1259
|
});
|
|
1083
1260
|
}); // Compose revised columns list with custom fields
|
|
1084
1261
|
|
|
@@ -1117,7 +1294,8 @@
|
|
|
1117
1294
|
sortColumn: 'createdUnix',
|
|
1118
1295
|
sortDesc: true,
|
|
1119
1296
|
selectedTimeFilter: Analytics$2.getAnalyticsFilterOptions()[1],
|
|
1120
|
-
assignees: []
|
|
1297
|
+
assignees: [],
|
|
1298
|
+
requesters: []
|
|
1121
1299
|
};
|
|
1122
1300
|
_this.exportColumns = [{
|
|
1123
1301
|
label: 'Select All',
|
|
@@ -1134,6 +1312,9 @@
|
|
|
1134
1312
|
}, {
|
|
1135
1313
|
label: 'Status',
|
|
1136
1314
|
key: 'status'
|
|
1315
|
+
}, {
|
|
1316
|
+
label: 'Priority',
|
|
1317
|
+
key: 'priority'
|
|
1137
1318
|
}, {
|
|
1138
1319
|
label: 'Title',
|
|
1139
1320
|
key: 'title'
|
|
@@ -1174,11 +1355,12 @@
|
|
|
1174
1355
|
_createClass__default['default'](JobList, [{
|
|
1175
1356
|
key: "UNSAFE_componentWillMount",
|
|
1176
1357
|
value: function UNSAFE_componentWillMount() {
|
|
1177
|
-
Session$
|
|
1358
|
+
Session$7.checkLoggedIn(this);
|
|
1178
1359
|
}
|
|
1179
1360
|
}, {
|
|
1180
1361
|
key: "componentDidMount",
|
|
1181
1362
|
value: function componentDidMount() {
|
|
1363
|
+
this.props.jobStatusesUpdate(this.props.auth.site);
|
|
1182
1364
|
this.getJobs();
|
|
1183
1365
|
this.getAssignees();
|
|
1184
1366
|
}
|
|
@@ -1192,7 +1374,7 @@
|
|
|
1192
1374
|
}
|
|
1193
1375
|
|
|
1194
1376
|
if (this.state.filterOpen === 'type') {
|
|
1195
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1377
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1196
1378
|
title: "Select ".concat(values.textJobType),
|
|
1197
1379
|
maxWidth: 600,
|
|
1198
1380
|
minWidth: 400,
|
|
@@ -1203,7 +1385,7 @@
|
|
|
1203
1385
|
})), function (t) {
|
|
1204
1386
|
return t.toLowerCase();
|
|
1205
1387
|
}).map(function (type) {
|
|
1206
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1388
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1207
1389
|
key: type,
|
|
1208
1390
|
onClick: function onClick() {
|
|
1209
1391
|
_this2.selectTypeFilter(type);
|
|
@@ -1214,28 +1396,49 @@
|
|
|
1214
1396
|
}));
|
|
1215
1397
|
}
|
|
1216
1398
|
|
|
1399
|
+
if (this.state.filterOpen === 'priority') {
|
|
1400
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1401
|
+
title: "Select Priority",
|
|
1402
|
+
maxWidth: 600,
|
|
1403
|
+
minWidth: 400,
|
|
1404
|
+
hasPadding: true,
|
|
1405
|
+
onClose: this.closeFilter
|
|
1406
|
+
}, jobPriorityOptions.map(function (p) {
|
|
1407
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1408
|
+
key: p.name,
|
|
1409
|
+
onClick: function onClick() {
|
|
1410
|
+
_this2.selectPriorityFilter(p.name);
|
|
1411
|
+
},
|
|
1412
|
+
text: p.name,
|
|
1413
|
+
className: "marginRight-10"
|
|
1414
|
+
});
|
|
1415
|
+
}));
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1217
1418
|
if (this.state.filterOpen === 'status') {
|
|
1218
|
-
|
|
1419
|
+
var statusTypes = this.props.statusTypes;
|
|
1420
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1219
1421
|
title: "Select Status",
|
|
1220
1422
|
maxWidth: 600,
|
|
1221
1423
|
minWidth: 400,
|
|
1222
1424
|
hasPadding: true,
|
|
1223
1425
|
onClose: this.closeFilter
|
|
1224
|
-
}, [
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1426
|
+
}, [STATUS_IMCOMPLETE].concat(_toConsumableArray__default['default'](statusTypes.map(function (s) {
|
|
1427
|
+
return s.text;
|
|
1428
|
+
}))).map(function (status) {
|
|
1429
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1430
|
+
key: status,
|
|
1228
1431
|
onClick: function onClick() {
|
|
1229
|
-
_this2.selectStatusFilter(
|
|
1432
|
+
_this2.selectStatusFilter(status);
|
|
1230
1433
|
},
|
|
1231
|
-
text:
|
|
1232
|
-
className: "marginRight-10"
|
|
1434
|
+
text: status,
|
|
1435
|
+
className: "marginRight-10 marginBottom-10"
|
|
1233
1436
|
});
|
|
1234
1437
|
}));
|
|
1235
1438
|
}
|
|
1236
1439
|
|
|
1237
1440
|
if (this.state.filterOpen === 'time') {
|
|
1238
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1441
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1239
1442
|
title: "Select Time",
|
|
1240
1443
|
maxWidth: 600,
|
|
1241
1444
|
minWidth: 400,
|
|
@@ -1251,7 +1454,7 @@
|
|
|
1251
1454
|
style: {
|
|
1252
1455
|
minHeight: 150
|
|
1253
1456
|
}
|
|
1254
|
-
}, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1457
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$7.AnalyticsFilter, {
|
|
1255
1458
|
defaultFilter: this.state.selectedTimeFilter,
|
|
1256
1459
|
filterChanged: this.timeFilterChanged,
|
|
1257
1460
|
filterDateRangeChanged: this.timeFilterDateRangeChanged
|
|
@@ -1262,10 +1465,10 @@
|
|
|
1262
1465
|
var userContent = null;
|
|
1263
1466
|
|
|
1264
1467
|
if (this.state.selectedAssignee) {
|
|
1265
|
-
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1468
|
+
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1266
1469
|
key: this.state.selectedAssignee.id,
|
|
1267
1470
|
user: this.state.selectedAssignee,
|
|
1268
|
-
rightContent: /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1471
|
+
rightContent: /*#__PURE__*/React__default['default'].createElement(Components$7.SVGIcon, {
|
|
1269
1472
|
className: "removeIcon",
|
|
1270
1473
|
icon: "close",
|
|
1271
1474
|
onClick: function onClick() {
|
|
@@ -1275,7 +1478,7 @@
|
|
|
1275
1478
|
})
|
|
1276
1479
|
}));
|
|
1277
1480
|
} else {
|
|
1278
|
-
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1481
|
+
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.GenericInput, {
|
|
1279
1482
|
id: "userSearch",
|
|
1280
1483
|
type: "text" // label="Search"
|
|
1281
1484
|
,
|
|
@@ -1291,7 +1494,7 @@
|
|
|
1291
1494
|
if (___default['default'].isEmpty(_this2.state.userSearch)) return true;
|
|
1292
1495
|
return u.displayName.toUpperCase().indexOf(_this2.state.userSearch.toUpperCase()) > -1;
|
|
1293
1496
|
}).map(function (user) {
|
|
1294
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1497
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1295
1498
|
key: user.id,
|
|
1296
1499
|
user: user,
|
|
1297
1500
|
onClick: function onClick() {
|
|
@@ -1301,7 +1504,7 @@
|
|
|
1301
1504
|
}));
|
|
1302
1505
|
}
|
|
1303
1506
|
|
|
1304
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1507
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1305
1508
|
title: "Select User",
|
|
1306
1509
|
maxWidth: 600,
|
|
1307
1510
|
minWidth: 400,
|
|
@@ -1316,6 +1519,64 @@
|
|
|
1316
1519
|
}, userContent);
|
|
1317
1520
|
}
|
|
1318
1521
|
|
|
1522
|
+
if (this.state.filterOpen === 'requester') {
|
|
1523
|
+
var _userContent = null;
|
|
1524
|
+
|
|
1525
|
+
if (this.state.selectedRequester) {
|
|
1526
|
+
_userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1527
|
+
key: this.state.selectedRequester.id,
|
|
1528
|
+
user: this.state.selectedRequester,
|
|
1529
|
+
rightContent: /*#__PURE__*/React__default['default'].createElement(Components$7.SVGIcon, {
|
|
1530
|
+
className: "removeIcon",
|
|
1531
|
+
icon: "close",
|
|
1532
|
+
onClick: function onClick() {
|
|
1533
|
+
_this2.onSelectRequester();
|
|
1534
|
+
},
|
|
1535
|
+
colour: PlussCore.Colours.COLOUR_DUSK
|
|
1536
|
+
})
|
|
1537
|
+
}));
|
|
1538
|
+
} else {
|
|
1539
|
+
_userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.GenericInput, {
|
|
1540
|
+
id: "requesterSearch",
|
|
1541
|
+
type: "text" // label="Search"
|
|
1542
|
+
,
|
|
1543
|
+
placeholder: "Search name",
|
|
1544
|
+
value: this.state.requesterSearch,
|
|
1545
|
+
onChange: function onChange(e) {
|
|
1546
|
+
return _this2.onHandleChange(e);
|
|
1547
|
+
},
|
|
1548
|
+
alwaysShowLabel: true
|
|
1549
|
+
}), ___default['default'].sortBy(this.state.requesters, function (u) {
|
|
1550
|
+
return u.displayName.toUpperCase();
|
|
1551
|
+
}).filter(function (u) {
|
|
1552
|
+
if (___default['default'].isEmpty(_this2.state.requesterSearch)) return true;
|
|
1553
|
+
return u.displayName.toUpperCase().indexOf(_this2.state.requesterSearch.toUpperCase()) > -1;
|
|
1554
|
+
}).map(function (user) {
|
|
1555
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1556
|
+
key: user.id,
|
|
1557
|
+
user: user,
|
|
1558
|
+
onClick: function onClick() {
|
|
1559
|
+
_this2.onSelectRequester(user);
|
|
1560
|
+
}
|
|
1561
|
+
});
|
|
1562
|
+
}));
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1566
|
+
title: "Select User",
|
|
1567
|
+
maxWidth: 600,
|
|
1568
|
+
minWidth: 400,
|
|
1569
|
+
hasPadding: true,
|
|
1570
|
+
onClose: this.closeFilter,
|
|
1571
|
+
buttons: [{
|
|
1572
|
+
type: 'primaryAction',
|
|
1573
|
+
onClick: this.saveRequesterFilter,
|
|
1574
|
+
text: 'Select',
|
|
1575
|
+
isActive: true
|
|
1576
|
+
}]
|
|
1577
|
+
}, _userContent);
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1319
1580
|
return null;
|
|
1320
1581
|
}
|
|
1321
1582
|
}, {
|
|
@@ -1323,19 +1584,33 @@
|
|
|
1323
1584
|
value: function renderRequests() {
|
|
1324
1585
|
var _this3 = this;
|
|
1325
1586
|
|
|
1587
|
+
var statusTypes = this.props.statusTypes;
|
|
1588
|
+
var defaultStatus = statusTypes.find(function (s) {
|
|
1589
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
1590
|
+
});
|
|
1326
1591
|
return this.getSource().map(function (ev, index) {
|
|
1327
1592
|
if (!ev) {
|
|
1328
1593
|
return null;
|
|
1329
1594
|
}
|
|
1330
1595
|
|
|
1331
|
-
var status = ev.status &&
|
|
1596
|
+
var status = ev.status && statusTypes.find(function (s) {
|
|
1597
|
+
return s.text === ev.status;
|
|
1598
|
+
}) || defaultStatus;
|
|
1599
|
+
var priority = getJobPriority(ev.priority);
|
|
1332
1600
|
return /*#__PURE__*/React__default['default'].createElement("tr", {
|
|
1333
1601
|
key: index
|
|
1334
1602
|
}, /*#__PURE__*/React__default['default'].createElement("td", null, ev.jobId), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
1335
1603
|
className: "table-TitleColumn"
|
|
1336
1604
|
}, /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
|
|
1337
1605
|
to: "".concat(values.routeRequestDetails, "/").concat(ev.id)
|
|
1338
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", null, ev.title))), /*#__PURE__*/React__default['default'].createElement("td", null, ev.type), /*#__PURE__*/React__default['default'].createElement("td", null, moment__default['default'].utc(ev.createdTime).local().format('D MMM YY')), /*#__PURE__*/React__default['default'].createElement("td", null, ev.room), /*#__PURE__*/React__default['default'].createElement("td", null, ev.
|
|
1606
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, ev.title))), /*#__PURE__*/React__default['default'].createElement("td", null, ev.type), /*#__PURE__*/React__default['default'].createElement("td", null, moment__default['default'].utc(ev.createdTime).local().format('D MMM YY')), /*#__PURE__*/React__default['default'].createElement("td", null, ev.room), /*#__PURE__*/React__default['default'].createElement("td", null, ev.userName ? /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1607
|
+
user: {
|
|
1608
|
+
id: ev.userID,
|
|
1609
|
+
displayName: ev.userName,
|
|
1610
|
+
profilePic: ev.userProfilePic
|
|
1611
|
+
},
|
|
1612
|
+
textClass: "fontSize-13"
|
|
1613
|
+
}) : 'Unknown'), /*#__PURE__*/React__default['default'].createElement("td", null, ev.Assignee ? /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1339
1614
|
user: ev.Assignee,
|
|
1340
1615
|
textClass: "fontSize-13"
|
|
1341
1616
|
}) : 'Unassigned'), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -1346,9 +1621,19 @@
|
|
|
1346
1621
|
paddingTop: 2,
|
|
1347
1622
|
paddingBottom: 2,
|
|
1348
1623
|
color: '#fff',
|
|
1349
|
-
backgroundColor: status.color
|
|
1624
|
+
backgroundColor: status ? status.color : undefined
|
|
1350
1625
|
}
|
|
1351
|
-
}, status.text)), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
1626
|
+
}, status ? status.text : '')), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1627
|
+
style: {
|
|
1628
|
+
textAlign: 'center',
|
|
1629
|
+
borderRadius: 4,
|
|
1630
|
+
width: 100,
|
|
1631
|
+
paddingTop: 2,
|
|
1632
|
+
paddingBottom: 2,
|
|
1633
|
+
color: '#fff',
|
|
1634
|
+
backgroundColor: priority.color
|
|
1635
|
+
}
|
|
1636
|
+
}, priority.name)), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
1352
1637
|
className: "table-options"
|
|
1353
1638
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1354
1639
|
style: {
|
|
@@ -1364,7 +1649,7 @@
|
|
|
1364
1649
|
cursor: 'pointer'
|
|
1365
1650
|
},
|
|
1366
1651
|
name: "pencil"
|
|
1367
|
-
})), Session$
|
|
1652
|
+
})), Session$7.validateAccess(_this3.props.auth.site, values.permissionMaintenanceTracking, _this3.props.auth) && /*#__PURE__*/React__default['default'].createElement("a", {
|
|
1368
1653
|
onClick: function onClick() {
|
|
1369
1654
|
return _this3.onRemoveRequest(ev);
|
|
1370
1655
|
}
|
|
@@ -1492,6 +1777,15 @@
|
|
|
1492
1777
|
_this4.sortByCol('room');
|
|
1493
1778
|
}
|
|
1494
1779
|
}, "Address", this.renderSort('room')), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1780
|
+
className: "".concat(this.sortIsActive('userName')),
|
|
1781
|
+
style: {
|
|
1782
|
+
cursor: 'pointer',
|
|
1783
|
+
width: 150
|
|
1784
|
+
},
|
|
1785
|
+
onClick: function onClick() {
|
|
1786
|
+
_this4.sortByCol('userName');
|
|
1787
|
+
}
|
|
1788
|
+
}, "Submitted By", this.renderSort('userName')), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1495
1789
|
className: "".concat(this.sortIsActive('assigned')),
|
|
1496
1790
|
style: {
|
|
1497
1791
|
cursor: 'pointer',
|
|
@@ -1505,6 +1799,10 @@
|
|
|
1505
1799
|
width: 120
|
|
1506
1800
|
}
|
|
1507
1801
|
}, "Status"), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1802
|
+
style: {
|
|
1803
|
+
width: 120
|
|
1804
|
+
}
|
|
1805
|
+
}, "Priority"), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1508
1806
|
style: {
|
|
1509
1807
|
width: 50
|
|
1510
1808
|
}
|
|
@@ -1515,37 +1813,51 @@
|
|
|
1515
1813
|
value: function renderFilters() {
|
|
1516
1814
|
var _this5 = this;
|
|
1517
1815
|
|
|
1518
|
-
var typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1816
|
+
var typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1519
1817
|
className: "marginRight-10",
|
|
1520
1818
|
onClick: function onClick() {
|
|
1521
1819
|
_this5.openFilter('type');
|
|
1522
1820
|
},
|
|
1523
1821
|
text: values.textJobType
|
|
1524
1822
|
});
|
|
1525
|
-
var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1823
|
+
var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1526
1824
|
className: "marginRight-10",
|
|
1527
1825
|
onClick: function onClick() {
|
|
1528
1826
|
_this5.openFilter('status');
|
|
1529
1827
|
},
|
|
1530
1828
|
text: "Status"
|
|
1531
1829
|
});
|
|
1532
|
-
var
|
|
1830
|
+
var priorityFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1831
|
+
className: "marginRight-10",
|
|
1832
|
+
onClick: function onClick() {
|
|
1833
|
+
_this5.openFilter('priority');
|
|
1834
|
+
},
|
|
1835
|
+
text: "Priority"
|
|
1836
|
+
});
|
|
1837
|
+
var timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1533
1838
|
className: "marginRight-10",
|
|
1534
1839
|
onClick: function onClick() {
|
|
1535
1840
|
_this5.openFilter('time');
|
|
1536
1841
|
},
|
|
1537
1842
|
text: "Time"
|
|
1538
1843
|
});
|
|
1539
|
-
var userFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1844
|
+
var userFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1540
1845
|
className: "marginRight-10",
|
|
1541
1846
|
onClick: function onClick() {
|
|
1542
1847
|
_this5.openFilter('user');
|
|
1543
1848
|
},
|
|
1544
1849
|
text: "Assigned To"
|
|
1545
1850
|
});
|
|
1851
|
+
var requesterFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1852
|
+
className: "marginRight-10",
|
|
1853
|
+
onClick: function onClick() {
|
|
1854
|
+
_this5.openFilter('requester');
|
|
1855
|
+
},
|
|
1856
|
+
text: "Submitted By"
|
|
1857
|
+
});
|
|
1546
1858
|
|
|
1547
1859
|
if (this.state.selectedTypeFilter) {
|
|
1548
|
-
typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1860
|
+
typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1549
1861
|
className: "marginRight-10",
|
|
1550
1862
|
onClick: function onClick() {
|
|
1551
1863
|
_this5.openFilter('type');
|
|
@@ -1560,8 +1872,24 @@
|
|
|
1560
1872
|
});
|
|
1561
1873
|
}
|
|
1562
1874
|
|
|
1875
|
+
if (this.state.selectedPriorityFilter) {
|
|
1876
|
+
priorityFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1877
|
+
className: "marginRight-10",
|
|
1878
|
+
onClick: function onClick() {
|
|
1879
|
+
_this5.openFilter('priority');
|
|
1880
|
+
},
|
|
1881
|
+
rightIcon: "close",
|
|
1882
|
+
rightClick: function rightClick(e) {
|
|
1883
|
+
e.stopPropagation();
|
|
1884
|
+
|
|
1885
|
+
_this5.selectPriorityFilter();
|
|
1886
|
+
},
|
|
1887
|
+
text: this.state.selectedPriorityFilter
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1563
1891
|
if (this.state.selectedStatusFilter) {
|
|
1564
|
-
statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1892
|
+
statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1565
1893
|
className: "marginRight-10",
|
|
1566
1894
|
onClick: function onClick() {
|
|
1567
1895
|
_this5.openFilter('status');
|
|
@@ -1572,12 +1900,12 @@
|
|
|
1572
1900
|
|
|
1573
1901
|
_this5.selectStatusFilter();
|
|
1574
1902
|
},
|
|
1575
|
-
text: this.state.selectedStatusFilter
|
|
1903
|
+
text: this.state.selectedStatusFilter
|
|
1576
1904
|
});
|
|
1577
1905
|
}
|
|
1578
1906
|
|
|
1579
1907
|
if (this.state.selectedTimeFilterText) {
|
|
1580
|
-
timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1908
|
+
timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1581
1909
|
className: "marginRight-10",
|
|
1582
1910
|
onClick: function onClick() {
|
|
1583
1911
|
_this5.openFilter('time');
|
|
@@ -1593,7 +1921,7 @@
|
|
|
1593
1921
|
}
|
|
1594
1922
|
|
|
1595
1923
|
if (this.state.selectedUserFilter) {
|
|
1596
|
-
userFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1924
|
+
userFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1597
1925
|
className: "marginRight-10",
|
|
1598
1926
|
onClick: function onClick() {
|
|
1599
1927
|
_this5.openFilter('user');
|
|
@@ -1608,20 +1936,36 @@
|
|
|
1608
1936
|
});
|
|
1609
1937
|
}
|
|
1610
1938
|
|
|
1939
|
+
if (this.state.selectedRequesterFilter) {
|
|
1940
|
+
requesterFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1941
|
+
className: "marginRight-10",
|
|
1942
|
+
onClick: function onClick() {
|
|
1943
|
+
_this5.openFilter('requester');
|
|
1944
|
+
},
|
|
1945
|
+
rightIcon: "close",
|
|
1946
|
+
rightClick: function rightClick(e) {
|
|
1947
|
+
e.stopPropagation();
|
|
1948
|
+
|
|
1949
|
+
_this5.removeRequesterFilter();
|
|
1950
|
+
},
|
|
1951
|
+
text: this.state.selectedRequesterFilterText
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1611
1955
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1612
1956
|
className: "marginTop-20 flex flex-between flex-center"
|
|
1613
1957
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1614
1958
|
className: "flex flex-center"
|
|
1615
|
-
}, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1959
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$7.Text, {
|
|
1616
1960
|
type: "h5",
|
|
1617
1961
|
className: "marginRight-20"
|
|
1618
|
-
}, "Filter by"), typeFilter, statusFilter, timeFilter, userFilter), /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1962
|
+
}, "Filter by"), typeFilter, statusFilter, priorityFilter, timeFilter, userFilter, requesterFilter), /*#__PURE__*/React__default['default'].createElement(Components$7.Button, {
|
|
1619
1963
|
inline: true,
|
|
1620
1964
|
buttonType: "primaryAction",
|
|
1621
1965
|
leftIcon: "file-code-o",
|
|
1622
1966
|
onClick: this.onOpenExportCsv,
|
|
1623
1967
|
isActive: !___default['default'].isEmpty(this.getSource())
|
|
1624
|
-
}, "Export CSV")), /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1968
|
+
}, "Export CSV")), /*#__PURE__*/React__default['default'].createElement(Components$7.GenericInput, {
|
|
1625
1969
|
id: "search",
|
|
1626
1970
|
type: "text",
|
|
1627
1971
|
placeholder: "Search by ".concat(values.textEntityName, " ID, Address or Title"),
|
|
@@ -1646,7 +1990,7 @@
|
|
|
1646
1990
|
columns = _this$getExportSource.columns,
|
|
1647
1991
|
source = _this$getExportSource.source;
|
|
1648
1992
|
|
|
1649
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1993
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.ExportCsvPopup, {
|
|
1650
1994
|
onClose: this.onCloseExportCsv,
|
|
1651
1995
|
columns: columns,
|
|
1652
1996
|
source: source,
|
|
@@ -1667,30 +2011,32 @@
|
|
|
1667
2011
|
return JobList;
|
|
1668
2012
|
}(React.Component);
|
|
1669
2013
|
|
|
1670
|
-
var mapStateToProps$
|
|
2014
|
+
var mapStateToProps$7 = function mapStateToProps(state) {
|
|
1671
2015
|
var auth = state.auth;
|
|
1672
2016
|
return {
|
|
1673
2017
|
jobs: state[values.reducerKey].jobs,
|
|
1674
2018
|
auth: auth,
|
|
1675
|
-
strings: state.strings && state.strings.config || {}
|
|
2019
|
+
strings: state.strings && state.strings.config || {},
|
|
2020
|
+
statusTypes: state[values.reducerKey].jobstatuses
|
|
1676
2021
|
};
|
|
1677
2022
|
};
|
|
1678
2023
|
|
|
1679
|
-
var JobList$1 = reactRedux.connect(mapStateToProps$
|
|
2024
|
+
var JobList$1 = reactRedux.connect(mapStateToProps$7, {
|
|
1680
2025
|
jobsLoaded: jobsLoaded,
|
|
1681
|
-
removeJob: removeJob
|
|
2026
|
+
removeJob: removeJob,
|
|
2027
|
+
jobStatusesUpdate: jobStatusesUpdate
|
|
1682
2028
|
})(reactRouter.withRouter(JobList));
|
|
1683
2029
|
|
|
1684
|
-
function _createSuper$
|
|
2030
|
+
function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
1685
2031
|
|
|
1686
|
-
function _isNativeReflectConstruct$
|
|
1687
|
-
var Session$
|
|
1688
|
-
Components$
|
|
2032
|
+
function _isNativeReflectConstruct$b() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2033
|
+
var Session$6 = PlussCore__namespace.Session,
|
|
2034
|
+
Components$6 = PlussCore__namespace.Components;
|
|
1689
2035
|
|
|
1690
2036
|
var JobTypes = /*#__PURE__*/function (_Component) {
|
|
1691
2037
|
_inherits__default['default'](JobTypes, _Component);
|
|
1692
2038
|
|
|
1693
|
-
var _super = _createSuper$
|
|
2039
|
+
var _super = _createSuper$b(JobTypes);
|
|
1694
2040
|
|
|
1695
2041
|
function JobTypes(props) {
|
|
1696
2042
|
var _this;
|
|
@@ -1816,7 +2162,7 @@
|
|
|
1816
2162
|
key: "componentWillMount",
|
|
1817
2163
|
value: function componentWillMount() {
|
|
1818
2164
|
this.updateProps(this.props);
|
|
1819
|
-
Session$
|
|
2165
|
+
Session$6.checkLoggedIn(this, this.props.auth);
|
|
1820
2166
|
}
|
|
1821
2167
|
}, {
|
|
1822
2168
|
key: "componentDidMount",
|
|
@@ -1863,7 +2209,7 @@
|
|
|
1863
2209
|
display: 'flex',
|
|
1864
2210
|
alignItems: 'center'
|
|
1865
2211
|
}
|
|
1866
|
-
}, Session$
|
|
2212
|
+
}, Session$6.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
|
|
1867
2213
|
to: "".concat(values.routeAddRequestType, "/").concat(ev.id)
|
|
1868
2214
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
1869
2215
|
style: {
|
|
@@ -1873,7 +2219,7 @@
|
|
|
1873
2219
|
cursor: 'pointer'
|
|
1874
2220
|
},
|
|
1875
2221
|
name: "pencil"
|
|
1876
|
-
})), Session$
|
|
2222
|
+
})), Session$6.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React__default['default'].createElement("a", {
|
|
1877
2223
|
onClick: function onClick() {
|
|
1878
2224
|
return _this2.onRemoveJobType(ev);
|
|
1879
2225
|
}
|
|
@@ -1960,50 +2306,581 @@
|
|
|
1960
2306
|
maxWidth: 500,
|
|
1961
2307
|
textAlign: 'center'
|
|
1962
2308
|
}
|
|
1963
|
-
}, values.textEmptyJobTypesExample));
|
|
2309
|
+
}, values.textEmptyJobTypesExample));
|
|
2310
|
+
}
|
|
2311
|
+
}, {
|
|
2312
|
+
key: "renderContent",
|
|
2313
|
+
value: function renderContent() {
|
|
2314
|
+
if (___default['default'].isEmpty(this.state.jobList)) return this.renderEmpty();
|
|
2315
|
+
return this.renderView();
|
|
2316
|
+
}
|
|
2317
|
+
}, {
|
|
2318
|
+
key: "renderJobTypes",
|
|
2319
|
+
value: function renderJobTypes() {
|
|
2320
|
+
var _this$state = this.state,
|
|
2321
|
+
jobList = _this$state.jobList,
|
|
2322
|
+
loading = _this$state.loading;
|
|
2323
|
+
|
|
2324
|
+
if (jobList.length === 0 && loading) {
|
|
2325
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2326
|
+
style: {
|
|
2327
|
+
minWidth: '100%'
|
|
2328
|
+
}
|
|
2329
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2330
|
+
className: "padding-60 paddingVertical-40",
|
|
2331
|
+
style: {
|
|
2332
|
+
textAlign: 'center'
|
|
2333
|
+
}
|
|
2334
|
+
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2335
|
+
style: {
|
|
2336
|
+
fontSize: 30,
|
|
2337
|
+
color: FeatureConfig.env.colourBrandingOff
|
|
2338
|
+
},
|
|
2339
|
+
name: "spinner fa-pulse fa-fw"
|
|
2340
|
+
})));
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2344
|
+
style: {
|
|
2345
|
+
minWidth: '100%'
|
|
2346
|
+
}
|
|
2347
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2348
|
+
className: "marginBottom-32"
|
|
2349
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$6.AddButton, {
|
|
2350
|
+
onClick: this.props.onNew,
|
|
2351
|
+
text: values.textNewTypeButton
|
|
2352
|
+
})), this.renderContent());
|
|
2353
|
+
}
|
|
2354
|
+
}, {
|
|
2355
|
+
key: "render",
|
|
2356
|
+
value: function render() {
|
|
2357
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2358
|
+
style: {
|
|
2359
|
+
minWidth: '100%'
|
|
2360
|
+
}
|
|
2361
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, this.renderJobTypes()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2362
|
+
className: "hub_tidioPadding"
|
|
2363
|
+
}));
|
|
2364
|
+
}
|
|
2365
|
+
}]);
|
|
2366
|
+
|
|
2367
|
+
return JobTypes;
|
|
2368
|
+
}(React.Component);
|
|
2369
|
+
|
|
2370
|
+
var mapStateToProps$6 = function mapStateToProps(state) {
|
|
2371
|
+
var auth = state.auth;
|
|
2372
|
+
return {
|
|
2373
|
+
jobtypes: state[values.reducerKey].jobtypes,
|
|
2374
|
+
auth: auth
|
|
2375
|
+
};
|
|
2376
|
+
};
|
|
2377
|
+
|
|
2378
|
+
var JobTypes$1 = reactRedux.connect(mapStateToProps$6, {
|
|
2379
|
+
jobTypesLoaded: jobTypesLoaded,
|
|
2380
|
+
jobTypesUpdate: jobTypesUpdate
|
|
2381
|
+
})(reactRouter.withRouter(JobTypes));
|
|
2382
|
+
|
|
2383
|
+
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2384
|
+
|
|
2385
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2386
|
+
|
|
2387
|
+
function _createSuper$a(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
2388
|
+
|
|
2389
|
+
function _isNativeReflectConstruct$a() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2390
|
+
var Session$5 = PlussCore__namespace.Session,
|
|
2391
|
+
Components$5 = PlussCore__namespace.Components,
|
|
2392
|
+
Colours$2 = PlussCore__namespace.Colours;
|
|
2393
|
+
|
|
2394
|
+
var Configuration = /*#__PURE__*/function (_Component) {
|
|
2395
|
+
_inherits__default['default'](Configuration, _Component);
|
|
2396
|
+
|
|
2397
|
+
var _super = _createSuper$a(Configuration);
|
|
2398
|
+
|
|
2399
|
+
function Configuration(props) {
|
|
2400
|
+
var _this;
|
|
2401
|
+
|
|
2402
|
+
_classCallCheck__default['default'](this, Configuration);
|
|
2403
|
+
|
|
2404
|
+
_this = _super.call(this, props);
|
|
2405
|
+
|
|
2406
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "isStatusValid", function (statusLabel, statusCategory, statusColour) {
|
|
2407
|
+
if (___default['default'].isEmpty(statusLabel)) return false;
|
|
2408
|
+
if (___default['default'].isEmpty(statusCategory)) return false;
|
|
2409
|
+
if (___default['default'].isEmpty(statusColour)) return false;
|
|
2410
|
+
return true;
|
|
2411
|
+
});
|
|
2412
|
+
|
|
2413
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onMoveStatus", function (index) {
|
|
2414
|
+
var up = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2415
|
+
if (_this.state.fetchingStatusTypes) return;
|
|
2416
|
+
|
|
2417
|
+
var statusTypes = ___default['default'].cloneDeep(_this.state.statusTypes);
|
|
2418
|
+
|
|
2419
|
+
if (up && index > 0) {
|
|
2420
|
+
// Moving up
|
|
2421
|
+
var _ref = [statusTypes[index], statusTypes[index - 1]];
|
|
2422
|
+
statusTypes[index - 1] = _ref[0];
|
|
2423
|
+
statusTypes[index] = _ref[1];
|
|
2424
|
+
} else if (index < statusTypes.length - 1) {
|
|
2425
|
+
// Moving down
|
|
2426
|
+
var _ref2 = [statusTypes[index + 1], statusTypes[index]];
|
|
2427
|
+
statusTypes[index] = _ref2[0];
|
|
2428
|
+
statusTypes[index + 1] = _ref2[1];
|
|
2429
|
+
} // Reset order
|
|
2430
|
+
|
|
2431
|
+
|
|
2432
|
+
statusTypes.forEach(function (status, index) {
|
|
2433
|
+
return status.order = index;
|
|
2434
|
+
});
|
|
2435
|
+
|
|
2436
|
+
_this.setState({
|
|
2437
|
+
statusTypes: statusTypes
|
|
2438
|
+
});
|
|
2439
|
+
});
|
|
2440
|
+
|
|
2441
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onEditStatus", function (index) {
|
|
2442
|
+
if (_this.state.fetchingStatusTypes) return;
|
|
2443
|
+
var status = _this.state.statusTypes[index];
|
|
2444
|
+
|
|
2445
|
+
_this.setState({
|
|
2446
|
+
showWarnings: false,
|
|
2447
|
+
showStatusPopup: true,
|
|
2448
|
+
selectedStatusIndex: index,
|
|
2449
|
+
statusLabel: status.text,
|
|
2450
|
+
statusCategory: status.category,
|
|
2451
|
+
statusColour: status.color
|
|
2452
|
+
});
|
|
2453
|
+
});
|
|
2454
|
+
|
|
2455
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteStatus", function (index) {
|
|
2456
|
+
if (_this.state.fetchingStatusTypes) return;
|
|
2457
|
+
|
|
2458
|
+
var statusTypes = ___default['default'].cloneDeep(_this.state.statusTypes);
|
|
2459
|
+
|
|
2460
|
+
statusTypes.splice(index, 1);
|
|
2461
|
+
|
|
2462
|
+
_this.setState({
|
|
2463
|
+
statusTypes: statusTypes
|
|
2464
|
+
});
|
|
2465
|
+
});
|
|
2466
|
+
|
|
2467
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddStatus", function () {
|
|
2468
|
+
var defaultStatus = _this.props.statusTypes.find(function (s) {
|
|
2469
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
2470
|
+
});
|
|
2471
|
+
|
|
2472
|
+
_this.setState({
|
|
2473
|
+
showWarnings: false,
|
|
2474
|
+
showStatusPopup: true,
|
|
2475
|
+
selectedStatusIndex: -1,
|
|
2476
|
+
statusLabel: '',
|
|
2477
|
+
statusCategory: STATUS_NOT_ACTIONED,
|
|
2478
|
+
statusColour: defaultStatus.color
|
|
2479
|
+
});
|
|
2480
|
+
});
|
|
2481
|
+
|
|
2482
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSaveStatus", function () {
|
|
2483
|
+
var _this$state = _this.state,
|
|
2484
|
+
selectedStatusIndex = _this$state.selectedStatusIndex,
|
|
2485
|
+
statusLabel = _this$state.statusLabel,
|
|
2486
|
+
statusCategory = _this$state.statusCategory,
|
|
2487
|
+
statusColour = _this$state.statusColour;
|
|
2488
|
+
|
|
2489
|
+
var statusTypes = ___default['default'].cloneDeep(_this.state.statusTypes);
|
|
2490
|
+
|
|
2491
|
+
if (selectedStatusIndex < 0) {
|
|
2492
|
+
statusTypes.push({
|
|
2493
|
+
text: statusLabel,
|
|
2494
|
+
order: statusTypes.length,
|
|
2495
|
+
color: statusColour,
|
|
2496
|
+
category: statusCategory
|
|
2497
|
+
});
|
|
2498
|
+
} else {
|
|
2499
|
+
var status = statusTypes[selectedStatusIndex];
|
|
2500
|
+
status.text = statusLabel;
|
|
2501
|
+
status.color = statusColour;
|
|
2502
|
+
status.category = statusCategory;
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
_this.setState({
|
|
2506
|
+
statusTypes: statusTypes,
|
|
2507
|
+
showStatusPopup: false
|
|
2508
|
+
});
|
|
2509
|
+
});
|
|
2510
|
+
|
|
2511
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHideStatusPopup", function () {
|
|
2512
|
+
if (_this.state.submitting) return;
|
|
2513
|
+
|
|
2514
|
+
_this.setState({
|
|
2515
|
+
showStatusPopup: false
|
|
2516
|
+
});
|
|
2517
|
+
});
|
|
2518
|
+
|
|
2519
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
2520
|
+
var stateChange = {};
|
|
2521
|
+
stateChange[event.target.getAttribute('id')] = event.target.value;
|
|
2522
|
+
|
|
2523
|
+
_this.setState(stateChange);
|
|
2524
|
+
});
|
|
2525
|
+
|
|
2526
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onToggleDisableSeen", function () {
|
|
2527
|
+
if (_this.state.fetchingHideSeen) return;
|
|
2528
|
+
|
|
2529
|
+
_this.setState({
|
|
2530
|
+
hideSeen: !_this.state.hideSeen
|
|
2531
|
+
});
|
|
2532
|
+
});
|
|
2533
|
+
|
|
2534
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSaveConfig", function () {
|
|
2535
|
+
if (!_this.validateForm()) return;
|
|
2536
|
+
|
|
2537
|
+
_this.setState({
|
|
2538
|
+
success: false,
|
|
2539
|
+
submitting: true
|
|
2540
|
+
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
2541
|
+
var _this$state2, statusTypes, hideSeen;
|
|
2542
|
+
|
|
2543
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2544
|
+
while (1) {
|
|
2545
|
+
switch (_context.prev = _context.next) {
|
|
2546
|
+
case 0:
|
|
2547
|
+
_context.prev = 0;
|
|
2548
|
+
_this$state2 = _this.state, statusTypes = _this$state2.statusTypes, hideSeen = _this$state2.hideSeen;
|
|
2549
|
+
_context.next = 4;
|
|
2550
|
+
return stringActions.setString(_this.props.auth.site, values.stringConfigJobStatus, statusTypes);
|
|
2551
|
+
|
|
2552
|
+
case 4:
|
|
2553
|
+
_context.next = 6;
|
|
2554
|
+
return stringActions.setString(_this.props.auth.site, values.stringConfigHideSeen, hideSeen);
|
|
2555
|
+
|
|
2556
|
+
case 6:
|
|
2557
|
+
_this.props.jobStatusesLoaded(statusTypes);
|
|
2558
|
+
|
|
2559
|
+
_this.props.jobHideSeenLoaded(hideSeen);
|
|
2560
|
+
|
|
2561
|
+
_this.setState({
|
|
2562
|
+
success: true
|
|
2563
|
+
});
|
|
2564
|
+
|
|
2565
|
+
_context.next = 15;
|
|
2566
|
+
break;
|
|
2567
|
+
|
|
2568
|
+
case 11:
|
|
2569
|
+
_context.prev = 11;
|
|
2570
|
+
_context.t0 = _context["catch"](0);
|
|
2571
|
+
console.log('onSaveConfig - error', _context.t0);
|
|
2572
|
+
|
|
2573
|
+
_this.setState({
|
|
2574
|
+
success: false
|
|
2575
|
+
});
|
|
2576
|
+
|
|
2577
|
+
case 15:
|
|
2578
|
+
_context.prev = 15;
|
|
2579
|
+
|
|
2580
|
+
_this.setState({
|
|
2581
|
+
submitting: false
|
|
2582
|
+
});
|
|
2583
|
+
|
|
2584
|
+
return _context.finish(15);
|
|
2585
|
+
|
|
2586
|
+
case 18:
|
|
2587
|
+
case "end":
|
|
2588
|
+
return _context.stop();
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
}, _callee, null, [[0, 11, 15, 18]]);
|
|
2592
|
+
})));
|
|
2593
|
+
});
|
|
2594
|
+
|
|
2595
|
+
_this.state = {
|
|
2596
|
+
success: false,
|
|
2597
|
+
submitting: false,
|
|
2598
|
+
selectedStatusIndex: -1,
|
|
2599
|
+
showStatusPopup: false,
|
|
2600
|
+
statusLabel: '',
|
|
2601
|
+
statusCategory: STATUS_NOT_ACTIONED,
|
|
2602
|
+
statusColour: '',
|
|
2603
|
+
fetchingStatusTypes: true,
|
|
2604
|
+
statusTypes: _this.props.statusTypes,
|
|
2605
|
+
fetchingHideSeen: true,
|
|
2606
|
+
hideSeen: _this.props.hideSeen
|
|
2607
|
+
};
|
|
2608
|
+
return _this;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
_createClass__default['default'](Configuration, [{
|
|
2612
|
+
key: "UNSAFE_componentWillMount",
|
|
2613
|
+
value: function UNSAFE_componentWillMount() {
|
|
2614
|
+
Session$5.checkLoggedIn(this);
|
|
2615
|
+
}
|
|
2616
|
+
}, {
|
|
2617
|
+
key: "componentDidMount",
|
|
2618
|
+
value: function componentDidMount() {
|
|
2619
|
+
var _this2 = this;
|
|
2620
|
+
|
|
2621
|
+
if (!Session$5.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth, true)) {
|
|
2622
|
+
this.props.history.push('/mastermenu');
|
|
2623
|
+
} else {
|
|
2624
|
+
this.props.jobStatusesUpdate(this.props.auth.site, function (statusTypes) {
|
|
2625
|
+
return _this2.setState({
|
|
2626
|
+
statusTypes: statusTypes,
|
|
2627
|
+
fetchingStatusTypes: false
|
|
2628
|
+
});
|
|
2629
|
+
});
|
|
2630
|
+
this.props.jobHideSeenUpdate(this.props.auth.site, function (hideSeen) {
|
|
2631
|
+
return _this2.setState({
|
|
2632
|
+
hideSeen: hideSeen,
|
|
2633
|
+
fetchingHideSeen: false
|
|
2634
|
+
});
|
|
2635
|
+
});
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
}, {
|
|
2639
|
+
key: "validateForm",
|
|
2640
|
+
value: function validateForm() {
|
|
2641
|
+
var _this3 = this;
|
|
2642
|
+
|
|
2643
|
+
var _this$state3 = this.state,
|
|
2644
|
+
submitting = _this$state3.submitting,
|
|
2645
|
+
statusTypes = _this$state3.statusTypes;
|
|
2646
|
+
if (submitting) return false; // Validate statuses
|
|
2647
|
+
|
|
2648
|
+
var statusesValid = statusTypes.map(function (status) {
|
|
2649
|
+
var text = status.text,
|
|
2650
|
+
category = status.category,
|
|
2651
|
+
color = status.color;
|
|
2652
|
+
return _this3.isStatusValid(text, category, color);
|
|
2653
|
+
});
|
|
2654
|
+
if (!statusesValid.every(function (valid) {
|
|
2655
|
+
return valid;
|
|
2656
|
+
})) return false;
|
|
2657
|
+
return true;
|
|
2658
|
+
}
|
|
2659
|
+
}, {
|
|
2660
|
+
key: "renderStatuses",
|
|
2661
|
+
value: function renderStatuses() {
|
|
2662
|
+
var _this4 = this;
|
|
2663
|
+
|
|
2664
|
+
var statusTypes = this.state.statusTypes;
|
|
2665
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
2666
|
+
className: "fontMedium fontSize-36 text-dark"
|
|
2667
|
+
}, "Statuses"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2668
|
+
style: styles$6.statusCategoryHeading
|
|
2669
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2670
|
+
className: "fontMedium fontSize-16 text-bold"
|
|
2671
|
+
}, "Status Category")), statusTypes.map(function (status, index) {
|
|
2672
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2673
|
+
key: "".concat(status.text, "_").concat(index),
|
|
2674
|
+
style: styles$6.statusTypeContainer
|
|
2675
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2676
|
+
key: status.text,
|
|
2677
|
+
className: "statusLabel",
|
|
2678
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.statusTextContainer), {}, {
|
|
2679
|
+
backgroundColor: status.color
|
|
2680
|
+
})
|
|
2681
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2682
|
+
className: "statusLabel_text"
|
|
2683
|
+
}, status.text)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2684
|
+
style: styles$6.statusCategoryContainer
|
|
2685
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2686
|
+
className: "fontMedium fontSize-16 text-dark"
|
|
2687
|
+
}, status.category)), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2688
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
|
|
2689
|
+
visibility: index === 0 ? 'hidden' : 'visible'
|
|
2690
|
+
}),
|
|
2691
|
+
name: 'arrow-up',
|
|
2692
|
+
onClick: function onClick() {
|
|
2693
|
+
return _this4.onMoveStatus(index, true);
|
|
2694
|
+
}
|
|
2695
|
+
}), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2696
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
|
|
2697
|
+
visibility: index === statusTypes.length - 1 ? 'hidden' : 'visible'
|
|
2698
|
+
}),
|
|
2699
|
+
name: 'arrow-down',
|
|
2700
|
+
onClick: function onClick() {
|
|
2701
|
+
return _this4.onMoveStatus(index, false);
|
|
2702
|
+
}
|
|
2703
|
+
}), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2704
|
+
style: _objectSpread$5({}, styles$6.statusIcon),
|
|
2705
|
+
name: "pencil",
|
|
2706
|
+
onClick: function onClick() {
|
|
2707
|
+
return _this4.onEditStatus(index);
|
|
2708
|
+
}
|
|
2709
|
+
}), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2710
|
+
style: _objectSpread$5({}, styles$6.statusIcon),
|
|
2711
|
+
name: "minus-circle",
|
|
2712
|
+
onClick: function onClick() {
|
|
2713
|
+
return _this4.onDeleteStatus(index);
|
|
2714
|
+
}
|
|
2715
|
+
}));
|
|
2716
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2717
|
+
onClick: this.onAddStatus,
|
|
2718
|
+
style: {
|
|
2719
|
+
display: 'flex',
|
|
2720
|
+
flexDirection: 'row',
|
|
2721
|
+
alignItems: 'center',
|
|
2722
|
+
marginTop: 16
|
|
2723
|
+
}
|
|
2724
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$5.P60Icon, {
|
|
2725
|
+
className: "addoption_plus",
|
|
2726
|
+
icon: "add",
|
|
2727
|
+
style: {
|
|
2728
|
+
fontSize: 12
|
|
2729
|
+
}
|
|
2730
|
+
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
2731
|
+
className: "addoption_text"
|
|
2732
|
+
}, "Add another status")));
|
|
1964
2733
|
}
|
|
1965
2734
|
}, {
|
|
1966
|
-
key: "
|
|
1967
|
-
value: function
|
|
1968
|
-
|
|
1969
|
-
|
|
2735
|
+
key: "renderOtherOptions",
|
|
2736
|
+
value: function renderOtherOptions() {
|
|
2737
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2738
|
+
className: "marginTop-55"
|
|
2739
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
2740
|
+
className: "fontMedium fontSize-36 text-dark"
|
|
2741
|
+
}, "Other options"), /*#__PURE__*/React__default['default'].createElement(Components$5.CheckBox, {
|
|
2742
|
+
label: "Disable whether a request has been \"Seen\" and prevent that from being surfaced to the App user",
|
|
2743
|
+
isActive: this.state.hideSeen,
|
|
2744
|
+
onChange: this.onToggleDisableSeen
|
|
2745
|
+
}));
|
|
1970
2746
|
}
|
|
1971
2747
|
}, {
|
|
1972
|
-
key: "
|
|
1973
|
-
value: function
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
2748
|
+
key: "renderSubmit",
|
|
2749
|
+
value: function renderSubmit() {
|
|
2750
|
+
if (this.state.submitting) {
|
|
2751
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$5.Button, {
|
|
2752
|
+
buttonType: "secondary"
|
|
2753
|
+
}, "Saving...");
|
|
2754
|
+
}
|
|
1977
2755
|
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2756
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$5.Button, {
|
|
2757
|
+
inline: true,
|
|
2758
|
+
buttonType: "primary",
|
|
2759
|
+
onClick: this.onSaveConfig,
|
|
2760
|
+
isActive: this.validateForm()
|
|
2761
|
+
}, "Save");
|
|
2762
|
+
}
|
|
2763
|
+
}, {
|
|
2764
|
+
key: "renderSuccess",
|
|
2765
|
+
value: function renderSuccess() {
|
|
2766
|
+
if (!this.state.success) return null;
|
|
2767
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2768
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.savedText), {}, {
|
|
2769
|
+
color: Colours$2.COLOUR_GREEN
|
|
2770
|
+
})
|
|
2771
|
+
}, "Saved");
|
|
2772
|
+
}
|
|
2773
|
+
}, {
|
|
2774
|
+
key: "renderNewStatusPopup",
|
|
2775
|
+
value: function renderNewStatusPopup() {
|
|
2776
|
+
var _ref4,
|
|
2777
|
+
_this5 = this;
|
|
2778
|
+
|
|
2779
|
+
var _this$state4 = this.state,
|
|
2780
|
+
submitting = _this$state4.submitting,
|
|
2781
|
+
showStatusPopup = _this$state4.showStatusPopup,
|
|
2782
|
+
showWarnings = _this$state4.showWarnings,
|
|
2783
|
+
selectedStatusIndex = _this$state4.selectedStatusIndex,
|
|
2784
|
+
statusLabel = _this$state4.statusLabel,
|
|
2785
|
+
statusCategory = _this$state4.statusCategory,
|
|
2786
|
+
statusColour = _this$state4.statusColour;
|
|
2787
|
+
if (!showStatusPopup) return null;
|
|
2788
|
+
var canSave = !submitting && this.isStatusValid(statusLabel, statusCategory, statusColour);
|
|
2789
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$5.Popup, {
|
|
2790
|
+
maxWidth: 800,
|
|
2791
|
+
minWidth: 450,
|
|
2792
|
+
hasPadding: true,
|
|
2793
|
+
buttons: [(_ref4 = {
|
|
2794
|
+
type: 'primaryAction',
|
|
2795
|
+
onClick: this.onSaveStatus,
|
|
2796
|
+
isActive: canSave
|
|
2797
|
+
}, _defineProperty__default['default'](_ref4, "isActive", true), _defineProperty__default['default'](_ref4, "text", submitting ? 'Saving...' : 'Save'), _defineProperty__default['default'](_ref4, "className", 'popupButton'), _ref4), {
|
|
2798
|
+
type: 'outlinedAction',
|
|
2799
|
+
onClick: this.onHideStatusPopup,
|
|
2800
|
+
isActive: !submitting,
|
|
2801
|
+
text: 'Cancel',
|
|
2802
|
+
className: 'popupButton'
|
|
2803
|
+
}],
|
|
2804
|
+
onClose: this.onHideStatusPopup,
|
|
2805
|
+
title: selectedStatusIndex < 0 ? 'New Status' : 'Edit Status'
|
|
2806
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$5.GenericInput, {
|
|
2807
|
+
id: "statusLabel",
|
|
2808
|
+
type: "text",
|
|
2809
|
+
label: "Label",
|
|
2810
|
+
placeholder: "Status label",
|
|
2811
|
+
value: statusLabel,
|
|
2812
|
+
onChange: this.onHandleChange,
|
|
2813
|
+
isRequired: true,
|
|
2814
|
+
isValid: function isValid() {
|
|
2815
|
+
return !___default['default'].isEmpty(statusLabel);
|
|
2816
|
+
},
|
|
2817
|
+
showError: function showError() {
|
|
2818
|
+
return showWarnings && ___default['default'].isEmpty(statusLabel);
|
|
2819
|
+
},
|
|
2820
|
+
alwaysShowLabel: true,
|
|
2821
|
+
className: "marginBottom-20"
|
|
2822
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components$5.RadioButton, {
|
|
2823
|
+
label: "Status Category",
|
|
2824
|
+
subLabel: /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2825
|
+
className: "marginBottom-16"
|
|
1983
2826
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1984
|
-
className: "
|
|
1985
|
-
|
|
1986
|
-
|
|
2827
|
+
className: "marginBottom-4"
|
|
2828
|
+
}, 'This is used to categorise statuses for filtering and analytics purposes'), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2829
|
+
className: "text-bold"
|
|
2830
|
+
}, 'This status is considered')),
|
|
2831
|
+
className: "marginBottom-20",
|
|
2832
|
+
rowStyle: {
|
|
2833
|
+
flexDirection: 'column'
|
|
2834
|
+
},
|
|
2835
|
+
buttonStyle: {
|
|
2836
|
+
marginBottom: 8
|
|
2837
|
+
},
|
|
2838
|
+
isActive: statusCategory || null,
|
|
2839
|
+
options: [{
|
|
2840
|
+
Label: STATUS_NOT_ACTIONED,
|
|
2841
|
+
Value: STATUS_NOT_ACTIONED,
|
|
2842
|
+
onChange: function onChange() {
|
|
2843
|
+
return _this5.setState({
|
|
2844
|
+
statusCategory: STATUS_NOT_ACTIONED
|
|
2845
|
+
});
|
|
1987
2846
|
}
|
|
1988
|
-
},
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2847
|
+
}, {
|
|
2848
|
+
Label: STATUS_IN_PROGRESS,
|
|
2849
|
+
Value: STATUS_IN_PROGRESS,
|
|
2850
|
+
onChange: function onChange() {
|
|
2851
|
+
return _this5.setState({
|
|
2852
|
+
statusCategory: STATUS_IN_PROGRESS
|
|
2853
|
+
});
|
|
2854
|
+
}
|
|
2855
|
+
}, {
|
|
2856
|
+
Label: STATUS_COMPLETED,
|
|
2857
|
+
Value: STATUS_COMPLETED,
|
|
2858
|
+
onChange: function onChange() {
|
|
2859
|
+
return _this5.setState({
|
|
2860
|
+
statusCategory: STATUS_COMPLETED
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2863
|
+
}]
|
|
2864
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components$5.ColourOptions, {
|
|
2865
|
+
options: ['vibrant', 'picker'],
|
|
2866
|
+
defaultTab: "vibrant",
|
|
2867
|
+
value: statusColour,
|
|
2868
|
+
onColourSelected: function onColourSelected(statusColour) {
|
|
2869
|
+
return _this5.setState({
|
|
2870
|
+
statusColour: statusColour
|
|
2871
|
+
});
|
|
2000
2872
|
}
|
|
2873
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2874
|
+
className: "marginTop-24"
|
|
2001
2875
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2002
|
-
className: "marginBottom-
|
|
2003
|
-
}, /*#__PURE__*/React__default['default'].createElement(Components$5.
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2876
|
+
className: "fieldLabel marginBottom-4"
|
|
2877
|
+
}, "Preview"), /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
|
|
2878
|
+
text: this.state.statusLabel,
|
|
2879
|
+
style: {
|
|
2880
|
+
backgroundColor: statusColour,
|
|
2881
|
+
borderColor: statusColour
|
|
2882
|
+
}
|
|
2883
|
+
})));
|
|
2007
2884
|
}
|
|
2008
2885
|
}, {
|
|
2009
2886
|
key: "render",
|
|
@@ -2012,27 +2889,68 @@
|
|
|
2012
2889
|
style: {
|
|
2013
2890
|
minWidth: '100%'
|
|
2014
2891
|
}
|
|
2015
|
-
},
|
|
2016
|
-
|
|
2017
|
-
|
|
2892
|
+
}, this.renderStatuses(), this.renderOtherOptions(), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2893
|
+
style: {
|
|
2894
|
+
paddingTop: 24,
|
|
2895
|
+
paddingBottom: 24
|
|
2896
|
+
}
|
|
2897
|
+
}, this.renderSubmit(), this.renderSuccess()), this.renderNewStatusPopup());
|
|
2018
2898
|
}
|
|
2019
2899
|
}]);
|
|
2020
2900
|
|
|
2021
|
-
return
|
|
2901
|
+
return Configuration;
|
|
2022
2902
|
}(React.Component);
|
|
2023
2903
|
|
|
2904
|
+
var styles$6 = {
|
|
2905
|
+
statusCategoryHeading: {
|
|
2906
|
+
marginLeft: 130,
|
|
2907
|
+
width: 160,
|
|
2908
|
+
textAlign: 'center',
|
|
2909
|
+
marginBottom: 12
|
|
2910
|
+
},
|
|
2911
|
+
statusTypeContainer: {
|
|
2912
|
+
display: 'flex',
|
|
2913
|
+
flexDirection: 'row',
|
|
2914
|
+
alignItems: 'center',
|
|
2915
|
+
marginBottom: 20
|
|
2916
|
+
},
|
|
2917
|
+
statusTextContainer: {
|
|
2918
|
+
width: 130
|
|
2919
|
+
},
|
|
2920
|
+
statusCategoryContainer: {
|
|
2921
|
+
width: 160,
|
|
2922
|
+
textAlign: 'center'
|
|
2923
|
+
},
|
|
2924
|
+
statusIcon: {
|
|
2925
|
+
cursor: 'pointer',
|
|
2926
|
+
fontSize: 20,
|
|
2927
|
+
padding: 5,
|
|
2928
|
+
marginLeft: 10,
|
|
2929
|
+
color: Colours$2.COLOUR_BRANDING_ACTION,
|
|
2930
|
+
visibility: 'visible'
|
|
2931
|
+
},
|
|
2932
|
+
savedText: {
|
|
2933
|
+
fontSize: 14,
|
|
2934
|
+
lineHeight: '33px',
|
|
2935
|
+
marginLeft: 15
|
|
2936
|
+
}
|
|
2937
|
+
};
|
|
2938
|
+
|
|
2024
2939
|
var mapStateToProps$5 = function mapStateToProps(state) {
|
|
2025
2940
|
var auth = state.auth;
|
|
2026
2941
|
return {
|
|
2027
|
-
|
|
2028
|
-
|
|
2942
|
+
auth: auth,
|
|
2943
|
+
statusTypes: state[values.reducerKey].jobstatuses,
|
|
2944
|
+
hideSeen: state[values.reducerKey].hideSeen
|
|
2029
2945
|
};
|
|
2030
2946
|
};
|
|
2031
2947
|
|
|
2032
|
-
var
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2948
|
+
var Configuration$1 = reactRedux.connect(mapStateToProps$5, {
|
|
2949
|
+
jobStatusesUpdate: jobStatusesUpdate,
|
|
2950
|
+
jobStatusesLoaded: jobStatusesLoaded,
|
|
2951
|
+
jobHideSeenUpdate: jobHideSeenUpdate,
|
|
2952
|
+
jobHideSeenLoaded: jobHideSeenLoaded
|
|
2953
|
+
})(reactRouter.withRouter(Configuration));
|
|
2036
2954
|
|
|
2037
2955
|
function _createSuper$9(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
2038
2956
|
|
|
@@ -2243,6 +3161,21 @@
|
|
|
2243
3161
|
});
|
|
2244
3162
|
}
|
|
2245
3163
|
|
|
3164
|
+
if (Session$4.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth)) {
|
|
3165
|
+
sectionItems.push({
|
|
3166
|
+
type: 'navItem',
|
|
3167
|
+
text: 'Feature Configuration',
|
|
3168
|
+
icon: 'settings',
|
|
3169
|
+
isFontAwesome: false,
|
|
3170
|
+
selected: this.state.selectedSection === 'config',
|
|
3171
|
+
onClick: function onClick() {
|
|
3172
|
+
_this2.setState({
|
|
3173
|
+
selectedSection: 'config'
|
|
3174
|
+
});
|
|
3175
|
+
}
|
|
3176
|
+
});
|
|
3177
|
+
}
|
|
3178
|
+
|
|
2246
3179
|
var helpGuide = {
|
|
2247
3180
|
text: "Help with ".concat(values.textTitleRequests),
|
|
2248
3181
|
url: Urls.HelpGuide.Maintenance
|
|
@@ -2262,6 +3195,8 @@
|
|
|
2262
3195
|
return /*#__PURE__*/React__default['default'].createElement(JobTypes$1, {
|
|
2263
3196
|
onNew: this.onAddRequestType
|
|
2264
3197
|
});
|
|
3198
|
+
} else if (this.state.selectedSection === 'config') {
|
|
3199
|
+
return /*#__PURE__*/React__default['default'].createElement(Configuration$1, null);
|
|
2265
3200
|
}
|
|
2266
3201
|
|
|
2267
3202
|
return /*#__PURE__*/React__default['default'].createElement(JobList$1, {
|
|
@@ -2333,6 +3268,7 @@
|
|
|
2333
3268
|
Session$3 = PlussCore__namespace.Session,
|
|
2334
3269
|
Colours$1 = PlussCore__namespace.Colours,
|
|
2335
3270
|
Components$3 = PlussCore__namespace.Components;
|
|
3271
|
+
var IMAGE_SIZE_NOTE = 72;
|
|
2336
3272
|
|
|
2337
3273
|
var Job = /*#__PURE__*/function (_Component) {
|
|
2338
3274
|
_inherits__default['default'](Job, _Component);
|
|
@@ -2417,13 +3353,20 @@
|
|
|
2417
3353
|
})));
|
|
2418
3354
|
|
|
2419
3355
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
|
|
2420
|
-
var
|
|
3356
|
+
var statusTypes = _this.props.statusTypes;
|
|
3357
|
+
var statusType = statusTypes.find(function (s) {
|
|
2421
3358
|
return s.text === status;
|
|
2422
3359
|
});
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
3360
|
+
|
|
3361
|
+
if (!statusType) {
|
|
3362
|
+
var defaultStatus = statusTypes.find(function (s) {
|
|
3363
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
3364
|
+
});
|
|
3365
|
+
statusType = _objectSpread$4(_objectSpread$4({}, defaultStatus), {}, {
|
|
3366
|
+
text: status
|
|
3367
|
+
});
|
|
3368
|
+
}
|
|
3369
|
+
|
|
2427
3370
|
return statusType;
|
|
2428
3371
|
});
|
|
2429
3372
|
|
|
@@ -2466,11 +3409,12 @@
|
|
|
2466
3409
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "isReadyToSaveNote", function () {
|
|
2467
3410
|
var _this$state = _this.state,
|
|
2468
3411
|
noteAttachments = _this$state.noteAttachments,
|
|
2469
|
-
noteInput = _this$state.noteInput
|
|
3412
|
+
noteInput = _this$state.noteInput,
|
|
3413
|
+
noteImages = _this$state.noteImages;
|
|
2470
3414
|
if (___default['default'].some(noteAttachments, function (n) {
|
|
2471
3415
|
return n.Uploading;
|
|
2472
3416
|
})) return false;
|
|
2473
|
-
return !___default['default'].isEmpty(noteInput) || !___default['default'].isEmpty(noteAttachments);
|
|
3417
|
+
return !___default['default'].isEmpty(noteInput) || !___default['default'].isEmpty(noteAttachments) || !___default['default'].isEmpty(noteImages);
|
|
2474
3418
|
});
|
|
2475
3419
|
|
|
2476
3420
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onOpenAddNote", function () {
|
|
@@ -2489,6 +3433,7 @@
|
|
|
2489
3433
|
if (!!_this.state.editingNote) {
|
|
2490
3434
|
newState.noteInput = '';
|
|
2491
3435
|
newState.noteAttachments = [];
|
|
3436
|
+
newState.noteImages = [];
|
|
2492
3437
|
}
|
|
2493
3438
|
|
|
2494
3439
|
_this.setState(newState);
|
|
@@ -2676,12 +3621,12 @@
|
|
|
2676
3621
|
Title: a.Title,
|
|
2677
3622
|
Source: a.Source
|
|
2678
3623
|
};
|
|
2679
|
-
})) : maintenanceActions.addNote(_this.state.jobId, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
3624
|
+
}), _this.state.noteImages) : maintenanceActions.addNote(_this.state.jobId, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
2680
3625
|
return {
|
|
2681
3626
|
Title: a.Title,
|
|
2682
3627
|
Source: a.Source
|
|
2683
3628
|
};
|
|
2684
|
-
}));
|
|
3629
|
+
}), _this.state.noteImages);
|
|
2685
3630
|
|
|
2686
3631
|
case 6:
|
|
2687
3632
|
res = _context5.sent;
|
|
@@ -2692,6 +3637,7 @@
|
|
|
2692
3637
|
addNoteOpen: false,
|
|
2693
3638
|
noteInput: '',
|
|
2694
3639
|
noteAttachments: [],
|
|
3640
|
+
noteImages: [],
|
|
2695
3641
|
editingNote: null
|
|
2696
3642
|
}, function () {
|
|
2697
3643
|
_this.props.jobsLoaded([_this.state.job]);
|
|
@@ -2741,11 +3687,12 @@
|
|
|
2741
3687
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onOpenEditNote", function (n) {
|
|
2742
3688
|
_this.setState({
|
|
2743
3689
|
noteAttachments: n.Attachments || [],
|
|
3690
|
+
noteImages: n.Images || [],
|
|
2744
3691
|
noteInput: n.Note || '',
|
|
2745
3692
|
addNoteOpen: true,
|
|
2746
3693
|
editingNote: n.Id,
|
|
2747
3694
|
noteMenuOpen: null
|
|
2748
|
-
});
|
|
3695
|
+
}, _this.checkSetImage);
|
|
2749
3696
|
});
|
|
2750
3697
|
|
|
2751
3698
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "markSeen", function () {
|
|
@@ -2851,53 +3798,54 @@
|
|
|
2851
3798
|
_this.setState(stateChange);
|
|
2852
3799
|
});
|
|
2853
3800
|
|
|
2854
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "
|
|
3801
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onTogglePriorityChanger", function () {
|
|
2855
3802
|
_this.setState({
|
|
2856
|
-
|
|
3803
|
+
priorityChangerOpen: !_this.state.priorityChangerOpen
|
|
2857
3804
|
});
|
|
2858
3805
|
});
|
|
2859
3806
|
|
|
2860
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "
|
|
2861
|
-
var _ref8 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8(
|
|
2862
|
-
var res;
|
|
3807
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
|
|
3808
|
+
var _ref8 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8(priority) {
|
|
3809
|
+
var res, job;
|
|
2863
3810
|
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
2864
3811
|
while (1) {
|
|
2865
3812
|
switch (_context8.prev = _context8.next) {
|
|
2866
3813
|
case 0:
|
|
2867
3814
|
_this.setState({
|
|
2868
3815
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
2869
|
-
|
|
3816
|
+
priority: priority
|
|
2870
3817
|
}),
|
|
2871
|
-
|
|
3818
|
+
priorityChangerOpen: false
|
|
2872
3819
|
});
|
|
2873
3820
|
|
|
2874
3821
|
_context8.prev = 1;
|
|
2875
3822
|
_context8.next = 4;
|
|
2876
|
-
return maintenanceActions.
|
|
3823
|
+
return maintenanceActions.editJobPriority(_this.state.job.id, priority);
|
|
2877
3824
|
|
|
2878
3825
|
case 4:
|
|
2879
3826
|
res = _context8.sent;
|
|
3827
|
+
job = res.data.job;
|
|
3828
|
+
|
|
3829
|
+
_this.props.jobsLoaded([job]);
|
|
2880
3830
|
|
|
2881
3831
|
_this.setState({
|
|
2882
|
-
job:
|
|
2883
|
-
}, function () {
|
|
2884
|
-
_this.props.jobsLoaded([_this.state.job]);
|
|
3832
|
+
job: job
|
|
2885
3833
|
});
|
|
2886
3834
|
|
|
2887
|
-
_context8.next =
|
|
3835
|
+
_context8.next = 13;
|
|
2888
3836
|
break;
|
|
2889
3837
|
|
|
2890
|
-
case
|
|
2891
|
-
_context8.prev =
|
|
3838
|
+
case 10:
|
|
3839
|
+
_context8.prev = 10;
|
|
2892
3840
|
_context8.t0 = _context8["catch"](1);
|
|
2893
|
-
console.error('
|
|
3841
|
+
console.error('onSelectPriority', _context8.t0);
|
|
2894
3842
|
|
|
2895
|
-
case
|
|
3843
|
+
case 13:
|
|
2896
3844
|
case "end":
|
|
2897
3845
|
return _context8.stop();
|
|
2898
3846
|
}
|
|
2899
3847
|
}
|
|
2900
|
-
}, _callee8, null, [[1,
|
|
3848
|
+
}, _callee8, null, [[1, 10]]);
|
|
2901
3849
|
}));
|
|
2902
3850
|
|
|
2903
3851
|
return function (_x2) {
|
|
@@ -2905,6 +3853,61 @@
|
|
|
2905
3853
|
};
|
|
2906
3854
|
}());
|
|
2907
3855
|
|
|
3856
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onToggleStatusChanger", function () {
|
|
3857
|
+
_this.setState({
|
|
3858
|
+
statusChangerOpen: !_this.state.statusChangerOpen
|
|
3859
|
+
});
|
|
3860
|
+
});
|
|
3861
|
+
|
|
3862
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
|
|
3863
|
+
var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(status) {
|
|
3864
|
+
var res, job;
|
|
3865
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
3866
|
+
while (1) {
|
|
3867
|
+
switch (_context9.prev = _context9.next) {
|
|
3868
|
+
case 0:
|
|
3869
|
+
_this.setState({
|
|
3870
|
+
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
3871
|
+
status: status
|
|
3872
|
+
}),
|
|
3873
|
+
statusChangerOpen: false
|
|
3874
|
+
});
|
|
3875
|
+
|
|
3876
|
+
_context9.prev = 1;
|
|
3877
|
+
_context9.next = 4;
|
|
3878
|
+
return maintenanceActions.editJobStatus(_this.state.job.id, status);
|
|
3879
|
+
|
|
3880
|
+
case 4:
|
|
3881
|
+
res = _context9.sent;
|
|
3882
|
+
job = res.data.job;
|
|
3883
|
+
|
|
3884
|
+
_this.props.jobsLoaded([job]);
|
|
3885
|
+
|
|
3886
|
+
_this.setState({
|
|
3887
|
+
job: job
|
|
3888
|
+
});
|
|
3889
|
+
|
|
3890
|
+
_context9.next = 13;
|
|
3891
|
+
break;
|
|
3892
|
+
|
|
3893
|
+
case 10:
|
|
3894
|
+
_context9.prev = 10;
|
|
3895
|
+
_context9.t0 = _context9["catch"](1);
|
|
3896
|
+
console.error('onSelectStatus', _context9.t0);
|
|
3897
|
+
|
|
3898
|
+
case 13:
|
|
3899
|
+
case "end":
|
|
3900
|
+
return _context9.stop();
|
|
3901
|
+
}
|
|
3902
|
+
}
|
|
3903
|
+
}, _callee9, null, [[1, 10]]);
|
|
3904
|
+
}));
|
|
3905
|
+
|
|
3906
|
+
return function (_x3) {
|
|
3907
|
+
return _ref9.apply(this, arguments);
|
|
3908
|
+
};
|
|
3909
|
+
}());
|
|
3910
|
+
|
|
2908
3911
|
_this.state = {
|
|
2909
3912
|
jobId: Helper$2.safeReadParams(props, 'jobId') ? props.match.params.jobId : null,
|
|
2910
3913
|
job: null,
|
|
@@ -2913,10 +3916,12 @@
|
|
|
2913
3916
|
comments: [],
|
|
2914
3917
|
commentInput: '',
|
|
2915
3918
|
loadingComments: false,
|
|
3919
|
+
priorityChangerOpen: false,
|
|
2916
3920
|
statusChangerOpen: false,
|
|
2917
3921
|
addNoteOpen: false,
|
|
2918
3922
|
noteAttachments: [],
|
|
2919
3923
|
noteInput: '',
|
|
3924
|
+
noteImages: [],
|
|
2920
3925
|
assignees: []
|
|
2921
3926
|
};
|
|
2922
3927
|
return _this;
|
|
@@ -2930,12 +3935,64 @@
|
|
|
2930
3935
|
}, {
|
|
2931
3936
|
key: "componentDidMount",
|
|
2932
3937
|
value: function componentDidMount() {
|
|
3938
|
+
this.props.jobStatusesUpdate(this.props.auth.site);
|
|
3939
|
+
|
|
2933
3940
|
if (this.state.jobId) {
|
|
2934
3941
|
this.getJob();
|
|
2935
3942
|
this.getComments();
|
|
2936
3943
|
this.getAssignees();
|
|
2937
3944
|
}
|
|
2938
3945
|
}
|
|
3946
|
+
}, {
|
|
3947
|
+
key: "checkSetImage",
|
|
3948
|
+
value: function checkSetImage() {
|
|
3949
|
+
if (this.imageInput && !___default['default'].isEmpty(this.state.noteImages)) {
|
|
3950
|
+
this.imageInput.getWrappedInstance().setValue(this.state.noteImages);
|
|
3951
|
+
} else {
|
|
3952
|
+
setTimeout(this.checkSetImage, 100);
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
}, {
|
|
3956
|
+
key: "renderPriorityChanger",
|
|
3957
|
+
value: function renderPriorityChanger() {
|
|
3958
|
+
var _this2 = this;
|
|
3959
|
+
|
|
3960
|
+
if (!this.state.priorityChangerOpen) return null;
|
|
3961
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3962
|
+
className: "statusChanger statusChanger-priority"
|
|
3963
|
+
}, jobPriorityOptions.map(function (p) {
|
|
3964
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3965
|
+
key: p.name,
|
|
3966
|
+
className: "statusLabel",
|
|
3967
|
+
onClick: function onClick() {
|
|
3968
|
+
return _this2.onSelectPriority(p.name);
|
|
3969
|
+
},
|
|
3970
|
+
style: {
|
|
3971
|
+
backgroundColor: p.color
|
|
3972
|
+
}
|
|
3973
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3974
|
+
className: "statusLabel_text"
|
|
3975
|
+
}, p.name));
|
|
3976
|
+
}));
|
|
3977
|
+
}
|
|
3978
|
+
}, {
|
|
3979
|
+
key: "renderPriorityLabel",
|
|
3980
|
+
value: function renderPriorityLabel() {
|
|
3981
|
+
var auth = this.props.auth;
|
|
3982
|
+
if (!Session$3.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return null;
|
|
3983
|
+
var job = this.state.job;
|
|
3984
|
+
if (!job) return null;
|
|
3985
|
+
var selectedPriority = getJobPriority(job.priority);
|
|
3986
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3987
|
+
className: "statusLabel marginTop-5 pointer",
|
|
3988
|
+
onClick: this.onTogglePriorityChanger,
|
|
3989
|
+
style: {
|
|
3990
|
+
backgroundColor: selectedPriority.color
|
|
3991
|
+
}
|
|
3992
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3993
|
+
className: "statusLabel_text"
|
|
3994
|
+
}, job.priority || selectedPriority.name), this.renderPriorityChanger());
|
|
3995
|
+
}
|
|
2939
3996
|
}, {
|
|
2940
3997
|
key: "renderStatusLabel",
|
|
2941
3998
|
value: function renderStatusLabel() {
|
|
@@ -2999,24 +4056,25 @@
|
|
|
2999
4056
|
}, {
|
|
3000
4057
|
key: "renderStatusChanger",
|
|
3001
4058
|
value: function renderStatusChanger() {
|
|
3002
|
-
var
|
|
4059
|
+
var _this3 = this;
|
|
3003
4060
|
|
|
3004
4061
|
if (!this.state.statusChangerOpen) return null;
|
|
4062
|
+
var statusTypes = this.props.statusTypes;
|
|
3005
4063
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3006
4064
|
className: "statusChanger statusChanger-maintenance"
|
|
3007
|
-
},
|
|
4065
|
+
}, statusTypes.map(function (status) {
|
|
3008
4066
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3009
|
-
key:
|
|
4067
|
+
key: status.text,
|
|
3010
4068
|
className: "statusLabel",
|
|
3011
4069
|
onClick: function onClick() {
|
|
3012
|
-
return
|
|
4070
|
+
return _this3.onSelectStatus(status.text);
|
|
3013
4071
|
},
|
|
3014
4072
|
style: {
|
|
3015
|
-
backgroundColor:
|
|
4073
|
+
backgroundColor: status.color
|
|
3016
4074
|
}
|
|
3017
4075
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3018
4076
|
className: "statusLabel_text"
|
|
3019
|
-
},
|
|
4077
|
+
}, status.text));
|
|
3020
4078
|
}));
|
|
3021
4079
|
}
|
|
3022
4080
|
}, {
|
|
@@ -3030,7 +4088,7 @@
|
|
|
3030
4088
|
}, {
|
|
3031
4089
|
key: "renderCommentSection",
|
|
3032
4090
|
value: function renderCommentSection() {
|
|
3033
|
-
var
|
|
4091
|
+
var _this4 = this;
|
|
3034
4092
|
|
|
3035
4093
|
if (this.state.loadingComments) return null;
|
|
3036
4094
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3043,7 +4101,7 @@
|
|
|
3043
4101
|
}, "Comments"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3044
4102
|
className: "commentSection"
|
|
3045
4103
|
}, this.state.comments.map(function (c) {
|
|
3046
|
-
return
|
|
4104
|
+
return _this4.renderComment(c);
|
|
3047
4105
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3048
4106
|
className: "commentReply"
|
|
3049
4107
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3059,13 +4117,14 @@
|
|
|
3059
4117
|
className: "commentReply_input",
|
|
3060
4118
|
value: this.state.commentInput,
|
|
3061
4119
|
onChange: function onChange(e) {
|
|
3062
|
-
return
|
|
4120
|
+
return _this4.onHandleChange(e);
|
|
3063
4121
|
}
|
|
3064
4122
|
}))));
|
|
3065
4123
|
}
|
|
3066
4124
|
}, {
|
|
3067
4125
|
key: "renderImageGrid",
|
|
3068
4126
|
value: function renderImageGrid(images) {
|
|
4127
|
+
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
3069
4128
|
var imagesToUse = images && images.length > 0 ? images : [];
|
|
3070
4129
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3071
4130
|
className: "imageGrid"
|
|
@@ -3078,7 +4137,9 @@
|
|
|
3078
4137
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3079
4138
|
className: "imageGrid_image",
|
|
3080
4139
|
style: {
|
|
3081
|
-
backgroundImage: "url('".concat(Helper$2.get1400(image), "')")
|
|
4140
|
+
backgroundImage: "url('".concat(Helper$2.get1400(image), "')"),
|
|
4141
|
+
width: size,
|
|
4142
|
+
height: size
|
|
3082
4143
|
}
|
|
3083
4144
|
}));
|
|
3084
4145
|
}));
|
|
@@ -3098,7 +4159,7 @@
|
|
|
3098
4159
|
}, {
|
|
3099
4160
|
key: "renderCustomFields",
|
|
3100
4161
|
value: function renderCustomFields() {
|
|
3101
|
-
var
|
|
4162
|
+
var _this5 = this;
|
|
3102
4163
|
|
|
3103
4164
|
var job = this.state.job;
|
|
3104
4165
|
var customFields = job.customFields;
|
|
@@ -3128,7 +4189,7 @@
|
|
|
3128
4189
|
}, field.answer && Array.isArray(field.answer) ? field.answer.join(', ') : '');
|
|
3129
4190
|
|
|
3130
4191
|
case 'image':
|
|
3131
|
-
return
|
|
4192
|
+
return _this5.renderImageGrid(field.answer);
|
|
3132
4193
|
|
|
3133
4194
|
default:
|
|
3134
4195
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3249,12 +4310,12 @@
|
|
|
3249
4310
|
}
|
|
3250
4311
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3251
4312
|
className: "statusLabel_text"
|
|
3252
|
-
}, e ? "
|
|
4313
|
+
}, e ? "".concat(entryToUse.user.displayName, " marked as ").concat(statusType.text) : "".concat(values.textEntityName, " opened"))));
|
|
3253
4314
|
}
|
|
3254
4315
|
}, {
|
|
3255
4316
|
key: "renderNote",
|
|
3256
4317
|
value: function renderNote(note, index) {
|
|
3257
|
-
var
|
|
4318
|
+
var _this6 = this;
|
|
3258
4319
|
|
|
3259
4320
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3260
4321
|
className: "ticketHistoryEntry",
|
|
@@ -3277,7 +4338,7 @@
|
|
|
3277
4338
|
icon: "more15",
|
|
3278
4339
|
className: "maintenanceNote_moreIcon",
|
|
3279
4340
|
onClick: function onClick() {
|
|
3280
|
-
return
|
|
4341
|
+
return _this6.onOpenNoteMenu(index);
|
|
3281
4342
|
}
|
|
3282
4343
|
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
3283
4344
|
className: "maintenanceNote_name"
|
|
@@ -3286,20 +4347,20 @@
|
|
|
3286
4347
|
key: 'edit',
|
|
3287
4348
|
text: 'Edit',
|
|
3288
4349
|
onPress: function onPress() {
|
|
3289
|
-
return
|
|
4350
|
+
return _this6.onOpenEditNote(note);
|
|
3290
4351
|
}
|
|
3291
4352
|
}, {
|
|
3292
4353
|
key: 'delete',
|
|
3293
4354
|
text: 'Delete',
|
|
3294
4355
|
onPress: function onPress() {
|
|
3295
|
-
return
|
|
4356
|
+
return _this6.onDeleteNote(note);
|
|
3296
4357
|
}
|
|
3297
4358
|
}]
|
|
3298
4359
|
})), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
3299
4360
|
className: "maintenanceNote_text"
|
|
3300
4361
|
}, Helper$2.toParagraphed(note.Note)), note.Attachments.map(function (a, i) {
|
|
3301
|
-
return
|
|
3302
|
-
})));
|
|
4362
|
+
return _this6.renderAttachment(a, i);
|
|
4363
|
+
}), note.Images && note.Images.length > 0 ? this.renderImageGrid(note.Images, IMAGE_SIZE_NOTE) : null));
|
|
3303
4364
|
}
|
|
3304
4365
|
}, {
|
|
3305
4366
|
key: "renderAssignment",
|
|
@@ -3340,10 +4401,24 @@
|
|
|
3340
4401
|
className: "statusLabel_text"
|
|
3341
4402
|
}, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
|
|
3342
4403
|
}
|
|
4404
|
+
}, {
|
|
4405
|
+
key: "renderPriority",
|
|
4406
|
+
value: function renderPriority() {
|
|
4407
|
+
var auth = this.props.auth;
|
|
4408
|
+
if (!Session$3.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return null;
|
|
4409
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4410
|
+
className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
|
|
4411
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4412
|
+
className: "newTopBar clearfix flex flex-reverse"
|
|
4413
|
+
}, this.renderPriorityLabel(), /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4414
|
+
type: "formTitleSmall",
|
|
4415
|
+
className: "flex-1"
|
|
4416
|
+
}, "Priority")));
|
|
4417
|
+
}
|
|
3343
4418
|
}, {
|
|
3344
4419
|
key: "renderOverview",
|
|
3345
4420
|
value: function renderOverview() {
|
|
3346
|
-
var
|
|
4421
|
+
var _this7 = this;
|
|
3347
4422
|
|
|
3348
4423
|
var job = this.state.job;
|
|
3349
4424
|
if (!job || !job.history) return null;
|
|
@@ -3369,13 +4444,13 @@
|
|
|
3369
4444
|
}, "Status History")), this.renderHistoryEntry(null, -1), ___default['default'].map(source, function (e, i) {
|
|
3370
4445
|
switch (e.EntryType) {
|
|
3371
4446
|
case 'status':
|
|
3372
|
-
return
|
|
4447
|
+
return _this7.renderHistoryEntry(e, i);
|
|
3373
4448
|
|
|
3374
4449
|
case 'note':
|
|
3375
|
-
return
|
|
4450
|
+
return _this7.renderNote(e, i);
|
|
3376
4451
|
|
|
3377
4452
|
case 'assignment':
|
|
3378
|
-
return
|
|
4453
|
+
return _this7.renderAssignmentEntry(e, i);
|
|
3379
4454
|
}
|
|
3380
4455
|
}));
|
|
3381
4456
|
}
|
|
@@ -3421,7 +4496,7 @@
|
|
|
3421
4496
|
}, {
|
|
3422
4497
|
key: "renderAddNotePopup",
|
|
3423
4498
|
value: function renderAddNotePopup() {
|
|
3424
|
-
var
|
|
4499
|
+
var _this8 = this;
|
|
3425
4500
|
|
|
3426
4501
|
if (!this.state.addNoteOpen) return null;
|
|
3427
4502
|
|
|
@@ -3461,7 +4536,7 @@
|
|
|
3461
4536
|
value: this.state.noteInput,
|
|
3462
4537
|
placeholder: "Enter note",
|
|
3463
4538
|
onChange: function onChange(e) {
|
|
3464
|
-
return
|
|
4539
|
+
return _this8.onHandleChange(e);
|
|
3465
4540
|
},
|
|
3466
4541
|
inputStyle: {
|
|
3467
4542
|
width: 400
|
|
@@ -3469,34 +4544,44 @@
|
|
|
3469
4544
|
}), /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
3470
4545
|
type: "h5"
|
|
3471
4546
|
}, "Attachments"), this.state.noteAttachments.map(function (a, i) {
|
|
3472
|
-
return
|
|
4547
|
+
return _this8.renderAttachment(a, i, _this8.onRemoveAttachment);
|
|
3473
4548
|
}), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
3474
4549
|
ref: function ref(input) {
|
|
3475
|
-
return
|
|
4550
|
+
return _this8.attachmentInput = input;
|
|
3476
4551
|
},
|
|
3477
4552
|
id: "attachmentInput",
|
|
3478
4553
|
type: "file",
|
|
3479
4554
|
className: "fileInput",
|
|
3480
4555
|
onChange: function onChange(e) {
|
|
3481
|
-
return
|
|
4556
|
+
return _this8.onHandlePDFFileChange(e);
|
|
3482
4557
|
},
|
|
3483
4558
|
accept: "application/pdf"
|
|
3484
4559
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3485
|
-
className: "iconTextButton",
|
|
4560
|
+
className: "iconTextButton marginBottom-16",
|
|
3486
4561
|
onClick: function onClick() {
|
|
3487
|
-
|
|
4562
|
+
_this8.attachmentInput.click();
|
|
3488
4563
|
}
|
|
3489
4564
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
3490
4565
|
className: "iconTextButton_icon",
|
|
3491
4566
|
name: "paperclip"
|
|
3492
4567
|
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
3493
4568
|
className: "iconTextButton_text"
|
|
3494
|
-
}, "Add Attachment"))
|
|
4569
|
+
}, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
|
|
4570
|
+
ref: function ref(_ref10) {
|
|
4571
|
+
_this8.imageInput = _ref10;
|
|
4572
|
+
},
|
|
4573
|
+
multiple: true,
|
|
4574
|
+
refreshCallback: function refreshCallback(images) {
|
|
4575
|
+
_this8.setState({
|
|
4576
|
+
noteImages: images
|
|
4577
|
+
});
|
|
4578
|
+
}
|
|
4579
|
+
}));
|
|
3495
4580
|
}
|
|
3496
4581
|
}, {
|
|
3497
4582
|
key: "renderUsers",
|
|
3498
4583
|
value: function renderUsers() {
|
|
3499
|
-
var
|
|
4584
|
+
var _this9 = this;
|
|
3500
4585
|
|
|
3501
4586
|
var content = null;
|
|
3502
4587
|
|
|
@@ -3515,7 +4600,7 @@
|
|
|
3515
4600
|
className: "removeIcon",
|
|
3516
4601
|
icon: "close",
|
|
3517
4602
|
onClick: function onClick() {
|
|
3518
|
-
|
|
4603
|
+
_this9.onSelectAssignee();
|
|
3519
4604
|
},
|
|
3520
4605
|
colour: Colours$1.COLOUR_DUSK
|
|
3521
4606
|
})
|
|
@@ -3528,20 +4613,20 @@
|
|
|
3528
4613
|
placeholder: "Search name",
|
|
3529
4614
|
value: this.state.userSearch,
|
|
3530
4615
|
onChange: function onChange(e) {
|
|
3531
|
-
return
|
|
4616
|
+
return _this9.onHandleChange(e);
|
|
3532
4617
|
},
|
|
3533
4618
|
alwaysShowLabel: true
|
|
3534
4619
|
}), ___default['default'].sortBy(this.state.assignees, function (u) {
|
|
3535
4620
|
return u.displayName.toUpperCase();
|
|
3536
4621
|
}).filter(function (u) {
|
|
3537
|
-
if (___default['default'].isEmpty(
|
|
3538
|
-
return u.displayName.toUpperCase().indexOf(
|
|
4622
|
+
if (___default['default'].isEmpty(_this9.state.userSearch)) return true;
|
|
4623
|
+
return u.displayName.toUpperCase().indexOf(_this9.state.userSearch.toUpperCase()) > -1;
|
|
3539
4624
|
}).map(function (user) {
|
|
3540
4625
|
return /*#__PURE__*/React__default['default'].createElement(Components$3.UserListing, {
|
|
3541
4626
|
key: user.id,
|
|
3542
4627
|
user: user,
|
|
3543
4628
|
onClick: function onClick() {
|
|
3544
|
-
|
|
4629
|
+
_this9.onSelectAssignee(user);
|
|
3545
4630
|
}
|
|
3546
4631
|
});
|
|
3547
4632
|
}));
|
|
@@ -3582,7 +4667,7 @@
|
|
|
3582
4667
|
className: "pageSectionWrapper--fixedPopupSize"
|
|
3583
4668
|
}, this.renderInner()), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageSection, {
|
|
3584
4669
|
className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
|
|
3585
|
-
}, this.renderAssignment(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4670
|
+
}, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
3586
4671
|
}
|
|
3587
4672
|
}]);
|
|
3588
4673
|
|
|
@@ -3592,12 +4677,14 @@
|
|
|
3592
4677
|
var mapStateToProps$3 = function mapStateToProps(state) {
|
|
3593
4678
|
var auth = state.auth;
|
|
3594
4679
|
return {
|
|
3595
|
-
auth: auth
|
|
4680
|
+
auth: auth,
|
|
4681
|
+
statusTypes: state[values.reducerKey].jobstatuses
|
|
3596
4682
|
};
|
|
3597
4683
|
};
|
|
3598
4684
|
|
|
3599
4685
|
var Job$1 = reactRedux.connect(mapStateToProps$3, {
|
|
3600
|
-
jobsLoaded: jobsLoaded
|
|
4686
|
+
jobsLoaded: jobsLoaded,
|
|
4687
|
+
jobStatusesUpdate: jobStatusesUpdate
|
|
3601
4688
|
})(reactRouter.withRouter(Job));
|
|
3602
4689
|
|
|
3603
4690
|
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -5982,8 +7069,9 @@
|
|
|
5982
7069
|
var INITIAL_STATE = {
|
|
5983
7070
|
jobs: [],
|
|
5984
7071
|
jobtypes: [],
|
|
5985
|
-
|
|
5986
|
-
|
|
7072
|
+
jobstatuses: jobStatusOptions,
|
|
7073
|
+
loading: false,
|
|
7074
|
+
hideSeen: false
|
|
5987
7075
|
};
|
|
5988
7076
|
var MaintenanceReducer = (function () {
|
|
5989
7077
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
|
|
@@ -6026,33 +7114,25 @@
|
|
|
6026
7114
|
return state;
|
|
6027
7115
|
|
|
6028
7116
|
case JOBS_TYPES_LOADED:
|
|
6029
|
-
var
|
|
7117
|
+
var jobtypes = ___default['default'].unionWith(action.payload, state.jobtypes, function (v1, v2) {
|
|
6030
7118
|
return v1 != null && v2 != null && v1.id === v2.id;
|
|
6031
7119
|
});
|
|
6032
7120
|
|
|
6033
7121
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
6034
|
-
jobtypes:
|
|
7122
|
+
jobtypes: jobtypes
|
|
7123
|
+
});
|
|
7124
|
+
|
|
7125
|
+
case JOBS_STATUSES_LOADED:
|
|
7126
|
+
var jobstatuses = ___default['default'].orderBy(action.payload, 'order', 'asc');
|
|
7127
|
+
|
|
7128
|
+
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
7129
|
+
jobstatuses: jobstatuses
|
|
7130
|
+
});
|
|
7131
|
+
|
|
7132
|
+
case JOBS_HIDE_SEEN:
|
|
7133
|
+
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
7134
|
+
hideSeen: action.payload
|
|
6035
7135
|
});
|
|
6036
|
-
// case JOBS_TYPES_REMOVED:
|
|
6037
|
-
// const indexSub = _.findIndex(state.jobtypes, (event) => {
|
|
6038
|
-
// return event != null && event.id === action.payload;
|
|
6039
|
-
// });
|
|
6040
|
-
// if (indexSub > -1) {
|
|
6041
|
-
// const newEventsSub = [...state.jobtypes];
|
|
6042
|
-
// newEventsSub.splice(indexSub, 1);
|
|
6043
|
-
// return { ...state, jobtypes: newEventsSub };
|
|
6044
|
-
// }
|
|
6045
|
-
// return state;
|
|
6046
|
-
// case TICKETS_LOADED:
|
|
6047
|
-
// const ticketResult = _.unionWith(action.payload, state.tickets, (v1, v2) => {
|
|
6048
|
-
// return v1 != null && v2 != null && v1.Id === v2.Id;
|
|
6049
|
-
// });
|
|
6050
|
-
// return {
|
|
6051
|
-
// ...state,
|
|
6052
|
-
// tickets: ticketResult,
|
|
6053
|
-
// };
|
|
6054
|
-
// case JOBS_PURGE:
|
|
6055
|
-
// return INITIAL_STATE;
|
|
6056
7136
|
|
|
6057
7137
|
default:
|
|
6058
7138
|
return state;
|