@plusscommunities/pluss-maintenance-web 1.1.23 → 1.1.24-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -14,7 +14,7 @@ import _ from 'lodash';
14
14
  import moment from 'moment';
15
15
  import FontAwesome from 'react-fontawesome';
16
16
  import * as PlussCore from '@plusscommunities/pluss-core-web';
17
- import { Colours as Colours$2 } from '@plusscommunities/pluss-core-web';
17
+ import { Colours as Colours$3 } from '@plusscommunities/pluss-core-web';
18
18
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
19
19
  import { Table, MenuItem, DropdownButton } from 'react-bootstrap';
20
20
  import { Link } from 'react-router-dom';
@@ -32,6 +32,8 @@ var values = {
32
32
  actionJobsLoaded: 'JOBS_LOADED',
33
33
  actionJobsRemoved: 'JOBS_REMOVED',
34
34
  actionJobsTypesLoaded: 'JOBS_TYPES_LOADED',
35
+ actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADED',
36
+ actionJobsHideSeen: 'JOBS_HIDE_SEEN',
35
37
  actionJobsLoading: 'JOBS_LOADING',
36
38
  permissionMaintenanceTracking: 'maintenanceTracking',
37
39
  permissionMaintenanceTypes: 'maintenanceTypes',
@@ -85,7 +87,9 @@ var values = {
85
87
  hiddenKeyMoreSectionMaintenance: 'maintenanceRequest',
86
88
  forceCustomFields: false,
87
89
  textEntityName: 'Job',
88
- hasHelpButton: true
90
+ hasHelpButton: true,
91
+ stringConfigJobStatus: 'maintenanceJobStatus',
92
+ stringConfigHideSeen: 'maintenanceDisableSeen'
89
93
  };
90
94
 
91
95
  // import * as PlussCore from '../../pluss-core/src';
@@ -206,19 +210,21 @@ var FeatureConfig = {
206
210
  };
207
211
 
208
212
  var JOBS_LOADED = values.actionJobsLoaded;
213
+ var JOBS_LOADING = values.actionJobsLoading;
209
214
  var JOBS_REMOVED = values.actionJobsRemoved;
210
215
  var JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
211
- var JOBS_LOADING = values.actionJobsLoading;
216
+ var JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
217
+ var JOBS_HIDE_SEEN = values.actionJobsHideSeen;
212
218
 
213
- 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; }
219
+ 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; }
214
220
 
215
- 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(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; }
221
+ 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(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; }
216
222
  var Helper$5 = PlussCore.Helper,
