@plusscommunities/pluss-maintenance-web-a 1.1.23 → 1.1.24
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_LOADEDA',
|
|
55
55
|
actionJobsRemoved: 'JOBS_REMOVEDA',
|
|
56
56
|
actionJobsTypesLoaded: 'JOBS_TYPES_LOADEDA',
|
|
57
|
+
actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADEDA',
|
|
58
|
+
actionJobsHideSeen: 'JOBS_HIDE_UNSEENA',
|
|
57
59
|
actionJobsLoading: 'JOBS_LOADINGA',
|
|
58
60
|
permissionMaintenanceTracking: 'maintenanceTrackingA',
|
|
59
61
|
permissionMaintenanceTypes: 'maintenanceTypesA',
|
|
@@ -97,7 +99,9 @@
|
|
|
97
99
|
optionKeyMoreSectionMaintenance: 'maintenanceRequestA',
|
|
98
100
|
hiddenKeyMoreSectionMaintenance: 'maintenanceRequestA',
|
|
99
101
|
forceCustomFields: false,
|
|
100
|
-
textEntityName: 'Job'
|
|
102
|
+
textEntityName: 'Job',
|
|
103
|
+
stringConfigJobStatus: 'maintenanceJobStatusA',
|
|
104
|
+
stringConfigHideSeen: 'maintenanceDisableSeenA'
|
|
101
105
|
};
|
|
102
106
|
|
|
103
107
|
// import * as PlussCore from '../../pluss-core/src';
|
|
@@ -212,19 +216,21 @@
|
|
|
212
216
|
};
|
|
213
217
|
|
|
214
218
|
var JOBS_LOADED = values.actionJobsLoaded;
|
|
219
|
+
var JOBS_LOADING = values.actionJobsLoading;
|
|
215
220
|
var JOBS_REMOVED = values.actionJobsRemoved;
|
|
216
221
|
var JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
|
|
217
|
-
var
|
|
222
|
+
var JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
|
|
223
|
+
var JOBS_HIDE_SEEN = values.actionJobsHideSeen;
|
|
218
224
|
|
|
219
|
-
function ownKeys$
|
|
225
|
+
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; }
|
|
220
226
|
|
|
221
|
-
function _objectSpread$
|
|
227
|
+
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; }
|
|
222
228
|
var Helper$5 = PlussCore__namespace.Helper,
|
|
223
|
-
Session$
|
|
229
|
+
Session$9 = PlussCore__namespace.Session;
|
|
224
230
|
var maintenanceActions = {
|
|
225
231
|
getJobType: function getJobType(site, typeId) {
|
|
226
232
|
var url = Helper$5.getUrl(values.serviceKey, 'getjobtype');
|
|
227
|
-
return Session$
|
|
233
|
+
return Session$9.authedFunction({
|
|
228
234
|
method: 'POST',
|
|
229
235
|
url: url,
|
|
230
236
|
data: {
|
|
@@ -235,7 +241,7 @@
|
|
|
235
241
|
},
|
|
236
242
|
getJobTypes: function getJobTypes(site, id) {
|
|
237
243
|
var url = Helper$5.getUrl(values.serviceKey, 'getjobtypes');
|
|
238
|
-
return Session$
|
|
244
|
+
return Session$9.authedFunction({
|
|
239
245
|
method: 'POST',
|
|
240
246
|
url: url,
|
|
241
247
|
data: {
|
|
@@ -245,7 +251,7 @@
|
|
|
245
251
|
},
|
|
246
252
|
getJob: function getJob(site, id) {
|
|
247
253
|
var url = Helper$5.getUrl(values.serviceKey, 'getJob');
|
|
248
|
-
return Session$
|
|
254
|
+
return Session$9.authedFunction({
|
|
249
255
|
method: 'POST',
|
|
250
256
|
url: url,
|
|
251
257
|
data: {
|
|
@@ -256,7 +262,7 @@
|
|
|
256
262
|
},
|
|
257
263
|
getJobByJobId: function getJobByJobId(site, jobId) {
|
|
258
264
|
var url = Helper$5.getUrl(values.serviceKey, 'getJob');
|
|
259
|
-
return Session$
|
|
265
|
+
return Session$9.authedFunction({
|
|
260
266
|
method: 'POST',
|
|
261
267
|
url: url,
|
|
262
268
|
data: {
|
|
@@ -268,7 +274,7 @@
|
|
|
268
274
|
getJobs: function getJobs(site) {
|
|
269
275
|
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
270
276
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
271
|
-
return Session$
|
|
277
|
+
return Session$9.authedFunction({
|
|
272
278
|
method: 'POST',
|
|
273
279
|
url: Helper$5.getUrl(values.serviceKey, 'getJobs'),
|
|
274
280
|
data: {
|
|
@@ -295,7 +301,7 @@
|
|
|
295
301
|
query.lastKey = JSON.stringify(lastKey);
|
|
296
302
|
}
|
|
297
303
|
|
|
298
|
-
return Session$
|
|
304
|
+
return Session$9.authedFunction({
|
|
299
305
|
method: 'GET',
|
|
300
306
|
url: Helper$5.getUrl(values.serviceKey, 'get/requests', query)
|
|
301
307
|
});
|
|
@@ -315,14 +321,14 @@
|
|
|
315
321
|
});
|
|
316
322
|
},
|
|
317
323
|
createJob: function createJob(job) {
|
|
318
|
-
return Session$
|
|
324
|
+
return Session$9.authedFunction({
|
|
319
325
|
method: 'POST',
|
|
320
326
|
url: Helper$5.getUrl(values.serviceKey, 'sendMaintenance'),
|
|
321
|
-
data: _objectSpread$
|
|
327
|
+
data: _objectSpread$7({}, job)
|
|
322
328
|
});
|
|
323
329
|
},
|
|
324
330
|
editJob: function editJob(job, site) {
|
|
325
|
-
return Session$
|
|
331
|
+
return Session$9.authedFunction({
|
|
326
332
|
method: 'POST',
|
|
327
333
|
url: Helper$5.getUrl(values.serviceKey, 'editJob'),
|
|
328
334
|
data: {
|
|
@@ -332,7 +338,7 @@
|
|
|
332
338
|
});
|
|
333
339
|
},
|
|
334
340
|
deleteJob: function deleteJob(site, id) {
|
|
335
|
-
return Session$
|
|
341
|
+
return Session$9.authedFunction({
|
|
336
342
|
method: 'POST',
|
|
337
343
|
url: Helper$5.getUrl(values.serviceKey, 'requests/remove'),
|
|
338
344
|
data: {
|
|
@@ -342,7 +348,7 @@
|
|
|
342
348
|
});
|
|
343
349
|
},
|
|
344
350
|
editJobStatus: function editJobStatus(id, status) {
|
|
345
|
-
return Session$
|
|
351
|
+
return Session$9.authedFunction({
|
|
346
352
|
method: 'POST',
|
|
347
353
|
url: Helper$5.getUrl(values.serviceKey, 'editJobStatus'),
|
|
348
354
|
data: {
|
|
@@ -351,8 +357,18 @@
|
|
|
351
357
|
}
|
|
352
358
|
});
|
|
353
359
|
},
|
|
360
|
+
editJobPriority: function editJobPriority(id, priority) {
|
|
361
|
+
return Session$9.authedFunction({
|
|
362
|
+
method: 'POST',
|
|
363
|
+
url: Helper$5.getUrl(values.serviceKey, 'update/priority'),
|
|
364
|
+
data: {
|
|
365
|
+
id: id,
|
|
366
|
+
priority: priority
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
},
|
|
354
370
|
assignJob: function assignJob(jobId, userId) {
|
|
355
|
-
return Session$
|
|
371
|
+
return Session$9.authedFunction({
|
|
356
372
|
method: 'POST',
|
|
357
373
|
url: Helper$5.getUrl(values.serviceKey, 'update/assign'),
|
|
358
374
|
data: {
|
|
@@ -362,40 +378,42 @@
|
|
|
362
378
|
});
|
|
363
379
|
},
|
|
364
380
|
getAssignees: function getAssignees(site) {
|
|
365
|
-
return Session$
|
|
381
|
+
return Session$9.authedFunction({
|
|
366
382
|
method: 'GET',
|
|
367
383
|
url: Helper$5.getUrl(values.serviceKey, 'get/assignees', {
|
|
368
384
|
site: site
|
|
369
385
|
})
|
|
370
386
|
});
|
|
371
387
|
},
|
|
372
|
-
addNote: function addNote(jobId, note, attachments) {
|
|
373
|
-
return Session$
|
|
388
|
+
addNote: function addNote(jobId, note, attachments, images) {
|
|
389
|
+
return Session$9.authedFunction({
|
|
374
390
|
method: 'POST',
|
|
375
391
|
url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
|
|
376
392
|
data: {
|
|
377
393
|
id: jobId,
|
|
378
394
|
note: note,
|
|
379
395
|
attachments: attachments,
|
|
396
|
+
images: images,
|
|
380
397
|
action: 'AddNote'
|
|
381
398
|
}
|
|
382
399
|
});
|
|
383
400
|
},
|
|
384
|
-
editNote: function editNote(jobId, noteId, note, attachments) {
|
|
385
|
-
return Session$
|
|
401
|
+
editNote: function editNote(jobId, noteId, note, attachments, images) {
|
|
402
|
+
return Session$9.authedFunction({
|
|
386
403
|
method: 'POST',
|
|
387
404
|
url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
|
|
388
405
|
data: {
|
|
389
406
|
id: jobId,
|
|
390
407
|
note: note,
|
|
391
408
|
attachments: attachments,
|
|
409
|
+
images: images,
|
|
392
410
|
noteId: noteId,
|
|
393
411
|
action: 'EditNote'
|
|
394
412
|
}
|
|
395
413
|
});
|
|
396
414
|
},
|
|
397
415
|
deleteNote: function deleteNote(jobId, noteId) {
|
|
398
|
-
return Session$
|
|
416
|
+
return Session$9.authedFunction({
|
|
399
417
|
method: 'POST',
|
|
400
418
|
url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
|
|
401
419
|
data: {
|
|
@@ -415,7 +433,7 @@
|
|
|
415
433
|
hasCustomFields: hasCustomFields,
|
|
416
434
|
customFields: customFields || []
|
|
417
435
|
};
|
|
418
|
-
return Session$
|
|
436
|
+
return Session$9.authedFunction({
|
|
419
437
|
method: 'POST',
|
|
420
438
|
url: Helper$5.getUrl(values.serviceKey, 'createJobType'),
|
|
421
439
|
data: data
|
|
@@ -433,14 +451,14 @@
|
|
|
433
451
|
customFields: customFields || []
|
|
434
452
|
};
|
|
435
453
|
if (hasCustomFields && customFields) data.customFields = customFields;
|
|
436
|
-
return Session$
|
|
454
|
+
return Session$9.authedFunction({
|
|
437
455
|
method: 'POST',
|
|
438
456
|
url: Helper$5.getUrl(values.serviceKey, 'editJobType'),
|
|
439
457
|
data: data
|
|
440
458
|
});
|
|
441
459
|
},
|
|
442
460
|
deleteJobType: function deleteJobType(site, id) {
|
|
443
|
-
return Session$
|
|
461
|
+
return Session$9.authedFunction({
|
|
444
462
|
method: 'POST',
|
|
445
463
|
url: Helper$5.getUrl(values.serviceKey, 'deleteJobType'),
|
|
446
464
|
data: {
|
|
@@ -452,7 +470,7 @@
|
|
|
452
470
|
};
|
|
453
471
|
|
|
454
472
|
var Helper$4 = PlussCore__namespace.Helper,
|
|
455
|
-
Session$
|
|
473
|
+
Session$8 = PlussCore__namespace.Session;
|
|
456
474
|
var reactionActions = {
|
|
457
475
|
addComment: function addComment(entityId, entityType, entityName, site, comment, image, parentId) {
|
|
458
476
|
var data = {
|
|
@@ -468,7 +486,7 @@
|
|
|
468
486
|
data.image = image;
|
|
469
487
|
}
|
|
470
488
|
|
|
471
|
-
return Session$
|
|
489
|
+
return Session$8.authedFunction({
|
|
472
490
|
method: 'POST',
|
|
473
491
|
url: Helper$4.getUrl('reactions', 'comments/add'),
|
|
474
492
|
data: data
|
|
@@ -493,7 +511,7 @@
|
|
|
493
511
|
query.minTime = minTime;
|
|
494
512
|
}
|
|
495
513
|
|
|
496
|
-
return Session$
|
|
514
|
+
return Session$8.authedFunction({
|
|
497
515
|
method: 'GET',
|
|
498
516
|
url: Helper$4.getUrl('reactions', 'comments/get', query)
|
|
499
517
|
});
|
|
@@ -503,6 +521,28 @@
|
|
|
503
521
|
var Apis$1 = PlussCore__namespace.Apis;
|
|
504
522
|
var analyticsActions = Apis$1.analyticsActions;
|
|
505
523
|
var userActions = Apis$1.userActions;
|
|
524
|
+
var stringActions = Apis$1.stringActions;
|
|
525
|
+
|
|
526
|
+
var jobStatusOptions = [
|
|
527
|
+
{
|
|
528
|
+
text: "Open",
|
|
529
|
+
order: 0,
|
|
530
|
+
color: "#d5dde4",
|
|
531
|
+
category: "Not Actioned"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
text: "In Progress",
|
|
535
|
+
order: 1,
|
|
536
|
+
color: "#82d6e5",
|
|
537
|
+
category: "In Progress"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
text: "Completed",
|
|
541
|
+
order: 2,
|
|
542
|
+
color: "#58dba4",
|
|
543
|
+
category: "Completed"
|
|
544
|
+
}
|
|
545
|
+
];
|
|
506
546
|
|
|
507
547
|
var Helper$3 = PlussCore__namespace.Helper;
|
|
508
548
|
var jobsUpdate = function jobsUpdate(site, isdashboard) {
|
|
@@ -554,6 +594,54 @@
|
|
|
554
594
|
type: JOBS_TYPES_LOADED,
|
|
555
595
|
payload: events
|
|
556
596
|
};
|
|
597
|
+
};
|
|
598
|
+
var jobStatusesUpdate = function jobStatusesUpdate(site) {
|
|
599
|
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
600
|
+
return function (dispatch) {
|
|
601
|
+
stringActions.getString(site, values.stringConfigJobStatus).then(function (res) {
|
|
602
|
+
dispatch({
|
|
603
|
+
type: JOBS_STATUSES_LOADED,
|
|
604
|
+
payload: res.data
|
|
605
|
+
});
|
|
606
|
+
if (callback) callback(res.data);
|
|
607
|
+
}).catch(function (_error) {
|
|
608
|
+
dispatch({
|
|
609
|
+
type: JOBS_STATUSES_LOADED,
|
|
610
|
+
payload: jobStatusOptions
|
|
611
|
+
});
|
|
612
|
+
if (callback) callback(jobStatusOptions);
|
|
613
|
+
});
|
|
614
|
+
};
|
|
615
|
+
};
|
|
616
|
+
var jobStatusesLoaded = function jobStatusesLoaded(statuses) {
|
|
617
|
+
return {
|
|
618
|
+
type: JOBS_STATUSES_LOADED,
|
|
619
|
+
payload: statuses
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
var jobHideSeenUpdate = function jobHideSeenUpdate(site) {
|
|
623
|
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
624
|
+
return function (dispatch) {
|
|
625
|
+
stringActions.getString(site, values.stringConfigHideSeen).then(function (res) {
|
|
626
|
+
dispatch({
|
|
627
|
+
type: JOBS_HIDE_SEEN,
|
|
628
|
+
payload: res.data
|
|
629
|
+
});
|
|
630
|
+
if (callback) callback(res.data);
|
|
631
|
+
}).catch(function (_error) {
|
|
632
|
+
dispatch({
|
|
633
|
+
type: JOBS_HIDE_SEEN,
|
|
634
|
+
payload: false
|
|
635
|
+
});
|
|
636
|
+
if (callback) callback(false);
|
|
637
|
+
});
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
var jobHideSeenLoaded = function jobHideSeenLoaded(hide) {
|
|
641
|
+
return {
|
|
642
|
+
type: JOBS_HIDE_SEEN,
|
|
643
|
+
payload: hide
|
|
644
|
+
};
|
|
557
645
|
}; // export const removeJobType = (id) => {
|
|
558
646
|
// return {
|
|
559
647
|
// type: JOBS_TYPES_REMOVED,
|
|
@@ -584,41 +672,56 @@
|
|
|
584
672
|
// };
|
|
585
673
|
// };
|
|
586
674
|
|
|
587
|
-
var
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
675
|
+
var jobPriorityOptions = [
|
|
676
|
+
{
|
|
677
|
+
name: "Low",
|
|
678
|
+
color: "green",
|
|
679
|
+
"default": true
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: "Medium",
|
|
683
|
+
color: "orange"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
name: "High",
|
|
687
|
+
color: "red"
|
|
688
|
+
}
|
|
689
|
+
];
|
|
690
|
+
|
|
691
|
+
var STATUS_IMCOMPLETE = 'All Incomplete';
|
|
692
|
+
var STATUS_NOT_ACTIONED = 'Not Actioned';
|
|
693
|
+
var STATUS_IN_PROGRESS = 'In Progress';
|
|
694
|
+
var STATUS_COMPLETED = 'Completed';
|
|
695
|
+
|
|
696
|
+
var getDefaultPriority = function getDefaultPriority() {
|
|
697
|
+
return jobPriorityOptions.find(function (p) {
|
|
698
|
+
return p.default;
|
|
699
|
+
});
|
|
596
700
|
};
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
Completed: Completed
|
|
701
|
+
|
|
702
|
+
var getJobPriority = function getJobPriority(priority) {
|
|
703
|
+
var priorityOption = null;
|
|
704
|
+
if (priority) priorityOption = jobPriorityOptions.find(function (p) {
|
|
705
|
+
return p.name === priority;
|
|
706
|
+
});
|
|
707
|
+
return priorityOption || getDefaultPriority();
|
|
605
708
|
};
|
|
606
709
|
|
|
607
|
-
function ownKeys$
|
|
710
|
+
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; }
|
|
608
711
|
|
|
609
|
-
function _objectSpread$
|
|
712
|
+
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; }
|
|
610
713
|
|
|
611
|
-
function _createSuper$
|
|
714
|
+
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); }; }
|
|
612
715
|
|
|
613
|
-
function _isNativeReflectConstruct$
|
|
614
|
-
var Session$
|
|
615
|
-
Components$
|
|
716
|
+
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; } }
|
|
717
|
+
var Session$7 = PlussCore__namespace.Session,
|
|
718
|
+
Components$7 = PlussCore__namespace.Components,
|
|
616
719
|
Analytics$2 = PlussCore__namespace.Analytics;
|
|
617
720
|
|
|
618
721
|
var JobList = /*#__PURE__*/function (_Component) {
|
|
619
722
|
_inherits__default['default'](JobList, _Component);
|
|
620
723
|
|
|
621
|
-
var _super = _createSuper$
|
|
724
|
+
var _super = _createSuper$c(JobList);
|
|
622
725
|
|
|
623
726
|
function JobList(props) {
|
|
624
727
|
var _this;
|
|
@@ -627,6 +730,20 @@
|
|
|
627
730
|
|
|
628
731
|
_this = _super.call(this, props);
|
|
629
732
|
|
|
733
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "setRequesters", function (jobs) {
|
|
734
|
+
var requesters = ___default['default'].orderBy(___default['default'].uniqBy(jobs.map(function (j) {
|
|
735
|
+
return {
|
|
736
|
+
id: j.userID,
|
|
737
|
+
displayName: j.userName,
|
|
738
|
+
profilePic: j.userProfilePic
|
|
739
|
+
};
|
|
740
|
+
}), 'id'), 'displayName', 'asc');
|
|
741
|
+
|
|
742
|
+
_this.setState({
|
|
743
|
+
requesters: requesters
|
|
744
|
+
});
|
|
745
|
+
});
|
|
746
|
+
|
|
630
747
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getJobs", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
631
748
|
var auth, res;
|
|
632
749
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
@@ -642,6 +759,8 @@
|
|
|
642
759
|
res = _context.sent;
|
|
643
760
|
|
|
644
761
|
if (!___default['default'].isEmpty(res) && res[0].site === auth.site) {
|
|
762
|
+
_this.setRequesters(res);
|
|
763
|
+
|
|
645
764
|
_this.props.jobsLoaded(res);
|
|
646
765
|
}
|
|
647
766
|
|
|
@@ -773,6 +892,14 @@
|
|
|
773
892
|
_this.closeFilter();
|
|
774
893
|
});
|
|
775
894
|
|
|
895
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "selectPriorityFilter", function (filter) {
|
|
896
|
+
_this.setState({
|
|
897
|
+
selectedPriorityFilter: filter
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
_this.closeFilter();
|
|
901
|
+
});
|
|
902
|
+
|
|
776
903
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "selectStatusFilter", function (filter) {
|
|
777
904
|
_this.setState({
|
|
778
905
|
selectedStatusFilter: filter
|
|
@@ -877,6 +1004,33 @@
|
|
|
877
1004
|
_this.closeFilter();
|
|
878
1005
|
});
|
|
879
1006
|
|
|
1007
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectRequester", function (user) {
|
|
1008
|
+
_this.setState({
|
|
1009
|
+
selectedRequester: user
|
|
1010
|
+
});
|
|
1011
|
+
});
|
|
1012
|
+
|
|
1013
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "removeRequesterFilter", function () {
|
|
1014
|
+
_this.setState({
|
|
1015
|
+
selectedRequesterFilter: null,
|
|
1016
|
+
selectedRequesterFilterText: null
|
|
1017
|
+
});
|
|
1018
|
+
});
|
|
1019
|
+
|
|
1020
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "saveRequesterFilter", function () {
|
|
1021
|
+
if (!_this.state.selectedRequester) {
|
|
1022
|
+
_this.removeRequesterFilter();
|
|
1023
|
+
} else {
|
|
1024
|
+
_this.setState({
|
|
1025
|
+
selectedRequesterFilter: _this.state.selectedRequester.id,
|
|
1026
|
+
selectedRequesterFilterText: _this.state.selectedRequester.displayName,
|
|
1027
|
+
selectedRequester: null
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
_this.closeFilter();
|
|
1032
|
+
});
|
|
1033
|
+
|
|
880
1034
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleSearchChange", function (event) {
|
|
881
1035
|
var thisSearchTime = moment__default['default']().valueOf();
|
|
882
1036
|
|
|
@@ -909,18 +1063,32 @@
|
|
|
909
1063
|
source = ___default['default'].filter(source, function (r) {
|
|
910
1064
|
return r.type === _this.state.selectedTypeFilter;
|
|
911
1065
|
});
|
|
1066
|
+
} // filter by priority
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
if (_this.state.selectedPriorityFilter) {
|
|
1070
|
+
var defaultPriority = getDefaultPriority().name;
|
|
1071
|
+
source = ___default['default'].filter(source, function (r) {
|
|
1072
|
+
return r.priority === _this.state.selectedPriorityFilter || _this.state.selectedPriorityFilter === defaultPriority && ___default['default'].isNil(r.priority);
|
|
1073
|
+
});
|
|
912
1074
|
} // filter by status
|
|
913
1075
|
|
|
914
1076
|
|
|
915
1077
|
if (_this.state.selectedStatusFilter) {
|
|
1078
|
+
var statusTypes = _this.props.statusTypes;
|
|
1079
|
+
var defaultStatus = statusTypes.find(function (s) {
|
|
1080
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
1081
|
+
});
|
|
916
1082
|
source = ___default['default'].filter(source, function (r) {
|
|
917
|
-
var status =
|
|
1083
|
+
var status = statusTypes.find(function (s) {
|
|
1084
|
+
return s.text === r.status;
|
|
1085
|
+
}) || defaultStatus;
|
|
918
1086
|
|
|
919
|
-
if (_this.state.selectedStatusFilter ===
|
|
920
|
-
return status !==
|
|
1087
|
+
if (_this.state.selectedStatusFilter === STATUS_IMCOMPLETE) {
|
|
1088
|
+
return status.category !== STATUS_COMPLETED;
|
|
921
1089
|
}
|
|
922
1090
|
|
|
923
|
-
return status === _this.state.selectedStatusFilter;
|
|
1091
|
+
return status.text === _this.state.selectedStatusFilter;
|
|
924
1092
|
});
|
|
925
1093
|
}
|
|
926
1094
|
|
|
@@ -930,6 +1098,12 @@
|
|
|
930
1098
|
});
|
|
931
1099
|
}
|
|
932
1100
|
|
|
1101
|
+
if (_this.state.selectedRequesterFilter) {
|
|
1102
|
+
source = ___default['default'].filter(source, function (r) {
|
|
1103
|
+
return r.userID === _this.state.selectedRequesterFilter;
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
|
|
933
1107
|
if (!___default['default'].isEmpty(_this.state.searchTerm)) {
|
|
934
1108
|
source = ___default['default'].filter(source, function (r) {
|
|
935
1109
|
if (r.jobId && r.jobId === _this.state.searchTerm) {
|
|
@@ -1011,6 +1185,7 @@
|
|
|
1011
1185
|
|
|
1012
1186
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getExportSource", function () {
|
|
1013
1187
|
var customColumns = [];
|
|
1188
|
+
var defaultPriority = getDefaultPriority().name;
|
|
1014
1189
|
|
|
1015
1190
|
var source = _this.getSource().map(function (r) {
|
|
1016
1191
|
var history = r.history || [];
|
|
@@ -1057,12 +1232,14 @@
|
|
|
1057
1232
|
|
|
1058
1233
|
var customFieldValues = _this.getCustomFields(r, customColumns);
|
|
1059
1234
|
|
|
1060
|
-
|
|
1235
|
+
var priority = r.priority || defaultPriority;
|
|
1236
|
+
return _objectSpread$6(_objectSpread$6(_objectSpread$6({}, r), customFieldValues), {}, {
|
|
1061
1237
|
notes: notes,
|
|
1062
1238
|
progressTime: progressTime,
|
|
1063
1239
|
completedTime: completedTime,
|
|
1064
1240
|
progressDuration: progressDuration,
|
|
1065
|
-
completedDuration: completedDuration
|
|
1241
|
+
completedDuration: completedDuration,
|
|
1242
|
+
priority: priority
|
|
1066
1243
|
});
|
|
1067
1244
|
}); // Compose revised columns list with custom fields
|
|
1068
1245
|
|
|
@@ -1101,7 +1278,8 @@
|
|
|
1101
1278
|
sortColumn: 'createdUnix',
|
|
1102
1279
|
sortDesc: true,
|
|
1103
1280
|
selectedTimeFilter: Analytics$2.getAnalyticsFilterOptions()[1],
|
|
1104
|
-
assignees: []
|
|
1281
|
+
assignees: [],
|
|
1282
|
+
requesters: []
|
|
1105
1283
|
};
|
|
1106
1284
|
_this.exportColumns = [{
|
|
1107
1285
|
label: 'Select All',
|
|
@@ -1118,6 +1296,9 @@
|
|
|
1118
1296
|
}, {
|
|
1119
1297
|
label: 'Status',
|
|
1120
1298
|
key: 'status'
|
|
1299
|
+
}, {
|
|
1300
|
+
label: 'Priority',
|
|
1301
|
+
key: 'priority'
|
|
1121
1302
|
}, {
|
|
1122
1303
|
label: 'Title',
|
|
1123
1304
|
key: 'title'
|
|
@@ -1158,11 +1339,12 @@
|
|
|
1158
1339
|
_createClass__default['default'](JobList, [{
|
|
1159
1340
|
key: "UNSAFE_componentWillMount",
|
|
1160
1341
|
value: function UNSAFE_componentWillMount() {
|
|
1161
|
-
Session$
|
|
1342
|
+
Session$7.checkLoggedIn(this);
|
|
1162
1343
|
}
|
|
1163
1344
|
}, {
|
|
1164
1345
|
key: "componentDidMount",
|
|
1165
1346
|
value: function componentDidMount() {
|
|
1347
|
+
this.props.jobStatusesUpdate(this.props.auth.site);
|
|
1166
1348
|
this.getJobs();
|
|
1167
1349
|
this.getAssignees();
|
|
1168
1350
|
}
|
|
@@ -1176,7 +1358,7 @@
|
|
|
1176
1358
|
}
|
|
1177
1359
|
|
|
1178
1360
|
if (this.state.filterOpen === 'type') {
|
|
1179
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1361
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1180
1362
|
title: "Select ".concat(values.textJobType),
|
|
1181
1363
|
maxWidth: 600,
|
|
1182
1364
|
minWidth: 400,
|
|
@@ -1187,7 +1369,7 @@
|
|
|
1187
1369
|
})), function (t) {
|
|
1188
1370
|
return t.toLowerCase();
|
|
1189
1371
|
}).map(function (type) {
|
|
1190
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1372
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1191
1373
|
key: type,
|
|
1192
1374
|
onClick: function onClick() {
|
|
1193
1375
|
_this2.selectTypeFilter(type);
|
|
@@ -1198,28 +1380,49 @@
|
|
|
1198
1380
|
}));
|
|
1199
1381
|
}
|
|
1200
1382
|
|
|
1383
|
+
if (this.state.filterOpen === 'priority') {
|
|
1384
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1385
|
+
title: "Select Priority",
|
|
1386
|
+
maxWidth: 600,
|
|
1387
|
+
minWidth: 400,
|
|
1388
|
+
hasPadding: true,
|
|
1389
|
+
onClose: this.closeFilter
|
|
1390
|
+
}, jobPriorityOptions.map(function (p) {
|
|
1391
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1392
|
+
key: p.name,
|
|
1393
|
+
onClick: function onClick() {
|
|
1394
|
+
_this2.selectPriorityFilter(p.name);
|
|
1395
|
+
},
|
|
1396
|
+
text: p.name,
|
|
1397
|
+
className: "marginRight-10"
|
|
1398
|
+
});
|
|
1399
|
+
}));
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1201
1402
|
if (this.state.filterOpen === 'status') {
|
|
1202
|
-
|
|
1403
|
+
var statusTypes = this.props.statusTypes;
|
|
1404
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1203
1405
|
title: "Select Status",
|
|
1204
1406
|
maxWidth: 600,
|
|
1205
1407
|
minWidth: 400,
|
|
1206
1408
|
hasPadding: true,
|
|
1207
1409
|
onClose: this.closeFilter
|
|
1208
|
-
}, [
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1410
|
+
}, [STATUS_IMCOMPLETE].concat(_toConsumableArray__default['default'](statusTypes.map(function (s) {
|
|
1411
|
+
return s.text;
|
|
1412
|
+
}))).map(function (status) {
|
|
1413
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1414
|
+
key: status,
|
|
1212
1415
|
onClick: function onClick() {
|
|
1213
|
-
_this2.selectStatusFilter(
|
|
1416
|
+
_this2.selectStatusFilter(status);
|
|
1214
1417
|
},
|
|
1215
|
-
text:
|
|
1216
|
-
className: "marginRight-10"
|
|
1418
|
+
text: status,
|
|
1419
|
+
className: "marginRight-10 marginBottom-10"
|
|
1217
1420
|
});
|
|
1218
1421
|
}));
|
|
1219
1422
|
}
|
|
1220
1423
|
|
|
1221
1424
|
if (this.state.filterOpen === 'time') {
|
|
1222
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1425
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1223
1426
|
title: "Select Time",
|
|
1224
1427
|
maxWidth: 600,
|
|
1225
1428
|
minWidth: 400,
|
|
@@ -1235,7 +1438,7 @@
|
|
|
1235
1438
|
style: {
|
|
1236
1439
|
minHeight: 150
|
|
1237
1440
|
}
|
|
1238
|
-
}, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1441
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$7.AnalyticsFilter, {
|
|
1239
1442
|
defaultFilter: this.state.selectedTimeFilter,
|
|
1240
1443
|
filterChanged: this.timeFilterChanged,
|
|
1241
1444
|
filterDateRangeChanged: this.timeFilterDateRangeChanged
|
|
@@ -1246,10 +1449,10 @@
|
|
|
1246
1449
|
var userContent = null;
|
|
1247
1450
|
|
|
1248
1451
|
if (this.state.selectedAssignee) {
|
|
1249
|
-
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1452
|
+
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1250
1453
|
key: this.state.selectedAssignee.id,
|
|
1251
1454
|
user: this.state.selectedAssignee,
|
|
1252
|
-
rightContent: /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1455
|
+
rightContent: /*#__PURE__*/React__default['default'].createElement(Components$7.SVGIcon, {
|
|
1253
1456
|
className: "removeIcon",
|
|
1254
1457
|
icon: "close",
|
|
1255
1458
|
onClick: function onClick() {
|
|
@@ -1259,7 +1462,7 @@
|
|
|
1259
1462
|
})
|
|
1260
1463
|
}));
|
|
1261
1464
|
} else {
|
|
1262
|
-
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1465
|
+
userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.GenericInput, {
|
|
1263
1466
|
id: "userSearch",
|
|
1264
1467
|
type: "text" // label="Search"
|
|
1265
1468
|
,
|
|
@@ -1275,7 +1478,7 @@
|
|
|
1275
1478
|
if (___default['default'].isEmpty(_this2.state.userSearch)) return true;
|
|
1276
1479
|
return u.displayName.toUpperCase().indexOf(_this2.state.userSearch.toUpperCase()) > -1;
|
|
1277
1480
|
}).map(function (user) {
|
|
1278
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1481
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1279
1482
|
key: user.id,
|
|
1280
1483
|
user: user,
|
|
1281
1484
|
onClick: function onClick() {
|
|
@@ -1285,7 +1488,7 @@
|
|
|
1285
1488
|
}));
|
|
1286
1489
|
}
|
|
1287
1490
|
|
|
1288
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1491
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1289
1492
|
title: "Select User",
|
|
1290
1493
|
maxWidth: 600,
|
|
1291
1494
|
minWidth: 400,
|
|
@@ -1300,6 +1503,64 @@
|
|
|
1300
1503
|
}, userContent);
|
|
1301
1504
|
}
|
|
1302
1505
|
|
|
1506
|
+
if (this.state.filterOpen === 'requester') {
|
|
1507
|
+
var _userContent = null;
|
|
1508
|
+
|
|
1509
|
+
if (this.state.selectedRequester) {
|
|
1510
|
+
_userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1511
|
+
key: this.state.selectedRequester.id,
|
|
1512
|
+
user: this.state.selectedRequester,
|
|
1513
|
+
rightContent: /*#__PURE__*/React__default['default'].createElement(Components$7.SVGIcon, {
|
|
1514
|
+
className: "removeIcon",
|
|
1515
|
+
icon: "close",
|
|
1516
|
+
onClick: function onClick() {
|
|
1517
|
+
_this2.onSelectRequester();
|
|
1518
|
+
},
|
|
1519
|
+
colour: PlussCore.Colours.COLOUR_DUSK
|
|
1520
|
+
})
|
|
1521
|
+
}));
|
|
1522
|
+
} else {
|
|
1523
|
+
_userContent = /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Components$7.GenericInput, {
|
|
1524
|
+
id: "requesterSearch",
|
|
1525
|
+
type: "text" // label="Search"
|
|
1526
|
+
,
|
|
1527
|
+
placeholder: "Search name",
|
|
1528
|
+
value: this.state.requesterSearch,
|
|
1529
|
+
onChange: function onChange(e) {
|
|
1530
|
+
return _this2.onHandleChange(e);
|
|
1531
|
+
},
|
|
1532
|
+
alwaysShowLabel: true
|
|
1533
|
+
}), ___default['default'].sortBy(this.state.requesters, function (u) {
|
|
1534
|
+
return u.displayName.toUpperCase();
|
|
1535
|
+
}).filter(function (u) {
|
|
1536
|
+
if (___default['default'].isEmpty(_this2.state.requesterSearch)) return true;
|
|
1537
|
+
return u.displayName.toUpperCase().indexOf(_this2.state.requesterSearch.toUpperCase()) > -1;
|
|
1538
|
+
}).map(function (user) {
|
|
1539
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1540
|
+
key: user.id,
|
|
1541
|
+
user: user,
|
|
1542
|
+
onClick: function onClick() {
|
|
1543
|
+
_this2.onSelectRequester(user);
|
|
1544
|
+
}
|
|
1545
|
+
});
|
|
1546
|
+
}));
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.Popup, {
|
|
1550
|
+
title: "Select User",
|
|
1551
|
+
maxWidth: 600,
|
|
1552
|
+
minWidth: 400,
|
|
1553
|
+
hasPadding: true,
|
|
1554
|
+
onClose: this.closeFilter,
|
|
1555
|
+
buttons: [{
|
|
1556
|
+
type: 'primaryAction',
|
|
1557
|
+
onClick: this.saveRequesterFilter,
|
|
1558
|
+
text: 'Select',
|
|
1559
|
+
isActive: true
|
|
1560
|
+
}]
|
|
1561
|
+
}, _userContent);
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1303
1564
|
return null;
|
|
1304
1565
|
}
|
|
1305
1566
|
}, {
|
|
@@ -1307,19 +1568,33 @@
|
|
|
1307
1568
|
value: function renderRequests() {
|
|
1308
1569
|
var _this3 = this;
|
|
1309
1570
|
|
|
1571
|
+
var statusTypes = this.props.statusTypes;
|
|
1572
|
+
var defaultStatus = statusTypes.find(function (s) {
|
|
1573
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
1574
|
+
});
|
|
1310
1575
|
return this.getSource().map(function (ev, index) {
|
|
1311
1576
|
if (!ev) {
|
|
1312
1577
|
return null;
|
|
1313
1578
|
}
|
|
1314
1579
|
|
|
1315
|
-
var status = ev.status &&
|
|
1580
|
+
var status = ev.status && statusTypes.find(function (s) {
|
|
1581
|
+
return s.text === ev.status;
|
|
1582
|
+
}) || defaultStatus;
|
|
1583
|
+
var priority = getJobPriority(ev.priority);
|
|
1316
1584
|
return /*#__PURE__*/React__default['default'].createElement("tr", {
|
|
1317
1585
|
key: index
|
|
1318
1586
|
}, /*#__PURE__*/React__default['default'].createElement("td", null, ev.jobId), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
1319
1587
|
className: "table-TitleColumn"
|
|
1320
1588
|
}, /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
|
|
1321
1589
|
to: "".concat(values.routeRequestDetails, "/").concat(ev.id)
|
|
1322
|
-
}, /*#__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.
|
|
1590
|
+
}, /*#__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, {
|
|
1591
|
+
user: {
|
|
1592
|
+
id: ev.userID,
|
|
1593
|
+
displayName: ev.userName,
|
|
1594
|
+
profilePic: ev.userProfilePic
|
|
1595
|
+
},
|
|
1596
|
+
textClass: "fontSize-13"
|
|
1597
|
+
}) : 'Unknown'), /*#__PURE__*/React__default['default'].createElement("td", null, ev.Assignee ? /*#__PURE__*/React__default['default'].createElement(Components$7.UserListing, {
|
|
1323
1598
|
user: ev.Assignee,
|
|
1324
1599
|
textClass: "fontSize-13"
|
|
1325
1600
|
}) : 'Unassigned'), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -1330,9 +1605,19 @@
|
|
|
1330
1605
|
paddingTop: 2,
|
|
1331
1606
|
paddingBottom: 2,
|
|
1332
1607
|
color: '#fff',
|
|
1333
|
-
backgroundColor: status.color
|
|
1608
|
+
backgroundColor: status ? status.color : undefined
|
|
1334
1609
|
}
|
|
1335
|
-
}, status.text)), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
1610
|
+
}, status ? status.text : '')), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1611
|
+
style: {
|
|
1612
|
+
textAlign: 'center',
|
|
1613
|
+
borderRadius: 4,
|
|
1614
|
+
width: 100,
|
|
1615
|
+
paddingTop: 2,
|
|
1616
|
+
paddingBottom: 2,
|
|
1617
|
+
color: '#fff',
|
|
1618
|
+
backgroundColor: priority.color
|
|
1619
|
+
}
|
|
1620
|
+
}, priority.name)), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
1336
1621
|
className: "table-options"
|
|
1337
1622
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1338
1623
|
style: {
|
|
@@ -1348,7 +1633,7 @@
|
|
|
1348
1633
|
cursor: 'pointer'
|
|
1349
1634
|
},
|
|
1350
1635
|
name: "pencil"
|
|
1351
|
-
})), Session$
|
|
1636
|
+
})), Session$7.validateAccess(_this3.props.auth.site, values.permissionMaintenanceTracking, _this3.props.auth) && /*#__PURE__*/React__default['default'].createElement("a", {
|
|
1352
1637
|
onClick: function onClick() {
|
|
1353
1638
|
return _this3.onRemoveRequest(ev);
|
|
1354
1639
|
}
|
|
@@ -1476,6 +1761,15 @@
|
|
|
1476
1761
|
_this4.sortByCol('room');
|
|
1477
1762
|
}
|
|
1478
1763
|
}, "Address", this.renderSort('room')), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1764
|
+
className: "".concat(this.sortIsActive('userName')),
|
|
1765
|
+
style: {
|
|
1766
|
+
cursor: 'pointer',
|
|
1767
|
+
width: 150
|
|
1768
|
+
},
|
|
1769
|
+
onClick: function onClick() {
|
|
1770
|
+
_this4.sortByCol('userName');
|
|
1771
|
+
}
|
|
1772
|
+
}, "Submitted By", this.renderSort('userName')), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1479
1773
|
className: "".concat(this.sortIsActive('assigned')),
|
|
1480
1774
|
style: {
|
|
1481
1775
|
cursor: 'pointer',
|
|
@@ -1489,6 +1783,10 @@
|
|
|
1489
1783
|
width: 120
|
|
1490
1784
|
}
|
|
1491
1785
|
}, "Status"), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1786
|
+
style: {
|
|
1787
|
+
width: 120
|
|
1788
|
+
}
|
|
1789
|
+
}, "Priority"), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
1492
1790
|
style: {
|
|
1493
1791
|
width: 50
|
|
1494
1792
|
}
|
|
@@ -1499,37 +1797,51 @@
|
|
|
1499
1797
|
value: function renderFilters() {
|
|
1500
1798
|
var _this5 = this;
|
|
1501
1799
|
|
|
1502
|
-
var typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1800
|
+
var typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1503
1801
|
className: "marginRight-10",
|
|
1504
1802
|
onClick: function onClick() {
|
|
1505
1803
|
_this5.openFilter('type');
|
|
1506
1804
|
},
|
|
1507
1805
|
text: values.textJobType
|
|
1508
1806
|
});
|
|
1509
|
-
var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1807
|
+
var statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1510
1808
|
className: "marginRight-10",
|
|
1511
1809
|
onClick: function onClick() {
|
|
1512
1810
|
_this5.openFilter('status');
|
|
1513
1811
|
},
|
|
1514
1812
|
text: "Status"
|
|
1515
1813
|
});
|
|
1516
|
-
var
|
|
1814
|
+
var priorityFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1815
|
+
className: "marginRight-10",
|
|
1816
|
+
onClick: function onClick() {
|
|
1817
|
+
_this5.openFilter('priority');
|
|
1818
|
+
},
|
|
1819
|
+
text: "Priority"
|
|
1820
|
+
});
|
|
1821
|
+
var timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1517
1822
|
className: "marginRight-10",
|
|
1518
1823
|
onClick: function onClick() {
|
|
1519
1824
|
_this5.openFilter('time');
|
|
1520
1825
|
},
|
|
1521
1826
|
text: "Time"
|
|
1522
1827
|
});
|
|
1523
|
-
var userFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1828
|
+
var userFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1524
1829
|
className: "marginRight-10",
|
|
1525
1830
|
onClick: function onClick() {
|
|
1526
1831
|
_this5.openFilter('user');
|
|
1527
1832
|
},
|
|
1528
1833
|
text: "Assigned To"
|
|
1529
1834
|
});
|
|
1835
|
+
var requesterFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1836
|
+
className: "marginRight-10",
|
|
1837
|
+
onClick: function onClick() {
|
|
1838
|
+
_this5.openFilter('requester');
|
|
1839
|
+
},
|
|
1840
|
+
text: "Submitted By"
|
|
1841
|
+
});
|
|
1530
1842
|
|
|
1531
1843
|
if (this.state.selectedTypeFilter) {
|
|
1532
|
-
typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1844
|
+
typeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1533
1845
|
className: "marginRight-10",
|
|
1534
1846
|
onClick: function onClick() {
|
|
1535
1847
|
_this5.openFilter('type');
|
|
@@ -1544,8 +1856,24 @@
|
|
|
1544
1856
|
});
|
|
1545
1857
|
}
|
|
1546
1858
|
|
|
1859
|
+
if (this.state.selectedPriorityFilter) {
|
|
1860
|
+
priorityFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1861
|
+
className: "marginRight-10",
|
|
1862
|
+
onClick: function onClick() {
|
|
1863
|
+
_this5.openFilter('priority');
|
|
1864
|
+
},
|
|
1865
|
+
rightIcon: "close",
|
|
1866
|
+
rightClick: function rightClick(e) {
|
|
1867
|
+
e.stopPropagation();
|
|
1868
|
+
|
|
1869
|
+
_this5.selectPriorityFilter();
|
|
1870
|
+
},
|
|
1871
|
+
text: this.state.selectedPriorityFilter
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1547
1875
|
if (this.state.selectedStatusFilter) {
|
|
1548
|
-
statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1876
|
+
statusFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1549
1877
|
className: "marginRight-10",
|
|
1550
1878
|
onClick: function onClick() {
|
|
1551
1879
|
_this5.openFilter('status');
|
|
@@ -1556,12 +1884,12 @@
|
|
|
1556
1884
|
|
|
1557
1885
|
_this5.selectStatusFilter();
|
|
1558
1886
|
},
|
|
1559
|
-
text: this.state.selectedStatusFilter
|
|
1887
|
+
text: this.state.selectedStatusFilter
|
|
1560
1888
|
});
|
|
1561
1889
|
}
|
|
1562
1890
|
|
|
1563
1891
|
if (this.state.selectedTimeFilterText) {
|
|
1564
|
-
timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1892
|
+
timeFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1565
1893
|
className: "marginRight-10",
|
|
1566
1894
|
onClick: function onClick() {
|
|
1567
1895
|
_this5.openFilter('time');
|
|
@@ -1577,7 +1905,7 @@
|
|
|
1577
1905
|
}
|
|
1578
1906
|
|
|
1579
1907
|
if (this.state.selectedUserFilter) {
|
|
1580
|
-
userFilter = /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1908
|
+
userFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1581
1909
|
className: "marginRight-10",
|
|
1582
1910
|
onClick: function onClick() {
|
|
1583
1911
|
_this5.openFilter('user');
|
|
@@ -1592,20 +1920,36 @@
|
|
|
1592
1920
|
});
|
|
1593
1921
|
}
|
|
1594
1922
|
|
|
1923
|
+
if (this.state.selectedRequesterFilter) {
|
|
1924
|
+
requesterFilter = /*#__PURE__*/React__default['default'].createElement(Components$7.Tag, {
|
|
1925
|
+
className: "marginRight-10",
|
|
1926
|
+
onClick: function onClick() {
|
|
1927
|
+
_this5.openFilter('requester');
|
|
1928
|
+
},
|
|
1929
|
+
rightIcon: "close",
|
|
1930
|
+
rightClick: function rightClick(e) {
|
|
1931
|
+
e.stopPropagation();
|
|
1932
|
+
|
|
1933
|
+
_this5.removeRequesterFilter();
|
|
1934
|
+
},
|
|
1935
|
+
text: this.state.selectedRequesterFilterText
|
|
1936
|
+
});
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1595
1939
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1596
1940
|
className: "marginTop-20 flex flex-between flex-center"
|
|
1597
1941
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1598
1942
|
className: "flex flex-center"
|
|
1599
|
-
}, /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1943
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$7.Text, {
|
|
1600
1944
|
type: "h5",
|
|
1601
1945
|
className: "marginRight-20"
|
|
1602
|
-
}, "Filter by"), typeFilter, statusFilter, timeFilter, userFilter), /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1946
|
+
}, "Filter by"), typeFilter, statusFilter, priorityFilter, timeFilter, userFilter, requesterFilter), /*#__PURE__*/React__default['default'].createElement(Components$7.Button, {
|
|
1603
1947
|
inline: true,
|
|
1604
1948
|
buttonType: "primaryAction",
|
|
1605
1949
|
leftIcon: "file-code-o",
|
|
1606
1950
|
onClick: this.onOpenExportCsv,
|
|
1607
1951
|
isActive: !___default['default'].isEmpty(this.getSource())
|
|
1608
|
-
}, "Export CSV")), /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1952
|
+
}, "Export CSV")), /*#__PURE__*/React__default['default'].createElement(Components$7.GenericInput, {
|
|
1609
1953
|
id: "search",
|
|
1610
1954
|
type: "text",
|
|
1611
1955
|
placeholder: "Search by ".concat(values.textEntityName, " ID, Address or Title"),
|
|
@@ -1630,7 +1974,7 @@
|
|
|
1630
1974
|
columns = _this$getExportSource.columns,
|
|
1631
1975
|
source = _this$getExportSource.source;
|
|
1632
1976
|
|
|
1633
|
-
return /*#__PURE__*/React__default['default'].createElement(Components$
|
|
1977
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$7.ExportCsvPopup, {
|
|
1634
1978
|
onClose: this.onCloseExportCsv,
|
|
1635
1979
|
columns: columns,
|
|
1636
1980
|
source: source,
|
|
@@ -1651,30 +1995,32 @@
|
|
|
1651
1995
|
return JobList;
|
|
1652
1996
|
}(React.Component);
|
|
1653
1997
|
|
|
1654
|
-
var mapStateToProps$
|
|
1998
|
+
var mapStateToProps$7 = function mapStateToProps(state) {
|
|
1655
1999
|
var auth = state.auth;
|
|
1656
2000
|
return {
|
|
1657
2001
|
jobs: state[values.reducerKey].jobs,
|
|
1658
2002
|
auth: auth,
|
|
1659
|
-
strings: state.strings && state.strings.config || {}
|
|
2003
|
+
strings: state.strings && state.strings.config || {},
|
|
2004
|
+
statusTypes: state[values.reducerKey].jobstatuses
|
|
1660
2005
|
};
|
|
1661
2006
|
};
|
|
1662
2007
|
|
|
1663
|
-
var JobList$1 = reactRedux.connect(mapStateToProps$
|
|
2008
|
+
var JobList$1 = reactRedux.connect(mapStateToProps$7, {
|
|
1664
2009
|
jobsLoaded: jobsLoaded,
|
|
1665
|
-
removeJob: removeJob
|
|
2010
|
+
removeJob: removeJob,
|
|
2011
|
+
jobStatusesUpdate: jobStatusesUpdate
|
|
1666
2012
|
})(reactRouter.withRouter(JobList));
|
|
1667
2013
|
|
|
1668
|
-
function _createSuper$
|
|
2014
|
+
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); }; }
|
|
1669
2015
|
|
|
1670
|
-
function _isNativeReflectConstruct$
|
|
1671
|
-
var Session$
|
|
1672
|
-
Components$
|
|
2016
|
+
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; } }
|
|
2017
|
+
var Session$6 = PlussCore__namespace.Session,
|
|
2018
|
+
Components$6 = PlussCore__namespace.Components;
|
|
1673
2019
|
|
|
1674
2020
|
var JobTypes = /*#__PURE__*/function (_Component) {
|
|
1675
2021
|
_inherits__default['default'](JobTypes, _Component);
|
|
1676
2022
|
|
|
1677
|
-
var _super = _createSuper$
|
|
2023
|
+
var _super = _createSuper$b(JobTypes);
|
|
1678
2024
|
|
|
1679
2025
|
function JobTypes(props) {
|
|
1680
2026
|
var _this;
|
|
@@ -1800,7 +2146,7 @@
|
|
|
1800
2146
|
key: "componentWillMount",
|
|
1801
2147
|
value: function componentWillMount() {
|
|
1802
2148
|
this.updateProps(this.props);
|
|
1803
|
-
Session$
|
|
2149
|
+
Session$6.checkLoggedIn(this, this.props.auth);
|
|
1804
2150
|
}
|
|
1805
2151
|
}, {
|
|
1806
2152
|
key: "componentDidMount",
|
|
@@ -1847,7 +2193,7 @@
|
|
|
1847
2193
|
display: 'flex',
|
|
1848
2194
|
alignItems: 'center'
|
|
1849
2195
|
}
|
|
1850
|
-
}, Session$
|
|
2196
|
+
}, Session$6.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React__default['default'].createElement(reactRouterDom.Link, {
|
|
1851
2197
|
to: "".concat(values.routeAddRequestType, "/").concat(ev.id)
|
|
1852
2198
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
1853
2199
|
style: {
|
|
@@ -1857,7 +2203,7 @@
|
|
|
1857
2203
|
cursor: 'pointer'
|
|
1858
2204
|
},
|
|
1859
2205
|
name: "pencil"
|
|
1860
|
-
})), Session$
|
|
2206
|
+
})), Session$6.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React__default['default'].createElement("a", {
|
|
1861
2207
|
onClick: function onClick() {
|
|
1862
2208
|
return _this2.onRemoveJobType(ev);
|
|
1863
2209
|
}
|
|
@@ -1944,50 +2290,581 @@
|
|
|
1944
2290
|
maxWidth: 500,
|
|
1945
2291
|
textAlign: 'center'
|
|
1946
2292
|
}
|
|
1947
|
-
}, values.textEmptyJobTypesExample));
|
|
2293
|
+
}, values.textEmptyJobTypesExample));
|
|
2294
|
+
}
|
|
2295
|
+
}, {
|
|
2296
|
+
key: "renderContent",
|
|
2297
|
+
value: function renderContent() {
|
|
2298
|
+
if (___default['default'].isEmpty(this.state.jobList)) return this.renderEmpty();
|
|
2299
|
+
return this.renderView();
|
|
2300
|
+
}
|
|
2301
|
+
}, {
|
|
2302
|
+
key: "renderJobTypes",
|
|
2303
|
+
value: function renderJobTypes() {
|
|
2304
|
+
var _this$state = this.state,
|
|
2305
|
+
jobList = _this$state.jobList,
|
|
2306
|
+
loading = _this$state.loading;
|
|
2307
|
+
|
|
2308
|
+
if (jobList.length === 0 && loading) {
|
|
2309
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2310
|
+
style: {
|
|
2311
|
+
minWidth: '100%'
|
|
2312
|
+
}
|
|
2313
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2314
|
+
className: "padding-60 paddingVertical-40",
|
|
2315
|
+
style: {
|
|
2316
|
+
textAlign: 'center'
|
|
2317
|
+
}
|
|
2318
|
+
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2319
|
+
style: {
|
|
2320
|
+
fontSize: 30,
|
|
2321
|
+
color: FeatureConfig.env.colourBrandingOff
|
|
2322
|
+
},
|
|
2323
|
+
name: "spinner fa-pulse fa-fw"
|
|
2324
|
+
})));
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2328
|
+
style: {
|
|
2329
|
+
minWidth: '100%'
|
|
2330
|
+
}
|
|
2331
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2332
|
+
className: "marginBottom-32"
|
|
2333
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$6.AddButton, {
|
|
2334
|
+
onClick: this.props.onNew,
|
|
2335
|
+
text: values.textNewTypeButton
|
|
2336
|
+
})), this.renderContent());
|
|
2337
|
+
}
|
|
2338
|
+
}, {
|
|
2339
|
+
key: "render",
|
|
2340
|
+
value: function render() {
|
|
2341
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2342
|
+
style: {
|
|
2343
|
+
minWidth: '100%'
|
|
2344
|
+
}
|
|
2345
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, this.renderJobTypes()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2346
|
+
className: "hub_tidioPadding"
|
|
2347
|
+
}));
|
|
2348
|
+
}
|
|
2349
|
+
}]);
|
|
2350
|
+
|
|
2351
|
+
return JobTypes;
|
|
2352
|
+
}(React.Component);
|
|
2353
|
+
|
|
2354
|
+
var mapStateToProps$6 = function mapStateToProps(state) {
|
|
2355
|
+
var auth = state.auth;
|
|
2356
|
+
return {
|
|
2357
|
+
jobtypes: state[values.reducerKey].jobtypes,
|
|
2358
|
+
auth: auth
|
|
2359
|
+
};
|
|
2360
|
+
};
|
|
2361
|
+
|
|
2362
|
+
var JobTypes$1 = reactRedux.connect(mapStateToProps$6, {
|
|
2363
|
+
jobTypesLoaded: jobTypesLoaded,
|
|
2364
|
+
jobTypesUpdate: jobTypesUpdate
|
|
2365
|
+
})(reactRouter.withRouter(JobTypes));
|
|
2366
|
+
|
|
2367
|
+
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; }
|
|
2368
|
+
|
|
2369
|
+
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; }
|
|
2370
|
+
|
|
2371
|
+
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); }; }
|
|
2372
|
+
|
|
2373
|
+
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; } }
|
|
2374
|
+
var Session$5 = PlussCore__namespace.Session,
|
|
2375
|
+
Components$5 = PlussCore__namespace.Components,
|
|
2376
|
+
Colours$2 = PlussCore__namespace.Colours;
|
|
2377
|
+
|
|
2378
|
+
var Configuration = /*#__PURE__*/function (_Component) {
|
|
2379
|
+
_inherits__default['default'](Configuration, _Component);
|
|
2380
|
+
|
|
2381
|
+
var _super = _createSuper$a(Configuration);
|
|
2382
|
+
|
|
2383
|
+
function Configuration(props) {
|
|
2384
|
+
var _this;
|
|
2385
|
+
|
|
2386
|
+
_classCallCheck__default['default'](this, Configuration);
|
|
2387
|
+
|
|
2388
|
+
_this = _super.call(this, props);
|
|
2389
|
+
|
|
2390
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "isStatusValid", function (statusLabel, statusCategory, statusColour) {
|
|
2391
|
+
if (___default['default'].isEmpty(statusLabel)) return false;
|
|
2392
|
+
if (___default['default'].isEmpty(statusCategory)) return false;
|
|
2393
|
+
if (___default['default'].isEmpty(statusColour)) return false;
|
|
2394
|
+
return true;
|
|
2395
|
+
});
|
|
2396
|
+
|
|
2397
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onMoveStatus", function (index) {
|
|
2398
|
+
var up = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2399
|
+
if (_this.state.fetchingStatusTypes) return;
|
|
2400
|
+
|
|
2401
|
+
var statusTypes = ___default['default'].cloneDeep(_this.state.statusTypes);
|
|
2402
|
+
|
|
2403
|
+
if (up && index > 0) {
|
|
2404
|
+
// Moving up
|
|
2405
|
+
var _ref = [statusTypes[index], statusTypes[index - 1]];
|
|
2406
|
+
statusTypes[index - 1] = _ref[0];
|
|
2407
|
+
statusTypes[index] = _ref[1];
|
|
2408
|
+
} else if (index < statusTypes.length - 1) {
|
|
2409
|
+
// Moving down
|
|
2410
|
+
var _ref2 = [statusTypes[index + 1], statusTypes[index]];
|
|
2411
|
+
statusTypes[index] = _ref2[0];
|
|
2412
|
+
statusTypes[index + 1] = _ref2[1];
|
|
2413
|
+
} // Reset order
|
|
2414
|
+
|
|
2415
|
+
|
|
2416
|
+
statusTypes.forEach(function (status, index) {
|
|
2417
|
+
return status.order = index;
|
|
2418
|
+
});
|
|
2419
|
+
|
|
2420
|
+
_this.setState({
|
|
2421
|
+
statusTypes: statusTypes
|
|
2422
|
+
});
|
|
2423
|
+
});
|
|
2424
|
+
|
|
2425
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onEditStatus", function (index) {
|
|
2426
|
+
if (_this.state.fetchingStatusTypes) return;
|
|
2427
|
+
var status = _this.state.statusTypes[index];
|
|
2428
|
+
|
|
2429
|
+
_this.setState({
|
|
2430
|
+
showWarnings: false,
|
|
2431
|
+
showStatusPopup: true,
|
|
2432
|
+
selectedStatusIndex: index,
|
|
2433
|
+
statusLabel: status.text,
|
|
2434
|
+
statusCategory: status.category,
|
|
2435
|
+
statusColour: status.color
|
|
2436
|
+
});
|
|
2437
|
+
});
|
|
2438
|
+
|
|
2439
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteStatus", function (index) {
|
|
2440
|
+
if (_this.state.fetchingStatusTypes) return;
|
|
2441
|
+
|
|
2442
|
+
var statusTypes = ___default['default'].cloneDeep(_this.state.statusTypes);
|
|
2443
|
+
|
|
2444
|
+
statusTypes.splice(index, 1);
|
|
2445
|
+
|
|
2446
|
+
_this.setState({
|
|
2447
|
+
statusTypes: statusTypes
|
|
2448
|
+
});
|
|
2449
|
+
});
|
|
2450
|
+
|
|
2451
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddStatus", function () {
|
|
2452
|
+
var defaultStatus = _this.props.statusTypes.find(function (s) {
|
|
2453
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
2454
|
+
});
|
|
2455
|
+
|
|
2456
|
+
_this.setState({
|
|
2457
|
+
showWarnings: false,
|
|
2458
|
+
showStatusPopup: true,
|
|
2459
|
+
selectedStatusIndex: -1,
|
|
2460
|
+
statusLabel: '',
|
|
2461
|
+
statusCategory: STATUS_NOT_ACTIONED,
|
|
2462
|
+
statusColour: defaultStatus.color
|
|
2463
|
+
});
|
|
2464
|
+
});
|
|
2465
|
+
|
|
2466
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSaveStatus", function () {
|
|
2467
|
+
var _this$state = _this.state,
|
|
2468
|
+
selectedStatusIndex = _this$state.selectedStatusIndex,
|
|
2469
|
+
statusLabel = _this$state.statusLabel,
|
|
2470
|
+
statusCategory = _this$state.statusCategory,
|
|
2471
|
+
statusColour = _this$state.statusColour;
|
|
2472
|
+
|
|
2473
|
+
var statusTypes = ___default['default'].cloneDeep(_this.state.statusTypes);
|
|
2474
|
+
|
|
2475
|
+
if (selectedStatusIndex < 0) {
|
|
2476
|
+
statusTypes.push({
|
|
2477
|
+
text: statusLabel,
|
|
2478
|
+
order: statusTypes.length,
|
|
2479
|
+
color: statusColour,
|
|
2480
|
+
category: statusCategory
|
|
2481
|
+
});
|
|
2482
|
+
} else {
|
|
2483
|
+
var status = statusTypes[selectedStatusIndex];
|
|
2484
|
+
status.text = statusLabel;
|
|
2485
|
+
status.color = statusColour;
|
|
2486
|
+
status.category = statusCategory;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
_this.setState({
|
|
2490
|
+
statusTypes: statusTypes,
|
|
2491
|
+
showStatusPopup: false
|
|
2492
|
+
});
|
|
2493
|
+
});
|
|
2494
|
+
|
|
2495
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHideStatusPopup", function () {
|
|
2496
|
+
if (_this.state.submitting) return;
|
|
2497
|
+
|
|
2498
|
+
_this.setState({
|
|
2499
|
+
showStatusPopup: false
|
|
2500
|
+
});
|
|
2501
|
+
});
|
|
2502
|
+
|
|
2503
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
2504
|
+
var stateChange = {};
|
|
2505
|
+
stateChange[event.target.getAttribute('id')] = event.target.value;
|
|
2506
|
+
|
|
2507
|
+
_this.setState(stateChange);
|
|
2508
|
+
});
|
|
2509
|
+
|
|
2510
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onToggleDisableSeen", function () {
|
|
2511
|
+
if (_this.state.fetchingHideSeen) return;
|
|
2512
|
+
|
|
2513
|
+
_this.setState({
|
|
2514
|
+
hideSeen: !_this.state.hideSeen
|
|
2515
|
+
});
|
|
2516
|
+
});
|
|
2517
|
+
|
|
2518
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSaveConfig", function () {
|
|
2519
|
+
if (!_this.validateForm()) return;
|
|
2520
|
+
|
|
2521
|
+
_this.setState({
|
|
2522
|
+
success: false,
|
|
2523
|
+
submitting: true
|
|
2524
|
+
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
2525
|
+
var _this$state2, statusTypes, hideSeen;
|
|
2526
|
+
|
|
2527
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2528
|
+
while (1) {
|
|
2529
|
+
switch (_context.prev = _context.next) {
|
|
2530
|
+
case 0:
|
|
2531
|
+
_context.prev = 0;
|
|
2532
|
+
_this$state2 = _this.state, statusTypes = _this$state2.statusTypes, hideSeen = _this$state2.hideSeen;
|
|
2533
|
+
_context.next = 4;
|
|
2534
|
+
return stringActions.setString(_this.props.auth.site, values.stringConfigJobStatus, statusTypes);
|
|
2535
|
+
|
|
2536
|
+
case 4:
|
|
2537
|
+
_context.next = 6;
|
|
2538
|
+
return stringActions.setString(_this.props.auth.site, values.stringConfigHideSeen, hideSeen);
|
|
2539
|
+
|
|
2540
|
+
case 6:
|
|
2541
|
+
_this.props.jobStatusesLoaded(statusTypes);
|
|
2542
|
+
|
|
2543
|
+
_this.props.jobHideSeenLoaded(hideSeen);
|
|
2544
|
+
|
|
2545
|
+
_this.setState({
|
|
2546
|
+
success: true
|
|
2547
|
+
});
|
|
2548
|
+
|
|
2549
|
+
_context.next = 15;
|
|
2550
|
+
break;
|
|
2551
|
+
|
|
2552
|
+
case 11:
|
|
2553
|
+
_context.prev = 11;
|
|
2554
|
+
_context.t0 = _context["catch"](0);
|
|
2555
|
+
console.log('onSaveConfig - error', _context.t0);
|
|
2556
|
+
|
|
2557
|
+
_this.setState({
|
|
2558
|
+
success: false
|
|
2559
|
+
});
|
|
2560
|
+
|
|
2561
|
+
case 15:
|
|
2562
|
+
_context.prev = 15;
|
|
2563
|
+
|
|
2564
|
+
_this.setState({
|
|
2565
|
+
submitting: false
|
|
2566
|
+
});
|
|
2567
|
+
|
|
2568
|
+
return _context.finish(15);
|
|
2569
|
+
|
|
2570
|
+
case 18:
|
|
2571
|
+
case "end":
|
|
2572
|
+
return _context.stop();
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
}, _callee, null, [[0, 11, 15, 18]]);
|
|
2576
|
+
})));
|
|
2577
|
+
});
|
|
2578
|
+
|
|
2579
|
+
_this.state = {
|
|
2580
|
+
success: false,
|
|
2581
|
+
submitting: false,
|
|
2582
|
+
selectedStatusIndex: -1,
|
|
2583
|
+
showStatusPopup: false,
|
|
2584
|
+
statusLabel: '',
|
|
2585
|
+
statusCategory: STATUS_NOT_ACTIONED,
|
|
2586
|
+
statusColour: '',
|
|
2587
|
+
fetchingStatusTypes: true,
|
|
2588
|
+
statusTypes: _this.props.statusTypes,
|
|
2589
|
+
fetchingHideSeen: true,
|
|
2590
|
+
hideSeen: _this.props.hideSeen
|
|
2591
|
+
};
|
|
2592
|
+
return _this;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
_createClass__default['default'](Configuration, [{
|
|
2596
|
+
key: "UNSAFE_componentWillMount",
|
|
2597
|
+
value: function UNSAFE_componentWillMount() {
|
|
2598
|
+
Session$5.checkLoggedIn(this);
|
|
2599
|
+
}
|
|
2600
|
+
}, {
|
|
2601
|
+
key: "componentDidMount",
|
|
2602
|
+
value: function componentDidMount() {
|
|
2603
|
+
var _this2 = this;
|
|
2604
|
+
|
|
2605
|
+
if (!Session$5.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth, true)) {
|
|
2606
|
+
this.props.history.push('/mastermenu');
|
|
2607
|
+
} else {
|
|
2608
|
+
this.props.jobStatusesUpdate(this.props.auth.site, function (statusTypes) {
|
|
2609
|
+
return _this2.setState({
|
|
2610
|
+
statusTypes: statusTypes,
|
|
2611
|
+
fetchingStatusTypes: false
|
|
2612
|
+
});
|
|
2613
|
+
});
|
|
2614
|
+
this.props.jobHideSeenUpdate(this.props.auth.site, function (hideSeen) {
|
|
2615
|
+
return _this2.setState({
|
|
2616
|
+
hideSeen: hideSeen,
|
|
2617
|
+
fetchingHideSeen: false
|
|
2618
|
+
});
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
}, {
|
|
2623
|
+
key: "validateForm",
|
|
2624
|
+
value: function validateForm() {
|
|
2625
|
+
var _this3 = this;
|
|
2626
|
+
|
|
2627
|
+
var _this$state3 = this.state,
|
|
2628
|
+
submitting = _this$state3.submitting,
|
|
2629
|
+
statusTypes = _this$state3.statusTypes;
|
|
2630
|
+
if (submitting) return false; // Validate statuses
|
|
2631
|
+
|
|
2632
|
+
var statusesValid = statusTypes.map(function (status) {
|
|
2633
|
+
var text = status.text,
|
|
2634
|
+
category = status.category,
|
|
2635
|
+
color = status.color;
|
|
2636
|
+
return _this3.isStatusValid(text, category, color);
|
|
2637
|
+
});
|
|
2638
|
+
if (!statusesValid.every(function (valid) {
|
|
2639
|
+
return valid;
|
|
2640
|
+
})) return false;
|
|
2641
|
+
return true;
|
|
2642
|
+
}
|
|
2643
|
+
}, {
|
|
2644
|
+
key: "renderStatuses",
|
|
2645
|
+
value: function renderStatuses() {
|
|
2646
|
+
var _this4 = this;
|
|
2647
|
+
|
|
2648
|
+
var statusTypes = this.state.statusTypes;
|
|
2649
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
2650
|
+
className: "fontMedium fontSize-36 text-dark"
|
|
2651
|
+
}, "Statuses"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2652
|
+
style: styles$6.statusCategoryHeading
|
|
2653
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2654
|
+
className: "fontMedium fontSize-16 text-bold"
|
|
2655
|
+
}, "Status Category")), statusTypes.map(function (status, index) {
|
|
2656
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2657
|
+
key: "".concat(status.text, "_").concat(index),
|
|
2658
|
+
style: styles$6.statusTypeContainer
|
|
2659
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2660
|
+
key: status.text,
|
|
2661
|
+
className: "statusLabel",
|
|
2662
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.statusTextContainer), {}, {
|
|
2663
|
+
backgroundColor: status.color
|
|
2664
|
+
})
|
|
2665
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2666
|
+
className: "statusLabel_text"
|
|
2667
|
+
}, status.text)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2668
|
+
style: styles$6.statusCategoryContainer
|
|
2669
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2670
|
+
className: "fontMedium fontSize-16 text-dark"
|
|
2671
|
+
}, status.category)), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2672
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
|
|
2673
|
+
visibility: index === 0 ? 'hidden' : 'visible'
|
|
2674
|
+
}),
|
|
2675
|
+
name: 'arrow-up',
|
|
2676
|
+
onClick: function onClick() {
|
|
2677
|
+
return _this4.onMoveStatus(index, true);
|
|
2678
|
+
}
|
|
2679
|
+
}), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2680
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
|
|
2681
|
+
visibility: index === statusTypes.length - 1 ? 'hidden' : 'visible'
|
|
2682
|
+
}),
|
|
2683
|
+
name: 'arrow-down',
|
|
2684
|
+
onClick: function onClick() {
|
|
2685
|
+
return _this4.onMoveStatus(index, false);
|
|
2686
|
+
}
|
|
2687
|
+
}), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2688
|
+
style: _objectSpread$5({}, styles$6.statusIcon),
|
|
2689
|
+
name: "pencil",
|
|
2690
|
+
onClick: function onClick() {
|
|
2691
|
+
return _this4.onEditStatus(index);
|
|
2692
|
+
}
|
|
2693
|
+
}), /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
2694
|
+
style: _objectSpread$5({}, styles$6.statusIcon),
|
|
2695
|
+
name: "minus-circle",
|
|
2696
|
+
onClick: function onClick() {
|
|
2697
|
+
return _this4.onDeleteStatus(index);
|
|
2698
|
+
}
|
|
2699
|
+
}));
|
|
2700
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2701
|
+
onClick: this.onAddStatus,
|
|
2702
|
+
style: {
|
|
2703
|
+
display: 'flex',
|
|
2704
|
+
flexDirection: 'row',
|
|
2705
|
+
alignItems: 'center',
|
|
2706
|
+
marginTop: 16
|
|
2707
|
+
}
|
|
2708
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$5.P60Icon, {
|
|
2709
|
+
className: "addoption_plus",
|
|
2710
|
+
icon: "add",
|
|
2711
|
+
style: {
|
|
2712
|
+
fontSize: 12
|
|
2713
|
+
}
|
|
2714
|
+
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
2715
|
+
className: "addoption_text"
|
|
2716
|
+
}, "Add another status")));
|
|
1948
2717
|
}
|
|
1949
2718
|
}, {
|
|
1950
|
-
key: "
|
|
1951
|
-
value: function
|
|
1952
|
-
|
|
1953
|
-
|
|
2719
|
+
key: "renderOtherOptions",
|
|
2720
|
+
value: function renderOtherOptions() {
|
|
2721
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2722
|
+
className: "marginTop-55"
|
|
2723
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
2724
|
+
className: "fontMedium fontSize-36 text-dark"
|
|
2725
|
+
}, "Other options"), /*#__PURE__*/React__default['default'].createElement(Components$5.CheckBox, {
|
|
2726
|
+
label: "Disable whether a request has been \"Seen\" and prevent that from being surfaced to the App user",
|
|
2727
|
+
isActive: this.state.hideSeen,
|
|
2728
|
+
onChange: this.onToggleDisableSeen
|
|
2729
|
+
}));
|
|
1954
2730
|
}
|
|
1955
2731
|
}, {
|
|
1956
|
-
key: "
|
|
1957
|
-
value: function
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2732
|
+
key: "renderSubmit",
|
|
2733
|
+
value: function renderSubmit() {
|
|
2734
|
+
if (this.state.submitting) {
|
|
2735
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$5.Button, {
|
|
2736
|
+
buttonType: "secondary"
|
|
2737
|
+
}, "Saving...");
|
|
2738
|
+
}
|
|
1961
2739
|
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
2740
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$5.Button, {
|
|
2741
|
+
inline: true,
|
|
2742
|
+
buttonType: "primary",
|
|
2743
|
+
onClick: this.onSaveConfig,
|
|
2744
|
+
isActive: this.validateForm()
|
|
2745
|
+
}, "Save");
|
|
2746
|
+
}
|
|
2747
|
+
}, {
|
|
2748
|
+
key: "renderSuccess",
|
|
2749
|
+
value: function renderSuccess() {
|
|
2750
|
+
if (!this.state.success) return null;
|
|
2751
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2752
|
+
style: _objectSpread$5(_objectSpread$5({}, styles$6.savedText), {}, {
|
|
2753
|
+
color: Colours$2.COLOUR_GREEN
|
|
2754
|
+
})
|
|
2755
|
+
}, "Saved");
|
|
2756
|
+
}
|
|
2757
|
+
}, {
|
|
2758
|
+
key: "renderNewStatusPopup",
|
|
2759
|
+
value: function renderNewStatusPopup() {
|
|
2760
|
+
var _ref4,
|
|
2761
|
+
_this5 = this;
|
|
2762
|
+
|
|
2763
|
+
var _this$state4 = this.state,
|
|
2764
|
+
submitting = _this$state4.submitting,
|
|
2765
|
+
showStatusPopup = _this$state4.showStatusPopup,
|
|
2766
|
+
showWarnings = _this$state4.showWarnings,
|
|
2767
|
+
selectedStatusIndex = _this$state4.selectedStatusIndex,
|
|
2768
|
+
statusLabel = _this$state4.statusLabel,
|
|
2769
|
+
statusCategory = _this$state4.statusCategory,
|
|
2770
|
+
statusColour = _this$state4.statusColour;
|
|
2771
|
+
if (!showStatusPopup) return null;
|
|
2772
|
+
var canSave = !submitting && this.isStatusValid(statusLabel, statusCategory, statusColour);
|
|
2773
|
+
return /*#__PURE__*/React__default['default'].createElement(Components$5.Popup, {
|
|
2774
|
+
maxWidth: 800,
|
|
2775
|
+
minWidth: 450,
|
|
2776
|
+
hasPadding: true,
|
|
2777
|
+
buttons: [(_ref4 = {
|
|
2778
|
+
type: 'primaryAction',
|
|
2779
|
+
onClick: this.onSaveStatus,
|
|
2780
|
+
isActive: canSave
|
|
2781
|
+
}, _defineProperty__default['default'](_ref4, "isActive", true), _defineProperty__default['default'](_ref4, "text", submitting ? 'Saving...' : 'Save'), _defineProperty__default['default'](_ref4, "className", 'popupButton'), _ref4), {
|
|
2782
|
+
type: 'outlinedAction',
|
|
2783
|
+
onClick: this.onHideStatusPopup,
|
|
2784
|
+
isActive: !submitting,
|
|
2785
|
+
text: 'Cancel',
|
|
2786
|
+
className: 'popupButton'
|
|
2787
|
+
}],
|
|
2788
|
+
onClose: this.onHideStatusPopup,
|
|
2789
|
+
title: selectedStatusIndex < 0 ? 'New Status' : 'Edit Status'
|
|
2790
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$5.GenericInput, {
|
|
2791
|
+
id: "statusLabel",
|
|
2792
|
+
type: "text",
|
|
2793
|
+
label: "Label",
|
|
2794
|
+
placeholder: "Status label",
|
|
2795
|
+
value: statusLabel,
|
|
2796
|
+
onChange: this.onHandleChange,
|
|
2797
|
+
isRequired: true,
|
|
2798
|
+
isValid: function isValid() {
|
|
2799
|
+
return !___default['default'].isEmpty(statusLabel);
|
|
2800
|
+
},
|
|
2801
|
+
showError: function showError() {
|
|
2802
|
+
return showWarnings && ___default['default'].isEmpty(statusLabel);
|
|
2803
|
+
},
|
|
2804
|
+
alwaysShowLabel: true,
|
|
2805
|
+
className: "marginBottom-20"
|
|
2806
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components$5.RadioButton, {
|
|
2807
|
+
label: "Status Category",
|
|
2808
|
+
subLabel: /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2809
|
+
className: "marginBottom-16"
|
|
1967
2810
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1968
|
-
className: "
|
|
1969
|
-
|
|
1970
|
-
|
|
2811
|
+
className: "marginBottom-4"
|
|
2812
|
+
}, 'This is used to categorise statuses for filtering and analytics purposes'), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2813
|
+
className: "text-bold"
|
|
2814
|
+
}, 'This status is considered')),
|
|
2815
|
+
className: "marginBottom-20",
|
|
2816
|
+
rowStyle: {
|
|
2817
|
+
flexDirection: 'column'
|
|
2818
|
+
},
|
|
2819
|
+
buttonStyle: {
|
|
2820
|
+
marginBottom: 8
|
|
2821
|
+
},
|
|
2822
|
+
isActive: statusCategory || null,
|
|
2823
|
+
options: [{
|
|
2824
|
+
Label: STATUS_NOT_ACTIONED,
|
|
2825
|
+
Value: STATUS_NOT_ACTIONED,
|
|
2826
|
+
onChange: function onChange() {
|
|
2827
|
+
return _this5.setState({
|
|
2828
|
+
statusCategory: STATUS_NOT_ACTIONED
|
|
2829
|
+
});
|
|
1971
2830
|
}
|
|
1972
|
-
},
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
2831
|
+
}, {
|
|
2832
|
+
Label: STATUS_IN_PROGRESS,
|
|
2833
|
+
Value: STATUS_IN_PROGRESS,
|
|
2834
|
+
onChange: function onChange() {
|
|
2835
|
+
return _this5.setState({
|
|
2836
|
+
statusCategory: STATUS_IN_PROGRESS
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
}, {
|
|
2840
|
+
Label: STATUS_COMPLETED,
|
|
2841
|
+
Value: STATUS_COMPLETED,
|
|
2842
|
+
onChange: function onChange() {
|
|
2843
|
+
return _this5.setState({
|
|
2844
|
+
statusCategory: STATUS_COMPLETED
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
}]
|
|
2848
|
+
}), /*#__PURE__*/React__default['default'].createElement(Components$5.ColourOptions, {
|
|
2849
|
+
options: ['vibrant', 'picker'],
|
|
2850
|
+
defaultTab: "vibrant",
|
|
2851
|
+
value: statusColour,
|
|
2852
|
+
onColourSelected: function onColourSelected(statusColour) {
|
|
2853
|
+
return _this5.setState({
|
|
2854
|
+
statusColour: statusColour
|
|
2855
|
+
});
|
|
1984
2856
|
}
|
|
2857
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2858
|
+
className: "marginTop-24"
|
|
1985
2859
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1986
|
-
className: "marginBottom-
|
|
1987
|
-
}, /*#__PURE__*/React__default['default'].createElement(Components$5.
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2860
|
+
className: "fieldLabel marginBottom-4"
|
|
2861
|
+
}, "Preview"), /*#__PURE__*/React__default['default'].createElement(Components$5.Tag, {
|
|
2862
|
+
text: this.state.statusLabel,
|
|
2863
|
+
style: {
|
|
2864
|
+
backgroundColor: statusColour,
|
|
2865
|
+
borderColor: statusColour
|
|
2866
|
+
}
|
|
2867
|
+
})));
|
|
1991
2868
|
}
|
|
1992
2869
|
}, {
|
|
1993
2870
|
key: "render",
|
|
@@ -1996,27 +2873,68 @@
|
|
|
1996
2873
|
style: {
|
|
1997
2874
|
minWidth: '100%'
|
|
1998
2875
|
}
|
|
1999
|
-
},
|
|
2000
|
-
|
|
2001
|
-
|
|
2876
|
+
}, this.renderStatuses(), this.renderOtherOptions(), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2877
|
+
style: {
|
|
2878
|
+
paddingTop: 24,
|
|
2879
|
+
paddingBottom: 24
|
|
2880
|
+
}
|
|
2881
|
+
}, this.renderSubmit(), this.renderSuccess()), this.renderNewStatusPopup());
|
|
2002
2882
|
}
|
|
2003
2883
|
}]);
|
|
2004
2884
|
|
|
2005
|
-
return
|
|
2885
|
+
return Configuration;
|
|
2006
2886
|
}(React.Component);
|
|
2007
2887
|
|
|
2888
|
+
var styles$6 = {
|
|
2889
|
+
statusCategoryHeading: {
|
|
2890
|
+
marginLeft: 130,
|
|
2891
|
+
width: 160,
|
|
2892
|
+
textAlign: 'center',
|
|
2893
|
+
marginBottom: 12
|
|
2894
|
+
},
|
|
2895
|
+
statusTypeContainer: {
|
|
2896
|
+
display: 'flex',
|
|
2897
|
+
flexDirection: 'row',
|
|
2898
|
+
alignItems: 'center',
|
|
2899
|
+
marginBottom: 20
|
|
2900
|
+
},
|
|
2901
|
+
statusTextContainer: {
|
|
2902
|
+
width: 130
|
|
2903
|
+
},
|
|
2904
|
+
statusCategoryContainer: {
|
|
2905
|
+
width: 160,
|
|
2906
|
+
textAlign: 'center'
|
|
2907
|
+
},
|
|
2908
|
+
statusIcon: {
|
|
2909
|
+
cursor: 'pointer',
|
|
2910
|
+
fontSize: 20,
|
|
2911
|
+
padding: 5,
|
|
2912
|
+
marginLeft: 10,
|
|
2913
|
+
color: Colours$2.COLOUR_BRANDING_ACTION,
|
|
2914
|
+
visibility: 'visible'
|
|
2915
|
+
},
|
|
2916
|
+
savedText: {
|
|
2917
|
+
fontSize: 14,
|
|
2918
|
+
lineHeight: '33px',
|
|
2919
|
+
marginLeft: 15
|
|
2920
|
+
}
|
|
2921
|
+
};
|
|
2922
|
+
|
|
2008
2923
|
var mapStateToProps$5 = function mapStateToProps(state) {
|
|
2009
2924
|
var auth = state.auth;
|
|
2010
2925
|
return {
|
|
2011
|
-
|
|
2012
|
-
|
|
2926
|
+
auth: auth,
|
|
2927
|
+
statusTypes: state[values.reducerKey].jobstatuses,
|
|
2928
|
+
hideSeen: state[values.reducerKey].hideSeen
|
|
2013
2929
|
};
|
|
2014
2930
|
};
|
|
2015
2931
|
|
|
2016
|
-
var
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2932
|
+
var Configuration$1 = reactRedux.connect(mapStateToProps$5, {
|
|
2933
|
+
jobStatusesUpdate: jobStatusesUpdate,
|
|
2934
|
+
jobStatusesLoaded: jobStatusesLoaded,
|
|
2935
|
+
jobHideSeenUpdate: jobHideSeenUpdate,
|
|
2936
|
+
jobHideSeenLoaded: jobHideSeenLoaded
|
|
2937
|
+
})(reactRouter.withRouter(Configuration));
|
|
2020
2938
|
|
|
2021
2939
|
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); }; }
|
|
2022
2940
|
|
|
@@ -2226,6 +3144,21 @@
|
|
|
2226
3144
|
});
|
|
2227
3145
|
}
|
|
2228
3146
|
|
|
3147
|
+
if (Session$4.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth)) {
|
|
3148
|
+
sectionItems.push({
|
|
3149
|
+
type: 'navItem',
|
|
3150
|
+
text: 'Feature Configuration',
|
|
3151
|
+
icon: 'settings',
|
|
3152
|
+
isFontAwesome: false,
|
|
3153
|
+
selected: this.state.selectedSection === 'config',
|
|
3154
|
+
onClick: function onClick() {
|
|
3155
|
+
_this2.setState({
|
|
3156
|
+
selectedSection: 'config'
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3161
|
+
|
|
2229
3162
|
var helpGuide = null;
|
|
2230
3163
|
return /*#__PURE__*/React__default['default'].createElement(Components$4.HubSidebar, {
|
|
2231
3164
|
sections: [{
|
|
@@ -2242,6 +3175,8 @@
|
|
|
2242
3175
|
return /*#__PURE__*/React__default['default'].createElement(JobTypes$1, {
|
|
2243
3176
|
onNew: this.onAddRequestType
|
|
2244
3177
|
});
|
|
3178
|
+
} else if (this.state.selectedSection === 'config') {
|
|
3179
|
+
return /*#__PURE__*/React__default['default'].createElement(Configuration$1, null);
|
|
2245
3180
|
}
|
|
2246
3181
|
|
|
2247
3182
|
return /*#__PURE__*/React__default['default'].createElement(JobList$1, {
|
|
@@ -2313,6 +3248,7 @@
|
|
|
2313
3248
|
Session$3 = PlussCore__namespace.Session,
|
|
2314
3249
|
Colours$1 = PlussCore__namespace.Colours,
|
|
2315
3250
|
Components$3 = PlussCore__namespace.Components;
|
|
3251
|
+
var IMAGE_SIZE_NOTE = 72;
|
|
2316
3252
|
|
|
2317
3253
|
var Job = /*#__PURE__*/function (_Component) {
|
|
2318
3254
|
_inherits__default['default'](Job, _Component);
|
|
@@ -2397,13 +3333,20 @@
|
|
|
2397
3333
|
})));
|
|
2398
3334
|
|
|
2399
3335
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
|
|
2400
|
-
var
|
|
3336
|
+
var statusTypes = _this.props.statusTypes;
|
|
3337
|
+
var statusType = statusTypes.find(function (s) {
|
|
2401
3338
|
return s.text === status;
|
|
2402
3339
|
});
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
3340
|
+
|
|
3341
|
+
if (!statusType) {
|
|
3342
|
+
var defaultStatus = statusTypes.find(function (s) {
|
|
3343
|
+
return s.category === STATUS_NOT_ACTIONED;
|
|
3344
|
+
});
|
|
3345
|
+
statusType = _objectSpread$4(_objectSpread$4({}, defaultStatus), {}, {
|
|
3346
|
+
text: status
|
|
3347
|
+
});
|
|
3348
|
+
}
|
|
3349
|
+
|
|
2407
3350
|
return statusType;
|
|
2408
3351
|
});
|
|
2409
3352
|
|
|
@@ -2446,11 +3389,12 @@
|
|
|
2446
3389
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "isReadyToSaveNote", function () {
|
|
2447
3390
|
var _this$state = _this.state,
|
|
2448
3391
|
noteAttachments = _this$state.noteAttachments,
|
|
2449
|
-
noteInput = _this$state.noteInput
|
|
3392
|
+
noteInput = _this$state.noteInput,
|
|
3393
|
+
noteImages = _this$state.noteImages;
|
|
2450
3394
|
if (___default['default'].some(noteAttachments, function (n) {
|
|
2451
3395
|
return n.Uploading;
|
|
2452
3396
|
})) return false;
|
|
2453
|
-
return !___default['default'].isEmpty(noteInput) || !___default['default'].isEmpty(noteAttachments);
|
|
3397
|
+
return !___default['default'].isEmpty(noteInput) || !___default['default'].isEmpty(noteAttachments) || !___default['default'].isEmpty(noteImages);
|
|
2454
3398
|
});
|
|
2455
3399
|
|
|
2456
3400
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onOpenAddNote", function () {
|
|
@@ -2469,6 +3413,7 @@
|
|
|
2469
3413
|
if (!!_this.state.editingNote) {
|
|
2470
3414
|
newState.noteInput = '';
|
|
2471
3415
|
newState.noteAttachments = [];
|
|
3416
|
+
newState.noteImages = [];
|
|
2472
3417
|
}
|
|
2473
3418
|
|
|
2474
3419
|
_this.setState(newState);
|
|
@@ -2656,12 +3601,12 @@
|
|
|
2656
3601
|
Title: a.Title,
|
|
2657
3602
|
Source: a.Source
|
|
2658
3603
|
};
|
|
2659
|
-
})) : maintenanceActions.addNote(_this.state.jobId, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
3604
|
+
}), _this.state.noteImages) : maintenanceActions.addNote(_this.state.jobId, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
2660
3605
|
return {
|
|
2661
3606
|
Title: a.Title,
|
|
2662
3607
|
Source: a.Source
|
|
2663
3608
|
};
|
|
2664
|
-
}));
|
|
3609
|
+
}), _this.state.noteImages);
|
|
2665
3610
|
|
|
2666
3611
|
case 6:
|
|
2667
3612
|
res = _context5.sent;
|
|
@@ -2672,6 +3617,7 @@
|
|
|
2672
3617
|
addNoteOpen: false,
|
|
2673
3618
|
noteInput: '',
|
|
2674
3619
|
noteAttachments: [],
|
|
3620
|
+
noteImages: [],
|
|
2675
3621
|
editingNote: null
|
|
2676
3622
|
}, function () {
|
|
2677
3623
|
_this.props.jobsLoaded([_this.state.job]);
|
|
@@ -2721,11 +3667,12 @@
|
|
|
2721
3667
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onOpenEditNote", function (n) {
|
|
2722
3668
|
_this.setState({
|
|
2723
3669
|
noteAttachments: n.Attachments || [],
|
|
3670
|
+
noteImages: n.Images || [],
|
|
2724
3671
|
noteInput: n.Note || '',
|
|
2725
3672
|
addNoteOpen: true,
|
|
2726
3673
|
editingNote: n.Id,
|
|
2727
3674
|
noteMenuOpen: null
|
|
2728
|
-
});
|
|
3675
|
+
}, _this.checkSetImage);
|
|
2729
3676
|
});
|
|
2730
3677
|
|
|
2731
3678
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "markSeen", function () {
|
|
@@ -2831,53 +3778,54 @@
|
|
|
2831
3778
|
_this.setState(stateChange);
|
|
2832
3779
|
});
|
|
2833
3780
|
|
|
2834
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "
|
|
3781
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onTogglePriorityChanger", function () {
|
|
2835
3782
|
_this.setState({
|
|
2836
|
-
|
|
3783
|
+
priorityChangerOpen: !_this.state.priorityChangerOpen
|
|
2837
3784
|
});
|
|
2838
3785
|
});
|
|
2839
3786
|
|
|
2840
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "
|
|
2841
|
-
var _ref8 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8(
|
|
2842
|
-
var res;
|
|
3787
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
|
|
3788
|
+
var _ref8 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8(priority) {
|
|
3789
|
+
var res, job;
|
|
2843
3790
|
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
2844
3791
|
while (1) {
|
|
2845
3792
|
switch (_context8.prev = _context8.next) {
|
|
2846
3793
|
case 0:
|
|
2847
3794
|
_this.setState({
|
|
2848
3795
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
2849
|
-
|
|
3796
|
+
priority: priority
|
|
2850
3797
|
}),
|
|
2851
|
-
|
|
3798
|
+
priorityChangerOpen: false
|
|
2852
3799
|
});
|
|
2853
3800
|
|
|
2854
3801
|
_context8.prev = 1;
|
|
2855
3802
|
_context8.next = 4;
|
|
2856
|
-
return maintenanceActions.
|
|
3803
|
+
return maintenanceActions.editJobPriority(_this.state.job.id, priority);
|
|
2857
3804
|
|
|
2858
3805
|
case 4:
|
|
2859
3806
|
res = _context8.sent;
|
|
3807
|
+
job = res.data.job;
|
|
3808
|
+
|
|
3809
|
+
_this.props.jobsLoaded([job]);
|
|
2860
3810
|
|
|
2861
3811
|
_this.setState({
|
|
2862
|
-
job:
|
|
2863
|
-
}, function () {
|
|
2864
|
-
_this.props.jobsLoaded([_this.state.job]);
|
|
3812
|
+
job: job
|
|
2865
3813
|
});
|
|
2866
3814
|
|
|
2867
|
-
_context8.next =
|
|
3815
|
+
_context8.next = 13;
|
|
2868
3816
|
break;
|
|
2869
3817
|
|
|
2870
|
-
case
|
|
2871
|
-
_context8.prev =
|
|
3818
|
+
case 10:
|
|
3819
|
+
_context8.prev = 10;
|
|
2872
3820
|
_context8.t0 = _context8["catch"](1);
|
|
2873
|
-
console.error('
|
|
3821
|
+
console.error('onSelectPriority', _context8.t0);
|
|
2874
3822
|
|
|
2875
|
-
case
|
|
3823
|
+
case 13:
|
|
2876
3824
|
case "end":
|
|
2877
3825
|
return _context8.stop();
|
|
2878
3826
|
}
|
|
2879
3827
|
}
|
|
2880
|
-
}, _callee8, null, [[1,
|
|
3828
|
+
}, _callee8, null, [[1, 10]]);
|
|
2881
3829
|
}));
|
|
2882
3830
|
|
|
2883
3831
|
return function (_x2) {
|
|
@@ -2885,6 +3833,61 @@
|
|
|
2885
3833
|
};
|
|
2886
3834
|
}());
|
|
2887
3835
|
|
|
3836
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onToggleStatusChanger", function () {
|
|
3837
|
+
_this.setState({
|
|
3838
|
+
statusChangerOpen: !_this.state.statusChangerOpen
|
|
3839
|
+
});
|
|
3840
|
+
});
|
|
3841
|
+
|
|
3842
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
|
|
3843
|
+
var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(status) {
|
|
3844
|
+
var res, job;
|
|
3845
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
3846
|
+
while (1) {
|
|
3847
|
+
switch (_context9.prev = _context9.next) {
|
|
3848
|
+
case 0:
|
|
3849
|
+
_this.setState({
|
|
3850
|
+
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
3851
|
+
status: status
|
|
3852
|
+
}),
|
|
3853
|
+
statusChangerOpen: false
|
|
3854
|
+
});
|
|
3855
|
+
|
|
3856
|
+
_context9.prev = 1;
|
|
3857
|
+
_context9.next = 4;
|
|
3858
|
+
return maintenanceActions.editJobStatus(_this.state.job.id, status);
|
|
3859
|
+
|
|
3860
|
+
case 4:
|
|
3861
|
+
res = _context9.sent;
|
|
3862
|
+
job = res.data.job;
|
|
3863
|
+
|
|
3864
|
+
_this.props.jobsLoaded([job]);
|
|
3865
|
+
|
|
3866
|
+
_this.setState({
|
|
3867
|
+
job: job
|
|
3868
|
+
});
|
|
3869
|
+
|
|
3870
|
+
_context9.next = 13;
|
|
3871
|
+
break;
|
|
3872
|
+
|
|
3873
|
+
case 10:
|
|
3874
|
+
_context9.prev = 10;
|
|
3875
|
+
_context9.t0 = _context9["catch"](1);
|
|
3876
|
+
console.error('onSelectStatus', _context9.t0);
|
|
3877
|
+
|
|
3878
|
+
case 13:
|
|
3879
|
+
case "end":
|
|
3880
|
+
return _context9.stop();
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
}, _callee9, null, [[1, 10]]);
|
|
3884
|
+
}));
|
|
3885
|
+
|
|
3886
|
+
return function (_x3) {
|
|
3887
|
+
return _ref9.apply(this, arguments);
|
|
3888
|
+
};
|
|
3889
|
+
}());
|
|
3890
|
+
|
|
2888
3891
|
_this.state = {
|
|
2889
3892
|
jobId: Helper$2.safeReadParams(props, 'jobId') ? props.match.params.jobId : null,
|
|
2890
3893
|
job: null,
|
|
@@ -2893,10 +3896,12 @@
|
|
|
2893
3896
|
comments: [],
|
|
2894
3897
|
commentInput: '',
|
|
2895
3898
|
loadingComments: false,
|
|
3899
|
+
priorityChangerOpen: false,
|
|
2896
3900
|
statusChangerOpen: false,
|
|
2897
3901
|
addNoteOpen: false,
|
|
2898
3902
|
noteAttachments: [],
|
|
2899
3903
|
noteInput: '',
|
|
3904
|
+
noteImages: [],
|
|
2900
3905
|
assignees: []
|
|
2901
3906
|
};
|
|
2902
3907
|
return _this;
|
|
@@ -2910,12 +3915,64 @@
|
|
|
2910
3915
|
}, {
|
|
2911
3916
|
key: "componentDidMount",
|
|
2912
3917
|
value: function componentDidMount() {
|
|
3918
|
+
this.props.jobStatusesUpdate(this.props.auth.site);
|
|
3919
|
+
|
|
2913
3920
|
if (this.state.jobId) {
|
|
2914
3921
|
this.getJob();
|
|
2915
3922
|
this.getComments();
|
|
2916
3923
|
this.getAssignees();
|
|
2917
3924
|
}
|
|
2918
3925
|
}
|
|
3926
|
+
}, {
|
|
3927
|
+
key: "checkSetImage",
|
|
3928
|
+
value: function checkSetImage() {
|
|
3929
|
+
if (this.imageInput && !___default['default'].isEmpty(this.state.noteImages)) {
|
|
3930
|
+
this.imageInput.getWrappedInstance().setValue(this.state.noteImages);
|
|
3931
|
+
} else {
|
|
3932
|
+
setTimeout(this.checkSetImage, 100);
|
|
3933
|
+
}
|
|
3934
|
+
}
|
|
3935
|
+
}, {
|
|
3936
|
+
key: "renderPriorityChanger",
|
|
3937
|
+
value: function renderPriorityChanger() {
|
|
3938
|
+
var _this2 = this;
|
|
3939
|
+
|
|
3940
|
+
if (!this.state.priorityChangerOpen) return null;
|
|
3941
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3942
|
+
className: "statusChanger statusChanger-priority"
|
|
3943
|
+
}, jobPriorityOptions.map(function (p) {
|
|
3944
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3945
|
+
key: p.name,
|
|
3946
|
+
className: "statusLabel",
|
|
3947
|
+
onClick: function onClick() {
|
|
3948
|
+
return _this2.onSelectPriority(p.name);
|
|
3949
|
+
},
|
|
3950
|
+
style: {
|
|
3951
|
+
backgroundColor: p.color
|
|
3952
|
+
}
|
|
3953
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3954
|
+
className: "statusLabel_text"
|
|
3955
|
+
}, p.name));
|
|
3956
|
+
}));
|
|
3957
|
+
}
|
|
3958
|
+
}, {
|
|
3959
|
+
key: "renderPriorityLabel",
|
|
3960
|
+
value: function renderPriorityLabel() {
|
|
3961
|
+
var auth = this.props.auth;
|
|
3962
|
+
if (!Session$3.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return null;
|
|
3963
|
+
var job = this.state.job;
|
|
3964
|
+
if (!job) return null;
|
|
3965
|
+
var selectedPriority = getJobPriority(job.priority);
|
|
3966
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3967
|
+
className: "statusLabel marginTop-5 pointer",
|
|
3968
|
+
onClick: this.onTogglePriorityChanger,
|
|
3969
|
+
style: {
|
|
3970
|
+
backgroundColor: selectedPriority.color
|
|
3971
|
+
}
|
|
3972
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3973
|
+
className: "statusLabel_text"
|
|
3974
|
+
}, job.priority || selectedPriority.name), this.renderPriorityChanger());
|
|
3975
|
+
}
|
|
2919
3976
|
}, {
|
|
2920
3977
|
key: "renderStatusLabel",
|
|
2921
3978
|
value: function renderStatusLabel() {
|
|
@@ -2979,24 +4036,25 @@
|
|
|
2979
4036
|
}, {
|
|
2980
4037
|
key: "renderStatusChanger",
|
|
2981
4038
|
value: function renderStatusChanger() {
|
|
2982
|
-
var
|
|
4039
|
+
var _this3 = this;
|
|
2983
4040
|
|
|
2984
4041
|
if (!this.state.statusChangerOpen) return null;
|
|
4042
|
+
var statusTypes = this.props.statusTypes;
|
|
2985
4043
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2986
4044
|
className: "statusChanger statusChanger-maintenance"
|
|
2987
|
-
},
|
|
4045
|
+
}, statusTypes.map(function (status) {
|
|
2988
4046
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2989
|
-
key:
|
|
4047
|
+
key: status.text,
|
|
2990
4048
|
className: "statusLabel",
|
|
2991
4049
|
onClick: function onClick() {
|
|
2992
|
-
return
|
|
4050
|
+
return _this3.onSelectStatus(status.text);
|
|
2993
4051
|
},
|
|
2994
4052
|
style: {
|
|
2995
|
-
backgroundColor:
|
|
4053
|
+
backgroundColor: status.color
|
|
2996
4054
|
}
|
|
2997
4055
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2998
4056
|
className: "statusLabel_text"
|
|
2999
|
-
},
|
|
4057
|
+
}, status.text));
|
|
3000
4058
|
}));
|
|
3001
4059
|
}
|
|
3002
4060
|
}, {
|
|
@@ -3010,7 +4068,7 @@
|
|
|
3010
4068
|
}, {
|
|
3011
4069
|
key: "renderCommentSection",
|
|
3012
4070
|
value: function renderCommentSection() {
|
|
3013
|
-
var
|
|
4071
|
+
var _this4 = this;
|
|
3014
4072
|
|
|
3015
4073
|
if (this.state.loadingComments) return null;
|
|
3016
4074
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3023,7 +4081,7 @@
|
|
|
3023
4081
|
}, "Comments"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3024
4082
|
className: "commentSection"
|
|
3025
4083
|
}, this.state.comments.map(function (c) {
|
|
3026
|
-
return
|
|
4084
|
+
return _this4.renderComment(c);
|
|
3027
4085
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3028
4086
|
className: "commentReply"
|
|
3029
4087
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3039,13 +4097,14 @@
|
|
|
3039
4097
|
className: "commentReply_input",
|
|
3040
4098
|
value: this.state.commentInput,
|
|
3041
4099
|
onChange: function onChange(e) {
|
|
3042
|
-
return
|
|
4100
|
+
return _this4.onHandleChange(e);
|
|
3043
4101
|
}
|
|
3044
4102
|
}))));
|
|
3045
4103
|
}
|
|
3046
4104
|
}, {
|
|
3047
4105
|
key: "renderImageGrid",
|
|
3048
4106
|
value: function renderImageGrid(images) {
|
|
4107
|
+
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
3049
4108
|
var imagesToUse = images && images.length > 0 ? images : [];
|
|
3050
4109
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3051
4110
|
className: "imageGrid"
|
|
@@ -3058,7 +4117,9 @@
|
|
|
3058
4117
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3059
4118
|
className: "imageGrid_image",
|
|
3060
4119
|
style: {
|
|
3061
|
-
backgroundImage: "url('".concat(Helper$2.get1400(image), "')")
|
|
4120
|
+
backgroundImage: "url('".concat(Helper$2.get1400(image), "')"),
|
|
4121
|
+
width: size,
|
|
4122
|
+
height: size
|
|
3062
4123
|
}
|
|
3063
4124
|
}));
|
|
3064
4125
|
}));
|
|
@@ -3078,7 +4139,7 @@
|
|
|
3078
4139
|
}, {
|
|
3079
4140
|
key: "renderCustomFields",
|
|
3080
4141
|
value: function renderCustomFields() {
|
|
3081
|
-
var
|
|
4142
|
+
var _this5 = this;
|
|
3082
4143
|
|
|
3083
4144
|
var job = this.state.job;
|
|
3084
4145
|
var customFields = job.customFields;
|
|
@@ -3108,7 +4169,7 @@
|
|
|
3108
4169
|
}, field.answer && Array.isArray(field.answer) ? field.answer.join(', ') : '');
|
|
3109
4170
|
|
|
3110
4171
|
case 'image':
|
|
3111
|
-
return
|
|
4172
|
+
return _this5.renderImageGrid(field.answer);
|
|
3112
4173
|
|
|
3113
4174
|
default:
|
|
3114
4175
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3229,12 +4290,12 @@
|
|
|
3229
4290
|
}
|
|
3230
4291
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3231
4292
|
className: "statusLabel_text"
|
|
3232
|
-
}, e ? "
|
|
4293
|
+
}, e ? "".concat(entryToUse.user.displayName, " marked as ").concat(statusType.text) : "".concat(values.textEntityName, " opened"))));
|
|
3233
4294
|
}
|
|
3234
4295
|
}, {
|
|
3235
4296
|
key: "renderNote",
|
|
3236
4297
|
value: function renderNote(note, index) {
|
|
3237
|
-
var
|
|
4298
|
+
var _this6 = this;
|
|
3238
4299
|
|
|
3239
4300
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3240
4301
|
className: "ticketHistoryEntry",
|
|
@@ -3257,7 +4318,7 @@
|
|
|
3257
4318
|
icon: "more15",
|
|
3258
4319
|
className: "maintenanceNote_moreIcon",
|
|
3259
4320
|
onClick: function onClick() {
|
|
3260
|
-
return
|
|
4321
|
+
return _this6.onOpenNoteMenu(index);
|
|
3261
4322
|
}
|
|
3262
4323
|
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
3263
4324
|
className: "maintenanceNote_name"
|
|
@@ -3266,20 +4327,20 @@
|
|
|
3266
4327
|
key: 'edit',
|
|
3267
4328
|
text: 'Edit',
|
|
3268
4329
|
onPress: function onPress() {
|
|
3269
|
-
return
|
|
4330
|
+
return _this6.onOpenEditNote(note);
|
|
3270
4331
|
}
|
|
3271
4332
|
}, {
|
|
3272
4333
|
key: 'delete',
|
|
3273
4334
|
text: 'Delete',
|
|
3274
4335
|
onPress: function onPress() {
|
|
3275
|
-
return
|
|
4336
|
+
return _this6.onDeleteNote(note);
|
|
3276
4337
|
}
|
|
3277
4338
|
}]
|
|
3278
4339
|
})), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
3279
4340
|
className: "maintenanceNote_text"
|
|
3280
4341
|
}, Helper$2.toParagraphed(note.Note)), note.Attachments.map(function (a, i) {
|
|
3281
|
-
return
|
|
3282
|
-
})));
|
|
4342
|
+
return _this6.renderAttachment(a, i);
|
|
4343
|
+
}), note.Images && note.Images.length > 0 ? this.renderImageGrid(note.Images, IMAGE_SIZE_NOTE) : null));
|
|
3283
4344
|
}
|
|
3284
4345
|
}, {
|
|
3285
4346
|
key: "renderAssignment",
|
|
@@ -3320,10 +4381,24 @@
|
|
|
3320
4381
|
className: "statusLabel_text"
|
|
3321
4382
|
}, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
|
|
3322
4383
|
}
|
|
4384
|
+
}, {
|
|
4385
|
+
key: "renderPriority",
|
|
4386
|
+
value: function renderPriority() {
|
|
4387
|
+
var auth = this.props.auth;
|
|
4388
|
+
if (!Session$3.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return null;
|
|
4389
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4390
|
+
className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
|
|
4391
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4392
|
+
className: "newTopBar clearfix flex flex-reverse"
|
|
4393
|
+
}, this.renderPriorityLabel(), /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4394
|
+
type: "formTitleSmall",
|
|
4395
|
+
className: "flex-1"
|
|
4396
|
+
}, "Priority")));
|
|
4397
|
+
}
|
|
3323
4398
|
}, {
|
|
3324
4399
|
key: "renderOverview",
|
|
3325
4400
|
value: function renderOverview() {
|
|
3326
|
-
var
|
|
4401
|
+
var _this7 = this;
|
|
3327
4402
|
|
|
3328
4403
|
var job = this.state.job;
|
|
3329
4404
|
if (!job || !job.history) return null;
|
|
@@ -3349,13 +4424,13 @@
|
|
|
3349
4424
|
}, "Status History")), this.renderHistoryEntry(null, -1), ___default['default'].map(source, function (e, i) {
|
|
3350
4425
|
switch (e.EntryType) {
|
|
3351
4426
|
case 'status':
|
|
3352
|
-
return
|
|
4427
|
+
return _this7.renderHistoryEntry(e, i);
|
|
3353
4428
|
|
|
3354
4429
|
case 'note':
|
|
3355
|
-
return
|
|
4430
|
+
return _this7.renderNote(e, i);
|
|
3356
4431
|
|
|
3357
4432
|
case 'assignment':
|
|
3358
|
-
return
|
|
4433
|
+
return _this7.renderAssignmentEntry(e, i);
|
|
3359
4434
|
}
|
|
3360
4435
|
}));
|
|
3361
4436
|
}
|
|
@@ -3401,7 +4476,7 @@
|
|
|
3401
4476
|
}, {
|
|
3402
4477
|
key: "renderAddNotePopup",
|
|
3403
4478
|
value: function renderAddNotePopup() {
|
|
3404
|
-
var
|
|
4479
|
+
var _this8 = this;
|
|
3405
4480
|
|
|
3406
4481
|
if (!this.state.addNoteOpen) return null;
|
|
3407
4482
|
|
|
@@ -3441,7 +4516,7 @@
|
|
|
3441
4516
|
value: this.state.noteInput,
|
|
3442
4517
|
placeholder: "Enter note",
|
|
3443
4518
|
onChange: function onChange(e) {
|
|
3444
|
-
return
|
|
4519
|
+
return _this8.onHandleChange(e);
|
|
3445
4520
|
},
|
|
3446
4521
|
inputStyle: {
|
|
3447
4522
|
width: 400
|
|
@@ -3449,34 +4524,44 @@
|
|
|
3449
4524
|
}), /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
3450
4525
|
type: "h5"
|
|
3451
4526
|
}, "Attachments"), this.state.noteAttachments.map(function (a, i) {
|
|
3452
|
-
return
|
|
4527
|
+
return _this8.renderAttachment(a, i, _this8.onRemoveAttachment);
|
|
3453
4528
|
}), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
3454
4529
|
ref: function ref(input) {
|
|
3455
|
-
return
|
|
4530
|
+
return _this8.attachmentInput = input;
|
|
3456
4531
|
},
|
|
3457
4532
|
id: "attachmentInput",
|
|
3458
4533
|
type: "file",
|
|
3459
4534
|
className: "fileInput",
|
|
3460
4535
|
onChange: function onChange(e) {
|
|
3461
|
-
return
|
|
4536
|
+
return _this8.onHandlePDFFileChange(e);
|
|
3462
4537
|
},
|
|
3463
4538
|
accept: "application/pdf"
|
|
3464
4539
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3465
|
-
className: "iconTextButton",
|
|
4540
|
+
className: "iconTextButton marginBottom-16",
|
|
3466
4541
|
onClick: function onClick() {
|
|
3467
|
-
|
|
4542
|
+
_this8.attachmentInput.click();
|
|
3468
4543
|
}
|
|
3469
4544
|
}, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
|
|
3470
4545
|
className: "iconTextButton_icon",
|
|
3471
4546
|
name: "paperclip"
|
|
3472
4547
|
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
3473
4548
|
className: "iconTextButton_text"
|
|
3474
|
-
}, "Add Attachment"))
|
|
4549
|
+
}, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
|
|
4550
|
+
ref: function ref(_ref10) {
|
|
4551
|
+
_this8.imageInput = _ref10;
|
|
4552
|
+
},
|
|
4553
|
+
multiple: true,
|
|
4554
|
+
refreshCallback: function refreshCallback(images) {
|
|
4555
|
+
_this8.setState({
|
|
4556
|
+
noteImages: images
|
|
4557
|
+
});
|
|
4558
|
+
}
|
|
4559
|
+
}));
|
|
3475
4560
|
}
|
|
3476
4561
|
}, {
|
|
3477
4562
|
key: "renderUsers",
|
|
3478
4563
|
value: function renderUsers() {
|
|
3479
|
-
var
|
|
4564
|
+
var _this9 = this;
|
|
3480
4565
|
|
|
3481
4566
|
var content = null;
|
|
3482
4567
|
|
|
@@ -3495,7 +4580,7 @@
|
|
|
3495
4580
|
className: "removeIcon",
|
|
3496
4581
|
icon: "close",
|
|
3497
4582
|
onClick: function onClick() {
|
|
3498
|
-
|
|
4583
|
+
_this9.onSelectAssignee();
|
|
3499
4584
|
},
|
|
3500
4585
|
colour: Colours$1.COLOUR_DUSK
|
|
3501
4586
|
})
|
|
@@ -3508,20 +4593,20 @@
|
|
|
3508
4593
|
placeholder: "Search name",
|
|
3509
4594
|
value: this.state.userSearch,
|
|
3510
4595
|
onChange: function onChange(e) {
|
|
3511
|
-
return
|
|
4596
|
+
return _this9.onHandleChange(e);
|
|
3512
4597
|
},
|
|
3513
4598
|
alwaysShowLabel: true
|
|
3514
4599
|
}), ___default['default'].sortBy(this.state.assignees, function (u) {
|
|
3515
4600
|
return u.displayName.toUpperCase();
|
|
3516
4601
|
}).filter(function (u) {
|
|
3517
|
-
if (___default['default'].isEmpty(
|
|
3518
|
-
return u.displayName.toUpperCase().indexOf(
|
|
4602
|
+
if (___default['default'].isEmpty(_this9.state.userSearch)) return true;
|
|
4603
|
+
return u.displayName.toUpperCase().indexOf(_this9.state.userSearch.toUpperCase()) > -1;
|
|
3519
4604
|
}).map(function (user) {
|
|
3520
4605
|
return /*#__PURE__*/React__default['default'].createElement(Components$3.UserListing, {
|
|
3521
4606
|
key: user.id,
|
|
3522
4607
|
user: user,
|
|
3523
4608
|
onClick: function onClick() {
|
|
3524
|
-
|
|
4609
|
+
_this9.onSelectAssignee(user);
|
|
3525
4610
|
}
|
|
3526
4611
|
});
|
|
3527
4612
|
}));
|
|
@@ -3562,7 +4647,7 @@
|
|
|
3562
4647
|
className: "pageSectionWrapper--fixedPopupSize"
|
|
3563
4648
|
}, this.renderInner()), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageSection, {
|
|
3564
4649
|
className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
|
|
3565
|
-
}, this.renderAssignment(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4650
|
+
}, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
3566
4651
|
}
|
|
3567
4652
|
}]);
|
|
3568
4653
|
|
|
@@ -3572,12 +4657,14 @@
|
|
|
3572
4657
|
var mapStateToProps$3 = function mapStateToProps(state) {
|
|
3573
4658
|
var auth = state.auth;
|
|
3574
4659
|
return {
|
|
3575
|
-
auth: auth
|
|
4660
|
+
auth: auth,
|
|
4661
|
+
statusTypes: state[values.reducerKey].jobstatuses
|
|
3576
4662
|
};
|
|
3577
4663
|
};
|
|
3578
4664
|
|
|
3579
4665
|
var Job$1 = reactRedux.connect(mapStateToProps$3, {
|
|
3580
|
-
jobsLoaded: jobsLoaded
|
|
4666
|
+
jobsLoaded: jobsLoaded,
|
|
4667
|
+
jobStatusesUpdate: jobStatusesUpdate
|
|
3581
4668
|
})(reactRouter.withRouter(Job));
|
|
3582
4669
|
|
|
3583
4670
|
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; }
|
|
@@ -5962,8 +7049,9 @@
|
|
|
5962
7049
|
var INITIAL_STATE = {
|
|
5963
7050
|
jobs: [],
|
|
5964
7051
|
jobtypes: [],
|
|
5965
|
-
|
|
5966
|
-
|
|
7052
|
+
jobstatuses: jobStatusOptions,
|
|
7053
|
+
loading: false,
|
|
7054
|
+
hideSeen: false
|
|
5967
7055
|
};
|
|
5968
7056
|
var MaintenanceReducer = (function () {
|
|
5969
7057
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
|
|
@@ -6006,33 +7094,25 @@
|
|
|
6006
7094
|
return state;
|
|
6007
7095
|
|
|
6008
7096
|
case JOBS_TYPES_LOADED:
|
|
6009
|
-
var
|
|
7097
|
+
var jobtypes = ___default['default'].unionWith(action.payload, state.jobtypes, function (v1, v2) {
|
|
6010
7098
|
return v1 != null && v2 != null && v1.id === v2.id;
|
|
6011
7099
|
});
|
|
6012
7100
|
|
|
6013
7101
|
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
6014
|
-
jobtypes:
|
|
7102
|
+
jobtypes: jobtypes
|
|
7103
|
+
});
|
|
7104
|
+
|
|
7105
|
+
case JOBS_STATUSES_LOADED:
|
|
7106
|
+
var jobstatuses = ___default['default'].orderBy(action.payload, 'order', 'asc');
|
|
7107
|
+
|
|
7108
|
+
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
7109
|
+
jobstatuses: jobstatuses
|
|
7110
|
+
});
|
|
7111
|
+
|
|
7112
|
+
case JOBS_HIDE_SEEN:
|
|
7113
|
+
return _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
7114
|
+
hideSeen: action.payload
|
|
6015
7115
|
});
|
|
6016
|
-
// case JOBS_TYPES_REMOVED:
|
|
6017
|
-
// const indexSub = _.findIndex(state.jobtypes, (event) => {
|
|
6018
|
-
// return event != null && event.id === action.payload;
|
|
6019
|
-
// });
|
|
6020
|
-
// if (indexSub > -1) {
|
|
6021
|
-
// const newEventsSub = [...state.jobtypes];
|
|
6022
|
-
// newEventsSub.splice(indexSub, 1);
|
|
6023
|
-
// return { ...state, jobtypes: newEventsSub };
|
|
6024
|
-
// }
|
|
6025
|
-
// return state;
|
|
6026
|
-
// case TICKETS_LOADED:
|
|
6027
|
-
// const ticketResult = _.unionWith(action.payload, state.tickets, (v1, v2) => {
|
|
6028
|
-
// return v1 != null && v2 != null && v1.Id === v2.Id;
|
|
6029
|
-
// });
|
|
6030
|
-
// return {
|
|
6031
|
-
// ...state,
|
|
6032
|
-
// tickets: ticketResult,
|
|
6033
|
-
// };
|
|
6034
|
-
// case JOBS_PURGE:
|
|
6035
|
-
// return INITIAL_STATE;
|
|
6036
7116
|
|
|
6037
7117
|
default:
|
|
6038
7118
|
return state;
|