217
- Session$8 = PlussCore.Session;
223
+ Session$9 = PlussCore.Session;
218
224
  var maintenanceActions = {
219
225
  getJobType: function getJobType(site, typeId) {
220
226
  var url = Helper$5.getUrl(values.serviceKey, 'getjobtype');
221
- return Session$8.authedFunction({
227
+ return Session$9.authedFunction({
222
228
  method: 'POST',
223
229
  url: url,
224
230
  data: {
@@ -229,7 +235,7 @@ var maintenanceActions = {
229
235
  },
230
236
  getJobTypes: function getJobTypes(site, id) {
231
237
  var url = Helper$5.getUrl(values.serviceKey, 'getjobtypes');
232
- return Session$8.authedFunction({
238
+ return Session$9.authedFunction({
233
239
  method: 'POST',
234
240
  url: url,
235
241
  data: {
@@ -239,7 +245,7 @@ var maintenanceActions = {
239
245
  },
240
246
  getJob: function getJob(site, id) {
241
247
  var url = Helper$5.getUrl(values.serviceKey, 'getJob');
242
- return Session$8.authedFunction({
248
+ return Session$9.authedFunction({
243
249
  method: 'POST',
244
250
  url: url,
245
251
  data: {
@@ -250,7 +256,7 @@ var maintenanceActions = {
250
256
  },
251
257
  getJobByJobId: function getJobByJobId(site, jobId) {
252
258
  var url = Helper$5.getUrl(values.serviceKey, 'getJob');
253
- return Session$8.authedFunction({
259
+ return Session$9.authedFunction({
254
260
  method: 'POST',
255
261
  url: url,
256
262
  data: {
@@ -262,7 +268,7 @@ var maintenanceActions = {
262
268
  getJobs: function getJobs(site) {
263
269
  var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
264
270
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
265
- return Session$8.authedFunction({
271
+ return Session$9.authedFunction({
266
272
  method: 'POST',
267
273
  url: Helper$5.getUrl(values.serviceKey, 'getJobs'),
268
274
  data: {
@@ -289,7 +295,7 @@ var maintenanceActions = {
289
295
  query.lastKey = JSON.stringify(lastKey);
290
296
  }
291
297
 
292
- return Session$8.authedFunction({
298
+ return Session$9.authedFunction({
293
299
  method: 'GET',
294
300
  url: Helper$5.getUrl(values.serviceKey, 'get/requests', query)
295
301
  });
@@ -309,14 +315,14 @@ var maintenanceActions = {
309
315
  });
310
316
  },
311
317
  createJob: function createJob(job) {
312
- return Session$8.authedFunction({
318
+ return Session$9.authedFunction({
313
319
  method: 'POST',
314
320
  url: Helper$5.getUrl(values.serviceKey, 'sendMaintenance'),
315
- data: _objectSpread$6({}, job)
321
+ data: _objectSpread$7({}, job)
316
322
  });
317
323
  },
318
324
  editJob: function editJob(job, site) {
319
- return Session$8.authedFunction({
325
+ return Session$9.authedFunction({
320
326
  method: 'POST',
321
327
  url: Helper$5.getUrl(values.serviceKey, 'editJob'),
322
328
  data: {
@@ -326,7 +332,7 @@ var maintenanceActions = {
326
332
  });
327
333
  },
328
334
  deleteJob: function deleteJob(site, id) {
329
- return Session$8.authedFunction({
335
+ return Session$9.authedFunction({
330
336
  method: 'POST',
331
337
  url: Helper$5.getUrl(values.serviceKey, 'requests/remove'),
332
338
  data: {
@@ -336,7 +342,7 @@ var maintenanceActions = {
336
342
  });
337
343
  },
338
344
  editJobStatus: function editJobStatus(id, status) {
339
- return Session$8.authedFunction({
345
+ return Session$9.authedFunction({
340
346
  method: 'POST',
341
347
  url: Helper$5.getUrl(values.serviceKey, 'editJobStatus'),
342
348
  data: {
@@ -345,8 +351,18 @@ var maintenanceActions = {
345
351
  }
346
352
  });
347
353
  },
354
+ editJobPriority: function editJobPriority(id, priority) {
355
+ return Session$9.authedFunction({
356
+ method: 'POST',
357
+ url: Helper$5.getUrl(values.serviceKey, 'update/priority'),
358
+ data: {
359
+ id: id,
360
+ priority: priority
361
+ }
362
+ });
363
+ },
348
364
  assignJob: function assignJob(jobId, userId) {
349
- return Session$8.authedFunction({
365
+ return Session$9.authedFunction({
350
366
  method: 'POST',
351
367
  url: Helper$5.getUrl(values.serviceKey, 'update/assign'),
352
368
  data: {
@@ -356,40 +372,42 @@ var maintenanceActions = {
356
372
  });
357
373
  },
358
374
  getAssignees: function getAssignees(site) {
359
- return Session$8.authedFunction({
375
+ return Session$9.authedFunction({
360
376
  method: 'GET',
361
377
  url: Helper$5.getUrl(values.serviceKey, 'get/assignees', {
362
378
  site: site
363
379
  })
364
380
  });
365
381
  },
366
- addNote: function addNote(jobId, note, attachments) {
367
- return Session$8.authedFunction({
382
+ addNote: function addNote(jobId, note, attachments, images) {
383
+ return Session$9.authedFunction({
368
384
  method: 'POST',
369
385
  url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
370
386
  data: {
371
387
  id: jobId,
372
388
  note: note,
373
389
  attachments: attachments,
390
+ images: images,
374
391
  action: 'AddNote'
375
392
  }
376
393
  });
377
394
  },
378
- editNote: function editNote(jobId, noteId, note, attachments) {
379
- return Session$8.authedFunction({
395
+ editNote: function editNote(jobId, noteId, note, attachments, images) {
396
+ return Session$9.authedFunction({
380
397
  method: 'POST',
381
398
  url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
382
399
  data: {
383
400
  id: jobId,
384
401
  note: note,
385
402
  attachments: attachments,
403
+ images: images,
386
404
  noteId: noteId,
387
405
  action: 'EditNote'
388
406
  }
389
407
  });
390
408
  },
391
409
  deleteNote: function deleteNote(jobId, noteId) {
392
- return Session$8.authedFunction({
410
+ return Session$9.authedFunction({
393
411
  method: 'POST',
394
412
  url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
395
413
  data: {
@@ -409,7 +427,7 @@ var maintenanceActions = {
409
427
  hasCustomFields: hasCustomFields,
410
428
  customFields: customFields || []
411
429
  };
412
- return Session$8.authedFunction({
430
+ return Session$9.authedFunction({
413
431
  method: 'POST',
414
432
  url: Helper$5.getUrl(values.serviceKey, 'createJobType'),
415
433
  data: data
@@ -427,14 +445,14 @@ var maintenanceActions = {
427
445
  customFields: customFields || []
428
446
  };
429
447
  if (hasCustomFields && customFields) data.customFields = customFields;
430
- return Session$8.authedFunction({
448
+ return Session$9.authedFunction({
431
449
  method: 'POST',
432
450
  url: Helper$5.getUrl(values.serviceKey, 'editJobType'),
433
451
  data: data
434
452
  });
435
453
  },
436
454
  deleteJobType: function deleteJobType(site, id) {
437
- return Session$8.authedFunction({
455
+ return Session$9.authedFunction({
438
456
  method: 'POST',
439
457
  url: Helper$5.getUrl(values.serviceKey, 'deleteJobType'),
440
458
  data: {
@@ -446,7 +464,7 @@ var maintenanceActions = {
446
464
  };
447
465
 
448
466
  var Helper$4 = PlussCore.Helper,
449
- Session$7 = PlussCore.Session;
467
+ Session$8 = PlussCore.Session;
450
468
  var reactionActions = {
451
469
  addComment: function addComment(entityId, entityType, entityName, site, comment, image, parentId) {
452
470
  var data = {
@@ -462,7 +480,7 @@ var reactionActions = {
462
480
  data.image = image;
463
481
  }
464
482
 
465
- return Session$7.authedFunction({
483
+ return Session$8.authedFunction({
466
484
  method: 'POST',
467
485
  url: Helper$4.getUrl('reactions', 'comments/add'),
468
486
  data: data
@@ -487,7 +505,7 @@ var reactionActions = {
487
505
  query.minTime = minTime;
488
506
  }
489
507
 
490
- return Session$7.authedFunction({
508
+ return Session$8.authedFunction({
491
509
  method: 'GET',
492
510
  url: Helper$4.getUrl('reactions', 'comments/get', query)
493
511
  });
@@ -497,6 +515,28 @@ var reactionActions = {
497
515
  var Apis$1 = PlussCore.Apis;
498
516
  var analyticsActions = Apis$1.analyticsActions;
499
517
  var userActions = Apis$1.userActions;
518
+ var stringActions = Apis$1.stringActions;
519
+
520
+ var jobStatusOptions = [
521
+ {
522
+ text: "Open",
523
+ order: 0,
524
+ color: "#d5dde4",
525
+ category: "Not Actioned"
526
+ },
527
+ {
528
+ text: "In Progress",
529
+ order: 1,
530
+ color: "#82d6e5",
531
+ category: "In Progress"
532
+ },
533
+ {
534
+ text: "Completed",
535
+ order: 2,
536
+ color: "#58dba4",
537
+ category: "Completed"
538
+ }
539
+ ];
500
540
 
501
541
  var Helper$3 = PlussCore.Helper;
502
542
  var jobsUpdate = function jobsUpdate(site, isdashboard) {
@@ -548,6 +588,54 @@ var jobTypesLoaded = function jobTypesLoaded(events) {
548
588
  type: JOBS_TYPES_LOADED,
549
589
  payload: events
550
590
  };
591
+ };
592
+ var jobStatusesUpdate = function jobStatusesUpdate(site) {
593
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
594
+ return function (dispatch) {
595
+ stringActions.getString(site, values.stringConfigJobStatus).then(function (res) {
596
+ dispatch({
597
+ type: JOBS_STATUSES_LOADED,
598
+ payload: res.data
599
+ });
600
+ if (callback) callback(res.data);
601
+ }).catch(function (_error) {
602
+ dispatch({
603
+ type: JOBS_STATUSES_LOADED,
604
+ payload: jobStatusOptions
605
+ });
606
+ if (callback) callback(jobStatusOptions);
607
+ });
608
+ };
609
+ };
610
+ var jobStatusesLoaded = function jobStatusesLoaded(statuses) {
611
+ return {
612
+ type: JOBS_STATUSES_LOADED,
613
+ payload: statuses
614
+ };
615
+ };
616
+ var jobHideSeenUpdate = function jobHideSeenUpdate(site) {
617
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
618
+ return function (dispatch) {
619
+ stringActions.getString(site, values.stringConfigHideSeen).then(function (res) {
620
+ dispatch({
621
+ type: JOBS_HIDE_SEEN,
622
+ payload: res.data
623
+ });
624
+ if (callback) callback(res.data);
625
+ }).catch(function (_error) {
626
+ dispatch({
627
+ type: JOBS_HIDE_SEEN,
628
+ payload: false
629
+ });
630
+ if (callback) callback(false);
631
+ });
632
+ };
633
+ };
634
+ var jobHideSeenLoaded = function jobHideSeenLoaded(hide) {
635
+ return {
636
+ type: JOBS_HIDE_SEEN,
637
+ payload: hide
638
+ };
551
639
  }; // export const removeJobType = (id) => {
552
640
  // return {
553
641
  // type: JOBS_TYPES_REMOVED,
@@ -578,41 +666,56 @@ var jobTypesLoaded = function jobTypesLoaded(events) {
578
666
  // };
579
667
  // };
580
668
 
581
- var Unassigned = {
582
- text: "Open",
583
- order: 0,
584
- color: "#d5dde4"
585
- };
586
- var Completed = {
587
- text: "Completed",
588
- order: 2,
589
- color: "#58dba4"
669
+ var jobPriorityOptions = [
670
+ {
671
+ name: "Low",
672
+ color: "green",
673
+ "default": true
674
+ },
675
+ {
676
+ name: "Medium",
677
+ color: "orange"
678
+ },
679
+ {
680
+ name: "High",
681
+ color: "red"
682
+ }
683
+ ];
684
+
685
+ var STATUS_IMCOMPLETE = 'All Incomplete';
686
+ var STATUS_NOT_ACTIONED = 'Not Actioned';
687
+ var STATUS_IN_PROGRESS = 'In Progress';
688
+ var STATUS_COMPLETED = 'Completed';
689
+
690
+ var getDefaultPriority = function getDefaultPriority() {
691
+ return jobPriorityOptions.find(function (p) {
692
+ return p.default;
693
+ });
590
694
  };
591
- var StatusTypes = {
592
- Unassigned: Unassigned,
593
- "In Progress": {
594
- text: "In Progress",
595
- order: 1,
596
- color: "#82d6e5"
597
- },
598
- Completed: Completed
695
+
696
+ var getJobPriority = function getJobPriority(priority) {
697
+ var priorityOption = null;
698
+ if (priority) priorityOption = jobPriorityOptions.find(function (p) {
699
+ return p.name === priority;
700
+ });
701
+ return priorityOption || getDefaultPriority();
599
702
  };
600
703
 
601
- 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; }
704
+ 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; }
602
705
 
603
- 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(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; }
706
+ 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(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; }
604
707
 
605
- function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
708
+ function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
606
709
 
607
- 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; } }
608
- var Session$6 = PlussCore.Session,
609
- Components$6 = PlussCore.Components,
710
+ 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; } }
711
+ var Session$7 = PlussCore.Session,
712
+ Components$7 = PlussCore.Components,
610
713
  Analytics$2 = PlussCore.Analytics;
611
714
 
612
715
  var JobList = /*#__PURE__*/function (_Component) {
613
716
  _inherits(JobList, _Component);
614
717
 
615
- var _super = _createSuper$b(JobList);
718
+ var _super = _createSuper$c(JobList);
616
719
 
617
720
  function JobList(props) {
618
721
  var _this;
@@ -621,6 +724,20 @@ var JobList = /*#__PURE__*/function (_Component) {
621
724
 
622
725
  _this = _super.call(this, props);
623
726
 
727
+ _defineProperty(_assertThisInitialized(_this), "setRequesters", function (jobs) {
728
+ var requesters = _.orderBy(_.uniqBy(jobs.map(function (j) {
729
+ return {
730
+ id: j.userID,
731
+ displayName: j.userName,
732
+ profilePic: j.userProfilePic
733
+ };
734
+ }), 'id'), 'displayName', 'asc');
735
+
736
+ _this.setState({
737
+ requesters: requesters
738
+ });
739
+ });
740
+
624
741
  _defineProperty(_assertThisInitialized(_this), "getJobs", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
625
742
  var auth, res;
626
743
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -636,6 +753,8 @@ var JobList = /*#__PURE__*/function (_Component) {
636
753
  res = _context.sent;
637
754
 
638
755
  if (!_.isEmpty(res) && res[0].site === auth.site) {
756
+ _this.setRequesters(res);
757
+
639
758
  _this.props.jobsLoaded(res);
640
759
  }
641
760
 
@@ -767,6 +886,14 @@ var JobList = /*#__PURE__*/function (_Component) {
767
886
  _this.closeFilter();
768
887
  });
769
888
 
889
+ _defineProperty(_assertThisInitialized(_this), "selectPriorityFilter", function (filter) {
890
+ _this.setState({
891
+ selectedPriorityFilter: filter
892
+ });
893
+
894
+ _this.closeFilter();
895
+ });
896
+
770
897
  _defineProperty(_assertThisInitialized(_this), "selectStatusFilter", function (filter) {
771
898
  _this.setState({
772
899
  selectedStatusFilter: filter
@@ -871,6 +998,33 @@ var JobList = /*#__PURE__*/function (_Component) {
871
998
  _this.closeFilter();
872
999
  });
873
1000
 
1001
+ _defineProperty(_assertThisInitialized(_this), "onSelectRequester", function (user) {
1002
+ _this.setState({
1003
+ selectedRequester: user
1004
+ });
1005
+ });
1006
+
1007
+ _defineProperty(_assertThisInitialized(_this), "removeRequesterFilter", function () {
1008
+ _this.setState({
1009
+ selectedRequesterFilter: null,
1010
+ selectedRequesterFilterText: null
1011
+ });
1012
+ });
1013
+
1014
+ _defineProperty(_assertThisInitialized(_this), "saveRequesterFilter", function () {
1015
+ if (!_this.state.selectedRequester) {
1016
+ _this.removeRequesterFilter();
1017
+ } else {
1018
+ _this.setState({
1019
+ selectedRequesterFilter: _this.state.selectedRequester.id,
1020
+ selectedRequesterFilterText: _this.state.selectedRequester.displayName,
1021
+ selectedRequester: null
1022
+ });
1023
+ }
1024
+
1025
+ _this.closeFilter();
1026
+ });
1027
+
874
1028
  _defineProperty(_assertThisInitialized(_this), "onHandleSearchChange", function (event) {
875
1029
  var thisSearchTime = moment().valueOf();
876
1030
 
@@ -903,18 +1057,32 @@ var JobList = /*#__PURE__*/function (_Component) {
903
1057
  source = _.filter(source, function (r) {
904
1058
  return r.type === _this.state.selectedTypeFilter;
905
1059
  });
1060
+ } // filter by priority
1061
+
1062
+
1063
+ if (_this.state.selectedPriorityFilter) {
1064
+ var defaultPriority = getDefaultPriority().name;
1065
+ source = _.filter(source, function (r) {
1066
+ return r.priority === _this.state.selectedPriorityFilter || _this.state.selectedPriorityFilter === defaultPriority && _.isNil(r.priority);
1067
+ });
906
1068
  } // filter by status
907
1069
 
908
1070
 
909
1071
  if (_this.state.selectedStatusFilter) {
1072
+ var statusTypes = _this.props.statusTypes;
1073
+ var defaultStatus = statusTypes.find(function (s) {
1074
+ return s.category === STATUS_NOT_ACTIONED;
1075
+ });
910
1076
  source = _.filter(source, function (r) {
911
- var status = r.status && StatusTypes[r.status] ? r.status : 'Unassigned';
1077
+ var status = statusTypes.find(function (s) {
1078
+ return s.text === r.status;
1079
+ }) || defaultStatus;
912
1080
 
913
- if (_this.state.selectedStatusFilter === 'incomplete') {
914
- return status !== 'Completed';
1081
+ if (_this.state.selectedStatusFilter === STATUS_IMCOMPLETE) {
1082
+ return status.category !== STATUS_COMPLETED;
915
1083
  }
916
1084
 
917
- return status === _this.state.selectedStatusFilter;
1085
+ return status.text === _this.state.selectedStatusFilter;
918
1086
  });
919
1087
  }
920
1088
 
@@ -924,6 +1092,12 @@ var JobList = /*#__PURE__*/function (_Component) {
924
1092
  });
925
1093
  }
926
1094
 
1095
+ if (_this.state.selectedRequesterFilter) {
1096
+ source = _.filter(source, function (r) {
1097
+ return r.userID === _this.state.selectedRequesterFilter;
1098
+ });
1099
+ }
1100
+
927
1101
  if (!_.isEmpty(_this.state.searchTerm)) {
928
1102
  source = _.filter(source, function (r) {
929
1103
  if (r.jobId && r.jobId === _this.state.searchTerm) {
@@ -1005,6 +1179,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1005
1179
 
1006
1180
  _defineProperty(_assertThisInitialized(_this), "getExportSource", function () {
1007
1181
  var customColumns = [];
1182
+ var defaultPriority = getDefaultPriority().name;
1008
1183
 
1009
1184
  var source = _this.getSource().map(function (r) {
1010
1185
  var history = r.history || [];
@@ -1051,12 +1226,14 @@ var JobList = /*#__PURE__*/function (_Component) {
1051
1226
 
1052
1227
  var customFieldValues = _this.getCustomFields(r, customColumns);
1053
1228
 
1054
- return _objectSpread$5(_objectSpread$5(_objectSpread$5({}, r), customFieldValues), {}, {
1229
+ var priority = r.priority || defaultPriority;
1230
+ return _objectSpread$6(_objectSpread$6(_objectSpread$6({}, r), customFieldValues), {}, {
1055
1231
  notes: notes,
1056
1232
  progressTime: progressTime,
1057
1233
  completedTime: completedTime,
1058
1234
  progressDuration: progressDuration,
1059
- completedDuration: completedDuration
1235
+ completedDuration: completedDuration,
1236
+ priority: priority
1060
1237
  });
1061
1238
  }); // Compose revised columns list with custom fields
1062
1239
 
@@ -1095,7 +1272,8 @@ var JobList = /*#__PURE__*/function (_Component) {
1095
1272
  sortColumn: 'createdUnix',
1096
1273
  sortDesc: true,
1097
1274
  selectedTimeFilter: Analytics$2.getAnalyticsFilterOptions()[1],
1098
- assignees: []
1275
+ assignees: [],
1276
+ requesters: []
1099
1277
  };
1100
1278
  _this.exportColumns = [{
1101
1279
  label: 'Select All',
@@ -1112,6 +1290,9 @@ var JobList = /*#__PURE__*/function (_Component) {
1112
1290
  }, {
1113
1291
  label: 'Status',
1114
1292
  key: 'status'
1293
+ }, {
1294
+ label: 'Priority',
1295
+ key: 'priority'
1115
1296
  }, {
1116
1297
  label: 'Title',
1117
1298
  key: 'title'
@@ -1152,11 +1333,12 @@ var JobList = /*#__PURE__*/function (_Component) {
1152
1333
  _createClass(JobList, [{
1153
1334
  key: "UNSAFE_componentWillMount",
1154
1335
  value: function UNSAFE_componentWillMount() {
1155
- Session$6.checkLoggedIn(this);
1336
+ Session$7.checkLoggedIn(this);
1156
1337
  }
1157
1338
  }, {
1158
1339
  key: "componentDidMount",
1159
1340
  value: function componentDidMount() {
1341
+ this.props.jobStatusesUpdate(this.props.auth.site);
1160
1342
  this.getJobs();
1161
1343
  this.getAssignees();
1162
1344
  }
@@ -1170,7 +1352,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1170
1352
  }
1171
1353
 
1172
1354
  if (this.state.filterOpen === 'type') {
1173
- return /*#__PURE__*/React.createElement(Components$6.Popup, {
1355
+ return /*#__PURE__*/React.createElement(Components$7.Popup, {
1174
1356
  title: "Select ".concat(values.textJobType),
1175
1357
  maxWidth: 600,
1176
1358
  minWidth: 400,
@@ -1181,7 +1363,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1181
1363
  })), function (t) {
1182
1364
  return t.toLowerCase();
1183
1365
  }).map(function (type) {
1184
- return /*#__PURE__*/React.createElement(Components$6.Tag, {
1366
+ return /*#__PURE__*/React.createElement(Components$7.Tag, {
1185
1367
  key: type,
1186
1368
  onClick: function onClick() {
1187
1369
  _this2.selectTypeFilter(type);
@@ -1192,28 +1374,49 @@ var JobList = /*#__PURE__*/function (_Component) {
1192
1374
  }));
1193
1375
  }
1194
1376
 
1377
+ if (this.state.filterOpen === 'priority') {
1378
+ return /*#__PURE__*/React.createElement(Components$7.Popup, {
1379
+ title: "Select Priority",
1380
+ maxWidth: 600,
1381
+ minWidth: 400,
1382
+ hasPadding: true,
1383
+ onClose: this.closeFilter
1384
+ }, jobPriorityOptions.map(function (p) {
1385
+ return /*#__PURE__*/React.createElement(Components$7.Tag, {
1386
+ key: p.name,
1387
+ onClick: function onClick() {
1388
+ _this2.selectPriorityFilter(p.name);
1389
+ },
1390
+ text: p.name,
1391
+ className: "marginRight-10"
1392
+ });
1393
+ }));
1394
+ }
1395
+
1195
1396
  if (this.state.filterOpen === 'status') {
1196
- return /*#__PURE__*/React.createElement(Components$6.Popup, {
1397
+ var statusTypes = this.props.statusTypes;
1398
+ return /*#__PURE__*/React.createElement(Components$7.Popup, {
1197
1399
  title: "Select Status",
1198
1400
  maxWidth: 600,
1199
1401
  minWidth: 400,
1200
1402
  hasPadding: true,
1201
1403
  onClose: this.closeFilter
1202
- }, ['incomplete'].concat(_toConsumableArray(Object.keys(StatusTypes))).map(function (sKey) {
1203
- var text = sKey === 'incomplete' ? 'All Incomplete' : StatusTypes[sKey].text;
1204
- return /*#__PURE__*/React.createElement(Components$6.Tag, {
1205
- key: sKey,
1404
+ }, [STATUS_IMCOMPLETE].concat(_toConsumableArray(statusTypes.map(function (s) {
1405
+ return s.text;
1406
+ }))).map(function (status) {
1407
+ return /*#__PURE__*/React.createElement(Components$7.Tag, {
1408
+ key: status,
1206
1409
  onClick: function onClick() {
1207
- _this2.selectStatusFilter(sKey);
1410
+ _this2.selectStatusFilter(status);
1208
1411
  },
1209
- text: text,
1210
- className: "marginRight-10"
1412
+ text: status,
1413
+ className: "marginRight-10 marginBottom-10"
1211
1414
  });
1212
1415
  }));
1213
1416
  }
1214
1417
 
1215
1418
  if (this.state.filterOpen === 'time') {
1216
- return /*#__PURE__*/React.createElement(Components$6.Popup, {
1419
+ return /*#__PURE__*/React.createElement(Components$7.Popup, {
1217
1420
  title: "Select Time",
1218
1421
  maxWidth: 600,
1219
1422
  minWidth: 400,
@@ -1229,7 +1432,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1229
1432
  style: {
1230
1433
  minHeight: 150
1231
1434
  }
1232
- }, /*#__PURE__*/React.createElement(Components$6.AnalyticsFilter, {
1435
+ }, /*#__PURE__*/React.createElement(Components$7.AnalyticsFilter, {
1233
1436
  defaultFilter: this.state.selectedTimeFilter,
1234
1437
  filterChanged: this.timeFilterChanged,
1235
1438
  filterDateRangeChanged: this.timeFilterDateRangeChanged
@@ -1240,20 +1443,20 @@ var JobList = /*#__PURE__*/function (_Component) {
1240
1443
  var userContent = null;
1241
1444
 
1242
1445
  if (this.state.selectedAssignee) {
1243
- userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$6.UserListing, {
1446
+ userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$7.UserListing, {
1244
1447
  key: this.state.selectedAssignee.id,
1245
1448
  user: this.state.selectedAssignee,
1246
- rightContent: /*#__PURE__*/React.createElement(Components$6.SVGIcon, {
1449
+ rightContent: /*#__PURE__*/React.createElement(Components$7.SVGIcon, {
1247
1450
  className: "removeIcon",
1248
1451
  icon: "close",
1249
1452
  onClick: function onClick() {
1250
1453
  _this2.onSelectAssignee();
1251
1454
  },
1252
- colour: Colours$2.COLOUR_DUSK
1455
+ colour: Colours$3.COLOUR_DUSK
1253
1456
  })
1254
1457
  }));
1255
1458
  } else {
1256
- userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$6.GenericInput, {
1459
+ userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$7.GenericInput, {
1257
1460
  id: "userSearch",
1258
1461
  type: "text" // label="Search"
1259
1462
  ,
@@ -1269,7 +1472,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1269
1472
  if (_.isEmpty(_this2.state.userSearch)) return true;
1270
1473
  return u.displayName.toUpperCase().indexOf(_this2.state.userSearch.toUpperCase()) > -1;
1271
1474
  }).map(function (user) {
1272
- return /*#__PURE__*/React.createElement(Components$6.UserListing, {
1475
+ return /*#__PURE__*/React.createElement(Components$7.UserListing, {
1273
1476
  key: user.id,
1274
1477
  user: user,
1275
1478
  onClick: function onClick() {
@@ -1279,7 +1482,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1279
1482
  }));
1280
1483
  }
1281
1484
 
1282
- return /*#__PURE__*/React.createElement(Components$6.Popup, {
1485
+ return /*#__PURE__*/React.createElement(Components$7.Popup, {
1283
1486
  title: "Select User",
1284
1487
  maxWidth: 600,
1285
1488
  minWidth: 400,
@@ -1294,6 +1497,64 @@ var JobList = /*#__PURE__*/function (_Component) {
1294
1497
  }, userContent);
1295
1498
  }
1296
1499
 
1500
+ if (this.state.filterOpen === 'requester') {
1501
+ var _userContent = null;
1502
+
1503
+ if (this.state.selectedRequester) {
1504
+ _userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$7.UserListing, {
1505
+ key: this.state.selectedRequester.id,
1506
+ user: this.state.selectedRequester,
1507
+ rightContent: /*#__PURE__*/React.createElement(Components$7.SVGIcon, {
1508
+ className: "removeIcon",
1509
+ icon: "close",
1510
+ onClick: function onClick() {
1511
+ _this2.onSelectRequester();
1512
+ },
1513
+ colour: Colours$3.COLOUR_DUSK
1514
+ })
1515
+ }));
1516
+ } else {
1517
+ _userContent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Components$7.GenericInput, {
1518
+ id: "requesterSearch",
1519
+ type: "text" // label="Search"
1520
+ ,
1521
+ placeholder: "Search name",
1522
+ value: this.state.requesterSearch,
1523
+ onChange: function onChange(e) {
1524
+ return _this2.onHandleChange(e);
1525
+ },
1526
+ alwaysShowLabel: true
1527
+ }), _.sortBy(this.state.requesters, function (u) {
1528
+ return u.displayName.toUpperCase();
1529
+ }).filter(function (u) {
1530
+ if (_.isEmpty(_this2.state.requesterSearch)) return true;
1531
+ return u.displayName.toUpperCase().indexOf(_this2.state.requesterSearch.toUpperCase()) > -1;
1532
+ }).map(function (user) {
1533
+ return /*#__PURE__*/React.createElement(Components$7.UserListing, {
1534
+ key: user.id,
1535
+ user: user,
1536
+ onClick: function onClick() {
1537
+ _this2.onSelectRequester(user);
1538
+ }
1539
+ });
1540
+ }));
1541
+ }
1542
+
1543
+ return /*#__PURE__*/React.createElement(Components$7.Popup, {
1544
+ title: "Select User",
1545
+ maxWidth: 600,
1546
+ minWidth: 400,
1547
+ hasPadding: true,
1548
+ onClose: this.closeFilter,
1549
+ buttons: [{
1550
+ type: 'primaryAction',
1551
+ onClick: this.saveRequesterFilter,
1552
+ text: 'Select',
1553
+ isActive: true
1554
+ }]
1555
+ }, _userContent);
1556
+ }
1557
+
1297
1558
  return null;
1298
1559
  }
1299
1560
  }, {
@@ -1301,19 +1562,33 @@ var JobList = /*#__PURE__*/function (_Component) {
1301
1562
  value: function renderRequests() {
1302
1563
  var _this3 = this;
1303
1564
 
1565
+ var statusTypes = this.props.statusTypes;
1566
+ var defaultStatus = statusTypes.find(function (s) {
1567
+ return s.category === STATUS_NOT_ACTIONED;
1568
+ });
1304
1569
  return this.getSource().map(function (ev, index) {
1305
1570
  if (!ev) {
1306
1571
  return null;
1307
1572
  }
1308
1573
 
1309
- var status = ev.status && StatusTypes[ev.status] ? StatusTypes[ev.status] : StatusTypes['Unassigned'];
1574
+ var status = ev.status && statusTypes.find(function (s) {
1575
+ return s.text === ev.status;
1576
+ }) || defaultStatus;
1577
+ var priority = getJobPriority(ev.priority);
1310
1578
  return /*#__PURE__*/React.createElement("tr", {
1311
1579
  key: index
1312
1580
  }, /*#__PURE__*/React.createElement("td", null, ev.jobId), /*#__PURE__*/React.createElement("td", {
1313
1581
  className: "table-TitleColumn"
1314
1582
  }, /*#__PURE__*/React.createElement(Link, {
1315
1583
  to: "".concat(values.routeRequestDetails, "/").concat(ev.id)
1316
- }, /*#__PURE__*/React.createElement("span", null, ev.title))), /*#__PURE__*/React.createElement("td", null, ev.type), /*#__PURE__*/React.createElement("td", null, moment.utc(ev.createdTime).local().format('D MMM YY')), /*#__PURE__*/React.createElement("td", null, ev.room), /*#__PURE__*/React.createElement("td", null, ev.Assignee ? /*#__PURE__*/React.createElement(Components$6.UserListing, {
1584
+ }, /*#__PURE__*/React.createElement("span", null, ev.title))), /*#__PURE__*/React.createElement("td", null, ev.type), /*#__PURE__*/React.createElement("td", null, moment.utc(ev.createdTime).local().format('D MMM YY')), /*#__PURE__*/React.createElement("td", null, ev.room), /*#__PURE__*/React.createElement("td", null, ev.userName ? /*#__PURE__*/React.createElement(Components$7.UserListing, {
1585
+ user: {
1586
+ id: ev.userID,
1587
+ displayName: ev.userName,
1588
+ profilePic: ev.userProfilePic
1589
+ },
1590
+ textClass: "fontSize-13"
1591
+ }) : 'Unknown'), /*#__PURE__*/React.createElement("td", null, ev.Assignee ? /*#__PURE__*/React.createElement(Components$7.UserListing, {
1317
1592
  user: ev.Assignee,
1318
1593
  textClass: "fontSize-13"
1319
1594
  }) : 'Unassigned'), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
@@ -1324,9 +1599,19 @@ var JobList = /*#__PURE__*/function (_Component) {
1324
1599
  paddingTop: 2,
1325
1600
  paddingBottom: 2,
1326
1601
  color: '#fff',
1327
- backgroundColor: status.color
1602
+ backgroundColor: status ? status.color : undefined
1328
1603
  }
1329
- }, status.text)), /*#__PURE__*/React.createElement("td", {
1604
+ }, status ? status.text : '')), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
1605
+ style: {
1606
+ textAlign: 'center',
1607
+ borderRadius: 4,
1608
+ width: 100,
1609
+ paddingTop: 2,
1610
+ paddingBottom: 2,
1611
+ color: '#fff',
1612
+ backgroundColor: priority.color
1613
+ }
1614
+ }, priority.name)), /*#__PURE__*/React.createElement("td", {
1330
1615
  className: "table-options"
1331
1616
  }, /*#__PURE__*/React.createElement("div", {
1332
1617
  style: {
@@ -1342,7 +1627,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1342
1627
  cursor: 'pointer'
1343
1628
  },
1344
1629
  name: "pencil"
1345
- })), Session$6.validateAccess(_this3.props.auth.site, values.permissionMaintenanceTracking, _this3.props.auth) && /*#__PURE__*/React.createElement("a", {
1630
+ })), Session$7.validateAccess(_this3.props.auth.site, values.permissionMaintenanceTracking, _this3.props.auth) && /*#__PURE__*/React.createElement("a", {
1346
1631
  onClick: function onClick() {
1347
1632
  return _this3.onRemoveRequest(ev);
1348
1633
  }
@@ -1470,6 +1755,15 @@ var JobList = /*#__PURE__*/function (_Component) {
1470
1755
  _this4.sortByCol('room');
1471
1756
  }
1472
1757
  }, "Address", this.renderSort('room')), /*#__PURE__*/React.createElement("th", {
1758
+ className: "".concat(this.sortIsActive('userName')),
1759
+ style: {
1760
+ cursor: 'pointer',
1761
+ width: 150
1762
+ },
1763
+ onClick: function onClick() {
1764
+ _this4.sortByCol('userName');
1765
+ }
1766
+ }, "Submitted By", this.renderSort('userName')), /*#__PURE__*/React.createElement("th", {
1473
1767
  className: "".concat(this.sortIsActive('assigned')),
1474
1768
  style: {
1475
1769
  cursor: 'pointer',
@@ -1483,6 +1777,10 @@ var JobList = /*#__PURE__*/function (_Component) {
1483
1777
  width: 120
1484
1778
  }
1485
1779
  }, "Status"), /*#__PURE__*/React.createElement("th", {
1780
+ style: {
1781
+ width: 120
1782
+ }
1783
+ }, "Priority"), /*#__PURE__*/React.createElement("th", {
1486
1784
  style: {
1487
1785
  width: 50
1488
1786
  }
@@ -1493,37 +1791,51 @@ var JobList = /*#__PURE__*/function (_Component) {
1493
1791
  value: function renderFilters() {
1494
1792
  var _this5 = this;
1495
1793
 
1496
- var typeFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1794
+ var typeFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1497
1795
  className: "marginRight-10",
1498
1796
  onClick: function onClick() {
1499
1797
  _this5.openFilter('type');
1500
1798
  },
1501
1799
  text: values.textJobType
1502
1800
  });
1503
- var statusFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1801
+ var statusFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1504
1802
  className: "marginRight-10",
1505
1803
  onClick: function onClick() {
1506
1804
  _this5.openFilter('status');
1507
1805
  },
1508
1806
  text: "Status"
1509
1807
  });
1510
- var timeFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1808
+ var priorityFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1809
+ className: "marginRight-10",
1810
+ onClick: function onClick() {
1811
+ _this5.openFilter('priority');
1812
+ },
1813
+ text: "Priority"
1814
+ });
1815
+ var timeFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1511
1816
  className: "marginRight-10",
1512
1817
  onClick: function onClick() {
1513
1818
  _this5.openFilter('time');
1514
1819
  },
1515
1820
  text: "Time"
1516
1821
  });
1517
- var userFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1822
+ var userFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1518
1823
  className: "marginRight-10",
1519
1824
  onClick: function onClick() {
1520
1825
  _this5.openFilter('user');
1521
1826
  },
1522
1827
  text: "Assigned To"
1523
1828
  });
1829
+ var requesterFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1830
+ className: "marginRight-10",
1831
+ onClick: function onClick() {
1832
+ _this5.openFilter('requester');
1833
+ },
1834
+ text: "Submitted By"
1835
+ });
1524
1836
 
1525
1837
  if (this.state.selectedTypeFilter) {
1526
- typeFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1838
+ typeFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1527
1839
  className: "marginRight-10",
1528
1840
  onClick: function onClick() {
1529
1841
  _this5.openFilter('type');
@@ -1538,8 +1850,24 @@ var JobList = /*#__PURE__*/function (_Component) {
1538
1850
  });
1539
1851
  }
1540
1852
 
1853
+ if (this.state.selectedPriorityFilter) {
1854
+ priorityFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1855
+ className: "marginRight-10",
1856
+ onClick: function onClick() {
1857
+ _this5.openFilter('priority');
1858
+ },
1859
+ rightIcon: "close",
1860
+ rightClick: function rightClick(e) {
1861
+ e.stopPropagation();
1862
+
1863
+ _this5.selectPriorityFilter();
1864
+ },
1865
+ text: this.state.selectedPriorityFilter
1866
+ });
1867
+ }
1868
+
1541
1869
  if (this.state.selectedStatusFilter) {
1542
- statusFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1870
+ statusFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1543
1871
  className: "marginRight-10",
1544
1872
  onClick: function onClick() {
1545
1873
  _this5.openFilter('status');
@@ -1550,12 +1878,12 @@ var JobList = /*#__PURE__*/function (_Component) {
1550
1878
 
1551
1879
  _this5.selectStatusFilter();
1552
1880
  },
1553
- text: this.state.selectedStatusFilter === 'incomplete' ? 'All Incomplete' : StatusTypes[this.state.selectedStatusFilter].text
1881
+ text: this.state.selectedStatusFilter
1554
1882
  });
1555
1883
  }
1556
1884
 
1557
1885
  if (this.state.selectedTimeFilterText) {
1558
- timeFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1886
+ timeFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1559
1887
  className: "marginRight-10",
1560
1888
  onClick: function onClick() {
1561
1889
  _this5.openFilter('time');
@@ -1571,7 +1899,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1571
1899
  }
1572
1900
 
1573
1901
  if (this.state.selectedUserFilter) {
1574
- userFilter = /*#__PURE__*/React.createElement(Components$6.Tag, {
1902
+ userFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1575
1903
  className: "marginRight-10",
1576
1904
  onClick: function onClick() {
1577
1905
  _this5.openFilter('user');
@@ -1586,20 +1914,36 @@ var JobList = /*#__PURE__*/function (_Component) {
1586
1914
  });
1587
1915
  }
1588
1916
 
1917
+ if (this.state.selectedRequesterFilter) {
1918
+ requesterFilter = /*#__PURE__*/React.createElement(Components$7.Tag, {
1919
+ className: "marginRight-10",
1920
+ onClick: function onClick() {
1921
+ _this5.openFilter('requester');
1922
+ },
1923
+ rightIcon: "close",
1924
+ rightClick: function rightClick(e) {
1925
+ e.stopPropagation();
1926
+
1927
+ _this5.removeRequesterFilter();
1928
+ },
1929
+ text: this.state.selectedRequesterFilterText
1930
+ });
1931
+ }
1932
+
1589
1933
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1590
1934
  className: "marginTop-20 flex flex-between flex-center"
1591
1935
  }, /*#__PURE__*/React.createElement("div", {
1592
1936
  className: "flex flex-center"
1593
- }, /*#__PURE__*/React.createElement(Components$6.Text, {
1937
+ }, /*#__PURE__*/React.createElement(Components$7.Text, {
1594
1938
  type: "h5",
1595
1939
  className: "marginRight-20"
1596
- }, "Filter by"), typeFilter, statusFilter, timeFilter, userFilter), /*#__PURE__*/React.createElement(Components$6.Button, {
1940
+ }, "Filter by"), typeFilter, statusFilter, priorityFilter, timeFilter, userFilter, requesterFilter), /*#__PURE__*/React.createElement(Components$7.Button, {
1597
1941
  inline: true,
1598
1942
  buttonType: "primaryAction",
1599
1943
  leftIcon: "file-code-o",
1600
1944
  onClick: this.onOpenExportCsv,
1601
1945
  isActive: !_.isEmpty(this.getSource())
1602
- }, "Export CSV")), /*#__PURE__*/React.createElement(Components$6.GenericInput, {
1946
+ }, "Export CSV")), /*#__PURE__*/React.createElement(Components$7.GenericInput, {
1603
1947
  id: "search",
1604
1948
  type: "text",
1605
1949
  placeholder: "Search by ".concat(values.textEntityName, " ID, Address or Title"),
@@ -1624,7 +1968,7 @@ var JobList = /*#__PURE__*/function (_Component) {
1624
1968
  columns = _this$getExportSource.columns,
1625
1969
  source = _this$getExportSource.source;
1626
1970
 
1627
- return /*#__PURE__*/React.createElement(Components$6.ExportCsvPopup, {
1971
+ return /*#__PURE__*/React.createElement(Components$7.ExportCsvPopup, {
1628
1972
  onClose: this.onCloseExportCsv,
1629
1973
  columns: columns,
1630
1974
  source: source,
@@ -1645,30 +1989,32 @@ var JobList = /*#__PURE__*/function (_Component) {
1645
1989
  return JobList;
1646
1990
  }(Component);
1647
1991
 
1648
- var mapStateToProps$6 = function mapStateToProps(state) {
1992
+ var mapStateToProps$7 = function mapStateToProps(state) {
1649
1993
  var auth = state.auth;
1650
1994
  return {
1651
1995
  jobs: state[values.reducerKey].jobs,
1652
1996
  auth: auth,
1653
- strings: state.strings && state.strings.config || {}
1997
+ strings: state.strings && state.strings.config || {},
1998
+ statusTypes: state[values.reducerKey].jobstatuses
1654
1999
  };
1655
2000
  };
1656
2001
 
1657
- var JobList$1 = connect(mapStateToProps$6, {
2002
+ var JobList$1 = connect(mapStateToProps$7, {
1658
2003
  jobsLoaded: jobsLoaded,
1659
- removeJob: removeJob
2004
+ removeJob: removeJob,
2005
+ jobStatusesUpdate: jobStatusesUpdate
1660
2006
  })(withRouter(JobList));
1661
2007
 
1662
- function _createSuper$a(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2008
+ function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
1663
2009
 
1664
- 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; } }
1665
- var Session$5 = PlussCore.Session,
1666
- Components$5 = PlussCore.Components;
2010
+ 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; } }
2011
+ var Session$6 = PlussCore.Session,
2012
+ Components$6 = PlussCore.Components;
1667
2013
 
1668
2014
  var JobTypes = /*#__PURE__*/function (_Component) {
1669
2015
  _inherits(JobTypes, _Component);
1670
2016
 
1671
- var _super = _createSuper$a(JobTypes);
2017
+ var _super = _createSuper$b(JobTypes);
1672
2018
 
1673
2019
  function JobTypes(props) {
1674
2020
  var _this;
@@ -1794,7 +2140,7 @@ var JobTypes = /*#__PURE__*/function (_Component) {
1794
2140
  key: "componentWillMount",
1795
2141
  value: function componentWillMount() {
1796
2142
  this.updateProps(this.props);
1797
- Session$5.checkLoggedIn(this, this.props.auth);
2143
+ Session$6.checkLoggedIn(this, this.props.auth);
1798
2144
  }
1799
2145
  }, {
1800
2146
  key: "componentDidMount",
@@ -1841,7 +2187,7 @@ var JobTypes = /*#__PURE__*/function (_Component) {
1841
2187
  display: 'flex',
1842
2188
  alignItems: 'center'
1843
2189
  }
1844
- }, Session$5.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React.createElement(Link, {
2190
+ }, Session$6.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React.createElement(Link, {
1845
2191
  to: "".concat(values.routeAddRequestType, "/").concat(ev.id)
1846
2192
  }, /*#__PURE__*/React.createElement(FontAwesome, {
1847
2193
  style: {
@@ -1851,7 +2197,7 @@ var JobTypes = /*#__PURE__*/function (_Component) {
1851
2197
  cursor: 'pointer'
1852
2198
  },
1853
2199
  name: "pencil"
1854
- })), Session$5.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React.createElement("a", {
2200
+ })), Session$6.validateAccess(_this2.props.auth.site, values.permissionMaintenanceTypes, _this2.props.auth) && /*#__PURE__*/React.createElement("a", {
1855
2201
  onClick: function onClick() {
1856
2202
  return _this2.onRemoveJobType(ev);
1857
2203
  }
@@ -1938,50 +2284,581 @@ var JobTypes = /*#__PURE__*/function (_Component) {
1938
2284
  maxWidth: 500,
1939
2285
  textAlign: 'center'
1940
2286
  }
1941
- }, values.textEmptyJobTypesExample));
2287
+ }, values.textEmptyJobTypesExample));
2288
+ }
2289
+ }, {
2290
+ key: "renderContent",
2291
+ value: function renderContent() {
2292
+ if (_.isEmpty(this.state.jobList)) return this.renderEmpty();
2293
+ return this.renderView();
2294
+ }
2295
+ }, {
2296
+ key: "renderJobTypes",
2297
+ value: function renderJobTypes() {
2298
+ var _this$state = this.state,
2299
+ jobList = _this$state.jobList,
2300
+ loading = _this$state.loading;
2301
+
2302
+ if (jobList.length === 0 && loading) {
2303
+ return /*#__PURE__*/React.createElement("div", {
2304
+ style: {
2305
+ minWidth: '100%'
2306
+ }
2307
+ }, /*#__PURE__*/React.createElement("div", {
2308
+ className: "padding-60 paddingVertical-40",
2309
+ style: {
2310
+ textAlign: 'center'
2311
+ }
2312
+ }, /*#__PURE__*/React.createElement(FontAwesome, {
2313
+ style: {
2314
+ fontSize: 30,
2315
+ color: FeatureConfig.env.colourBrandingOff
2316
+ },
2317
+ name: "spinner fa-pulse fa-fw"
2318
+ })));
2319
+ }
2320
+
2321
+ return /*#__PURE__*/React.createElement("div", {
2322
+ style: {
2323
+ minWidth: '100%'
2324
+ }
2325
+ }, /*#__PURE__*/React.createElement("div", {
2326
+ className: "marginBottom-32"
2327
+ }, /*#__PURE__*/React.createElement(Components$6.AddButton, {
2328
+ onClick: this.props.onNew,
2329
+ text: values.textNewTypeButton
2330
+ })), this.renderContent());
2331
+ }
2332
+ }, {
2333
+ key: "render",
2334
+ value: function render() {
2335
+ return /*#__PURE__*/React.createElement("div", {
2336
+ style: {
2337
+ minWidth: '100%'
2338
+ }
2339
+ }, /*#__PURE__*/React.createElement("div", null, this.renderJobTypes()), /*#__PURE__*/React.createElement("div", {
2340
+ className: "hub_tidioPadding"
2341
+ }));
2342
+ }
2343
+ }]);
2344
+
2345
+ return JobTypes;
2346
+ }(Component);
2347
+
2348
+ var mapStateToProps$6 = function mapStateToProps(state) {
2349
+ var auth = state.auth;
2350
+ return {
2351
+ jobtypes: state[values.reducerKey].jobtypes,
2352
+ auth: auth
2353
+ };
2354
+ };
2355
+
2356
+ var JobTypes$1 = connect(mapStateToProps$6, {
2357
+ jobTypesLoaded: jobTypesLoaded,
2358
+ jobTypesUpdate: jobTypesUpdate
2359
+ })(withRouter(JobTypes));
2360
+
2361
+ 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; }
2362
+
2363
+ 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(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; }
2364
+
2365
+ function _createSuper$a(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2366
+
2367
+ 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; } }
2368
+ var Session$5 = PlussCore.Session,
2369
+ Components$5 = PlussCore.Components,
2370
+ Colours$2 = PlussCore.Colours;
2371
+
2372
+ var Configuration = /*#__PURE__*/function (_Component) {
2373
+ _inherits(Configuration, _Component);
2374
+
2375
+ var _super = _createSuper$a(Configuration);
2376
+
2377
+ function Configuration(props) {
2378
+ var _this;
2379
+
2380
+ _classCallCheck(this, Configuration);
2381
+
2382
+ _this = _super.call(this, props);
2383
+
2384
+ _defineProperty(_assertThisInitialized(_this), "isStatusValid", function (statusLabel, statusCategory, statusColour) {
2385
+ if (_.isEmpty(statusLabel)) return false;
2386
+ if (_.isEmpty(statusCategory)) return false;
2387
+ if (_.isEmpty(statusColour)) return false;
2388
+ return true;
2389
+ });
2390
+
2391
+ _defineProperty(_assertThisInitialized(_this), "onMoveStatus", function (index) {
2392
+ var up = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2393
+ if (_this.state.fetchingStatusTypes) return;
2394
+
2395
+ var statusTypes = _.cloneDeep(_this.state.statusTypes);
2396
+
2397
+ if (up && index > 0) {
2398
+ // Moving up
2399
+ var _ref = [statusTypes[index], statusTypes[index - 1]];
2400
+ statusTypes[index - 1] = _ref[0];
2401
+ statusTypes[index] = _ref[1];
2402
+ } else if (index < statusTypes.length - 1) {
2403
+ // Moving down
2404
+ var _ref2 = [statusTypes[index + 1], statusTypes[index]];
2405
+ statusTypes[index] = _ref2[0];
2406
+ statusTypes[index + 1] = _ref2[1];
2407
+ } // Reset order
2408
+
2409
+
2410
+ statusTypes.forEach(function (status, index) {
2411
+ return status.order = index;
2412
+ });
2413
+
2414
+ _this.setState({
2415
+ statusTypes: statusTypes
2416
+ });
2417
+ });
2418
+
2419
+ _defineProperty(_assertThisInitialized(_this), "onEditStatus", function (index) {
2420
+ if (_this.state.fetchingStatusTypes) return;
2421
+ var status = _this.state.statusTypes[index];
2422
+
2423
+ _this.setState({
2424
+ showWarnings: false,
2425
+ showStatusPopup: true,
2426
+ selectedStatusIndex: index,
2427
+ statusLabel: status.text,
2428
+ statusCategory: status.category,
2429
+ statusColour: status.color
2430
+ });
2431
+ });
2432
+
2433
+ _defineProperty(_assertThisInitialized(_this), "onDeleteStatus", function (index) {
2434
+ if (_this.state.fetchingStatusTypes) return;
2435
+
2436
+ var statusTypes = _.cloneDeep(_this.state.statusTypes);
2437
+
2438
+ statusTypes.splice(index, 1);
2439
+
2440
+ _this.setState({
2441
+ statusTypes: statusTypes
2442
+ });
2443
+ });
2444
+
2445
+ _defineProperty(_assertThisInitialized(_this), "onAddStatus", function () {
2446
+ var defaultStatus = _this.props.statusTypes.find(function (s) {
2447
+ return s.category === STATUS_NOT_ACTIONED;
2448
+ });
2449
+
2450
+ _this.setState({
2451
+ showWarnings: false,
2452
+ showStatusPopup: true,
2453
+ selectedStatusIndex: -1,
2454
+ statusLabel: '',
2455
+ statusCategory: STATUS_NOT_ACTIONED,
2456
+ statusColour: defaultStatus.color
2457
+ });
2458
+ });
2459
+
2460
+ _defineProperty(_assertThisInitialized(_this), "onSaveStatus", function () {
2461
+ var _this$state = _this.state,
2462
+ selectedStatusIndex = _this$state.selectedStatusIndex,
2463
+ statusLabel = _this$state.statusLabel,
2464
+ statusCategory = _this$state.statusCategory,
2465
+ statusColour = _this$state.statusColour;
2466
+
2467
+ var statusTypes = _.cloneDeep(_this.state.statusTypes);
2468
+
2469
+ if (selectedStatusIndex < 0) {
2470
+ statusTypes.push({
2471
+ text: statusLabel,
2472
+ order: statusTypes.length,
2473
+ color: statusColour,
2474
+ category: statusCategory
2475
+ });
2476
+ } else {
2477
+ var status = statusTypes[selectedStatusIndex];
2478
+ status.text = statusLabel;
2479
+ status.color = statusColour;
2480
+ status.category = statusCategory;
2481
+ }
2482
+
2483
+ _this.setState({
2484
+ statusTypes: statusTypes,
2485
+ showStatusPopup: false
2486
+ });
2487
+ });
2488
+
2489
+ _defineProperty(_assertThisInitialized(_this), "onHideStatusPopup", function () {
2490
+ if (_this.state.submitting) return;
2491
+
2492
+ _this.setState({
2493
+ showStatusPopup: false
2494
+ });
2495
+ });
2496
+
2497
+ _defineProperty(_assertThisInitialized(_this), "onHandleChange", function (event) {
2498
+ var stateChange = {};
2499
+ stateChange[event.target.getAttribute('id')] = event.target.value;
2500
+
2501
+ _this.setState(stateChange);
2502
+ });
2503
+
2504
+ _defineProperty(_assertThisInitialized(_this), "onToggleDisableSeen", function () {
2505
+ if (_this.state.fetchingHideSeen) return;
2506
+
2507
+ _this.setState({
2508
+ hideSeen: !_this.state.hideSeen
2509
+ });
2510
+ });
2511
+
2512
+ _defineProperty(_assertThisInitialized(_this), "onSaveConfig", function () {
2513
+ if (!_this.validateForm()) return;
2514
+
2515
+ _this.setState({
2516
+ success: false,
2517
+ submitting: true
2518
+ }, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
2519
+ var _this$state2, statusTypes, hideSeen;
2520
+
2521
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
2522
+ while (1) {
2523
+ switch (_context.prev = _context.next) {
2524
+ case 0:
2525
+ _context.prev = 0;
2526
+ _this$state2 = _this.state, statusTypes = _this$state2.statusTypes, hideSeen = _this$state2.hideSeen;
2527
+ _context.next = 4;
2528
+ return stringActions.setString(_this.props.auth.site, values.stringConfigJobStatus, statusTypes);
2529
+
2530
+ case 4:
2531
+ _context.next = 6;
2532
+ return stringActions.setString(_this.props.auth.site, values.stringConfigHideSeen, hideSeen);
2533
+
2534
+ case 6:
2535
+ _this.props.jobStatusesLoaded(statusTypes);
2536
+
2537
+ _this.props.jobHideSeenLoaded(hideSeen);
2538
+
2539
+ _this.setState({
2540
+ success: true
2541
+ });
2542
+
2543
+ _context.next = 15;
2544
+ break;
2545
+
2546
+ case 11:
2547
+ _context.prev = 11;
2548
+ _context.t0 = _context["catch"](0);
2549
+ console.log('onSaveConfig - error', _context.t0);
2550
+
2551
+ _this.setState({
2552
+ success: false
2553
+ });
2554
+
2555
+ case 15:
2556
+ _context.prev = 15;
2557
+
2558
+ _this.setState({
2559
+ submitting: false
2560
+ });
2561
+
2562
+ return _context.finish(15);
2563
+
2564
+ case 18:
2565
+ case "end":
2566
+ return _context.stop();
2567
+ }
2568
+ }
2569
+ }, _callee, null, [[0, 11, 15, 18]]);
2570
+ })));
2571
+ });
2572
+
2573
+ _this.state = {
2574
+ success: false,
2575
+ submitting: false,
2576
+ selectedStatusIndex: -1,
2577
+ showStatusPopup: false,
2578
+ statusLabel: '',
2579
+ statusCategory: STATUS_NOT_ACTIONED,
2580
+ statusColour: '',
2581
+ fetchingStatusTypes: true,
2582
+ statusTypes: _this.props.statusTypes,
2583
+ fetchingHideSeen: true,
2584
+ hideSeen: _this.props.hideSeen
2585
+ };
2586
+ return _this;
2587
+ }
2588
+
2589
+ _createClass(Configuration, [{
2590
+ key: "UNSAFE_componentWillMount",
2591
+ value: function UNSAFE_componentWillMount() {
2592
+ Session$5.checkLoggedIn(this);
2593
+ }
2594
+ }, {
2595
+ key: "componentDidMount",
2596
+ value: function componentDidMount() {
2597
+ var _this2 = this;
2598
+
2599
+ if (!Session$5.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth, true)) {
2600
+ this.props.history.push('/mastermenu');
2601
+ } else {
2602
+ this.props.jobStatusesUpdate(this.props.auth.site, function (statusTypes) {
2603
+ return _this2.setState({
2604
+ statusTypes: statusTypes,
2605
+ fetchingStatusTypes: false
2606
+ });
2607
+ });
2608
+ this.props.jobHideSeenUpdate(this.props.auth.site, function (hideSeen) {
2609
+ return _this2.setState({
2610
+ hideSeen: hideSeen,
2611
+ fetchingHideSeen: false
2612
+ });
2613
+ });
2614
+ }
2615
+ }
2616
+ }, {
2617
+ key: "validateForm",
2618
+ value: function validateForm() {
2619
+ var _this3 = this;
2620
+
2621
+ var _this$state3 = this.state,
2622
+ submitting = _this$state3.submitting,
2623
+ statusTypes = _this$state3.statusTypes;
2624
+ if (submitting) return false; // Validate statuses
2625
+
2626
+ var statusesValid = statusTypes.map(function (status) {
2627
+ var text = status.text,
2628
+ category = status.category,
2629
+ color = status.color;
2630
+ return _this3.isStatusValid(text, category, color);
2631
+ });
2632
+ if (!statusesValid.every(function (valid) {
2633
+ return valid;
2634
+ })) return false;
2635
+ return true;
2636
+ }
2637
+ }, {
2638
+ key: "renderStatuses",
2639
+ value: function renderStatuses() {
2640
+ var _this4 = this;
2641
+
2642
+ var statusTypes = this.state.statusTypes;
2643
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
2644
+ className: "fontMedium fontSize-36 text-dark"
2645
+ }, "Statuses"), /*#__PURE__*/React.createElement("div", {
2646
+ style: styles$6.statusCategoryHeading
2647
+ }, /*#__PURE__*/React.createElement("span", {
2648
+ className: "fontMedium fontSize-16 text-bold"
2649
+ }, "Status Category")), statusTypes.map(function (status, index) {
2650
+ return /*#__PURE__*/React.createElement("div", {
2651
+ key: "".concat(status.text, "_").concat(index),
2652
+ style: styles$6.statusTypeContainer
2653
+ }, /*#__PURE__*/React.createElement("div", {
2654
+ key: status.text,
2655
+ className: "statusLabel",
2656
+ style: _objectSpread$5(_objectSpread$5({}, styles$6.statusTextContainer), {}, {
2657
+ backgroundColor: status.color
2658
+ })
2659
+ }, /*#__PURE__*/React.createElement("span", {
2660
+ className: "statusLabel_text"
2661
+ }, status.text)), /*#__PURE__*/React.createElement("div", {
2662
+ style: styles$6.statusCategoryContainer
2663
+ }, /*#__PURE__*/React.createElement("span", {
2664
+ className: "fontMedium fontSize-16 text-dark"
2665
+ }, status.category)), /*#__PURE__*/React.createElement(FontAwesome, {
2666
+ style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
2667
+ visibility: index === 0 ? 'hidden' : 'visible'
2668
+ }),
2669
+ name: 'arrow-up',
2670
+ onClick: function onClick() {
2671
+ return _this4.onMoveStatus(index, true);
2672
+ }
2673
+ }), /*#__PURE__*/React.createElement(FontAwesome, {
2674
+ style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
2675
+ visibility: index === statusTypes.length - 1 ? 'hidden' : 'visible'
2676
+ }),
2677
+ name: 'arrow-down',
2678
+ onClick: function onClick() {
2679
+ return _this4.onMoveStatus(index, false);
2680
+ }
2681
+ }), /*#__PURE__*/React.createElement(FontAwesome, {
2682
+ style: _objectSpread$5({}, styles$6.statusIcon),
2683
+ name: "pencil",
2684
+ onClick: function onClick() {
2685
+ return _this4.onEditStatus(index);
2686
+ }
2687
+ }), /*#__PURE__*/React.createElement(FontAwesome, {
2688
+ style: _objectSpread$5({}, styles$6.statusIcon),
2689
+ name: "minus-circle",
2690
+ onClick: function onClick() {
2691
+ return _this4.onDeleteStatus(index);
2692
+ }
2693
+ }));
2694
+ }), /*#__PURE__*/React.createElement("div", {
2695
+ onClick: this.onAddStatus,
2696
+ style: {
2697
+ display: 'flex',
2698
+ flexDirection: 'row',
2699
+ alignItems: 'center',
2700
+ marginTop: 16
2701
+ }
2702
+ }, /*#__PURE__*/React.createElement(Components$5.P60Icon, {
2703
+ className: "addoption_plus",
2704
+ icon: "add",
2705
+ style: {
2706
+ fontSize: 12
2707
+ }
2708
+ }), /*#__PURE__*/React.createElement("p", {
2709
+ className: "addoption_text"
2710
+ }, "Add another status")));
1942
2711
  }
1943
2712
  }, {
1944
- key: "renderContent",
1945
- value: function renderContent() {
1946
- if (_.isEmpty(this.state.jobList)) return this.renderEmpty();
1947
- return this.renderView();
2713
+ key: "renderOtherOptions",
2714
+ value: function renderOtherOptions() {
2715
+ return /*#__PURE__*/React.createElement("div", {
2716
+ className: "marginTop-55"
2717
+ }, /*#__PURE__*/React.createElement("p", {
2718
+ className: "fontMedium fontSize-36 text-dark"
2719
+ }, "Other options"), /*#__PURE__*/React.createElement(Components$5.CheckBox, {
2720
+ label: "Disable whether a request has been \"Seen\" and prevent that from being surfaced to the App user",
2721
+ isActive: this.state.hideSeen,
2722
+ onChange: this.onToggleDisableSeen
2723
+ }));
1948
2724
  }
1949
2725
  }, {
1950
- key: "renderJobTypes",
1951
- value: function renderJobTypes() {
1952
- var _this$state = this.state,
1953
- jobList = _this$state.jobList,
1954
- loading = _this$state.loading;
2726
+ key: "renderSubmit",
2727
+ value: function renderSubmit() {
2728
+ if (this.state.submitting) {
2729
+ return /*#__PURE__*/React.createElement(Components$5.Button, {
2730
+ buttonType: "secondary"
2731
+ }, "Saving...");
2732
+ }
1955
2733
 
1956
- if (jobList.length === 0 && loading) {
1957
- return /*#__PURE__*/React.createElement("div", {
1958
- style: {
1959
- minWidth: '100%'
1960
- }
2734
+ return /*#__PURE__*/React.createElement(Components$5.Button, {
2735
+ inline: true,
2736
+ buttonType: "primary",
2737
+ onClick: this.onSaveConfig,
2738
+ isActive: this.validateForm()
2739
+ }, "Save");
2740
+ }
2741
+ }, {
2742
+ key: "renderSuccess",
2743
+ value: function renderSuccess() {
2744
+ if (!this.state.success) return null;
2745
+ return /*#__PURE__*/React.createElement("span", {
2746
+ style: _objectSpread$5(_objectSpread$5({}, styles$6.savedText), {}, {
2747
+ color: Colours$2.COLOUR_GREEN
2748
+ })
2749
+ }, "Saved");
2750
+ }
2751
+ }, {
2752
+ key: "renderNewStatusPopup",
2753
+ value: function renderNewStatusPopup() {
2754
+ var _ref4,
2755
+ _this5 = this;
2756
+
2757
+ var _this$state4 = this.state,
2758
+ submitting = _this$state4.submitting,
2759
+ showStatusPopup = _this$state4.showStatusPopup,
2760
+ showWarnings = _this$state4.showWarnings,
2761
+ selectedStatusIndex = _this$state4.selectedStatusIndex,
2762
+ statusLabel = _this$state4.statusLabel,
2763
+ statusCategory = _this$state4.statusCategory,
2764
+ statusColour = _this$state4.statusColour;
2765
+ if (!showStatusPopup) return null;
2766
+ var canSave = !submitting && this.isStatusValid(statusLabel, statusCategory, statusColour);
2767
+ return /*#__PURE__*/React.createElement(Components$5.Popup, {
2768
+ maxWidth: 800,
2769
+ minWidth: 450,
2770
+ hasPadding: true,
2771
+ buttons: [(_ref4 = {
2772
+ type: 'primaryAction',
2773
+ onClick: this.onSaveStatus,
2774
+ isActive: canSave
2775
+ }, _defineProperty(_ref4, "isActive", true), _defineProperty(_ref4, "text", submitting ? 'Saving...' : 'Save'), _defineProperty(_ref4, "className", 'popupButton'), _ref4), {
2776
+ type: 'outlinedAction',
2777
+ onClick: this.onHideStatusPopup,
2778
+ isActive: !submitting,
2779
+ text: 'Cancel',
2780
+ className: 'popupButton'
2781
+ }],
2782
+ onClose: this.onHideStatusPopup,
2783
+ title: selectedStatusIndex < 0 ? 'New Status' : 'Edit Status'
2784
+ }, /*#__PURE__*/React.createElement(Components$5.GenericInput, {
2785
+ id: "statusLabel",
2786
+ type: "text",
2787
+ label: "Label",
2788
+ placeholder: "Status label",
2789
+ value: statusLabel,
2790
+ onChange: this.onHandleChange,
2791
+ isRequired: true,
2792
+ isValid: function isValid() {
2793
+ return !_.isEmpty(statusLabel);
2794
+ },
2795
+ showError: function showError() {
2796
+ return showWarnings && _.isEmpty(statusLabel);
2797
+ },
2798
+ alwaysShowLabel: true,
2799
+ className: "marginBottom-20"
2800
+ }), /*#__PURE__*/React.createElement(Components$5.RadioButton, {
2801
+ label: "Status Category",
2802
+ subLabel: /*#__PURE__*/React.createElement("div", {
2803
+ className: "marginBottom-16"
1961
2804
  }, /*#__PURE__*/React.createElement("div", {
1962
- className: "padding-60 paddingVertical-40",
1963
- style: {
1964
- textAlign: 'center'
2805
+ className: "marginBottom-4"
2806
+ }, 'This is used to categorise statuses for filtering and analytics purposes'), /*#__PURE__*/React.createElement("div", {
2807
+ className: "text-bold"
2808
+ }, 'This status is considered')),
2809
+ className: "marginBottom-20",
2810
+ rowStyle: {
2811
+ flexDirection: 'column'
2812
+ },
2813
+ buttonStyle: {
2814
+ marginBottom: 8
2815
+ },
2816
+ isActive: statusCategory || null,
2817
+ options: [{
2818
+ Label: STATUS_NOT_ACTIONED,
2819
+ Value: STATUS_NOT_ACTIONED,
2820
+ onChange: function onChange() {
2821
+ return _this5.setState({
2822
+ statusCategory: STATUS_NOT_ACTIONED
2823
+ });
1965
2824
  }
1966
- }, /*#__PURE__*/React.createElement(FontAwesome, {
1967
- style: {
1968
- fontSize: 30,
1969
- color: FeatureConfig.env.colourBrandingOff
1970
- },
1971
- name: "spinner fa-pulse fa-fw"
1972
- })));
1973
- }
1974
-
1975
- return /*#__PURE__*/React.createElement("div", {
1976
- style: {
1977
- minWidth: '100%'
2825
+ }, {
2826
+ Label: STATUS_IN_PROGRESS,
2827
+ Value: STATUS_IN_PROGRESS,
2828
+ onChange: function onChange() {
2829
+ return _this5.setState({
2830
+ statusCategory: STATUS_IN_PROGRESS
2831
+ });
2832
+ }
2833
+ }, {
2834
+ Label: STATUS_COMPLETED,
2835
+ Value: STATUS_COMPLETED,
2836
+ onChange: function onChange() {
2837
+ return _this5.setState({
2838
+ statusCategory: STATUS_COMPLETED
2839
+ });
2840
+ }
2841
+ }]
2842
+ }), /*#__PURE__*/React.createElement(Components$5.ColourOptions, {
2843
+ options: ['vibrant', 'picker'],
2844
+ defaultTab: "vibrant",
2845
+ value: statusColour,
2846
+ onColourSelected: function onColourSelected(statusColour) {
2847
+ return _this5.setState({
2848
+ statusColour: statusColour
2849
+ });
1978
2850
  }
2851
+ }), /*#__PURE__*/React.createElement("div", {
2852
+ className: "marginTop-24"
1979
2853
  }, /*#__PURE__*/React.createElement("div", {
1980
- className: "marginBottom-32"
1981
- }, /*#__PURE__*/React.createElement(Components$5.AddButton, {
1982
- onClick: this.props.onNew,
1983
- text: values.textNewTypeButton
1984
- })), this.renderContent());
2854
+ className: "fieldLabel marginBottom-4"
2855
+ }, "Preview"), /*#__PURE__*/React.createElement(Components$5.Tag, {
2856
+ text: this.state.statusLabel,
2857
+ style: {
2858
+ backgroundColor: statusColour,
2859
+ borderColor: statusColour
2860
+ }
2861
+ })));
1985
2862
  }
1986
2863
  }, {
1987
2864
  key: "render",
@@ -1990,27 +2867,68 @@ var JobTypes = /*#__PURE__*/function (_Component) {
1990
2867
  style: {
1991
2868
  minWidth: '100%'
1992
2869
  }
1993
- }, /*#__PURE__*/React.createElement("div", null, this.renderJobTypes()), /*#__PURE__*/React.createElement("div", {
1994
- className: "hub_tidioPadding"
1995
- }));
2870
+ }, this.renderStatuses(), this.renderOtherOptions(), /*#__PURE__*/React.createElement("div", {
2871
+ style: {
2872
+ paddingTop: 24,
2873
+ paddingBottom: 24
2874
+ }
2875
+ }, this.renderSubmit(), this.renderSuccess()), this.renderNewStatusPopup());
1996
2876
  }
1997
2877
  }]);
1998
2878
 
1999
- return JobTypes;
2879
+ return Configuration;
2000
2880
  }(Component);
2001
2881
 
2882
+ var styles$6 = {
2883
+ statusCategoryHeading: {
2884
+ marginLeft: 130,
2885
+ width: 160,
2886
+ textAlign: 'center',
2887
+ marginBottom: 12
2888
+ },
2889
+ statusTypeContainer: {
2890
+ display: 'flex',
2891
+ flexDirection: 'row',
2892
+ alignItems: 'center',
2893
+ marginBottom: 20
2894
+ },
2895
+ statusTextContainer: {
2896
+ width: 130
2897
+ },
2898
+ statusCategoryContainer: {
2899
+ width: 160,
2900
+ textAlign: 'center'
2901
+ },
2902
+ statusIcon: {
2903
+ cursor: 'pointer',
2904
+ fontSize: 20,
2905
+ padding: 5,
2906
+ marginLeft: 10,
2907
+ color: Colours$2.COLOUR_BRANDING_ACTION,
2908
+ visibility: 'visible'
2909
+ },
2910
+ savedText: {
2911
+ fontSize: 14,
2912
+ lineHeight: '33px',
2913
+ marginLeft: 15
2914
+ }
2915
+ };
2916
+
2002
2917
  var mapStateToProps$5 = function mapStateToProps(state) {
2003
2918
  var auth = state.auth;
2004
2919
  return {
2005
- jobtypes: state[values.reducerKey].jobtypes,
2006
- auth: auth
2920
+ auth: auth,
2921
+ statusTypes: state[values.reducerKey].jobstatuses,
2922
+ hideSeen: state[values.reducerKey].hideSeen
2007
2923
  };
2008
2924
  };
2009
2925
 
2010
- var JobTypes$1 = connect(mapStateToProps$5, {
2011
- jobTypesLoaded: jobTypesLoaded,
2012
- jobTypesUpdate: jobTypesUpdate
2013
- })(withRouter(JobTypes));
2926
+ var Configuration$1 = connect(mapStateToProps$5, {
2927
+ jobStatusesUpdate: jobStatusesUpdate,
2928
+ jobStatusesLoaded: jobStatusesLoaded,
2929
+ jobHideSeenUpdate: jobHideSeenUpdate,
2930
+ jobHideSeenLoaded: jobHideSeenLoaded
2931
+ })(withRouter(Configuration));
2014
2932
 
2015
2933
  function _createSuper$9(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2016
2934
 
@@ -2221,6 +3139,21 @@ var RequestsHub = /*#__PURE__*/function (_Component) {
2221
3139
  });
2222
3140
  }
2223
3141
 
3142
+ if (Session$4.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth)) {
3143
+ sectionItems.push({
3144
+ type: 'navItem',
3145
+ text: 'Feature Configuration',
3146
+ icon: 'settings',
3147
+ isFontAwesome: false,
3148
+ selected: this.state.selectedSection === 'config',
3149
+ onClick: function onClick() {
3150
+ _this2.setState({
3151
+ selectedSection: 'config'
3152
+ });
3153
+ }
3154
+ });
3155
+ }
3156
+
2224
3157
  var helpGuide = {
2225
3158
  text: "Help with ".concat(values.textTitleRequests),
2226
3159
  url: Urls.HelpGuide.Maintenance
@@ -2240,6 +3173,8 @@ var RequestsHub = /*#__PURE__*/function (_Component) {
2240
3173
  return /*#__PURE__*/React.createElement(JobTypes$1, {
2241
3174
  onNew: this.onAddRequestType
2242
3175
  });
3176
+ } else if (this.state.selectedSection === 'config') {
3177
+ return /*#__PURE__*/React.createElement(Configuration$1, null);
2243
3178
  }
2244
3179
 
2245
3180
  return /*#__PURE__*/React.createElement(JobList$1, {
@@ -2311,6 +3246,7 @@ var Apis = PlussCore.Apis,
2311
3246
  Session$3 = PlussCore.Session,
2312
3247
  Colours$1 = PlussCore.Colours,
2313
3248
  Components$3 = PlussCore.Components;
3249
+ var IMAGE_SIZE_NOTE = 72;
2314
3250
 
2315
3251
  var Job = /*#__PURE__*/function (_Component) {
2316
3252
  _inherits(Job, _Component);
@@ -2395,13 +3331,20 @@ var Job = /*#__PURE__*/function (_Component) {
2395
3331
  })));
2396
3332
 
2397
3333
  _defineProperty(_assertThisInitialized(_this), "getStatusType", function (status) {
2398
- var statusType = StatusTypes[status] || Object.values(StatusTypes).find(function (s) {
3334
+ var statusTypes = _this.props.statusTypes;
3335
+ var statusType = statusTypes.find(function (s) {
2399
3336
  return s.text === status;
2400
3337
  });
2401
- if (!statusType) statusType = {
2402
- text: status,
2403
- color: '#aaa'
2404
- };
3338
+
3339
+ if (!statusType) {
3340
+ var defaultStatus = statusTypes.find(function (s) {
3341
+ return s.category === STATUS_NOT_ACTIONED;
3342
+ });
3343
+ statusType = _objectSpread$4(_objectSpread$4({}, defaultStatus), {}, {
3344
+ text: status
3345
+ });
3346
+ }
3347
+
2405
3348
  return statusType;
2406
3349
  });
2407
3350
 
@@ -2444,11 +3387,12 @@ var Job = /*#__PURE__*/function (_Component) {
2444
3387
  _defineProperty(_assertThisInitialized(_this), "isReadyToSaveNote", function () {
2445
3388
  var _this$state = _this.state,
2446
3389
  noteAttachments = _this$state.noteAttachments,
2447
- noteInput = _this$state.noteInput;
3390
+ noteInput = _this$state.noteInput,
3391
+ noteImages = _this$state.noteImages;
2448
3392
  if (_.some(noteAttachments, function (n) {
2449
3393
  return n.Uploading;
2450
3394
  })) return false;
2451
- return !_.isEmpty(noteInput) || !_.isEmpty(noteAttachments);
3395
+ return !_.isEmpty(noteInput) || !_.isEmpty(noteAttachments) || !_.isEmpty(noteImages);
2452
3396
  });
2453
3397
 
2454
3398
  _defineProperty(_assertThisInitialized(_this), "onOpenAddNote", function () {
@@ -2467,6 +3411,7 @@ var Job = /*#__PURE__*/function (_Component) {
2467
3411
  if (!!_this.state.editingNote) {
2468
3412
  newState.noteInput = '';
2469
3413
  newState.noteAttachments = [];
3414
+ newState.noteImages = [];
2470
3415
  }
2471
3416
 
2472
3417
  _this.setState(newState);
@@ -2654,12 +3599,12 @@ var Job = /*#__PURE__*/function (_Component) {
2654
3599
  Title: a.Title,
2655
3600
  Source: a.Source
2656
3601
  };
2657
- })) : maintenanceActions.addNote(_this.state.jobId, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
3602
+ }), _this.state.noteImages) : maintenanceActions.addNote(_this.state.jobId, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
2658
3603
  return {
2659
3604
  Title: a.Title,
2660
3605
  Source: a.Source
2661
3606
  };
2662
- }));
3607
+ }), _this.state.noteImages);
2663
3608
 
2664
3609
  case 6:
2665
3610
  res = _context5.sent;
@@ -2670,6 +3615,7 @@ var Job = /*#__PURE__*/function (_Component) {
2670
3615
  addNoteOpen: false,
2671
3616
  noteInput: '',
2672
3617
  noteAttachments: [],
3618
+ noteImages: [],
2673
3619
  editingNote: null
2674
3620
  }, function () {
2675
3621
  _this.props.jobsLoaded([_this.state.job]);
@@ -2719,11 +3665,12 @@ var Job = /*#__PURE__*/function (_Component) {
2719
3665
  _defineProperty(_assertThisInitialized(_this), "onOpenEditNote", function (n) {
2720
3666
  _this.setState({
2721
3667
  noteAttachments: n.Attachments || [],
3668
+ noteImages: n.Images || [],
2722
3669
  noteInput: n.Note || '',
2723
3670
  addNoteOpen: true,
2724
3671
  editingNote: n.Id,
2725
3672
  noteMenuOpen: null
2726
- });
3673
+ }, _this.checkSetImage);
2727
3674
  });
2728
3675
 
2729
3676
  _defineProperty(_assertThisInitialized(_this), "markSeen", function () {
@@ -2829,53 +3776,54 @@ var Job = /*#__PURE__*/function (_Component) {
2829
3776
  _this.setState(stateChange);
2830
3777
  });
2831
3778
 
2832
- _defineProperty(_assertThisInitialized(_this), "onToggleStatusChanger", function () {
3779
+ _defineProperty(_assertThisInitialized(_this), "onTogglePriorityChanger", function () {
2833
3780
  _this.setState({
2834
- statusChangerOpen: !_this.state.statusChangerOpen
3781
+ priorityChangerOpen: !_this.state.priorityChangerOpen
2835
3782
  });
2836
3783
  });
2837
3784
 
2838
- _defineProperty(_assertThisInitialized(_this), "onSelectStatus", /*#__PURE__*/function () {
2839
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(status) {
2840
- var res;
3785
+ _defineProperty(_assertThisInitialized(_this), "onSelectPriority", /*#__PURE__*/function () {
3786
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(priority) {
3787
+ var res, job;
2841
3788
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2842
3789
  while (1) {
2843
3790
  switch (_context8.prev = _context8.next) {
2844
3791
  case 0:
2845
3792
  _this.setState({
2846
3793
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
2847
- status: status
3794
+ priority: priority
2848
3795
  }),
2849
- statusChangerOpen: false
3796
+ priorityChangerOpen: false
2850
3797
  });
2851
3798
 
2852
3799
  _context8.prev = 1;
2853
3800
  _context8.next = 4;
2854
- return maintenanceActions.editJobStatus(_this.state.job.id, status);
3801
+ return maintenanceActions.editJobPriority(_this.state.job.id, priority);
2855
3802
 
2856
3803
  case 4:
2857
3804
  res = _context8.sent;
3805
+ job = res.data.job;
3806
+
3807
+ _this.props.jobsLoaded([job]);
2858
3808
 
2859
3809
  _this.setState({
2860
- job: res.data.job
2861
- }, function () {
2862
- _this.props.jobsLoaded([_this.state.job]);
3810
+ job: job
2863
3811
  });
2864
3812
 
2865
- _context8.next = 11;
3813
+ _context8.next = 13;
2866
3814
  break;
2867
3815
 
2868
- case 8:
2869
- _context8.prev = 8;
3816
+ case 10:
3817
+ _context8.prev = 10;
2870
3818
  _context8.t0 = _context8["catch"](1);
2871
- console.error('onSelectStatus', _context8.t0);
3819
+ console.error('onSelectPriority', _context8.t0);
2872
3820
 
2873
- case 11:
3821
+ case 13:
2874
3822
  case "end":
2875
3823
  return _context8.stop();
2876
3824
  }
2877
3825
  }
2878
- }, _callee8, null, [[1, 8]]);
3826
+ }, _callee8, null, [[1, 10]]);
2879
3827
  }));
2880
3828
 
2881
3829
  return function (_x2) {
@@ -2883,6 +3831,61 @@ var Job = /*#__PURE__*/function (_Component) {
2883
3831
  };
2884
3832
  }());
2885
3833
 
3834
+ _defineProperty(_assertThisInitialized(_this), "onToggleStatusChanger", function () {
3835
+ _this.setState({
3836
+ statusChangerOpen: !_this.state.statusChangerOpen
3837
+ });
3838
+ });
3839
+
3840
+ _defineProperty(_assertThisInitialized(_this), "onSelectStatus", /*#__PURE__*/function () {
3841
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(status) {
3842
+ var res, job;
3843
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
3844
+ while (1) {
3845
+ switch (_context9.prev = _context9.next) {
3846
+ case 0:
3847
+ _this.setState({
3848
+ job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
3849
+ status: status
3850
+ }),
3851
+ statusChangerOpen: false
3852
+ });
3853
+
3854
+ _context9.prev = 1;
3855
+ _context9.next = 4;
3856
+ return maintenanceActions.editJobStatus(_this.state.job.id, status);
3857
+
3858
+ case 4:
3859
+ res = _context9.sent;
3860
+ job = res.data.job;
3861
+
3862
+ _this.props.jobsLoaded([job]);
3863
+
3864
+ _this.setState({
3865
+ job: job
3866
+ });
3867
+
3868
+ _context9.next = 13;
3869
+ break;
3870
+
3871
+ case 10:
3872
+ _context9.prev = 10;
3873
+ _context9.t0 = _context9["catch"](1);
3874
+ console.error('onSelectStatus', _context9.t0);
3875
+
3876
+ case 13:
3877
+ case "end":
3878
+ return _context9.stop();
3879
+ }
3880
+ }
3881
+ }, _callee9, null, [[1, 10]]);
3882
+ }));
3883
+
3884
+ return function (_x3) {
3885
+ return _ref9.apply(this, arguments);
3886
+ };
3887
+ }());
3888
+
2886
3889
  _this.state = {
2887
3890
  jobId: Helper$2.safeReadParams(props, 'jobId') ? props.match.params.jobId : null,
2888
3891
  job: null,
@@ -2891,10 +3894,12 @@ var Job = /*#__PURE__*/function (_Component) {
2891
3894
  comments: [],
2892
3895
  commentInput: '',
2893
3896
  loadingComments: false,
3897
+ priorityChangerOpen: false,
2894
3898
  statusChangerOpen: false,
2895
3899
  addNoteOpen: false,
2896
3900
  noteAttachments: [],
2897
3901
  noteInput: '',
3902
+ noteImages: [],
2898
3903
  assignees: []
2899
3904
  };
2900
3905
  return _this;
@@ -2908,12 +3913,64 @@ var Job = /*#__PURE__*/function (_Component) {
2908
3913
  }, {
2909
3914
  key: "componentDidMount",
2910
3915
  value: function componentDidMount() {
3916
+ this.props.jobStatusesUpdate(this.props.auth.site);
3917
+
2911
3918
  if (this.state.jobId) {
2912
3919
  this.getJob();
2913
3920
  this.getComments();
2914
3921
  this.getAssignees();
2915
3922
  }
2916
3923
  }
3924
+ }, {
3925
+ key: "checkSetImage",
3926
+ value: function checkSetImage() {
3927
+ if (this.imageInput && !_.isEmpty(this.state.noteImages)) {
3928
+ this.imageInput.getWrappedInstance().setValue(this.state.noteImages);
3929
+ } else {
3930
+ setTimeout(this.checkSetImage, 100);
3931
+ }
3932
+ }
3933
+ }, {
3934
+ key: "renderPriorityChanger",
3935
+ value: function renderPriorityChanger() {
3936
+ var _this2 = this;
3937
+
3938
+ if (!this.state.priorityChangerOpen) return null;
3939
+ return /*#__PURE__*/React.createElement("div", {
3940
+ className: "statusChanger statusChanger-priority"
3941
+ }, jobPriorityOptions.map(function (p) {
3942
+ return /*#__PURE__*/React.createElement("div", {
3943
+ key: p.name,
3944
+ className: "statusLabel",
3945
+ onClick: function onClick() {
3946
+ return _this2.onSelectPriority(p.name);
3947
+ },
3948
+ style: {
3949
+ backgroundColor: p.color
3950
+ }
3951
+ }, /*#__PURE__*/React.createElement("span", {
3952
+ className: "statusLabel_text"
3953
+ }, p.name));
3954
+ }));
3955
+ }
3956
+ }, {
3957
+ key: "renderPriorityLabel",
3958
+ value: function renderPriorityLabel() {
3959
+ var auth = this.props.auth;
3960
+ if (!Session$3.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return null;
3961
+ var job = this.state.job;
3962
+ if (!job) return null;
3963
+ var selectedPriority = getJobPriority(job.priority);
3964
+ return /*#__PURE__*/React.createElement("div", {
3965
+ className: "statusLabel marginTop-5 pointer",
3966
+ onClick: this.onTogglePriorityChanger,
3967
+ style: {
3968
+ backgroundColor: selectedPriority.color
3969
+ }
3970
+ }, /*#__PURE__*/React.createElement("span", {
3971
+ className: "statusLabel_text"
3972
+ }, job.priority || selectedPriority.name), this.renderPriorityChanger());
3973
+ }
2917
3974
  }, {
2918
3975
  key: "renderStatusLabel",
2919
3976
  value: function renderStatusLabel() {
@@ -2977,24 +4034,25 @@ var Job = /*#__PURE__*/function (_Component) {
2977
4034
  }, {
2978
4035
  key: "renderStatusChanger",
2979
4036
  value: function renderStatusChanger() {
2980
- var _this2 = this;
4037
+ var _this3 = this;
2981
4038
 
2982
4039
  if (!this.state.statusChangerOpen) return null;
4040
+ var statusTypes = this.props.statusTypes;
2983
4041
  return /*#__PURE__*/React.createElement("div", {
2984
4042
  className: "statusChanger statusChanger-maintenance"
2985
- }, Object.keys(StatusTypes).map(function (statusKey) {
4043
+ }, statusTypes.map(function (status) {
2986
4044
  return /*#__PURE__*/React.createElement("div", {
2987
- key: statusKey,
4045
+ key: status.text,
2988
4046
  className: "statusLabel",
2989
4047
  onClick: function onClick() {
2990
- return _this2.onSelectStatus(statusKey);
4048
+ return _this3.onSelectStatus(status.text);
2991
4049
  },
2992
4050
  style: {
2993
- backgroundColor: StatusTypes[statusKey].color
4051
+ backgroundColor: status.color
2994
4052
  }
2995
4053
  }, /*#__PURE__*/React.createElement("span", {
2996
4054
  className: "statusLabel_text"
2997
- }, StatusTypes[statusKey].text));
4055
+ }, status.text));
2998
4056
  }));
2999
4057
  }
3000
4058
  }, {
@@ -3008,7 +4066,7 @@ var Job = /*#__PURE__*/function (_Component) {
3008
4066
  }, {
3009
4067
  key: "renderCommentSection",
3010
4068
  value: function renderCommentSection() {
3011
- var _this3 = this;
4069
+ var _this4 = this;
3012
4070
 
3013
4071
  if (this.state.loadingComments) return null;
3014
4072
  return /*#__PURE__*/React.createElement("div", {
@@ -3021,7 +4079,7 @@ var Job = /*#__PURE__*/function (_Component) {
3021
4079
  }, "Comments"), /*#__PURE__*/React.createElement("div", {
3022
4080
  className: "commentSection"
3023
4081
  }, this.state.comments.map(function (c) {
3024
- return _this3.renderComment(c);
4082
+ return _this4.renderComment(c);
3025
4083
  })), /*#__PURE__*/React.createElement("div", {
3026
4084
  className: "commentReply"
3027
4085
  }, /*#__PURE__*/React.createElement("div", {
@@ -3037,13 +4095,14 @@ var Job = /*#__PURE__*/function (_Component) {
3037
4095
  className: "commentReply_input",
3038
4096
  value: this.state.commentInput,
3039
4097
  onChange: function onChange(e) {
3040
- return _this3.onHandleChange(e);
4098
+ return _this4.onHandleChange(e);
3041
4099
  }
3042
4100
  }))));
3043
4101
  }
3044
4102
  }, {
3045
4103
  key: "renderImageGrid",
3046
4104
  value: function renderImageGrid(images) {
4105
+ var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
3047
4106
  var imagesToUse = images && images.length > 0 ? images : [];
3048
4107
  return /*#__PURE__*/React.createElement("div", {
3049
4108
  className: "imageGrid"
@@ -3056,7 +4115,9 @@ var Job = /*#__PURE__*/function (_Component) {
3056
4115
  }, /*#__PURE__*/React.createElement("div", {
3057
4116
  className: "imageGrid_image",
3058
4117
  style: {
3059
- backgroundImage: "url('".concat(Helper$2.get1400(image), "')")
4118
+ backgroundImage: "url('".concat(Helper$2.get1400(image), "')"),
4119
+ width: size,
4120
+ height: size
3060
4121
  }
3061
4122
  }));
3062
4123
  }));
@@ -3076,7 +4137,7 @@ var Job = /*#__PURE__*/function (_Component) {
3076
4137
  }, {
3077
4138
  key: "renderCustomFields",
3078
4139
  value: function renderCustomFields() {
3079
- var _this4 = this;
4140
+ var _this5 = this;
3080
4141
 
3081
4142
  var job = this.state.job;
3082
4143
  var customFields = job.customFields;
@@ -3106,7 +4167,7 @@ var Job = /*#__PURE__*/function (_Component) {
3106
4167
  }, field.answer && Array.isArray(field.answer) ? field.answer.join(', ') : '');
3107
4168
 
3108
4169
  case 'image':
3109
- return _this4.renderImageGrid(field.answer);
4170
+ return _this5.renderImageGrid(field.answer);
3110
4171
 
3111
4172
  default:
3112
4173
  return /*#__PURE__*/React.createElement("div", {
@@ -3227,12 +4288,12 @@ var Job = /*#__PURE__*/function (_Component) {
3227
4288
  }
3228
4289
  }, /*#__PURE__*/React.createElement("span", {
3229
4290
  className: "statusLabel_text"
3230
- }, e ? "Marked as ".concat(statusType.text) : "".concat(values.textEntityName, " opened"))));
4291
+ }, e ? "".concat(entryToUse.user.displayName, " marked as ").concat(statusType.text) : "".concat(values.textEntityName, " opened"))));
3231
4292
  }
3232
4293
  }, {
3233
4294
  key: "renderNote",
3234
4295
  value: function renderNote(note, index) {
3235
- var _this5 = this;
4296
+ var _this6 = this;
3236
4297
 
3237
4298
  return /*#__PURE__*/React.createElement("div", {
3238
4299
  className: "ticketHistoryEntry",
@@ -3255,7 +4316,7 @@ var Job = /*#__PURE__*/function (_Component) {
3255
4316
  icon: "more15",
3256
4317
  className: "maintenanceNote_moreIcon",
3257
4318
  onClick: function onClick() {
3258
- return _this5.onOpenNoteMenu(index);
4319
+ return _this6.onOpenNoteMenu(index);
3259
4320
  }
3260
4321
  }), /*#__PURE__*/React.createElement("p", {
3261
4322
  className: "maintenanceNote_name"
@@ -3264,20 +4325,20 @@ var Job = /*#__PURE__*/function (_Component) {
3264
4325
  key: 'edit',
3265
4326
  text: 'Edit',
3266
4327
  onPress: function onPress() {
3267
- return _this5.onOpenEditNote(note);
4328
+ return _this6.onOpenEditNote(note);
3268
4329
  }
3269
4330
  }, {
3270
4331
  key: 'delete',
3271
4332
  text: 'Delete',
3272
4333
  onPress: function onPress() {
3273
- return _this5.onDeleteNote(note);
4334
+ return _this6.onDeleteNote(note);
3274
4335
  }
3275
4336
  }]
3276
4337
  })), /*#__PURE__*/React.createElement("p", {
3277
4338
  className: "maintenanceNote_text"
3278
4339
  }, Helper$2.toParagraphed(note.Note)), note.Attachments.map(function (a, i) {
3279
- return _this5.renderAttachment(a, i);
3280
- })));
4340
+ return _this6.renderAttachment(a, i);
4341
+ }), note.Images && note.Images.length > 0 ? this.renderImageGrid(note.Images, IMAGE_SIZE_NOTE) : null));
3281
4342
  }
3282
4343
  }, {
3283
4344
  key: "renderAssignment",
@@ -3318,10 +4379,24 @@ var Job = /*#__PURE__*/function (_Component) {
3318
4379
  className: "statusLabel_text"
3319
4380
  }, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
3320
4381
  }
4382
+ }, {
4383
+ key: "renderPriority",
4384
+ value: function renderPriority() {
4385
+ var auth = this.props.auth;
4386
+ if (!Session$3.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return null;
4387
+ return /*#__PURE__*/React.createElement("div", {
4388
+ className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
4389
+ }, /*#__PURE__*/React.createElement("div", {
4390
+ className: "newTopBar clearfix flex flex-reverse"
4391
+ }, this.renderPriorityLabel(), /*#__PURE__*/React.createElement(Components$3.Text, {
4392
+ type: "formTitleSmall",
4393
+ className: "flex-1"
4394
+ }, "Priority")));
4395
+ }
3321
4396
  }, {
3322
4397
  key: "renderOverview",
3323
4398
  value: function renderOverview() {
3324
- var _this6 = this;
4399
+ var _this7 = this;
3325
4400
 
3326
4401
  var job = this.state.job;
3327
4402
  if (!job || !job.history) return null;
@@ -3347,13 +4422,13 @@ var Job = /*#__PURE__*/function (_Component) {
3347
4422
  }, "Status History")), this.renderHistoryEntry(null, -1), _.map(source, function (e, i) {
3348
4423
  switch (e.EntryType) {
3349
4424
  case 'status':
3350
- return _this6.renderHistoryEntry(e, i);
4425
+ return _this7.renderHistoryEntry(e, i);
3351
4426
 
3352
4427
  case 'note':
3353
- return _this6.renderNote(e, i);
4428
+ return _this7.renderNote(e, i);
3354
4429
 
3355
4430
  case 'assignment':
3356
- return _this6.renderAssignmentEntry(e, i);
4431
+ return _this7.renderAssignmentEntry(e, i);
3357
4432
  }
3358
4433
  }));
3359
4434
  }
@@ -3399,7 +4474,7 @@ var Job = /*#__PURE__*/function (_Component) {
3399
4474
  }, {
3400
4475
  key: "renderAddNotePopup",
3401
4476
  value: function renderAddNotePopup() {
3402
- var _this7 = this;
4477
+ var _this8 = this;
3403
4478
 
3404
4479
  if (!this.state.addNoteOpen) return null;
3405
4480
 
@@ -3439,7 +4514,7 @@ var Job = /*#__PURE__*/function (_Component) {
3439
4514
  value: this.state.noteInput,
3440
4515
  placeholder: "Enter note",
3441
4516
  onChange: function onChange(e) {
3442
- return _this7.onHandleChange(e);
4517
+ return _this8.onHandleChange(e);
3443
4518
  },
3444
4519
  inputStyle: {
3445
4520
  width: 400
@@ -3447,34 +4522,44 @@ var Job = /*#__PURE__*/function (_Component) {
3447
4522
  }), /*#__PURE__*/React.createElement(Components$3.Text, {
3448
4523
  type: "h5"
3449
4524
  }, "Attachments"), this.state.noteAttachments.map(function (a, i) {
3450
- return _this7.renderAttachment(a, i, _this7.onRemoveAttachment);
4525
+ return _this8.renderAttachment(a, i, _this8.onRemoveAttachment);
3451
4526
  }), /*#__PURE__*/React.createElement("input", {
3452
4527
  ref: function ref(input) {
3453
- return _this7.attachmentInput = input;
4528
+ return _this8.attachmentInput = input;
3454
4529
  },
3455
4530
  id: "attachmentInput",
3456
4531
  type: "file",
3457
4532
  className: "fileInput",
3458
4533
  onChange: function onChange(e) {
3459
- return _this7.onHandlePDFFileChange(e);
4534
+ return _this8.onHandlePDFFileChange(e);
3460
4535
  },
3461
4536
  accept: "application/pdf"
3462
4537
  }), /*#__PURE__*/React.createElement("div", {
3463
- className: "iconTextButton",
4538
+ className: "iconTextButton marginBottom-16",
3464
4539
  onClick: function onClick() {
3465
- _this7.attachmentInput.click();
4540
+ _this8.attachmentInput.click();
3466
4541
  }
3467
4542
  }, /*#__PURE__*/React.createElement(FontAwesome, {
3468
4543
  className: "iconTextButton_icon",
3469
4544
  name: "paperclip"
3470
4545
  }), /*#__PURE__*/React.createElement("p", {
3471
4546
  className: "iconTextButton_text"
3472
- }, "Add Attachment")));
4547
+ }, "Add Attachment")), /*#__PURE__*/React.createElement(Components$3.ImageInput, {
4548
+ ref: function ref(_ref10) {
4549
+ _this8.imageInput = _ref10;
4550
+ },
4551
+ multiple: true,
4552
+ refreshCallback: function refreshCallback(images) {
4553
+ _this8.setState({
4554
+ noteImages: images
4555
+ });
4556
+ }
4557
+ }));
3473
4558
  }
3474
4559
  }, {
3475
4560
  key: "renderUsers",
3476
4561
  value: function renderUsers() {
3477
- var _this8 = this;
4562
+ var _this9 = this;
3478
4563
 
3479
4564
  var content = null;
3480
4565
 
@@ -3493,7 +4578,7 @@ var Job = /*#__PURE__*/function (_Component) {
3493
4578
  className: "removeIcon",
3494
4579
  icon: "close",
3495
4580
  onClick: function onClick() {
3496
- _this8.onSelectAssignee();
4581
+ _this9.onSelectAssignee();
3497
4582
  },
3498
4583
  colour: Colours$1.COLOUR_DUSK
3499
4584
  })
@@ -3506,20 +4591,20 @@ var Job = /*#__PURE__*/function (_Component) {
3506
4591
  placeholder: "Search name",
3507
4592
  value: this.state.userSearch,
3508
4593
  onChange: function onChange(e) {
3509
- return _this8.onHandleChange(e);
4594
+ return _this9.onHandleChange(e);
3510
4595
  },
3511
4596
  alwaysShowLabel: true
3512
4597
  }), _.sortBy(this.state.assignees, function (u) {
3513
4598
  return u.displayName.toUpperCase();
3514
4599
  }).filter(function (u) {
3515
- if (_.isEmpty(_this8.state.userSearch)) return true;
3516
- return u.displayName.toUpperCase().indexOf(_this8.state.userSearch.toUpperCase()) > -1;
4600
+ if (_.isEmpty(_this9.state.userSearch)) return true;
4601
+ return u.displayName.toUpperCase().indexOf(_this9.state.userSearch.toUpperCase()) > -1;
3517
4602
  }).map(function (user) {
3518
4603
  return /*#__PURE__*/React.createElement(Components$3.UserListing, {
3519
4604
  key: user.id,
3520
4605
  user: user,
3521
4606
  onClick: function onClick() {
3522
- _this8.onSelectAssignee(user);
4607
+ _this9.onSelectAssignee(user);
3523
4608
  }
3524
4609
  });
3525
4610
  }));
@@ -3560,7 +4645,7 @@ var Job = /*#__PURE__*/function (_Component) {
3560
4645
  className: "pageSectionWrapper--fixedPopupSize"
3561
4646
  }, this.renderInner()), /*#__PURE__*/React.createElement(Components$3.OverlayPageSection, {
3562
4647
  className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
3563
- }, this.renderAssignment(), this.renderOverview())), /*#__PURE__*/React.createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
4648
+ }, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React.createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
3564
4649
  }
3565
4650
  }]);
3566
4651
 
@@ -3570,12 +4655,14 @@ var Job = /*#__PURE__*/function (_Component) {
3570
4655
  var mapStateToProps$3 = function mapStateToProps(state) {
3571
4656
  var auth = state.auth;
3572
4657
  return {
3573
- auth: auth
4658
+ auth: auth,
4659
+ statusTypes: state[values.reducerKey].jobstatuses
3574
4660
  };
3575
4661
  };
3576
4662
 
3577
4663
  var Job$1 = connect(mapStateToProps$3, {
3578
- jobsLoaded: jobsLoaded
4664
+ jobsLoaded: jobsLoaded,
4665
+ jobStatusesUpdate: jobStatusesUpdate
3579
4666
  })(withRouter(Job));
3580
4667
 
3581
4668
  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; }
@@ -5644,7 +6731,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5644
6731
  type: "bodyLarge",
5645
6732
  className: "marginBottom-24 paddingLeft-40",
5646
6733
  style: {
5647
- color: Colours$2.COLOUR_LIGHTGREY
6734
+ color: Colours$3.COLOUR_LIGHTGREY
5648
6735
  }
5649
6736
  }, "By default, the form submission title will be the name of the person submitting the form. You can choose to select a different field to use as the title for the form submission."), /*#__PURE__*/React.createElement("div", {
5650
6737
  className: "fields"
@@ -5674,7 +6761,7 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5674
6761
  return /*#__PURE__*/React.createElement("div", {
5675
6762
  className: "padding-60 paddingVertical-8 text-bodyLarge",
5676
6763
  style: {
5677
- color: Colours$2.COLOUR_RED
6764
+ color: Colours$3.COLOUR_RED
5678
6765
  }
5679
6766
  }, "To save the form", /*#__PURE__*/React.createElement("ul", {
5680
6767
  style: {
@@ -5960,8 +7047,9 @@ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) {
5960
7047
  var INITIAL_STATE = {
5961
7048
  jobs: [],
5962
7049
  jobtypes: [],
5963
- loading: false // tickets: [],
5964
-
7050
+ jobstatuses: jobStatusOptions,
7051
+ loading: false,
7052
+ hideSeen: false
5965
7053
  };
5966
7054
  var MaintenanceReducer = (function () {
5967
7055
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
@@ -6004,33 +7092,25 @@ var MaintenanceReducer = (function () {
6004
7092
  return state;
6005
7093
 
6006
7094
  case JOBS_TYPES_LOADED:
6007
- var resultSub = _.unionWith(action.payload, state.jobtypes, function (v1, v2) {
7095
+ var jobtypes = _.unionWith(action.payload, state.jobtypes, function (v1, v2) {
6008
7096
  return v1 != null && v2 != null && v1.id === v2.id;
6009
7097
  });
6010
7098
 
6011
7099
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
6012
- jobtypes: resultSub
7100
+ jobtypes: jobtypes
7101
+ });
7102
+
7103
+ case JOBS_STATUSES_LOADED:
7104
+ var jobstatuses = _.orderBy(action.payload, 'order', 'asc');
7105
+
7106
+ return _objectSpread$2(_objectSpread$2({}, state), {}, {
7107
+ jobstatuses: jobstatuses
7108
+ });
7109
+
7110
+ case JOBS_HIDE_SEEN:
7111
+ return _objectSpread$2(_objectSpread$2({}, state), {}, {
7112
+ hideSeen: action.payload
6013
7113
  });
6014
- // case JOBS_TYPES_REMOVED:
6015
- // const indexSub = _.findIndex(state.jobtypes, (event) => {
6016
- // return event != null && event.id === action.payload;
6017
- // });
6018
- // if (indexSub > -1) {
6019
- // const newEventsSub = [...state.jobtypes];
6020
- // newEventsSub.splice(indexSub, 1);
6021
- // return { ...state, jobtypes: newEventsSub };
6022
- // }
6023
- // return state;
6024
- // case TICKETS_LOADED:
6025
- // const ticketResult = _.unionWith(action.payload, state.tickets, (v1, v2) => {
6026
- // return v1 != null && v2 != null && v1.Id === v2.Id;
6027
- // });
6028
- // return {
6029
- // ...state,
6030
- // tickets: ticketResult,
6031
- // };
6032
- // case JOBS_PURGE:
6033
- // return INITIAL_STATE;
6034
7114
 
6035
7115
  default:
6036
7116
  return state;