@plusscommunities/pluss-maintenance-web 1.2.4-beta.2 → 1.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,128 +1,93 @@
1
+ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
2
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
1
3
  import { Component, useState, useEffect } from 'react';
2
4
  import { connect } from 'react-redux';
3
5
  import { withRouter } from 'react-router';
4
6
  import _ from 'lodash';
5
7
  import moment from 'moment';
6
- import FontAwesome from 'react-fontawesome';
8
+ import { Icon } from '@plusscommunities/pluss-icons';
7
9
  import * as PlussCore from '@plusscommunities/pluss-core-web';
8
- import { Colours as Colours$3 } from '@plusscommunities/pluss-core-web';
9
- import { Table, DropdownItem, DropdownButton } from 'react-bootstrap';
10
+ import { PERMISSION_CATEGORIES, IMPORTANCE_LEVELS, Colours as Colours$4 } from '@plusscommunities/pluss-core-web';
11
+ import { Table, MenuItem, DropdownButton } from 'react-bootstrap';
10
12
  import { Link } from 'react-router-dom';
11
13
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
14
  import Textarea from 'react-textarea-autosize';
13
- import { faWrench, faCircleCheck, faComment } from '@fortawesome/free-solid-svg-icons';
14
-
15
- function _typeof(o) {
16
- "@babel/helpers - typeof";
17
-
18
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
19
- return typeof o;
20
- } : function (o) {
21
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
22
- }, _typeof(o);
23
- }
24
-
25
- function toPrimitive(t, r) {
26
- if ("object" != _typeof(t) || !t) return t;
27
- var e = t[Symbol.toPrimitive];
28
- if (void 0 !== e) {
29
- var i = e.call(t, r || "default");
30
- if ("object" != _typeof(i)) return i;
31
- throw new TypeError("@@toPrimitive must return a primitive value.");
32
- }
33
- return ("string" === r ? String : Number)(t);
34
- }
35
-
36
- function toPropertyKey(t) {
37
- var i = toPrimitive(t, "string");
38
- return "symbol" == _typeof(i) ? i : i + "";
39
- }
40
-
41
- function _defineProperty(e, r, t) {
42
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
43
- value: t,
44
- enumerable: !0,
45
- configurable: !0,
46
- writable: !0
47
- }) : e[r] = t, e;
48
- }
49
15
 
50
16
  var values = {
51
- featureKey: 'maintenance',
52
- aliases: ['maintenanceTracking', 'maintenanceTypes', 'maintenancerequest'],
53
- serviceKey: 'maintenance',
54
- reducerKey: 'maintenance',
55
- analyticsKey: 'maintenancerequest',
56
- commentKey: 'maintenancerequest',
57
- actionJobsLoaded: 'JOBS_LOADED',
58
- actionJobsAdded: 'JOBS_ADDED',
59
- actionJobsRemoved: 'JOBS_REMOVED',
60
- actionJobsTypesLoaded: 'JOBS_TYPES_LOADED',
61
- actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADED',
62
- actionJobsHideSeen: 'JOBS_HIDE_SEEN',
63
- actionJobsLoading: 'JOBS_LOADING',
64
- permissionMaintenanceTracking: 'maintenanceTracking',
65
- permissionMaintenanceTypes: 'maintenanceTypes',
66
- permissionMaintenanceAssignment: 'maintenanceAssignment',
67
- activityMaintenanceJobStatusChanged: 'MaintenanceJobStatusChanged',
68
- activityAddMaintenanceJob: 'AddMaintenanceJob',
69
- activityEditMaintenanceJob: 'EditMaintenanceJob',
70
- activityDeleteMaintenanceJob: 'DeleteMaintenanceJob',
71
- routeRequestsHub: '/requestsHub',
72
- routeAddRequest: '/requestsHub/job',
73
- routeAddRequestType: '/requestsHub/requestType',
74
- routeRequestDetails: '/requestsHub/jobDetails',
75
- routeRequestTypes: '/requestTypes',
76
- screenRequestsHub: 'RequestsHub',
77
- screenAddJob: 'AddJob',
78
- screenAddJobType: 'AddJobType',
79
- screenJob: 'Job',
80
- screenJobTypes: 'JobTypes',
81
- menuIcon: 'maintenance',
17
+ featureKey: "maintenance",
18
+ aliases: ["maintenanceTracking", "maintenanceTypes", "maintenancerequest"],
19
+ serviceKey: "maintenance",
20
+ reducerKey: "maintenance",
21
+ analyticsKey: "maintenancerequest",
22
+ commentKey: "maintenancerequest",
23
+ actionJobsLoaded: "JOBS_LOADED",
24
+ actionJobsRemoved: "JOBS_REMOVED",
25
+ actionJobsTypesLoaded: "JOBS_TYPES_LOADED",
26
+ actionJobsStatusesLoaded: "JOBS_STATUSES_LOADED",
27
+ actionJobsHideSeen: "JOBS_HIDE_SEEN",
28
+ actionJobsLoading: "JOBS_LOADING",
29
+ permissionMaintenanceTracking: "maintenanceTracking",
30
+ permissionMaintenanceTypes: "maintenanceTypes",
31
+ permissionMaintenanceAssignment: "maintenanceAssignment",
32
+ activityMaintenanceJobStatusChanged: "MaintenanceJobStatusChanged",
33
+ activityAddMaintenanceJob: "AddMaintenanceJob",
34
+ activityEditMaintenanceJob: "EditMaintenanceJob",
35
+ activityDeleteMaintenanceJob: "DeleteMaintenanceJob",
36
+ routeRequestsHub: "/requestsHub",
37
+ routeAddRequest: "/requestsHub/job",
38
+ routeAddRequestType: "/requestsHub/requestType",
39
+ routeRequestDetails: "/requestsHub/jobDetails",
40
+ routeRequestTypes: "/requestTypes",
41
+ screenRequestsHub: "RequestsHub",
42
+ screenAddJob: "AddJob",
43
+ screenAddJobType: "AddJobType",
44
+ screenJob: "Job",
45
+ screenJobTypes: "JobTypes",
46
+ menuIcon: "maintenance",
82
47
  isFontAwesomeIcon: false,
83
48
  isSVGIcon: false,
84
- svgPathGridIcon: 'M22.7072 2.33998C20.5868 2.30886 18.2156 3.43862 16.824 4.83022C15.1138 6.54042 15.1486 8.34584 15.7894 10.5065L13.2058 13.0901L7.7566 7.64089C7.75294 7.60976 7.75477 7.5768 7.74927 7.54567L7.48926 6.30605C7.43799 6.06435 7.28968 5.84645 7.08277 5.71279L3.77589 3.56313C3.40601 3.32509 2.91163 3.37636 2.60035 3.68764L1.81116 4.47682C1.50171 4.7881 1.44861 5.28066 1.68848 5.6487L3.80152 8.91713C3.93336 9.12221 4.13843 9.26686 4.3783 9.32179L5.66004 9.61659C5.69483 9.62392 5.72962 9.62209 5.76441 9.62575L11.2155 15.0786L8.03309 18.2647C6.23316 18.0907 4.52112 18.8396 3.417 20.2971C2.0254 22.1373 2.05836 24.7814 3.49756 26.5886C4.41858 27.7459 5.78821 28.4563 7.25123 28.5405C7.34827 28.546 7.44532 28.5479 7.54236 28.5479C8.9065 28.5479 10.2212 28.0059 11.1898 27.0372C12.2866 25.9404 12.8195 24.4445 12.6711 22.9027L14.7311 20.8446C14.8391 21.2035 15.0259 21.5386 15.2987 21.8114L21.5939 28.1102C22.0516 28.5662 22.6522 28.7932 23.2528 28.7932C23.8534 28.7932 24.454 28.5662 24.9099 28.1102L26.2356 26.7827C27.1493 25.869 27.1493 24.3822 26.2356 23.4685L19.9368 17.1697C19.6658 16.8987 19.3307 16.7138 18.9718 16.6039L20.4275 15.1464C22.5881 15.7854 24.3954 15.822 26.1056 14.1118C27.814 12.4035 29.1323 9.21559 28.3834 6.83522C28.3358 6.67958 28.2076 6.55873 28.0483 6.52028C27.889 6.48183 27.7206 6.52944 27.6052 6.64479L24.681 9.56899C24.5638 9.68801 24.3899 9.73561 24.2288 9.68984L23.7161 9.55251C22.5863 9.25038 21.6964 8.36049 21.3943 7.23256L21.257 6.71987C21.213 6.55873 21.2606 6.38478 21.3796 6.2676L24.3093 3.33608C24.4247 3.22072 24.4705 3.05409 24.4338 2.89479C24.3936 2.73549 24.2764 2.60732 24.1189 2.55788C23.6721 2.41506 23.1961 2.34731 22.7072 2.33998ZM22.6669 3.28115C22.7877 3.28298 22.9067 3.28664 23.0239 3.29579L20.7168 5.60292C20.3616 5.95815 20.2242 6.47817 20.3543 6.96157L20.4916 7.47609C20.8798 8.92629 22.0223 10.0689 23.4744 10.4589L23.9871 10.5962C24.4705 10.7262 24.9905 10.5871 25.3439 10.2318L27.6437 7.93202C27.7883 9.80702 26.7318 12.1599 25.4446 13.4472C23.9834 14.9083 22.5021 14.8168 20.4367 14.1686C20.27 14.1173 20.0888 14.1613 19.9661 14.284L11.849 22.401C11.7446 22.5054 11.6952 22.6519 11.7172 22.7984C11.9039 24.1277 11.47 25.4314 10.527 26.3744C9.67737 27.224 8.5055 27.6708 7.30433 27.6049C6.08851 27.5353 4.9972 26.9677 4.22999 26.0045C3.05445 24.5287 3.02698 22.3662 4.16407 20.8648C4.98438 19.7826 6.20936 19.1765 7.52588 19.1765C7.7273 19.1765 7.93238 19.1912 8.13746 19.2186C8.28211 19.2388 8.43043 19.1912 8.53296 19.0868L16.65 10.9716C16.7745 10.8471 16.8203 10.6658 16.7672 10.4973C16.119 8.43373 16.0275 6.95424 17.4887 5.49306C18.7008 4.2809 20.8541 3.27931 22.6669 3.28115ZM3.26319 4.35048L6.57191 6.49831L6.83191 7.73793L5.86695 8.70107L4.58704 8.4081L2.474 5.13967L3.26319 4.35048ZM7.34095 8.55275L12.543 13.7529L11.8801 14.4158L6.67994 9.21559L7.0077 8.88967L7.34095 8.55275ZM18.4811 8.66994C18.3621 8.66994 18.243 8.71572 18.1497 8.80727C17.9666 8.99037 17.9666 9.287 18.1497 9.47011L21.4657 12.7843C21.5573 12.8759 21.6763 12.9216 21.7971 12.9216C21.9161 12.9216 22.037 12.8759 22.1267 12.7843C22.3117 12.6012 22.3117 12.3046 22.1267 12.1215L18.8143 8.80727C18.721 8.71572 18.6019 8.66994 18.4811 8.66994ZM17.1554 12.647C17.0364 12.647 16.9155 12.6928 16.824 12.7843C16.6409 12.9674 16.6409 13.2641 16.824 13.4472L17.4887 14.11C17.5802 14.2016 17.6992 14.2473 17.8201 14.2473C17.9409 14.2473 18.0599 14.2016 18.1515 14.11C18.3346 13.9269 18.3346 13.6303 18.1515 13.4472L17.4887 12.7843C17.3953 12.6928 17.2763 12.647 17.1554 12.647ZM15.4983 14.3041C15.3793 14.3041 15.2603 14.3499 15.1687 14.4433C14.9838 14.6264 14.9838 14.9212 15.1687 15.1043L15.8297 15.7689C15.9213 15.8587 16.0421 15.9063 16.163 15.9063C16.282 15.9063 16.4028 15.8587 16.4944 15.7689C16.6775 15.584 16.6775 15.2892 16.4944 15.1043L15.8297 14.4433C15.7382 14.3499 15.6191 14.3041 15.4983 14.3041ZM13.843 15.9612C13.7222 15.9612 13.6032 16.007 13.5116 16.0985C13.3267 16.2816 13.3267 16.5783 13.5116 16.7632L14.1726 17.4242C14.2642 17.5158 14.385 17.5634 14.504 17.5634C14.6249 17.5634 14.7457 17.5158 14.8373 17.4242C15.0204 17.2429 15.0204 16.9463 14.8373 16.7632L14.1726 16.0985C14.0811 16.007 13.962 15.9612 13.843 15.9612ZM18.4426 17.4444C18.7539 17.4755 19.0487 17.6073 19.2758 17.8344L25.5728 24.1314C26.1221 24.6807 26.1221 25.5706 25.5728 26.1199L24.2452 27.4456C23.6978 27.9949 22.806 27.9949 22.2586 27.4456L15.9597 21.1467C15.6594 20.8465 15.5258 20.4216 15.5734 20.0023L18.1277 17.4462C18.2339 17.4352 18.3383 17.4334 18.4426 17.4444ZM12.1859 17.6201C12.0651 17.6201 11.9461 17.6641 11.8527 17.7556C11.6696 17.9406 11.6696 18.2354 11.8527 18.4203L12.5173 19.0813C12.6071 19.1729 12.7279 19.2186 12.8469 19.2186C12.9678 19.2186 13.0886 19.1729 13.1784 19.0813C13.3633 18.8982 13.3633 18.6034 13.1784 18.4203L12.5173 17.7556C12.424 17.6641 12.3049 17.6201 12.1859 17.6201ZM10.527 19.2772C10.408 19.2772 10.2889 19.323 10.1956 19.4146C10.0125 19.5977 10.0125 19.8925 10.1956 20.0756L10.8584 20.7403C10.95 20.83 11.069 20.8757 11.1898 20.8757C11.3107 20.8757 11.4297 20.83 11.5212 20.7403C11.7044 20.5553 11.7044 20.2605 11.5212 20.0756L10.8584 19.4146C10.7669 19.323 10.646 19.2772 10.527 19.2772ZM19.2758 19.3523C19.1549 19.3523 19.0359 19.3981 18.9425 19.4896C18.7594 19.6746 18.7594 19.9694 18.9425 20.1543L23.5842 24.7942C23.6758 24.8858 23.7948 24.9315 23.9157 24.9315C24.0365 24.9315 24.1555 24.8858 24.2471 24.7942C24.4302 24.6111 24.4302 24.3145 24.2471 24.1314L19.6072 19.4896C19.5138 19.3981 19.3948 19.3523 19.2758 19.3523ZM17.9501 20.678C17.8292 20.678 17.7102 20.7238 17.6168 20.8153C17.4337 21.0003 17.4337 21.2951 17.6168 21.48L22.2586 26.1199C22.3483 26.2114 22.4691 26.2572 22.5881 26.2572C22.709 26.2572 22.8298 26.2114 22.9196 26.1199C23.1045 25.9368 23.1045 25.6402 22.9196 25.457L18.2815 20.8153C18.1881 20.7238 18.0691 20.678 17.9501 20.678ZM8.11182 20.8373C8.07154 20.8373 8.03126 20.8428 7.99097 20.8538L5.89808 21.4141C5.73694 21.458 5.6106 21.5844 5.56666 21.7455L5.00818 23.8366C4.96424 23.9977 5.01002 24.1698 5.1272 24.2888L6.65796 25.8196C6.74769 25.9093 6.86671 25.9569 6.98939 25.9569C7.0315 25.9569 7.07178 25.9514 7.11207 25.9423L9.20313 25.3801C9.36426 25.338 9.49061 25.2117 9.53455 25.0487L10.0949 22.9595C10.1388 22.7965 10.0912 22.6244 9.974 22.5054L8.44324 20.9746C8.35352 20.8867 8.2345 20.8391 8.11182 20.8373ZM7.97083 21.8279L9.1189 22.976L8.69959 24.5452L7.13038 24.9663L5.98231 23.8183L6.40162 22.249L7.97083 21.8279Z',
85
- svgPathGridIconViewBox: '0 0 30 30',
49
+ svgPathGridIcon: "M22.7072 2.33998C20.5868 2.30886 18.2156 3.43862 16.824 4.83022C15.1138 6.54042 15.1486 8.34584 15.7894 10.5065L13.2058 13.0901L7.7566 7.64089C7.75294 7.60976 7.75477 7.5768 7.74927 7.54567L7.48926 6.30605C7.43799 6.06435 7.28968 5.84645 7.08277 5.71279L3.77589 3.56313C3.40601 3.32509 2.91163 3.37636 2.60035 3.68764L1.81116 4.47682C1.50171 4.7881 1.44861 5.28066 1.68848 5.6487L3.80152 8.91713C3.93336 9.12221 4.13843 9.26686 4.3783 9.32179L5.66004 9.61659C5.69483 9.62392 5.72962 9.62209 5.76441 9.62575L11.2155 15.0786L8.03309 18.2647C6.23316 18.0907 4.52112 18.8396 3.417 20.2971C2.0254 22.1373 2.05836 24.7814 3.49756 26.5886C4.41858 27.7459 5.78821 28.4563 7.25123 28.5405C7.34827 28.546 7.44532 28.5479 7.54236 28.5479C8.9065 28.5479 10.2212 28.0059 11.1898 27.0372C12.2866 25.9404 12.8195 24.4445 12.6711 22.9027L14.7311 20.8446C14.8391 21.2035 15.0259 21.5386 15.2987 21.8114L21.5939 28.1102C22.0516 28.5662 22.6522 28.7932 23.2528 28.7932C23.8534 28.7932 24.454 28.5662 24.9099 28.1102L26.2356 26.7827C27.1493 25.869 27.1493 24.3822 26.2356 23.4685L19.9368 17.1697C19.6658 16.8987 19.3307 16.7138 18.9718 16.6039L20.4275 15.1464C22.5881 15.7854 24.3954 15.822 26.1056 14.1118C27.814 12.4035 29.1323 9.21559 28.3834 6.83522C28.3358 6.67958 28.2076 6.55873 28.0483 6.52028C27.889 6.48183 27.7206 6.52944 27.6052 6.64479L24.681 9.56899C24.5638 9.68801 24.3899 9.73561 24.2288 9.68984L23.7161 9.55251C22.5863 9.25038 21.6964 8.36049 21.3943 7.23256L21.257 6.71987C21.213 6.55873 21.2606 6.38478 21.3796 6.2676L24.3093 3.33608C24.4247 3.22072 24.4705 3.05409 24.4338 2.89479C24.3936 2.73549 24.2764 2.60732 24.1189 2.55788C23.6721 2.41506 23.1961 2.34731 22.7072 2.33998ZM22.6669 3.28115C22.7877 3.28298 22.9067 3.28664 23.0239 3.29579L20.7168 5.60292C20.3616 5.95815 20.2242 6.47817 20.3543 6.96157L20.4916 7.47609C20.8798 8.92629 22.0223 10.0689 23.4744 10.4589L23.9871 10.5962C24.4705 10.7262 24.9905 10.5871 25.3439 10.2318L27.6437 7.93202C27.7883 9.80702 26.7318 12.1599 25.4446 13.4472C23.9834 14.9083 22.5021 14.8168 20.4367 14.1686C20.27 14.1173 20.0888 14.1613 19.9661 14.284L11.849 22.401C11.7446 22.5054 11.6952 22.6519 11.7172 22.7984C11.9039 24.1277 11.47 25.4314 10.527 26.3744C9.67737 27.224 8.5055 27.6708 7.30433 27.6049C6.08851 27.5353 4.9972 26.9677 4.22999 26.0045C3.05445 24.5287 3.02698 22.3662 4.16407 20.8648C4.98438 19.7826 6.20936 19.1765 7.52588 19.1765C7.7273 19.1765 7.93238 19.1912 8.13746 19.2186C8.28211 19.2388 8.43043 19.1912 8.53296 19.0868L16.65 10.9716C16.7745 10.8471 16.8203 10.6658 16.7672 10.4973C16.119 8.43373 16.0275 6.95424 17.4887 5.49306C18.7008 4.2809 20.8541 3.27931 22.6669 3.28115ZM3.26319 4.35048L6.57191 6.49831L6.83191 7.73793L5.86695 8.70107L4.58704 8.4081L2.474 5.13967L3.26319 4.35048ZM7.34095 8.55275L12.543 13.7529L11.8801 14.4158L6.67994 9.21559L7.0077 8.88967L7.34095 8.55275ZM18.4811 8.66994C18.3621 8.66994 18.243 8.71572 18.1497 8.80727C17.9666 8.99037 17.9666 9.287 18.1497 9.47011L21.4657 12.7843C21.5573 12.8759 21.6763 12.9216 21.7971 12.9216C21.9161 12.9216 22.037 12.8759 22.1267 12.7843C22.3117 12.6012 22.3117 12.3046 22.1267 12.1215L18.8143 8.80727C18.721 8.71572 18.6019 8.66994 18.4811 8.66994ZM17.1554 12.647C17.0364 12.647 16.9155 12.6928 16.824 12.7843C16.6409 12.9674 16.6409 13.2641 16.824 13.4472L17.4887 14.11C17.5802 14.2016 17.6992 14.2473 17.8201 14.2473C17.9409 14.2473 18.0599 14.2016 18.1515 14.11C18.3346 13.9269 18.3346 13.6303 18.1515 13.4472L17.4887 12.7843C17.3953 12.6928 17.2763 12.647 17.1554 12.647ZM15.4983 14.3041C15.3793 14.3041 15.2603 14.3499 15.1687 14.4433C14.9838 14.6264 14.9838 14.9212 15.1687 15.1043L15.8297 15.7689C15.9213 15.8587 16.0421 15.9063 16.163 15.9063C16.282 15.9063 16.4028 15.8587 16.4944 15.7689C16.6775 15.584 16.6775 15.2892 16.4944 15.1043L15.8297 14.4433C15.7382 14.3499 15.6191 14.3041 15.4983 14.3041ZM13.843 15.9612C13.7222 15.9612 13.6032 16.007 13.5116 16.0985C13.3267 16.2816 13.3267 16.5783 13.5116 16.7632L14.1726 17.4242C14.2642 17.5158 14.385 17.5634 14.504 17.5634C14.6249 17.5634 14.7457 17.5158 14.8373 17.4242C15.0204 17.2429 15.0204 16.9463 14.8373 16.7632L14.1726 16.0985C14.0811 16.007 13.962 15.9612 13.843 15.9612ZM18.4426 17.4444C18.7539 17.4755 19.0487 17.6073 19.2758 17.8344L25.5728 24.1314C26.1221 24.6807 26.1221 25.5706 25.5728 26.1199L24.2452 27.4456C23.6978 27.9949 22.806 27.9949 22.2586 27.4456L15.9597 21.1467C15.6594 20.8465 15.5258 20.4216 15.5734 20.0023L18.1277 17.4462C18.2339 17.4352 18.3383 17.4334 18.4426 17.4444ZM12.1859 17.6201C12.0651 17.6201 11.9461 17.6641 11.8527 17.7556C11.6696 17.9406 11.6696 18.2354 11.8527 18.4203L12.5173 19.0813C12.6071 19.1729 12.7279 19.2186 12.8469 19.2186C12.9678 19.2186 13.0886 19.1729 13.1784 19.0813C13.3633 18.8982 13.3633 18.6034 13.1784 18.4203L12.5173 17.7556C12.424 17.6641 12.3049 17.6201 12.1859 17.6201ZM10.527 19.2772C10.408 19.2772 10.2889 19.323 10.1956 19.4146C10.0125 19.5977 10.0125 19.8925 10.1956 20.0756L10.8584 20.7403C10.95 20.83 11.069 20.8757 11.1898 20.8757C11.3107 20.8757 11.4297 20.83 11.5212 20.7403C11.7044 20.5553 11.7044 20.2605 11.5212 20.0756L10.8584 19.4146C10.7669 19.323 10.646 19.2772 10.527 19.2772ZM19.2758 19.3523C19.1549 19.3523 19.0359 19.3981 18.9425 19.4896C18.7594 19.6746 18.7594 19.9694 18.9425 20.1543L23.5842 24.7942C23.6758 24.8858 23.7948 24.9315 23.9157 24.9315C24.0365 24.9315 24.1555 24.8858 24.2471 24.7942C24.4302 24.6111 24.4302 24.3145 24.2471 24.1314L19.6072 19.4896C19.5138 19.3981 19.3948 19.3523 19.2758 19.3523ZM17.9501 20.678C17.8292 20.678 17.7102 20.7238 17.6168 20.8153C17.4337 21.0003 17.4337 21.2951 17.6168 21.48L22.2586 26.1199C22.3483 26.2114 22.4691 26.2572 22.5881 26.2572C22.709 26.2572 22.8298 26.2114 22.9196 26.1199C23.1045 25.9368 23.1045 25.6402 22.9196 25.457L18.2815 20.8153C18.1881 20.7238 18.0691 20.678 17.9501 20.678ZM8.11182 20.8373C8.07154 20.8373 8.03126 20.8428 7.99097 20.8538L5.89808 21.4141C5.73694 21.458 5.6106 21.5844 5.56666 21.7455L5.00818 23.8366C4.96424 23.9977 5.01002 24.1698 5.1272 24.2888L6.65796 25.8196C6.74769 25.9093 6.86671 25.9569 6.98939 25.9569C7.0315 25.9569 7.07178 25.9514 7.11207 25.9423L9.20313 25.3801C9.36426 25.338 9.49061 25.2117 9.53455 25.0487L10.0949 22.9595C10.1388 22.7965 10.0912 22.6244 9.974 22.5054L8.44324 20.9746C8.35352 20.8867 8.2345 20.8391 8.11182 20.8373ZM7.97083 21.8279L9.1189 22.976L8.69959 24.5452L7.13038 24.9663L5.98231 23.8183L6.40162 22.249L7.97083 21.8279Z",
50
+ svgPathGridIconViewBox: "0 0 30 30",
86
51
  menuOrder: 10,
87
- optionOnlyForResidents: 'onlyForResidentsMaintenance',
88
- textEmptyDescription: 'allows your users to submit Requests (such as maintenance requests) that all appear in this job board.',
89
- textEmptyExample: 'Example might be; Fix my light bulb, hand rail is broken, or please send flowers to Mum.',
90
- textEmptyJobTypes: 'Please add the many categories of request types that exist in your village which work alongside the Maintenance area.',
91
- textEmptyJobTypesExample: 'Example might be; Electrical, Plumbing, Gardening, or General Maintenance.',
92
- textNewTypeButton: 'NEW REQUEST TYPE',
93
- textTitleJobTypes: 'Request Types',
94
- textJobType: 'Request Type',
95
- textAreYouSureYouWantToDelete: 'Are you sure you want to delete that request?',
96
- textAreYouSureYouWantToDeleteNote: 'Are you sure you want to delete that note?',
52
+ optionOnlyForResidents: "onlyForResidentsMaintenance",
53
+ textEmptyDescription: "allows your users to submit Requests (such as maintenance requests) that all appear in this job board.",
54
+ textEmptyExample: "Example might be; Fix my light bulb, hand rail is broken, or please send flowers to Mum.",
55
+ textEmptyJobTypes: "Please add the many categories of request types that exist in your village which work alongside the Maintenance area.",
56
+ textEmptyJobTypesExample: "Example might be; Electrical, Plumbing, Gardening, or General Maintenance.",
57
+ textNewTypeButton: "NEW REQUEST TYPE",
58
+ textTitleJobTypes: "Request Types",
59
+ textJobType: "Request Type",
60
+ textAreYouSureYouWantToDelete: "Are you sure you want to delete that request?",
61
+ textAreYouSureYouWantToDeleteNote: "Are you sure you want to delete that note?",
97
62
  textChangedRequestStatus: "changed a maintenance request's status:",
98
- textAddedRequest: 'added a maintenance request:',
99
- textEditedRequest: 'edited a maintenance request:',
100
- textRemovedRequest: 'removed a maintenance request:',
101
- textSingularName: 'Request',
102
- textYourRequestHere: 'Your Requests will show here',
103
- textTitleRequests: 'Requests',
104
- textMenuTitle: 'Maintenance',
105
- textPermissionMaintenanceTracking: 'Maintenance Tracking',
106
- textPermissionManageMaintenanceTypes: 'Manage Maintenance Types',
107
- textPermissionManageAssignedMaintenance: 'Manage Assigned Maintenance',
108
- textHiddenSectionMaintenanceRequests: 'Maintenance requests',
109
- keyHiddenSectionMaintenanceRequests: 'maintenanceRequest',
63
+ textAddedRequest: "added a maintenance request:",
64
+ textEditedRequest: "edited a maintenance request:",
65
+ textRemovedRequest: "removed a maintenance request:",
66
+ textSingularName: "Request",
67
+ textYourRequestHere: "Your Requests will show here",
68
+ textTitleRequests: "Requests",
69
+ textMenuTitle: "Maintenance",
70
+ textPermissionMaintenanceTracking: "Maintenance Tracking",
71
+ textPermissionManageMaintenanceTypes: "Manage Maintenance Types",
72
+ textPermissionManageAssignedMaintenance: "Manage Assigned Maintenance",
73
+ textHiddenSectionMaintenanceRequests: "Maintenance requests",
74
+ keyHiddenSectionMaintenanceRequests: "maintenanceRequest",
110
75
  hasMoreSection: true,
111
- textMoreSectionMaintenance: 'Maintenance',
112
- featureKeyMoreSectionMaintenance: 'maintenance',
113
- optionKeyMoreSectionMaintenance: 'maintenanceRequest',
114
- hiddenKeyMoreSectionMaintenance: 'maintenanceRequest',
76
+ textMoreSectionMaintenance: "Maintenance",
77
+ featureKeyMoreSectionMaintenance: "maintenance",
78
+ optionKeyMoreSectionMaintenance: "maintenanceRequest",
79
+ hiddenKeyMoreSectionMaintenance: "maintenanceRequest",
115
80
  forceCustomFields: false,
116
- textEntityName: 'Job',
81
+ textEntityName: "Job",
117
82
  hasHelpButton: true,
118
- helpGuideURL: '',
119
- stringConfigJobStatus: 'maintenanceJobStatus',
120
- stringConfigHideSeen: 'maintenanceDisableSeen',
83
+ helpGuideURL: "",
84
+ stringConfigJobStatus: "maintenanceJobStatus",
85
+ stringConfigHideSeen: "maintenanceDisableSeen",
121
86
  // Comment subscription notification preference
122
87
  notificationPreference: {
123
- key: 'maintenancerequestComments',
124
- label: 'Maintenance comments',
125
- permission: 'maintenanceTracking'
88
+ key: "maintenancerequestComments",
89
+ label: "Maintenance comments",
90
+ permission: "maintenanceTracking"
126
91
  }
127
92
  };
128
93
 
@@ -131,7 +96,7 @@ var FeatureConfig = {
131
96
  key: values.featureKey,
132
97
  aliases: values.aliases,
133
98
  singularName: values.textSingularName,
134
- description: 'Submit maintenance requests and track the progress.',
99
+ description: "Submit maintenance requests and track the progress.",
135
100
  emptyText: values.textYourRequestHere,
136
101
  widgetOptions: [{
137
102
  key: values.featureKey,
@@ -139,10 +104,10 @@ var FeatureConfig = {
139
104
  main: true,
140
105
  hideOnTabNumbers: [],
141
106
  optionKey: values.optionOnlyForResidents,
142
- type: 'toggle',
107
+ type: "toggle",
143
108
  inverseOption: false,
144
- title: 'Limit Admins to Only Submit on Behalf of Primary Users',
145
- description: 'This will limit admins to only make a submission on behalf of a primary users in the site. Otherwise they can also submit on behalf of other admins/staff users.',
109
+ title: "Limit Admins to Only Submit on Behalf of Primary Users",
110
+ description: "This will limit admins to only make a submission on behalf of a primary users in the site. Otherwise they can also submit on behalf of other admins/staff users.",
146
111
  defaultNew: false,
147
112
  default: false
148
113
  }],
@@ -155,20 +120,20 @@ var FeatureConfig = {
155
120
  url: values.routeRequestsHub,
156
121
  countProps: null,
157
122
  visibleExps: {
158
- type: 'and',
123
+ type: "and",
159
124
  exps: [{
160
- type: 'feature',
125
+ type: "feature",
161
126
  value: values.featureKey
162
127
  }, {
163
- type: 'or',
128
+ type: "or",
164
129
  exps: [{
165
- type: 'permission',
130
+ type: "permission",
166
131
  value: values.permissionMaintenanceTracking
167
132
  }, {
168
- type: 'permission',
133
+ type: "permission",
169
134
  value: values.permissionMaintenanceTypes
170
135
  }, {
171
- type: 'permission',
136
+ type: "permission",
172
137
  value: values.permissionMaintenanceAssignment
173
138
  }]
174
139
  }]
@@ -180,15 +145,24 @@ var FeatureConfig = {
180
145
  permissions: [{
181
146
  displayName: values.textPermissionMaintenanceTracking,
182
147
  key: values.permissionMaintenanceTracking,
183
- hq: false
148
+ hq: false,
149
+ category: PERMISSION_CATEGORIES.FACILITIES_BOOKINGS,
150
+ helperText: "Allows tracking and managing maintenance requests and job status updates.",
151
+ importance: IMPORTANCE_LEVELS.IMPORTANT
184
152
  }, {
185
153
  displayName: values.textPermissionManageMaintenanceTypes,
186
154
  key: values.permissionMaintenanceTypes,
187
- hq: false
155
+ hq: false,
156
+ category: PERMISSION_CATEGORIES.FACILITIES_BOOKINGS,
157
+ helperText: "Allows creating and configuring maintenance request types and categories.",
158
+ importance: IMPORTANCE_LEVELS.IMPORTANT
188
159
  }, {
189
160
  displayName: values.textPermissionManageAssignedMaintenance,
190
161
  key: values.permissionMaintenanceAssignment,
191
- hq: false
162
+ hq: false,
163
+ category: PERMISSION_CATEGORIES.FACILITIES_BOOKINGS,
164
+ helperText: "Allows assigning and managing assigned maintenance requests.",
165
+ importance: IMPORTANCE_LEVELS.IMPORTANT
192
166
  }],
193
167
  hiddenSections: [{
194
168
  displayName: values.textHiddenSectionMaintenanceRequests,
@@ -233,21 +207,21 @@ var FeatureConfig = {
233
207
  exact: true
234
208
  }],
235
209
  env: {
236
- baseStage: '',
237
- baseAPIUrl: '',
238
- baseUploadsUrl: '',
239
- uploadBucket: '',
240
- colourBrandingMain: '',
241
- colourBrandingOff: '',
242
- colourBrandingApp: '',
243
- defaultProfileImage: '',
244
- utcOffset: '',
210
+ baseStage: "",
211
+ baseAPIUrl: "",
212
+ baseUploadsUrl: "",
213
+ uploadBucket: "",
214
+ colourBrandingMain: "",
215
+ colourBrandingOff: "",
216
+ colourBrandingApp: "",
217
+ defaultProfileImage: "",
218
+ utcOffset: "",
245
219
  hasAvailableNews: false,
246
220
  newsHaveTags: true,
247
221
  defaultAllowComments: true,
248
- makeApiKey: '',
249
- logo: '',
250
- clientName: ''
222
+ makeApiKey: "",
223
+ logo: "",
224
+ clientName: ""
251
225
  },
252
226
  init: environment => {
253
227
  FeatureConfig.env = environment;
@@ -256,51 +230,24 @@ var FeatureConfig = {
256
230
  notificationPreference: values.notificationPreference
257
231
  };
258
232
 
259
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
260
- try {
261
- var i = n[a](c),
262
- u = i.value;
263
- } catch (n) {
264
- return void e(n);
265
- }
266
- i.done ? t(u) : Promise.resolve(u).then(r, o);
267
- }
268
- function _asyncToGenerator(n) {
269
- return function () {
270
- var t = this,
271
- e = arguments;
272
- return new Promise(function (r, o) {
273
- var a = n.apply(t, e);
274
- function _next(n) {
275
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
276
- }
277
- function _throw(n) {
278
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
279
- }
280
- _next(void 0);
281
- });
282
- };
283
- }
284
-
285
233
  var JOBS_LOADED = values.actionJobsLoaded;
286
- var JOBS_ADDED = values.actionJobsAdded;
287
234
  var JOBS_LOADING = values.actionJobsLoading;
288
235
  var JOBS_REMOVED = values.actionJobsRemoved;
289
236
  var JOBS_TYPES_LOADED = values.actionJobsTypesLoaded;
290
237
  var JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
291
238
  var JOBS_HIDE_SEEN = values.actionJobsHideSeen;
292
239
 
293
- function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
294
- function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
240
+ function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
241
+ function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
295
242
  var {
296
- Helper: Helper$5,
243
+ Helper: Helper$6,
297
244
  Session: Session$9
298
245
  } = PlussCore;
299
246
  var maintenanceActions = {
300
247
  getJobType: (site, typeId) => {
301
- var url = Helper$5.getUrl(values.serviceKey, 'getjobtype');
248
+ var url = Helper$6.getUrl(values.serviceKey, "getjobtype");
302
249
  return Session$9.authedFunction({
303
- method: 'POST',
250
+ method: "POST",
304
251
  url,
305
252
  data: {
306
253
  site,
@@ -309,9 +256,9 @@ var maintenanceActions = {
309
256
  });
310
257
  },
311
258
  getJobTypes: (site, id) => {
312
- var url = Helper$5.getUrl(values.serviceKey, 'getjobtypes');
259
+ var url = Helper$6.getUrl(values.serviceKey, "getjobtypes");
313
260
  return Session$9.authedFunction({
314
- method: 'POST',
261
+ method: "POST",
315
262
  url,
316
263
  data: {
317
264
  site
@@ -319,9 +266,9 @@ var maintenanceActions = {
319
266
  });
320
267
  },
321
268
  getJob: (site, id) => {
322
- var url = Helper$5.getUrl(values.serviceKey, 'getJob');
269
+ var url = Helper$6.getUrl(values.serviceKey, "getJob");
323
270
  return Session$9.authedFunction({
324
- method: 'POST',
271
+ method: "POST",
325
272
  url,
326
273
  data: {
327
274
  site,
@@ -330,9 +277,9 @@ var maintenanceActions = {
330
277
  });
331
278
  },
332
279
  getJobByJobId: (site, jobId) => {
333
- var url = Helper$5.getUrl(values.serviceKey, 'getJob');
280
+ var url = Helper$6.getUrl(values.serviceKey, "getJob");
334
281
  return Session$9.authedFunction({
335
- method: 'POST',
282
+ method: "POST",
336
283
  url,
337
284
  data: {
338
285
  site,
@@ -341,11 +288,11 @@ var maintenanceActions = {
341
288
  });
342
289
  },
343
290
  getJobs: function getJobs(site) {
344
- var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
345
- var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
291
+ var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
292
+ var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
346
293
  return Session$9.authedFunction({
347
- method: 'POST',
348
- url: Helper$5.getUrl(values.serviceKey, 'getJobs'),
294
+ method: "POST",
295
+ url: Helper$6.getUrl(values.serviceKey, "getJobs"),
349
296
  data: {
350
297
  site,
351
298
  status,
@@ -353,67 +300,47 @@ var maintenanceActions = {
353
300
  }
354
301
  });
355
302
  },
356
- getJobs2: (site, status, priority, type, lastKey, assignee, startTime, endTime, search) => {
303
+ getJobs2: (site, status, type, lastKey) => {
357
304
  var query = {
358
305
  site
359
306
  };
360
307
  if (status) {
361
308
  query.status = status;
362
309
  }
363
- if (priority) {
364
- query.priority = priority;
365
- }
366
310
  if (type) {
367
311
  query.type = type;
368
312
  }
369
313
  if (lastKey) {
370
314
  query.lastKey = JSON.stringify(lastKey);
371
315
  }
372
- if (assignee) {
373
- query.assignee = assignee;
374
- }
375
- if (startTime) {
376
- query.startTime = startTime;
377
- }
378
- if (endTime) {
379
- query.endTime = endTime;
380
- }
381
- if (search) {
382
- query.search = search;
383
- }
384
316
  return Session$9.authedFunction({
385
- method: 'GET',
386
- url: Helper$5.getUrl(values.serviceKey, 'get/requests', query)
317
+ method: "GET",
318
+ url: Helper$6.getUrl(values.serviceKey, "get/requests", query)
387
319
  });
388
320
  },
389
- /**
390
- * @deprecated Use getJobs2 with pagination instead.
391
- * This method recursively fetches ALL pages which can be slow for large datasets.
392
- * For better performance, use getJobs2 directly and implement pagination in the UI.
393
- */
394
321
  getJobsRecursive: function getJobsRecursive(site, status, type, lastKey) {
395
322
  var jobs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
396
- return new Promise((resolve, reject) => {
397
- maintenanceActions.getJobs2(site, status, undefined, type, lastKey).then(jobRes => {
323
+ return new Promise(resolve => {
324
+ maintenanceActions.getJobs2(site, status, type, lastKey).then(jobRes => {
398
325
  var newJobs = [...jobs, ...jobRes.data.Items];
399
326
  if (!jobRes.data.LastKey) {
400
327
  return resolve(newJobs);
401
328
  }
402
- maintenanceActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs).then(resolve).catch(reject);
403
- }).catch(reject);
329
+ return resolve(maintenanceActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs));
330
+ });
404
331
  });
405
332
  },
406
333
  createJob: job => {
407
334
  return Session$9.authedFunction({
408
- method: 'POST',
409
- url: Helper$5.getUrl(values.serviceKey, 'sendMaintenance'),
410
- data: _objectSpread$7({}, job)
335
+ method: "POST",
336
+ url: Helper$6.getUrl(values.serviceKey, "sendMaintenance"),
337
+ data: _objectSpread$8({}, job)
411
338
  });
412
339
  },
413
340
  editJob: (job, site) => {
414
341
  return Session$9.authedFunction({
415
- method: 'POST',
416
- url: Helper$5.getUrl(values.serviceKey, 'editJob'),
342
+ method: "POST",
343
+ url: Helper$6.getUrl(values.serviceKey, "editJob"),
417
344
  data: {
418
345
  job,
419
346
  site
@@ -422,8 +349,8 @@ var maintenanceActions = {
422
349
  },
423
350
  deleteJob: (site, id) => {
424
351
  return Session$9.authedFunction({
425
- method: 'POST',
426
- url: Helper$5.getUrl(values.serviceKey, 'requests/remove'),
352
+ method: "POST",
353
+ url: Helper$6.getUrl(values.serviceKey, "requests/remove"),
427
354
  data: {
428
355
  site,
429
356
  id
@@ -432,8 +359,8 @@ var maintenanceActions = {
432
359
  },
433
360
  editJobStatus: (id, status) => {
434
361
  return Session$9.authedFunction({
435
- method: 'POST',
436
- url: Helper$5.getUrl(values.serviceKey, 'editJobStatus'),
362
+ method: "POST",
363
+ url: Helper$6.getUrl(values.serviceKey, "editJobStatus"),
437
364
  data: {
438
365
  id,
439
366
  status
@@ -442,8 +369,8 @@ var maintenanceActions = {
442
369
  },
443
370
  editJobPriority: (id, priority) => {
444
371
  return Session$9.authedFunction({
445
- method: 'POST',
446
- url: Helper$5.getUrl(values.serviceKey, 'update/priority'),
372
+ method: "POST",
373
+ url: Helper$6.getUrl(values.serviceKey, "update/priority"),
447
374
  data: {
448
375
  id,
449
376
  priority
@@ -452,8 +379,8 @@ var maintenanceActions = {
452
379
  },
453
380
  assignJob: (jobId, userId) => {
454
381
  return Session$9.authedFunction({
455
- method: 'POST',
456
- url: Helper$5.getUrl(values.serviceKey, 'update/assign'),
382
+ method: "POST",
383
+ url: Helper$6.getUrl(values.serviceKey, "update/assign"),
457
384
  data: {
458
385
  id: jobId,
459
386
  userId
@@ -462,47 +389,47 @@ var maintenanceActions = {
462
389
  },
463
390
  getAssignees: site => {
464
391
  return Session$9.authedFunction({
465
- method: 'GET',
466
- url: Helper$5.getUrl(values.serviceKey, 'get/assignees', {
392
+ method: "GET",
393
+ url: Helper$6.getUrl(values.serviceKey, "get/assignees", {
467
394
  site
468
395
  })
469
396
  });
470
397
  },
471
398
  addNote: (jobId, note, attachments, images) => {
472
399
  return Session$9.authedFunction({
473
- method: 'POST',
474
- url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
400
+ method: "POST",
401
+ url: Helper$6.getUrl(values.serviceKey, "requests/note"),
475
402
  data: {
476
403
  id: jobId,
477
404
  note,
478
405
  attachments,
479
406
  images,
480
- action: 'AddNote'
407
+ action: "AddNote"
481
408
  }
482
409
  });
483
410
  },
484
411
  editNote: (jobId, noteId, note, attachments, images) => {
485
412
  return Session$9.authedFunction({
486
- method: 'POST',
487
- url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
413
+ method: "POST",
414
+ url: Helper$6.getUrl(values.serviceKey, "requests/note"),
488
415
  data: {
489
416
  id: jobId,
490
417
  note,
491
418
  attachments,
492
419
  images,
493
420
  noteId,
494
- action: 'EditNote'
421
+ action: "EditNote"
495
422
  }
496
423
  });
497
424
  },
498
425
  deleteNote: (jobId, noteId) => {
499
426
  return Session$9.authedFunction({
500
- method: 'POST',
501
- url: Helper$5.getUrl(values.serviceKey, 'requests/note'),
427
+ method: "POST",
428
+ url: Helper$6.getUrl(values.serviceKey, "requests/note"),
502
429
  data: {
503
430
  id: jobId,
504
431
  noteId,
505
- action: 'DeleteNote'
432
+ action: "DeleteNote"
506
433
  }
507
434
  });
508
435
  },
@@ -517,8 +444,8 @@ var maintenanceActions = {
517
444
  customFields: customFields || []
518
445
  };
519
446
  return Session$9.authedFunction({
520
- method: 'POST',
521
- url: Helper$5.getUrl(values.serviceKey, 'createJobType'),
447
+ method: "POST",
448
+ url: Helper$6.getUrl(values.serviceKey, "createJobType"),
522
449
  data
523
450
  });
524
451
  },
@@ -535,15 +462,15 @@ var maintenanceActions = {
535
462
  };
536
463
  if (hasCustomFields && customFields) data.customFields = customFields;
537
464
  return Session$9.authedFunction({
538
- method: 'POST',
539
- url: Helper$5.getUrl(values.serviceKey, 'editJobType'),
465
+ method: "POST",
466
+ url: Helper$6.getUrl(values.serviceKey, "editJobType"),
540
467
  data
541
468
  });
542
469
  },
543
470
  deleteJobType: (site, id) => {
544
471
  return Session$9.authedFunction({
545
- method: 'POST',
546
- url: Helper$5.getUrl(values.serviceKey, 'deleteJobType'),
472
+ method: "POST",
473
+ url: Helper$6.getUrl(values.serviceKey, "deleteJobType"),
547
474
  data: {
548
475
  site,
549
476
  id
@@ -552,16 +479,16 @@ var maintenanceActions = {
552
479
  },
553
480
  getExternalSync: jobId => {
554
481
  return Session$9.authedFunction({
555
- method: 'GET',
556
- url: Helper$5.getUrl(values.serviceKey, 'get/externalsync', {
482
+ method: "GET",
483
+ url: Helper$6.getUrl(values.serviceKey, "get/externalsync", {
557
484
  id: jobId
558
485
  })
559
486
  });
560
487
  },
561
488
  retrySync: jobId => {
562
489
  return Session$9.authedFunction({
563
- method: 'POST',
564
- url: Helper$5.getUrl(values.serviceKey, 'update/retrysync'),
490
+ method: "POST",
491
+ url: Helper$6.getUrl(values.serviceKey, "update/retrysync"),
565
492
  data: {
566
493
  id: jobId
567
494
  }
@@ -570,7 +497,7 @@ var maintenanceActions = {
570
497
  };
571
498
 
572
499
  var {
573
- Helper: Helper$4,
500
+ Helper: Helper$5,
574
501
  Session: Session$8
575
502
  } = PlussCore;
576
503
  var reactionActions = {
@@ -587,8 +514,8 @@ var reactionActions = {
587
514
  data.image = image;
588
515
  }
589
516
  return Session$8.authedFunction({
590
- method: 'POST',
591
- url: Helper$4.getUrl('reactions', 'comments/add'),
517
+ method: "POST",
518
+ url: Helper$5.getUrl("reactions", "comments/add"),
592
519
  data
593
520
  });
594
521
  },
@@ -610,8 +537,8 @@ var reactionActions = {
610
537
  query.minTime = minTime;
611
538
  }
612
539
  return Session$8.authedFunction({
613
- method: 'GET',
614
- url: Helper$4.getUrl('reactions', 'comments/get', query)
540
+ method: "GET",
541
+ url: Helper$5.getUrl("reactions", "comments/get", query)
615
542
  });
616
543
  }
617
544
  };
@@ -645,20 +572,19 @@ var jobStatusOptions = [
645
572
  ];
646
573
 
647
574
  var {
648
- Helper: Helper$3
575
+ Helper: Helper$4
649
576
  } = PlussCore;
650
577
  var jobsUpdate = (site, isdashboard) => {
651
578
  return dispatch => {
652
579
  if (isdashboard) dispatch({
653
580
  type: JOBS_LOADING
654
581
  });
655
- maintenanceActions.getJobs2(site).then(res => {
656
- var currentSite = Helper$3.readStorageWithCookie('site');
657
- var jobs = res.data.Items;
658
- if (!_.isEmpty(jobs) && jobs[0].site === currentSite) {
582
+ maintenanceActions.getJobsRecursive(site).then(res => {
583
+ var currentSite = Helper$4.readStorageWithCookie("site");
584
+ if (!_.isEmpty(res) && res[0].site === currentSite) {
659
585
  dispatch({
660
586
  type: JOBS_LOADED,
661
- payload: jobs
587
+ payload: res
662
588
  });
663
589
  } else {
664
590
  dispatch({
@@ -666,12 +592,6 @@ var jobsUpdate = (site, isdashboard) => {
666
592
  payload: []
667
593
  });
668
594
  }
669
- }).catch(error => {
670
- console.error('jobsUpdate error', error);
671
- dispatch({
672
- type: JOBS_LOADED,
673
- payload: []
674
- });
675
595
  });
676
596
  };
677
597
  };
@@ -681,12 +601,6 @@ var jobsLoaded = events => {
681
601
  payload: events
682
602
  };
683
603
  };
684
- var jobsAdded = events => {
685
- return {
686
- type: JOBS_ADDED,
687
- payload: events
688
- };
689
- };
690
604
  var removeJob = id => {
691
605
  return {
692
606
  type: JOBS_REMOVED,
@@ -807,10 +721,10 @@ var jobPriorityOptions = [
807
721
  }
808
722
  ];
809
723
 
810
- var STATUS_IMCOMPLETE = 'All Incomplete';
811
- var STATUS_NOT_ACTIONED = 'Not Actioned';
812
- var STATUS_IN_PROGRESS = 'In Progress';
813
- var STATUS_COMPLETED = 'Completed';
724
+ var STATUS_IMCOMPLETE = "All Incomplete";
725
+ var STATUS_NOT_ACTIONED = "Not Actioned";
726
+ var STATUS_IN_PROGRESS = "In Progress";
727
+ var STATUS_COMPLETED = "Completed";
814
728
  var getDefaultPriority = () => jobPriorityOptions.find(p => p.default);
815
729
  var getJobPriority = priority => {
816
730
  var priorityOption = null;
@@ -818,8 +732,8 @@ var getJobPriority = priority => {
818
732
  return priorityOption || getDefaultPriority();
819
733
  };
820
734
 
821
- function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
822
- function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
735
+ function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
736
+ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
823
737
  var {
824
738
  Session: Session$7,
825
739
  Components: Components$7,
@@ -835,75 +749,25 @@ class JobList extends Component {
835
749
  id: j.userID,
836
750
  displayName: j.userName,
837
751
  profilePic: j.userProfilePic
838
- })), 'id'), 'displayName', 'asc');
752
+ })), "id"), "displayName", "asc");
839
753
  this.setState({
840
754
  requesters
841
755
  });
842
756
  });
843
- _defineProperty(this, "refresh", () => {
844
- var {
845
- auth
846
- } = this.props;
847
- this.setState({
848
- loading: true,
849
- lastKey: null,
850
- hasMore: true
851
- }, /*#__PURE__*/_asyncToGenerator(function* () {
852
- try {
853
- var statusForApi = _this.state.selectedStatusFilter === STATUS_IMCOMPLETE ? undefined : _this.state.selectedStatusFilter;
854
- var res = yield maintenanceActions.getJobs2(auth.site, statusForApi, _this.state.selectedPriorityFilter, _this.state.selectedTypeFilter, null,
855
- // first page
856
- _this.state.selectedUserFilter, _this.state.selectedTimeFilterStart, _this.state.selectedTimeFilterEnd, _this.state.search);
857
- var jobs = res.data.Items;
858
- var lastKey = res.data.LastKey;
859
- _this.setRequesters(jobs);
860
- _this.props.jobsLoaded(jobs);
861
- _this.setState({
862
- lastKey,
863
- hasMore: !!lastKey,
864
- loading: false
865
- });
866
- } catch (error) {
867
- console.error('refresh error', error);
868
- _this.setState({
869
- loading: false
870
- });
871
- }
872
- }));
873
- });
874
- _defineProperty(this, "loadMore", () => {
757
+ _defineProperty(this, "getJobs", /*#__PURE__*/_asyncToGenerator(function* () {
875
758
  var {
876
759
  auth
877
- } = this.props;
878
- var {
879
- loading,
880
- loadingMore,
881
- hasMore,
882
- lastKey
883
- } = this.state;
884
- if (loading || loadingMore || !hasMore || !lastKey) return;
885
- this.setState({
886
- loadingMore: true
887
- }, /*#__PURE__*/_asyncToGenerator(function* () {
888
- try {
889
- var statusForApi = _this.state.selectedStatusFilter === STATUS_IMCOMPLETE ? undefined : _this.state.selectedStatusFilter;
890
- var res = yield maintenanceActions.getJobs2(auth.site, statusForApi, _this.state.selectedPriorityFilter, _this.state.selectedTypeFilter, lastKey, _this.state.selectedUserFilter, _this.state.selectedTimeFilterStart, _this.state.selectedTimeFilterEnd, _this.state.search);
891
- var newJobs = res.data.Items;
892
- var newLastKey = res.data.LastKey;
893
- _this.props.jobsAdded(newJobs);
894
- _this.setState({
895
- lastKey: newLastKey,
896
- hasMore: !!newLastKey,
897
- loadingMore: false
898
- });
899
- } catch (error) {
900
- console.error('loadMore error', error);
901
- _this.setState({
902
- loadingMore: false
903
- });
760
+ } = _this.props;
761
+ try {
762
+ var res = yield maintenanceActions.getJobsRecursive(auth.site);
763
+ if (!_.isEmpty(res) && res[0].site === auth.site) {
764
+ _this.setRequesters(res);
765
+ _this.props.jobsLoaded(res);
904
766
  }
905
- }));
906
- });
767
+ } catch (error) {
768
+ console.error("getJobs", error);
769
+ }
770
+ }));
907
771
  _defineProperty(this, "getAssignees", /*#__PURE__*/_asyncToGenerator(function* () {
908
772
  try {
909
773
  var res = yield maintenanceActions.getAssignees(_this.props.auth.site);
@@ -911,7 +775,7 @@ class JobList extends Component {
911
775
  assignees: res.data.Users
912
776
  });
913
777
  } catch (error) {
914
- console.error('getAssignees', error);
778
+ console.error("getAssignees", error);
915
779
  }
916
780
  }));
917
781
  _defineProperty(this, "sortByCol", col => {
@@ -931,20 +795,20 @@ class JobList extends Component {
931
795
  }
932
796
  });
933
797
  _defineProperty(this, "onRemoveRequest", /*#__PURE__*/function () {
934
- var _ref4 = _asyncToGenerator(function* (request) {
798
+ var _ref3 = _asyncToGenerator(function* (request) {
935
799
  if (window.confirm(values.textAreYouSureYouWantToDelete)) {
936
800
  _this.props.removeJob(request.id);
937
801
  try {
938
802
  yield maintenanceActions.deleteJob(_this.props.auth.site, request.id);
939
- _this.refresh();
803
+ _this.getJobs();
940
804
  } catch (error) {
941
- console.log('onRemoveRequest', error);
942
- alert('Something went wrong with the request. Please try again.');
805
+ console.log("onRemoveRequest", error);
806
+ alert("Something went wrong with the request. Please try again.");
943
807
  }
944
808
  }
945
809
  });
946
810
  return function (_x) {
947
- return _ref4.apply(this, arguments);
811
+ return _ref3.apply(this, arguments);
948
812
  };
949
813
  }());
950
814
  _defineProperty(this, "openFilter", filter => {
@@ -958,22 +822,22 @@ class JobList extends Component {
958
822
  });
959
823
  });
960
824
  _defineProperty(this, "selectTypeFilter", filter => {
961
- this.closeFilter();
962
825
  this.setState({
963
826
  selectedTypeFilter: filter
964
- }, () => this.refresh());
827
+ });
828
+ this.closeFilter();
965
829
  });
966
830
  _defineProperty(this, "selectPriorityFilter", filter => {
967
- this.closeFilter();
968
831
  this.setState({
969
832
  selectedPriorityFilter: filter
970
- }, () => this.refresh());
833
+ });
834
+ this.closeFilter();
971
835
  });
972
836
  _defineProperty(this, "selectStatusFilter", filter => {
973
- this.closeFilter();
974
837
  this.setState({
975
838
  selectedStatusFilter: filter
976
- }, () => this.refresh());
839
+ });
840
+ this.closeFilter();
977
841
  });
978
842
  _defineProperty(this, "timeFilterChanged", selectedTimeFilter => {
979
843
  this.setState({
@@ -993,42 +857,42 @@ class JobList extends Component {
993
857
  if (this.state.selectedTimeFilter.dayCount > 0) {
994
858
  return true;
995
859
  }
996
- return moment(this.state.timeFilterStart).startOf('d').valueOf() < moment(this.state.timeFilterEnd).endOf('d').valueOf();
860
+ return moment(this.state.timeFilterStart).startOf("d").valueOf() < moment(this.state.timeFilterEnd).endOf("d").valueOf();
997
861
  });
998
862
  _defineProperty(this, "saveTimeFilter", () => {
999
863
  if (!this.isValidTimeFilter()) {
1000
864
  return;
1001
865
  }
1002
866
  var startTime = 0;
1003
- var endTime = moment().endOf('d').valueOf();
1004
- var text = '';
867
+ var endTime = moment().endOf("d").valueOf();
868
+ var text = "";
1005
869
  if (this.state.selectedTimeFilter.dayCount > 0) {
1006
- startTime = moment().add(-this.state.selectedTimeFilter.dayCount, 'd').startOf('d').valueOf();
870
+ startTime = moment().add(-this.state.selectedTimeFilter.dayCount, "d").startOf("d").valueOf();
1007
871
  text = this.state.selectedTimeFilter.text;
1008
872
  } else {
1009
- var startDate = moment(this.state.timeFilterStart).startOf('d');
1010
- var endDate = moment(this.state.timeFilterEnd).endOf('d');
873
+ var startDate = moment(this.state.timeFilterStart).startOf("d");
874
+ var endDate = moment(this.state.timeFilterEnd).endOf("d");
1011
875
  startTime = startDate.valueOf();
1012
876
  endTime = endDate.valueOf();
1013
- text = "".concat(startDate.format('DD/MM/YYYY'), " to ").concat(endDate.format('DD/MM/YYYY'));
877
+ text = "".concat(startDate.format("DD/MM/YYYY"), " to ").concat(endDate.format("DD/MM/YYYY"));
1014
878
  }
1015
- this.closeFilter();
1016
879
  this.setState({
1017
880
  selectedTimeFilterStart: startTime,
1018
881
  selectedTimeFilterEnd: endTime,
1019
882
  selectedTimeFilterText: text
1020
- }, () => this.refresh());
883
+ });
884
+ this.closeFilter();
1021
885
  });
1022
886
  _defineProperty(this, "removeTimeFilter", () => {
1023
887
  this.setState({
1024
888
  selectedTimeFilterStart: null,
1025
889
  selectedTimeFilterEnd: null,
1026
890
  selectedTimeFilterText: null
1027
- }, () => this.refresh());
891
+ });
1028
892
  });
1029
893
  _defineProperty(this, "onHandleChange", event => {
1030
894
  var stateChange = {};
1031
- stateChange[event.target.getAttribute('id')] = event.target.value;
895
+ stateChange[event.target.getAttribute("id")] = event.target.value;
1032
896
  this.setState(stateChange);
1033
897
  });
1034
898
  _defineProperty(this, "onSelectAssignee", user => {
@@ -1040,10 +904,9 @@ class JobList extends Component {
1040
904
  this.setState({
1041
905
  selectedUserFilter: null,
1042
906
  selectedUserFilterText: null
1043
- }, () => this.refresh());
907
+ });
1044
908
  });
1045
909
  _defineProperty(this, "saveUserFilter", () => {
1046
- this.closeFilter();
1047
910
  if (!this.state.selectedAssignee) {
1048
911
  this.removeUserFilter();
1049
912
  } else {
@@ -1051,8 +914,9 @@ class JobList extends Component {
1051
914
  selectedUserFilter: this.state.selectedAssignee.id,
1052
915
  selectedUserFilterText: this.state.selectedAssignee.displayName,
1053
916
  selectedAssignee: null
1054
- }, () => this.refresh());
917
+ });
1055
918
  }
919
+ this.closeFilter();
1056
920
  });
1057
921
  _defineProperty(this, "onSelectRequester", user => {
1058
922
  this.setState({
@@ -1084,41 +948,82 @@ class JobList extends Component {
1084
948
  lastSearch: thisSearchTime
1085
949
  });
1086
950
  setTimeout(() => {
1087
- // Debounced: trigger server-side refresh after user stops typing
951
+ // delayed setter to avoid filtering on every keypress
1088
952
  if (this.state.lastSearch === thisSearchTime) {
1089
- this.refresh();
953
+ this.setState({
954
+ searchTerm: this.state.search
955
+ });
1090
956
  }
1091
957
  }, 500);
1092
958
  });
1093
959
  _defineProperty(this, "getSource", () => {
1094
960
  var source = this.props.source;
1095
961
 
1096
- // Client-side filter: Incomplete status (composite filter, not supported server-side)
1097
- if (this.state.selectedStatusFilter === STATUS_IMCOMPLETE) {
962
+ // filter by time
963
+ if (this.state.selectedTimeFilterStart && this.state.selectedTimeFilterEnd) {
964
+ source = _.filter(source, r => {
965
+ return r.createdUnix >= this.state.selectedTimeFilterStart && r.createdUnix <= this.state.selectedTimeFilterEnd;
966
+ });
967
+ }
968
+
969
+ // filter by type
970
+ if (this.state.selectedTypeFilter) {
971
+ source = _.filter(source, r => {
972
+ return r.type === this.state.selectedTypeFilter;
973
+ });
974
+ }
975
+
976
+ // filter by priority
977
+ if (this.state.selectedPriorityFilter) {
978
+ var defaultPriority = getDefaultPriority().name;
979
+ source = _.filter(source, r => {
980
+ return r.priority === this.state.selectedPriorityFilter || this.state.selectedPriorityFilter === defaultPriority && _.isNil(r.priority);
981
+ });
982
+ }
983
+
984
+ // filter by status
985
+ if (this.state.selectedStatusFilter) {
1098
986
  var {
1099
987
  statusTypes
1100
988
  } = this.props;
989
+ var defaultStatus = statusTypes.find(s => s.category === STATUS_NOT_ACTIONED);
1101
990
  source = _.filter(source, r => {
1102
- var status = statusTypes.find(s => s.text === r.status);
1103
- return !status || status.category !== STATUS_COMPLETED;
991
+ var status = statusTypes.find(s => s.text === r.status) || defaultStatus;
992
+ if (this.state.selectedStatusFilter === STATUS_IMCOMPLETE) {
993
+ return status.category !== STATUS_COMPLETED;
994
+ }
995
+ return status.text === this.state.selectedStatusFilter;
996
+ });
997
+ }
998
+ if (this.state.selectedUserFilter) {
999
+ source = _.filter(source, r => {
1000
+ return r.AssigneeId === this.state.selectedUserFilter;
1104
1001
  });
1105
1002
  }
1106
-
1107
- // Client-side filter: requester (not supported server-side)
1108
1003
  if (this.state.selectedRequesterFilter) {
1109
1004
  source = _.filter(source, r => {
1110
1005
  return r.userID === this.state.selectedRequesterFilter;
1111
1006
  });
1112
1007
  }
1113
-
1114
- // Note: status, type, priority, assignee, time range, and search filters
1115
- // are all applied server-side via getJobs2 pagination.
1116
-
1008
+ if (!_.isEmpty(this.state.searchTerm)) {
1009
+ source = _.filter(source, r => {
1010
+ if (r.jobId && r.jobId === this.state.searchTerm) {
1011
+ return true;
1012
+ }
1013
+ if (r.room && r.room.toLowerCase().indexOf(this.state.searchTerm.toLowerCase()) > -1) {
1014
+ return true;
1015
+ }
1016
+ if (r.title && r.title.toLowerCase().indexOf(this.state.searchTerm.toLowerCase()) > -1) {
1017
+ return true;
1018
+ }
1019
+ return false;
1020
+ });
1021
+ }
1117
1022
  source = _.sortBy(source, event => {
1118
- if (this.state.sortColumn === 'assigned') {
1119
- return event.Assignee ? event.Assignee.displayName : 'Unassigned';
1023
+ if (this.state.sortColumn === "assigned") {
1024
+ return event.Assignee ? event.Assignee.displayName : "Unassigned";
1120
1025
  }
1121
- if (this.state.sortColumn !== 'createdUnix') return event[this.state.sortColumn];
1026
+ if (this.state.sortColumn !== "createdUnix") return event[this.state.sortColumn];
1122
1027
  return event.createdUnix;
1123
1028
  });
1124
1029
  if (this.state.sortDesc) source.reverse();
@@ -1126,14 +1031,14 @@ class JobList extends Component {
1126
1031
  });
1127
1032
  _defineProperty(this, "getCustomFieldValue", field => {
1128
1033
  switch (field.type) {
1129
- case 'date':
1130
- return field.answer ? moment(field.answer, 'YYYY-MM-DD').format('DD-MMM-YYYY') : '';
1131
- case 'time':
1132
- return field.answer ? moment(field.answer, 'HH:mm').format('h:mm a') : '';
1133
- case 'yn':
1134
- return field.answer ? 'Yes' : 'No';
1135
- case 'checkbox':
1136
- return field.answer && Array.isArray(field.answer) ? field.answer.join(', ') : '';
1034
+ case "date":
1035
+ return field.answer ? moment(field.answer, "YYYY-MM-DD").format("DD-MMM-YYYY") : "";
1036
+ case "time":
1037
+ return field.answer ? moment(field.answer, "HH:mm").format("h:mm a") : "";
1038
+ case "yn":
1039
+ return field.answer ? "Yes" : "No";
1040
+ case "checkbox":
1041
+ return field.answer && Array.isArray(field.answer) ? field.answer.join(", ") : "";
1137
1042
  default:
1138
1043
  return field.answer;
1139
1044
  }
@@ -1147,7 +1052,7 @@ class JobList extends Component {
1147
1052
  if (customFields && Array.isArray(customFields)) {
1148
1053
  customFields.forEach(field => {
1149
1054
  // Exclude un-exportable fields
1150
- if (['image', 'document', 'staticTitle', 'staticText'].includes(field.type)) return;
1055
+ if (["image", "document", "staticTitle", "staticText"].includes(field.type)) return;
1151
1056
  var fieldKey = "".concat(_.camelCase(type), ".").concat(_.camelCase(field.label));
1152
1057
  // Build custom columns
1153
1058
  var exists = customColumns.find(c => c.key === fieldKey);
@@ -1169,10 +1074,10 @@ class JobList extends Component {
1169
1074
  var source = this.getSource().map(r => {
1170
1075
  var history = r.history || [];
1171
1076
  var progressEntry = _.find(history, e => {
1172
- return e.status !== 'Unassigned';
1077
+ return e.status !== "Unassigned";
1173
1078
  });
1174
1079
  var completedEntry = _.find(history, e => {
1175
- return e.status === 'Completed';
1080
+ return e.status === "Completed";
1176
1081
  });
1177
1082
  var progressTime = null;
1178
1083
  var completedTime = null;
@@ -1186,22 +1091,22 @@ class JobList extends Component {
1186
1091
  completedTime = moment.utc(completedEntry.timestamp).format();
1187
1092
  completedDuration = moment.utc(completedEntry.timestamp).unix() - moment.utc(r.createdTime).unix();
1188
1093
  }
1189
- var notes = '';
1094
+ var notes = "";
1190
1095
  (r.Notes || []).forEach((note, index) => {
1191
1096
  if (index > 0) {
1192
- notes += '\n\n';
1097
+ notes += "\n\n";
1193
1098
  }
1194
1099
  if (note.User && !_.isEmpty(note.User.displayName)) {
1195
1100
  notes += "".concat(note.User.displayName, ":\n");
1196
1101
  }
1197
1102
  if (note.Timestamp) {
1198
- notes += "".concat(moment(note.Timestamp).format('DD-MM-YYYY h:mma'), "\n");
1103
+ notes += "".concat(moment(note.Timestamp).format("DD-MM-YYYY h:mma"), "\n");
1199
1104
  }
1200
1105
  notes += note.Note;
1201
1106
  });
1202
1107
  var customFieldValues = this.getCustomFields(r, customColumns);
1203
1108
  var priority = r.priority || defaultPriority;
1204
- return _objectSpread$6(_objectSpread$6(_objectSpread$6({}, r), customFieldValues), {}, {
1109
+ return _objectSpread$7(_objectSpread$7(_objectSpread$7({}, r), customFieldValues), {}, {
1205
1110
  notes,
1206
1111
  progressTime,
1207
1112
  completedTime,
@@ -1212,7 +1117,7 @@ class JobList extends Component {
1212
1117
  });
1213
1118
 
1214
1119
  // Compose revised columns list with custom fields
1215
- var index = this.exportColumns.findIndex(c => c.key === 'notes');
1120
+ var index = this.exportColumns.findIndex(c => c.key === "notes");
1216
1121
  var columns = [...this.exportColumns.slice(0, index), ...customColumns, ...this.exportColumns.slice(index)];
1217
1122
  return {
1218
1123
  columns,
@@ -1234,67 +1139,64 @@ class JobList extends Component {
1234
1139
  });
1235
1140
  });
1236
1141
  this.state = {
1237
- sortColumn: 'createdUnix',
1142
+ showCompleted: false,
1143
+ sortColumn: "createdUnix",
1238
1144
  sortDesc: true,
1239
1145
  selectedTimeFilter: Analytics$2.getAnalyticsFilterOptions()[1],
1240
1146
  assignees: [],
1241
- requesters: [],
1242
- loading: false,
1243
- loadingMore: false,
1244
- lastKey: null,
1245
- hasMore: true
1147
+ requesters: []
1246
1148
  };
1247
1149
  this.exportColumns = [{
1248
- label: 'Select All',
1249
- key: ''
1150
+ label: "Select All",
1151
+ key: ""
1250
1152
  }, {
1251
- label: 'System Id',
1252
- key: 'id'
1153
+ label: "System Id",
1154
+ key: "id"
1253
1155
  }, {
1254
1156
  label: "".concat(values.textEntityName, " No."),
1255
- key: 'jobId'
1157
+ key: "jobId"
1256
1158
  }, {
1257
1159
  label: values.textJobType,
1258
- key: 'type'
1160
+ key: "type"
1259
1161
  }, {
1260
- label: 'Status',
1261
- key: 'status'
1162
+ label: "Status",
1163
+ key: "status"
1262
1164
  }, {
1263
- label: 'Priority',
1264
- key: 'priority'
1165
+ label: "Priority",
1166
+ key: "priority"
1265
1167
  }, {
1266
- label: 'Title',
1267
- key: 'title'
1168
+ label: "Title",
1169
+ key: "title"
1268
1170
  }, {
1269
- label: 'Address',
1270
- key: 'room'
1171
+ label: "Address",
1172
+ key: "room"
1271
1173
  }, {
1272
- label: 'Description',
1273
- key: 'description'
1174
+ label: "Description",
1175
+ key: "description"
1274
1176
  }, {
1275
- label: 'Notes',
1276
- key: 'notes'
1177
+ label: "Notes",
1178
+ key: "notes"
1277
1179
  }, {
1278
- label: 'User Name',
1279
- key: 'userName'
1180
+ label: "User Name",
1181
+ key: "userName"
1280
1182
  }, {
1281
- label: 'User ID',
1282
- key: 'userID'
1183
+ label: "User ID",
1184
+ key: "userID"
1283
1185
  }, {
1284
- label: 'Request Time',
1285
- key: 'createdTime'
1186
+ label: "Request Time",
1187
+ key: "createdTime"
1286
1188
  }, {
1287
- label: 'Progress Time',
1288
- key: 'progressTime'
1189
+ label: "Progress Time",
1190
+ key: "progressTime"
1289
1191
  }, {
1290
- label: 'Completed Time',
1291
- key: 'completedTime'
1192
+ label: "Completed Time",
1193
+ key: "completedTime"
1292
1194
  }, {
1293
- label: 'Time to Progress (in seconds)',
1294
- key: 'progressDuration'
1195
+ label: "Time to Progress (in seconds)",
1196
+ key: "progressDuration"
1295
1197
  }, {
1296
- label: 'Time to Complete (in seconds)',
1297
- key: 'completedDuration'
1198
+ label: "Time to Complete (in seconds)",
1199
+ key: "completedDuration"
1298
1200
  }];
1299
1201
  }
1300
1202
  UNSAFE_componentWillMount() {
@@ -1302,14 +1204,14 @@ class JobList extends Component {
1302
1204
  }
1303
1205
  componentDidMount() {
1304
1206
  this.props.jobStatusesUpdate(this.props.auth.site);
1305
- this.refresh();
1207
+ this.getJobs();
1306
1208
  this.getAssignees();
1307
1209
  }
1308
1210
  renderFilterPopup() {
1309
1211
  if (!this.state.filterOpen) {
1310
1212
  return null;
1311
1213
  }
1312
- if (this.state.filterOpen === 'type') {
1214
+ if (this.state.filterOpen === "type") {
1313
1215
  return /*#__PURE__*/jsx(Components$7.Popup, {
1314
1216
  title: "Select ".concat(values.textJobType),
1315
1217
  maxWidth: 600,
@@ -1327,7 +1229,7 @@ class JobList extends Component {
1327
1229
  })
1328
1230
  });
1329
1231
  }
1330
- if (this.state.filterOpen === 'priority') {
1232
+ if (this.state.filterOpen === "priority") {
1331
1233
  return /*#__PURE__*/jsx(Components$7.Popup, {
1332
1234
  title: "Select Priority",
1333
1235
  maxWidth: 600,
@@ -1345,7 +1247,7 @@ class JobList extends Component {
1345
1247
  })
1346
1248
  });
1347
1249
  }
1348
- if (this.state.filterOpen === 'status') {
1250
+ if (this.state.filterOpen === "status") {
1349
1251
  var {
1350
1252
  statusTypes
1351
1253
  } = this.props;
@@ -1366,7 +1268,7 @@ class JobList extends Component {
1366
1268
  })
1367
1269
  });
1368
1270
  }
1369
- if (this.state.filterOpen === 'time') {
1271
+ if (this.state.filterOpen === "time") {
1370
1272
  return /*#__PURE__*/jsx(Components$7.Popup, {
1371
1273
  title: "Select Time",
1372
1274
  maxWidth: 600,
@@ -1374,13 +1276,13 @@ class JobList extends Component {
1374
1276
  hasPadding: true,
1375
1277
  onClose: this.closeFilter,
1376
1278
  buttons: [{
1377
- type: 'primaryAction',
1279
+ type: "primaryAction",
1378
1280
  onClick: this.saveTimeFilter,
1379
- text: 'Select',
1281
+ text: "Select",
1380
1282
  isActive: this.isValidTimeFilter()
1381
1283
  }],
1382
1284
  children: /*#__PURE__*/jsx("div", {
1383
- style: {
1285
+ iconStyle: {
1384
1286
  minHeight: 150
1385
1287
  },
1386
1288
  children: /*#__PURE__*/jsx(Components$7.AnalyticsFilter, {
@@ -1391,19 +1293,19 @@ class JobList extends Component {
1391
1293
  })
1392
1294
  });
1393
1295
  }
1394
- if (this.state.filterOpen === 'user') {
1296
+ if (this.state.filterOpen === "user") {
1395
1297
  var userContent = null;
1396
1298
  if (this.state.selectedAssignee) {
1397
1299
  userContent = /*#__PURE__*/jsx("div", {
1398
1300
  children: /*#__PURE__*/jsx(Components$7.UserListing, {
1399
1301
  user: this.state.selectedAssignee,
1400
- rightContent: /*#__PURE__*/jsx(Components$7.SVGIcon, {
1302
+ rightContent: /*#__PURE__*/jsx(Icon, {
1401
1303
  className: "removeIcon",
1402
- icon: "close",
1304
+ icon: "xmark",
1403
1305
  onClick: () => {
1404
1306
  this.onSelectAssignee();
1405
1307
  },
1406
- colour: Colours$3.COLOUR_DUSK
1308
+ colour: Colours$4.COLOUR_DUSK
1407
1309
  })
1408
1310
  }, this.state.selectedAssignee.id)
1409
1311
  });
@@ -1438,27 +1340,27 @@ class JobList extends Component {
1438
1340
  hasPadding: true,
1439
1341
  onClose: this.closeFilter,
1440
1342
  buttons: [{
1441
- type: 'primaryAction',
1343
+ type: "primaryAction",
1442
1344
  onClick: this.saveUserFilter,
1443
- text: 'Select',
1345
+ text: "Select",
1444
1346
  isActive: true
1445
1347
  }],
1446
1348
  children: userContent
1447
1349
  });
1448
1350
  }
1449
- if (this.state.filterOpen === 'requester') {
1351
+ if (this.state.filterOpen === "requester") {
1450
1352
  var _userContent = null;
1451
1353
  if (this.state.selectedRequester) {
1452
1354
  _userContent = /*#__PURE__*/jsx("div", {
1453
1355
  children: /*#__PURE__*/jsx(Components$7.UserListing, {
1454
1356
  user: this.state.selectedRequester,
1455
- rightContent: /*#__PURE__*/jsx(Components$7.SVGIcon, {
1357
+ rightContent: /*#__PURE__*/jsx(Icon, {
1456
1358
  className: "removeIcon",
1457
- icon: "close",
1359
+ icon: "xmark",
1458
1360
  onClick: () => {
1459
1361
  this.onSelectRequester();
1460
1362
  },
1461
- colour: Colours$3.COLOUR_DUSK
1363
+ colour: Colours$4.COLOUR_DUSK
1462
1364
  })
1463
1365
  }, this.state.selectedRequester.id)
1464
1366
  });
@@ -1493,9 +1395,9 @@ class JobList extends Component {
1493
1395
  hasPadding: true,
1494
1396
  onClose: this.closeFilter,
1495
1397
  buttons: [{
1496
- type: 'primaryAction',
1398
+ type: "primaryAction",
1497
1399
  onClick: this.saveRequesterFilter,
1498
- text: 'Select',
1400
+ text: "Select",
1499
1401
  isActive: true
1500
1402
  }],
1501
1403
  children: _userContent
@@ -1528,7 +1430,7 @@ class JobList extends Component {
1528
1430
  }), /*#__PURE__*/jsx("td", {
1529
1431
  children: ev.type
1530
1432
  }), /*#__PURE__*/jsx("td", {
1531
- children: moment.utc(ev.createdTime).local().format('D MMM YY')
1433
+ children: moment.utc(ev.createdTime).local().format("D MMM YY")
1532
1434
  }), /*#__PURE__*/jsx("td", {
1533
1435
  children: ev.room
1534
1436
  }), /*#__PURE__*/jsx("td", {
@@ -1539,34 +1441,34 @@ class JobList extends Component {
1539
1441
  profilePic: ev.userProfilePic
1540
1442
  },
1541
1443
  textClass: "fontSize-13"
1542
- }) : 'Unknown'
1444
+ }) : "Unknown"
1543
1445
  }), /*#__PURE__*/jsx("td", {
1544
1446
  children: ev.Assignee ? /*#__PURE__*/jsx(Components$7.UserListing, {
1545
1447
  user: ev.Assignee,
1546
1448
  textClass: "fontSize-13"
1547
- }) : 'Unassigned'
1449
+ }) : "Unassigned"
1548
1450
  }), /*#__PURE__*/jsx("td", {
1549
1451
  children: /*#__PURE__*/jsx("div", {
1550
1452
  style: {
1551
- textAlign: 'center',
1453
+ textAlign: "center",
1552
1454
  borderRadius: 4,
1553
1455
  width: 100,
1554
1456
  paddingTop: 2,
1555
1457
  paddingBottom: 2,
1556
- color: '#fff',
1458
+ color: "#fff",
1557
1459
  backgroundColor: status ? status.color : undefined
1558
1460
  },
1559
- children: status ? status.text : ''
1461
+ children: status ? status.text : ""
1560
1462
  })
1561
1463
  }), /*#__PURE__*/jsx("td", {
1562
1464
  children: /*#__PURE__*/jsx("div", {
1563
1465
  style: {
1564
- textAlign: 'center',
1466
+ textAlign: "center",
1565
1467
  borderRadius: 4,
1566
1468
  width: 100,
1567
1469
  paddingTop: 2,
1568
1470
  paddingBottom: 2,
1569
- color: '#fff',
1471
+ color: "#fff",
1570
1472
  backgroundColor: priority.color
1571
1473
  },
1572
1474
  children: priority.name
@@ -1574,30 +1476,30 @@ class JobList extends Component {
1574
1476
  }), /*#__PURE__*/jsx("td", {
1575
1477
  className: "table-options",
1576
1478
  children: /*#__PURE__*/jsxs("div", {
1577
- style: {
1578
- display: 'flex',
1579
- alignItems: 'center'
1479
+ iconStyle: {
1480
+ display: "flex",
1481
+ alignItems: "center"
1580
1482
  },
1581
1483
  children: [/*#__PURE__*/jsx(Link, {
1582
1484
  to: "".concat(values.routeRequestDetails, "/").concat(ev.id),
1583
- children: /*#__PURE__*/jsx(FontAwesome, {
1485
+ children: /*#__PURE__*/jsx(Icon, {
1584
1486
  style: {
1585
1487
  fontSize: 20,
1586
1488
  padding: 5,
1587
- cursor: 'pointer'
1489
+ cursor: "pointer"
1588
1490
  },
1589
- name: "pencil"
1491
+ icon: "pencil"
1590
1492
  })
1591
1493
  }), Session$7.validateAccess(this.props.auth.site, values.permissionMaintenanceTracking, this.props.auth) && /*#__PURE__*/jsx("a", {
1592
1494
  onClick: () => this.onRemoveRequest(ev),
1593
- children: /*#__PURE__*/jsx(FontAwesome, {
1495
+ children: /*#__PURE__*/jsx(Icon, {
1594
1496
  style: {
1595
1497
  fontSize: 20,
1596
1498
  padding: 5,
1597
1499
  marginLeft: 8,
1598
- cursor: 'pointer'
1500
+ cursor: "pointer"
1599
1501
  },
1600
- name: "minus-circle"
1502
+ icon: "circle-minus"
1601
1503
  })
1602
1504
  })]
1603
1505
  })
@@ -1611,26 +1513,26 @@ class JobList extends Component {
1611
1513
  sortDesc
1612
1514
  } = this.state;
1613
1515
  if (col !== sortColumn) return null;
1614
- return /*#__PURE__*/jsx(FontAwesome, {
1516
+ return /*#__PURE__*/jsx(Icon, {
1615
1517
  style: {
1616
1518
  marginLeft: 5
1617
1519
  },
1618
- name: sortDesc ? 'chevron-up' : 'chevron-down'
1520
+ icon: sortDesc ? "fa-".concat("chevron-up") : "fa-".concat("chevron-down")
1619
1521
  });
1620
1522
  }
1621
1523
  sortIsActive(col) {
1622
- if (col !== this.state.sortColumn) return '';
1623
- return ' table--columnActive';
1524
+ if (col !== this.state.sortColumn) return "";
1525
+ return " table--columnActive";
1624
1526
  }
1625
1527
  renderEmpty() {
1626
1528
  var title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
1627
1529
  return /*#__PURE__*/jsxs("div", {
1628
1530
  style: {
1629
- display: 'flex',
1630
- flexDirection: 'column',
1531
+ display: "flex",
1532
+ flexDirection: "column",
1631
1533
  flex: 1,
1632
- justifyContent: 'center',
1633
- alignItems: 'center',
1534
+ justifyContent: "center",
1535
+ alignItems: "center",
1634
1536
  marginTop: 32
1635
1537
  },
1636
1538
  children: [/*#__PURE__*/jsx("div", {
@@ -1639,7 +1541,7 @@ class JobList extends Component {
1639
1541
  className: "marginTop-32",
1640
1542
  style: {
1641
1543
  maxWidth: 500,
1642
- textAlign: 'center'
1544
+ textAlign: "center"
1643
1545
  },
1644
1546
  children: /*#__PURE__*/jsxs("span", {
1645
1547
  className: "fontRegular fontSize-13",
@@ -1652,149 +1554,112 @@ class JobList extends Component {
1652
1554
  className: "marginTop-8 fontRegular fontSize-13",
1653
1555
  style: {
1654
1556
  maxWidth: 500,
1655
- textAlign: 'center'
1557
+ textAlign: "center"
1656
1558
  },
1657
1559
  children: values.textEmptyExample
1658
1560
  })]
1659
1561
  });
1660
1562
  }
1661
1563
  renderContent() {
1662
- if (this.state.loading) {
1663
- return /*#__PURE__*/jsx("div", {
1664
- style: {
1665
- display: 'flex',
1666
- justifyContent: 'center',
1667
- padding: 40
1668
- },
1669
- children: /*#__PURE__*/jsx(FontAwesome, {
1670
- style: {
1671
- fontSize: 32,
1672
- color: '#ccc'
1673
- },
1674
- name: "spinner fa-pulse fa-fw"
1675
- })
1676
- });
1677
- }
1678
1564
  if (_.isEmpty(this.props.source)) return this.renderEmpty();
1679
- return /*#__PURE__*/jsxs("div", {
1680
- children: [/*#__PURE__*/jsxs(Table, {
1681
- className: "plussTable",
1682
- striped: true,
1683
- bordered: true,
1684
- condensed: true,
1685
- hover: true,
1686
- style: {
1687
- minWidth: '100%'
1688
- },
1689
- children: [/*#__PURE__*/jsx("thead", {
1690
- children: /*#__PURE__*/jsxs("tr", {
1691
- children: [/*#__PURE__*/jsxs("th", {
1692
- className: "".concat(this.sortIsActive('jobId')),
1693
- style: {
1694
- cursor: 'pointer',
1695
- width: 70
1696
- },
1697
- onClick: () => {
1698
- this.sortByCol('jobId');
1699
- },
1700
- children: [values.textEntityName, " No.", this.renderSort('jobId')]
1701
- }), /*#__PURE__*/jsxs("th", {
1702
- className: "".concat(this.sortIsActive('title')),
1703
- style: {
1704
- cursor: 'pointer'
1705
- },
1706
- onClick: () => {
1707
- this.sortByCol('title');
1708
- },
1709
- children: ["Title", this.renderSort('title')]
1710
- }), /*#__PURE__*/jsxs("th", {
1711
- className: "".concat(this.sortIsActive('type')),
1712
- style: {
1713
- cursor: 'pointer',
1714
- width: 100
1715
- },
1716
- onClick: () => {
1717
- this.sortByCol('type');
1718
- },
1719
- children: [values.textJobType, this.renderSort('type')]
1720
- }), /*#__PURE__*/jsxs("th", {
1721
- className: "".concat(this.sortIsActive('createdUnix')),
1722
- style: {
1723
- cursor: 'pointer',
1724
- width: 80
1725
- },
1726
- onClick: () => {
1727
- this.sortByCol('createdUnix');
1728
- },
1729
- children: ["Date", this.renderSort('createdUnix')]
1730
- }), /*#__PURE__*/jsxs("th", {
1731
- className: "".concat(this.sortIsActive('room')),
1732
- style: {
1733
- cursor: 'pointer',
1734
- width: 100
1735
- },
1736
- onClick: () => {
1737
- this.sortByCol('room');
1738
- },
1739
- children: ["Address", this.renderSort('room')]
1740
- }), /*#__PURE__*/jsxs("th", {
1741
- className: "".concat(this.sortIsActive('userName')),
1742
- style: {
1743
- cursor: 'pointer',
1744
- width: 150
1745
- },
1746
- onClick: () => {
1747
- this.sortByCol('userName');
1748
- },
1749
- children: ["Submitted By", this.renderSort('userName')]
1750
- }), /*#__PURE__*/jsxs("th", {
1751
- className: "".concat(this.sortIsActive('assigned')),
1752
- style: {
1753
- cursor: 'pointer',
1754
- width: 150
1755
- },
1756
- onClick: () => {
1757
- this.sortByCol('assigned');
1758
- },
1759
- children: ["Assigned To", this.renderSort('assigned')]
1760
- }), /*#__PURE__*/jsx("th", {
1761
- style: {
1762
- width: 120
1763
- },
1764
- children: "Status"
1765
- }), /*#__PURE__*/jsx("th", {
1766
- style: {
1767
- width: 120
1768
- },
1769
- children: "Priority"
1770
- }), /*#__PURE__*/jsx("th", {
1771
- style: {
1772
- width: 50
1773
- }
1774
- })]
1775
- })
1776
- }), /*#__PURE__*/jsx("tbody", {
1777
- children: this.renderRequests()
1778
- })]
1779
- }), this.state.hasMore && /*#__PURE__*/jsx("div", {
1780
- style: {
1781
- display: 'flex',
1782
- justifyContent: 'center',
1783
- padding: '16px 0'
1784
- },
1785
- children: this.state.loadingMore ? /*#__PURE__*/jsx(FontAwesome, {
1786
- style: {
1787
- fontSize: 24,
1788
- color: '#ccc'
1789
- },
1790
- name: "spinner fa-pulse fa-fw"
1791
- }) : /*#__PURE__*/jsx(Components$7.Button, {
1792
- inline: true,
1793
- buttonType: "tertiary",
1794
- onClick: this.loadMore,
1795
- isActive: true,
1796
- children: "Load More"
1565
+ return /*#__PURE__*/jsxs(Table, {
1566
+ className: "plussTable",
1567
+ striped: true,
1568
+ bordered: true,
1569
+ condensed: true,
1570
+ hover: true,
1571
+ style: {
1572
+ minWidth: "100%"
1573
+ },
1574
+ children: [/*#__PURE__*/jsx("thead", {
1575
+ children: /*#__PURE__*/jsxs("tr", {
1576
+ children: [/*#__PURE__*/jsxs("th", {
1577
+ className: "".concat(this.sortIsActive("jobId")),
1578
+ style: {
1579
+ cursor: "pointer",
1580
+ width: 70
1581
+ },
1582
+ onClick: () => {
1583
+ this.sortByCol("jobId");
1584
+ },
1585
+ children: [values.textEntityName, " No.", this.renderSort("jobId")]
1586
+ }), /*#__PURE__*/jsxs("th", {
1587
+ className: "".concat(this.sortIsActive("title")),
1588
+ style: {
1589
+ cursor: "pointer"
1590
+ },
1591
+ onClick: () => {
1592
+ this.sortByCol("title");
1593
+ },
1594
+ children: ["Title", this.renderSort("title")]
1595
+ }), /*#__PURE__*/jsxs("th", {
1596
+ className: "".concat(this.sortIsActive("type")),
1597
+ style: {
1598
+ cursor: "pointer",
1599
+ width: 100
1600
+ },
1601
+ onClick: () => {
1602
+ this.sortByCol("type");
1603
+ },
1604
+ children: [values.textJobType, this.renderSort("type")]
1605
+ }), /*#__PURE__*/jsxs("th", {
1606
+ className: "".concat(this.sortIsActive("createdUnix")),
1607
+ style: {
1608
+ cursor: "pointer",
1609
+ width: 80
1610
+ },
1611
+ onClick: () => {
1612
+ this.sortByCol("createdUnix");
1613
+ },
1614
+ children: ["Date", this.renderSort("createdUnix")]
1615
+ }), /*#__PURE__*/jsxs("th", {
1616
+ className: "".concat(this.sortIsActive("room")),
1617
+ style: {
1618
+ cursor: "pointer",
1619
+ width: 100
1620
+ },
1621
+ onClick: () => {
1622
+ this.sortByCol("room");
1623
+ },
1624
+ children: ["Address", this.renderSort("room")]
1625
+ }), /*#__PURE__*/jsxs("th", {
1626
+ className: "".concat(this.sortIsActive("userName")),
1627
+ style: {
1628
+ cursor: "pointer",
1629
+ width: 150
1630
+ },
1631
+ onClick: () => {
1632
+ this.sortByCol("userName");
1633
+ },
1634
+ children: ["Submitted By", this.renderSort("userName")]
1635
+ }), /*#__PURE__*/jsxs("th", {
1636
+ className: "".concat(this.sortIsActive("assigned")),
1637
+ style: {
1638
+ cursor: "pointer",
1639
+ width: 150
1640
+ },
1641
+ onClick: () => {
1642
+ this.sortByCol("assigned");
1643
+ },
1644
+ children: ["Assigned To", this.renderSort("assigned")]
1645
+ }), /*#__PURE__*/jsx("th", {
1646
+ iconStyle: {
1647
+ width: 120
1648
+ },
1649
+ children: "Status"
1650
+ }), /*#__PURE__*/jsx("th", {
1651
+ iconStyle: {
1652
+ width: 120
1653
+ },
1654
+ children: "Priority"
1655
+ }), /*#__PURE__*/jsx("th", {
1656
+ iconStyle: {
1657
+ width: 50
1658
+ }
1659
+ })]
1797
1660
  })
1661
+ }), /*#__PURE__*/jsx("tbody", {
1662
+ children: this.renderRequests()
1798
1663
  })]
1799
1664
  });
1800
1665
  }
@@ -1802,42 +1667,42 @@ class JobList extends Component {
1802
1667
  var typeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1803
1668
  className: "marginRight-10",
1804
1669
  onClick: () => {
1805
- this.openFilter('type');
1670
+ this.openFilter("type");
1806
1671
  },
1807
1672
  text: values.textJobType
1808
1673
  });
1809
1674
  var statusFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1810
1675
  className: "marginRight-10",
1811
1676
  onClick: () => {
1812
- this.openFilter('status');
1677
+ this.openFilter("status");
1813
1678
  },
1814
1679
  text: "Status"
1815
1680
  });
1816
1681
  var priorityFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1817
1682
  className: "marginRight-10",
1818
1683
  onClick: () => {
1819
- this.openFilter('priority');
1684
+ this.openFilter("priority");
1820
1685
  },
1821
1686
  text: "Priority"
1822
1687
  });
1823
1688
  var timeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1824
1689
  className: "marginRight-10",
1825
1690
  onClick: () => {
1826
- this.openFilter('time');
1691
+ this.openFilter("time");
1827
1692
  },
1828
1693
  text: "Time"
1829
1694
  });
1830
1695
  var userFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1831
1696
  className: "marginRight-10",
1832
1697
  onClick: () => {
1833
- this.openFilter('user');
1698
+ this.openFilter("user");
1834
1699
  },
1835
1700
  text: "Assigned To"
1836
1701
  });
1837
1702
  var requesterFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1838
1703
  className: "marginRight-10",
1839
1704
  onClick: () => {
1840
- this.openFilter('requester');
1705
+ this.openFilter("requester");
1841
1706
  },
1842
1707
  text: "Submitted By"
1843
1708
  });
@@ -1845,7 +1710,7 @@ class JobList extends Component {
1845
1710
  typeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1846
1711
  className: "marginRight-10",
1847
1712
  onClick: () => {
1848
- this.openFilter('type');
1713
+ this.openFilter("type");
1849
1714
  },
1850
1715
  rightIcon: "close",
1851
1716
  rightClick: e => {
@@ -1859,7 +1724,7 @@ class JobList extends Component {
1859
1724
  priorityFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1860
1725
  className: "marginRight-10",
1861
1726
  onClick: () => {
1862
- this.openFilter('priority');
1727
+ this.openFilter("priority");
1863
1728
  },
1864
1729
  rightIcon: "close",
1865
1730
  rightClick: e => {
@@ -1873,7 +1738,7 @@ class JobList extends Component {
1873
1738
  statusFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1874
1739
  className: "marginRight-10",
1875
1740
  onClick: () => {
1876
- this.openFilter('status');
1741
+ this.openFilter("status");
1877
1742
  },
1878
1743
  rightIcon: "close",
1879
1744
  rightClick: e => {
@@ -1887,7 +1752,7 @@ class JobList extends Component {
1887
1752
  timeFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1888
1753
  className: "marginRight-10",
1889
1754
  onClick: () => {
1890
- this.openFilter('time');
1755
+ this.openFilter("time");
1891
1756
  },
1892
1757
  rightIcon: "close",
1893
1758
  rightClick: e => {
@@ -1901,7 +1766,7 @@ class JobList extends Component {
1901
1766
  userFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1902
1767
  className: "marginRight-10",
1903
1768
  onClick: () => {
1904
- this.openFilter('user');
1769
+ this.openFilter("user");
1905
1770
  },
1906
1771
  rightIcon: "close",
1907
1772
  rightClick: e => {
@@ -1915,7 +1780,7 @@ class JobList extends Component {
1915
1780
  requesterFilter = /*#__PURE__*/jsx(Components$7.Tag, {
1916
1781
  className: "marginRight-10",
1917
1782
  onClick: () => {
1918
- this.openFilter('requester');
1783
+ this.openFilter("requester");
1919
1784
  },
1920
1785
  rightIcon: "close",
1921
1786
  rightClick: e => {
@@ -1938,7 +1803,7 @@ class JobList extends Component {
1938
1803
  }), /*#__PURE__*/jsx(Components$7.Button, {
1939
1804
  inline: true,
1940
1805
  buttonType: "primaryAction",
1941
- leftIcon: "file-code-o",
1806
+ leftIcon: "file-code",
1942
1807
  onClick: this.onOpenExportCsv,
1943
1808
  isActive: !_.isEmpty(this.getSource()),
1944
1809
  children: "Export CSV"
@@ -1973,8 +1838,8 @@ class JobList extends Component {
1973
1838
  }
1974
1839
  render() {
1975
1840
  return /*#__PURE__*/jsxs("div", {
1976
- style: {
1977
- minWidth: '100%'
1841
+ iconStyle: {
1842
+ minWidth: "100%"
1978
1843
  },
1979
1844
  children: [this.renderFilterPopup(), this.renderCSVPopup(), this.renderFilters(), this.renderContent()]
1980
1845
  });
@@ -1993,7 +1858,6 @@ var mapStateToProps$7 = state => {
1993
1858
  };
1994
1859
  var JobList$1 = connect(mapStateToProps$7, {
1995
1860
  jobsLoaded,
1996
- jobsAdded,
1997
1861
  removeJob,
1998
1862
  jobStatusesUpdate
1999
1863
  })(withRouter(JobList));
@@ -2012,7 +1876,7 @@ class JobTypes extends Component {
2012
1876
  var res = yield maintenanceActions.getJobTypes(_this.props.auth.site);
2013
1877
  if (res.data != null) _this.props.jobTypesLoaded(res.data);
2014
1878
  } catch (error) {
2015
- console.error('getJobTypes', error);
1879
+ console.error("getJobTypes", error);
2016
1880
  } finally {
2017
1881
  _this.setState({
2018
1882
  loading: false
@@ -2045,8 +1909,8 @@ class JobTypes extends Component {
2045
1909
  _this.props.jobTypesLoaded(newJobTypes);
2046
1910
  }
2047
1911
  } catch (error) {
2048
- console.error('onRemoveJobType', error);
2049
- alert('Something went wrong with the request. Please try again.');
1912
+ console.error("onRemoveJobType", error);
1913
+ alert("Something went wrong with the request. Please try again.");
2050
1914
  }
2051
1915
  });
2052
1916
  return function (_x) {
@@ -2055,7 +1919,7 @@ class JobTypes extends Component {
2055
1919
  }());
2056
1920
  this.state = {
2057
1921
  jobList: [],
2058
- sortColumn: 'name',
1922
+ sortColumn: "name",
2059
1923
  sortDesc: false,
2060
1924
  loading: true
2061
1925
  };
@@ -2099,31 +1963,31 @@ class JobTypes extends Component {
2099
1963
  }), /*#__PURE__*/jsx("td", {
2100
1964
  className: "table-options",
2101
1965
  children: /*#__PURE__*/jsxs("div", {
2102
- style: {
2103
- display: 'flex',
2104
- alignItems: 'center'
1966
+ iconStyle: {
1967
+ display: "flex",
1968
+ alignItems: "center"
2105
1969
  },
2106
1970
  children: [Session$6.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && /*#__PURE__*/jsx(Link, {
2107
1971
  to: "".concat(values.routeAddRequestType, "/").concat(ev.id),
2108
- children: /*#__PURE__*/jsx(FontAwesome, {
1972
+ children: /*#__PURE__*/jsx(Icon, {
2109
1973
  style: {
2110
1974
  fontSize: 20,
2111
1975
  padding: 5,
2112
1976
  marginLeft: 12,
2113
- cursor: 'pointer'
1977
+ cursor: "pointer"
2114
1978
  },
2115
- name: "pencil"
1979
+ icon: "pencil"
2116
1980
  })
2117
1981
  }), Session$6.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth) && /*#__PURE__*/jsx("a", {
2118
1982
  onClick: () => this.onRemoveJobType(ev),
2119
- children: /*#__PURE__*/jsx(FontAwesome, {
1983
+ children: /*#__PURE__*/jsx(Icon, {
2120
1984
  style: {
2121
1985
  fontSize: 20,
2122
1986
  padding: 5,
2123
1987
  marginLeft: 8,
2124
- cursor: 'pointer'
1988
+ cursor: "pointer"
2125
1989
  },
2126
- name: "minus-circle"
1990
+ icon: "circle-minus"
2127
1991
  })
2128
1992
  })]
2129
1993
  })
@@ -2141,30 +2005,30 @@ class JobTypes extends Component {
2141
2005
  condensed: true,
2142
2006
  hover: true,
2143
2007
  style: {
2144
- minWidth: '100%'
2008
+ minWidth: "100%"
2145
2009
  },
2146
2010
  children: [/*#__PURE__*/jsx("thead", {
2147
2011
  children: /*#__PURE__*/jsxs("tr", {
2148
2012
  children: [/*#__PURE__*/jsxs("th", {
2149
2013
  style: {
2150
- cursor: 'pointer'
2014
+ cursor: "pointer"
2151
2015
  },
2152
- onClick: () => this.sortByCol('name'),
2016
+ onClick: () => this.sortByCol("name"),
2153
2017
  children: [values.textSingularName, " type"]
2154
2018
  }), /*#__PURE__*/jsx("th", {
2155
2019
  style: {
2156
- cursor: 'pointer'
2020
+ cursor: "pointer"
2157
2021
  },
2158
- onClick: () => this.sortByCol('name'),
2022
+ onClick: () => this.sortByCol("name"),
2159
2023
  children: "Type Description"
2160
2024
  }), /*#__PURE__*/jsx("th", {
2161
2025
  style: {
2162
- cursor: 'pointer'
2026
+ cursor: "pointer"
2163
2027
  },
2164
- onClick: () => this.sortByCol('email'),
2028
+ onClick: () => this.sortByCol("email"),
2165
2029
  children: "Email"
2166
2030
  }), /*#__PURE__*/jsx("th", {
2167
- style: {
2031
+ iconStyle: {
2168
2032
  width: 70
2169
2033
  }
2170
2034
  })]
@@ -2177,11 +2041,11 @@ class JobTypes extends Component {
2177
2041
  renderEmpty() {
2178
2042
  return /*#__PURE__*/jsxs("div", {
2179
2043
  style: {
2180
- display: 'flex',
2181
- flexDirection: 'column',
2044
+ display: "flex",
2045
+ flexDirection: "column",
2182
2046
  flex: 1,
2183
- justifyContent: 'center',
2184
- alignItems: 'center',
2047
+ justifyContent: "center",
2048
+ alignItems: "center",
2185
2049
  marginTop: 32
2186
2050
  },
2187
2051
  children: [/*#__PURE__*/jsx("div", {
@@ -2190,7 +2054,7 @@ class JobTypes extends Component {
2190
2054
  className: "marginTop-32",
2191
2055
  style: {
2192
2056
  maxWidth: 500,
2193
- textAlign: 'center'
2057
+ textAlign: "center"
2194
2058
  },
2195
2059
  children: /*#__PURE__*/jsx("span", {
2196
2060
  className: "fontRegular fontSize-13",
@@ -2200,7 +2064,7 @@ class JobTypes extends Component {
2200
2064
  className: "marginTop-8 fontRegular fontSize-13",
2201
2065
  style: {
2202
2066
  maxWidth: 500,
2203
- textAlign: 'center'
2067
+ textAlign: "center"
2204
2068
  },
2205
2069
  children: values.textEmptyJobTypesExample
2206
2070
  })]
@@ -2217,27 +2081,29 @@ class JobTypes extends Component {
2217
2081
  } = this.state;
2218
2082
  if (jobList.length === 0 && loading) {
2219
2083
  return /*#__PURE__*/jsx("div", {
2220
- style: {
2221
- minWidth: '100%'
2084
+ iconStyle: {
2085
+ minWidth: "100%"
2222
2086
  },
2223
2087
  children: /*#__PURE__*/jsx("div", {
2224
2088
  className: "padding-60 paddingVertical-40",
2225
2089
  style: {
2226
- textAlign: 'center'
2090
+ textAlign: "center"
2227
2091
  },
2228
- children: /*#__PURE__*/jsx(FontAwesome, {
2229
- style: {
2092
+ children: /*#__PURE__*/jsx(Icon, {
2093
+ iconStyle: {
2230
2094
  fontSize: 30,
2231
2095
  color: FeatureConfig.env.colourBrandingOff
2232
2096
  },
2233
- name: "spinner fa-pulse fa-fw"
2097
+ icon: "spinner",
2098
+ pulse: true,
2099
+ fixedWidth: true
2234
2100
  })
2235
2101
  })
2236
2102
  });
2237
2103
  }
2238
2104
  return /*#__PURE__*/jsxs("div", {
2239
- style: {
2240
- minWidth: '100%'
2105
+ iconStyle: {
2106
+ minWidth: "100%"
2241
2107
  },
2242
2108
  children: [/*#__PURE__*/jsx("div", {
2243
2109
  className: "marginBottom-32",
@@ -2250,8 +2116,8 @@ class JobTypes extends Component {
2250
2116
  }
2251
2117
  render() {
2252
2118
  return /*#__PURE__*/jsxs("div", {
2253
- style: {
2254
- minWidth: '100%'
2119
+ iconStyle: {
2120
+ minWidth: "100%"
2255
2121
  },
2256
2122
  children: [/*#__PURE__*/jsx("div", {
2257
2123
  children: this.renderJobTypes()
@@ -2275,12 +2141,12 @@ var JobTypes$1 = connect(mapStateToProps$6, {
2275
2141
  jobTypesUpdate
2276
2142
  })(withRouter(JobTypes));
2277
2143
 
2278
- function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2279
- function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2144
+ function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2145
+ function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2280
2146
  var {
2281
2147
  Session: Session$5,
2282
2148
  Components: Components$5,
2283
- Colours: Colours$2
2149
+ Colours: Colours$3
2284
2150
  } = PlussCore;
2285
2151
  class Configuration extends Component {
2286
2152
  constructor(props) {
@@ -2336,7 +2202,7 @@ class Configuration extends Component {
2336
2202
  showWarnings: false,
2337
2203
  showStatusPopup: true,
2338
2204
  selectedStatusIndex: -1,
2339
- statusLabel: '',
2205
+ statusLabel: "",
2340
2206
  statusCategory: STATUS_NOT_ACTIONED,
2341
2207
  statusColour: defaultStatus.color
2342
2208
  });
@@ -2375,7 +2241,7 @@ class Configuration extends Component {
2375
2241
  });
2376
2242
  _defineProperty(this, "onHandleChange", event => {
2377
2243
  var stateChange = {};
2378
- stateChange[event.target.getAttribute('id')] = event.target.value;
2244
+ stateChange[event.target.getAttribute("id")] = event.target.value;
2379
2245
  this.setState(stateChange);
2380
2246
  });
2381
2247
  _defineProperty(this, "onToggleDisableSeen", () => {
@@ -2403,7 +2269,7 @@ class Configuration extends Component {
2403
2269
  success: true
2404
2270
  });
2405
2271
  } catch (error) {
2406
- console.log('onSaveConfig - error', error);
2272
+ console.log("onSaveConfig - error", error);
2407
2273
  _this.setState({
2408
2274
  success: false
2409
2275
  });
@@ -2419,9 +2285,9 @@ class Configuration extends Component {
2419
2285
  submitting: false,
2420
2286
  selectedStatusIndex: -1,
2421
2287
  showStatusPopup: false,
2422
- statusLabel: '',
2288
+ statusLabel: "",
2423
2289
  statusCategory: STATUS_NOT_ACTIONED,
2424
- statusColour: '',
2290
+ statusColour: "",
2425
2291
  fetchingStatusTypes: true,
2426
2292
  statusTypes: this.props.statusTypes,
2427
2293
  fetchingHideSeen: true,
@@ -2432,8 +2298,8 @@ class Configuration extends Component {
2432
2298
  Session$5.checkLoggedIn(this);
2433
2299
  }
2434
2300
  componentDidMount() {
2435
- if (!Session$5.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth, true)) {
2436
- this.props.history.push('/mastermenu');
2301
+ if (!Session$5.validateAccess(this.props.auth.site, "featurePicker", this.props.auth, true)) {
2302
+ this.props.history.push("/mastermenu");
2437
2303
  } else {
2438
2304
  this.props.jobStatusesUpdate(this.props.auth.site, statusTypes => this.setState({
2439
2305
  statusTypes,
@@ -2483,7 +2349,7 @@ class Configuration extends Component {
2483
2349
  style: styles$6.statusTypeContainer,
2484
2350
  children: [/*#__PURE__*/jsx("div", {
2485
2351
  className: "statusLabel",
2486
- style: _objectSpread$5(_objectSpread$5({}, styles$6.statusTextContainer), {}, {
2352
+ style: _objectSpread$6(_objectSpread$6({}, styles$6.statusTextContainer), {}, {
2487
2353
  backgroundColor: status.color
2488
2354
  }),
2489
2355
  children: /*#__PURE__*/jsx("span", {
@@ -2496,39 +2362,39 @@ class Configuration extends Component {
2496
2362
  className: "fontMedium fontSize-16 text-dark",
2497
2363
  children: status.category
2498
2364
  })
2499
- }), /*#__PURE__*/jsx(FontAwesome, {
2500
- style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
2501
- visibility: index === 0 ? 'hidden' : 'visible'
2365
+ }), /*#__PURE__*/jsx(Icon, {
2366
+ style: _objectSpread$6(_objectSpread$6({}, styles$6.statusIcon), {}, {
2367
+ visibility: index === 0 ? "hidden" : "visible"
2502
2368
  }),
2503
- name: 'arrow-up',
2369
+ name: "arrow-up",
2504
2370
  onClick: () => this.onMoveStatus(index, true)
2505
- }), /*#__PURE__*/jsx(FontAwesome, {
2506
- style: _objectSpread$5(_objectSpread$5({}, styles$6.statusIcon), {}, {
2507
- visibility: index === statusTypes.length - 1 ? 'hidden' : 'visible'
2371
+ }), /*#__PURE__*/jsx(Icon, {
2372
+ style: _objectSpread$6(_objectSpread$6({}, styles$6.statusIcon), {}, {
2373
+ visibility: index === statusTypes.length - 1 ? "hidden" : "visible"
2508
2374
  }),
2509
- name: 'arrow-down',
2375
+ name: "arrow-down",
2510
2376
  onClick: () => this.onMoveStatus(index, false)
2511
- }), /*#__PURE__*/jsx(FontAwesome, {
2512
- style: _objectSpread$5({}, styles$6.statusIcon),
2513
- name: "pencil",
2377
+ }), /*#__PURE__*/jsx(Icon, {
2378
+ style: _objectSpread$6({}, styles$6.statusIcon),
2379
+ icon: "pencil",
2514
2380
  onClick: () => this.onEditStatus(index)
2515
- }), /*#__PURE__*/jsx(FontAwesome, {
2516
- style: _objectSpread$5({}, styles$6.statusIcon),
2517
- name: "minus-circle",
2381
+ }), /*#__PURE__*/jsx(Icon, {
2382
+ style: _objectSpread$6({}, styles$6.statusIcon),
2383
+ icon: "circle-minus",
2518
2384
  onClick: () => this.onDeleteStatus(index)
2519
2385
  })]
2520
2386
  }, "".concat(status.text, "_").concat(index));
2521
2387
  }), /*#__PURE__*/jsxs("div", {
2522
2388
  onClick: this.onAddStatus,
2523
2389
  style: {
2524
- display: 'flex',
2525
- flexDirection: 'row',
2526
- alignItems: 'center',
2390
+ display: "flex",
2391
+ flexDirection: "row",
2392
+ alignItems: "center",
2527
2393
  marginTop: 16
2528
2394
  },
2529
- children: [/*#__PURE__*/jsx(Components$5.P60Icon, {
2395
+ children: [/*#__PURE__*/jsx(Icon, {
2530
2396
  className: "addoption_plus",
2531
- icon: "add",
2397
+ icon: "plus",
2532
2398
  style: {
2533
2399
  fontSize: 12
2534
2400
  }
@@ -2570,8 +2436,8 @@ class Configuration extends Component {
2570
2436
  renderSuccess() {
2571
2437
  if (!this.state.success) return null;
2572
2438
  return /*#__PURE__*/jsx("span", {
2573
- style: _objectSpread$5(_objectSpread$5({}, styles$6.savedText), {}, {
2574
- color: Colours$2.COLOUR_GREEN
2439
+ iconStyle: _objectSpread$6(_objectSpread$6({}, styles$6.savedText), {}, {
2440
+ color: Colours$3.COLOUR_GREEN
2575
2441
  }),
2576
2442
  children: "Saved"
2577
2443
  });
@@ -2593,21 +2459,21 @@ class Configuration extends Component {
2593
2459
  minWidth: 450,
2594
2460
  hasPadding: true,
2595
2461
  buttons: [{
2596
- type: 'primaryAction',
2462
+ type: "primaryAction",
2597
2463
  onClick: this.onSaveStatus,
2598
2464
  isActive: canSave,
2599
2465
  isActive: true,
2600
- text: submitting ? 'Saving...' : 'Save',
2601
- className: 'popupButton'
2466
+ text: submitting ? "Saving..." : "Save",
2467
+ className: "popupButton"
2602
2468
  }, {
2603
- type: 'outlinedAction',
2469
+ type: "outlinedAction",
2604
2470
  onClick: this.onHideStatusPopup,
2605
2471
  isActive: !submitting,
2606
- text: 'Cancel',
2607
- className: 'popupButton'
2472
+ text: "Cancel",
2473
+ className: "popupButton"
2608
2474
  }],
2609
2475
  onClose: this.onHideStatusPopup,
2610
- title: selectedStatusIndex < 0 ? 'New Status' : 'Edit Status',
2476
+ title: selectedStatusIndex < 0 ? "New Status" : "Edit Status",
2611
2477
  children: [/*#__PURE__*/jsx(Components$5.GenericInput, {
2612
2478
  id: "statusLabel",
2613
2479
  type: "text",
@@ -2626,15 +2492,15 @@ class Configuration extends Component {
2626
2492
  className: "marginBottom-16",
2627
2493
  children: [/*#__PURE__*/jsx("div", {
2628
2494
  className: "marginBottom-4",
2629
- children: 'This is used to categorise statuses for filtering and analytics purposes'
2495
+ children: "This is used to categorise statuses for filtering and analytics purposes"
2630
2496
  }), /*#__PURE__*/jsx("div", {
2631
2497
  className: "text-bold",
2632
- children: 'This status is considered'
2498
+ children: "This status is considered"
2633
2499
  })]
2634
2500
  }),
2635
2501
  className: "marginBottom-20",
2636
2502
  rowStyle: {
2637
- flexDirection: 'column'
2503
+ flexDirection: "column"
2638
2504
  },
2639
2505
  buttonStyle: {
2640
2506
  marginBottom: 8
@@ -2660,7 +2526,7 @@ class Configuration extends Component {
2660
2526
  })
2661
2527
  }]
2662
2528
  }), /*#__PURE__*/jsx(Components$5.ColourOptions, {
2663
- options: ['vibrant', 'picker'],
2529
+ options: ["vibrant", "picker"],
2664
2530
  defaultTab: "vibrant",
2665
2531
  value: statusColour,
2666
2532
  onColourSelected: statusColour => this.setState({
@@ -2683,11 +2549,11 @@ class Configuration extends Component {
2683
2549
  }
2684
2550
  render() {
2685
2551
  return /*#__PURE__*/jsxs("div", {
2686
- style: {
2687
- minWidth: '100%'
2552
+ iconStyle: {
2553
+ minWidth: "100%"
2688
2554
  },
2689
2555
  children: [this.renderStatuses(), this.renderOtherOptions(), /*#__PURE__*/jsxs("div", {
2690
- style: {
2556
+ iconStyle: {
2691
2557
  paddingTop: 24,
2692
2558
  paddingBottom: 24
2693
2559
  },
@@ -2700,13 +2566,13 @@ var styles$6 = {
2700
2566
  statusCategoryHeading: {
2701
2567
  marginLeft: 130,
2702
2568
  width: 160,
2703
- textAlign: 'center',
2569
+ textAlign: "center",
2704
2570
  marginBottom: 12
2705
2571
  },
2706
2572
  statusTypeContainer: {
2707
- display: 'flex',
2708
- flexDirection: 'row',
2709
- alignItems: 'center',
2573
+ display: "flex",
2574
+ flexDirection: "row",
2575
+ alignItems: "center",
2710
2576
  marginBottom: 20
2711
2577
  },
2712
2578
  statusTextContainer: {
@@ -2714,19 +2580,19 @@ var styles$6 = {
2714
2580
  },
2715
2581
  statusCategoryContainer: {
2716
2582
  width: 160,
2717
- textAlign: 'center'
2583
+ textAlign: "center"
2718
2584
  },
2719
2585
  statusIcon: {
2720
- cursor: 'pointer',
2586
+ cursor: "pointer",
2721
2587
  fontSize: 20,
2722
2588
  padding: 5,
2723
2589
  marginLeft: 10,
2724
- color: Colours$2.COLOUR_BRANDING_ACTION,
2725
- visibility: 'visible'
2590
+ color: Colours$3.COLOUR_BRANDING_ACTION,
2591
+ visibility: "visible"
2726
2592
  },
2727
2593
  savedText: {
2728
2594
  fontSize: 14,
2729
- lineHeight: '33px',
2595
+ lineHeight: "33px",
2730
2596
  marginLeft: 15
2731
2597
  }
2732
2598
  };
@@ -2754,7 +2620,55 @@ var {
2754
2620
  } = PlussCore;
2755
2621
  class RequestsHub extends Component {
2756
2622
  constructor(props) {
2623
+ var _this;
2757
2624
  super(props);
2625
+ _this = this;
2626
+ _defineProperty(this, "setData", () => {
2627
+ var allList = [];
2628
+ this.state.allList.forEach(ev => {
2629
+ if (ev != null && !ev.Deleted) allList.push(ev);
2630
+ });
2631
+ var upcoming = _.filter(allList, ev => {
2632
+ if (!ev) return false;
2633
+ if (ev.status && ev.status === "Completed") return false;
2634
+ return true;
2635
+ });
2636
+ var completed = _.filter(allList, ev => {
2637
+ if (!ev) return false;
2638
+ if (ev.status && ev.status === "Completed") return true;
2639
+ return false;
2640
+ });
2641
+
2642
+ // console.log('setData', upcoming, completed);
2643
+ this.setState({
2644
+ allList,
2645
+ upcoming,
2646
+ completed
2647
+ });
2648
+ });
2649
+ _defineProperty(this, "getData", () => {
2650
+ var {
2651
+ auth
2652
+ } = this.props;
2653
+ this.setState({
2654
+ loadingAll: true
2655
+ }, /*#__PURE__*/_asyncToGenerator(function* () {
2656
+ try {
2657
+ var res = yield maintenanceActions.getJobsRecursive(auth.site);
2658
+ _this.setState({
2659
+ loadingAll: false
2660
+ });
2661
+ if (!_.isEmpty(res) && res[0].site === auth.site) {
2662
+ _this.props.jobsLoaded(res);
2663
+ }
2664
+ } catch (error) {
2665
+ console.error("getData", error);
2666
+ _this.setState({
2667
+ loadingAll: false
2668
+ });
2669
+ }
2670
+ }));
2671
+ });
2758
2672
  _defineProperty(this, "onAddNew", () => {
2759
2673
  var {
2760
2674
  auth
@@ -2775,74 +2689,91 @@ class RequestsHub extends Component {
2775
2689
  var {
2776
2690
  auth
2777
2691
  } = this.props;
2778
- if (Session$4.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return isClass ? '' : true;
2779
- return isClass ? ' hub-sideContent-topButton--hide' : false;
2692
+ if (Session$4.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return isClass ? "" : true;
2693
+ return isClass ? " hub-sideContent-topButton--hide" : false;
2780
2694
  });
2781
2695
  _defineProperty(this, "getSideBarSectionColour", id => this.state.selectedSection === id ? {
2782
- backgroundColor: '#fff'
2696
+ backgroundColor: "#fff"
2783
2697
  } : {});
2784
- _defineProperty(this, "renderStats", (stat, loading) => loading ? /*#__PURE__*/jsx(FontAwesome, {
2698
+ _defineProperty(this, "renderStats", (stat, loading) => loading ? /*#__PURE__*/jsx(Icon, {
2785
2699
  style: styles$5.spinner,
2786
- name: "spinner fa-pulse fa-fw"
2700
+ icon: "spinner",
2701
+ pulse: true,
2702
+ fixedWidth: true
2787
2703
  }) : stat);
2788
2704
  this.state = {
2789
- selectedSection: 'all',
2790
- location: '',
2705
+ selectedSection: "all",
2706
+ location: "",
2707
+ loadingAll: false,
2791
2708
  loadingSubmissions: false,
2792
2709
  submissionEntries: [],
2710
+ allList: [],
2711
+ completed: [],
2712
+ upcoming: [],
2793
2713
  now: moment.utc(),
2794
2714
  onlyFuture: true,
2795
- search: ''
2715
+ search: ""
2796
2716
  };
2797
2717
  }
2718
+ UNSAFE_componentWillMount() {
2719
+ this.updateProps(this.props);
2720
+ }
2798
2721
  componentDidMount() {
2799
- // Data fetching is now handled by JobList component with pagination
2722
+ this.getData();
2723
+ }
2724
+ UNSAFE_componentWillReceiveProps(nextProps) {
2725
+ if (!_.isEqual(this.props.jobs, nextProps.jobs)) this.updateProps(nextProps);
2726
+ }
2727
+ updateProps(props) {
2728
+ this.setState({
2729
+ allList: props.jobs
2730
+ }, this.setData);
2800
2731
  }
2801
2732
  renderLeftBar() {
2802
2733
  var sectionItems = [];
2803
2734
  if (this.canAddNew()) {
2804
2735
  sectionItems.push({
2805
- type: 'newButton',
2736
+ type: "newButton",
2806
2737
  text: "New ".concat(values.textSingularName),
2807
2738
  onClick: this.onAddNew
2808
2739
  });
2809
2740
  }
2810
2741
  sectionItems.push({
2811
- type: 'navItem',
2742
+ type: "navItem",
2812
2743
  text: "View ".concat(values.textSingularName, "s"),
2813
- icon: 'eye',
2744
+ icon: "eye",
2814
2745
  isFontAwesome: true,
2815
- selected: this.state.selectedSection === 'all',
2746
+ selected: this.state.selectedSection === "all",
2816
2747
  onClick: () => {
2817
2748
  this.setState({
2818
- selectedSection: 'all'
2749
+ selectedSection: "all"
2819
2750
  });
2820
2751
  }
2821
2752
  });
2822
2753
  if (Session$4.validateAccess(this.props.auth.site, values.permissionMaintenanceTypes, this.props.auth)) {
2823
2754
  sectionItems.push({
2824
- type: 'navItem',
2755
+ type: "navItem",
2825
2756
  text: values.textTitleJobTypes,
2826
2757
  // icon: 'maintenance2',
2827
2758
  // isSVG: true,
2828
- selected: this.state.selectedSection === 'requestTypes',
2759
+ selected: this.state.selectedSection === "requestTypes",
2829
2760
  onClick: () => {
2830
2761
  this.setState({
2831
- selectedSection: 'requestTypes'
2762
+ selectedSection: "requestTypes"
2832
2763
  });
2833
2764
  }
2834
2765
  });
2835
2766
  }
2836
- if (Session$4.validateAccess(this.props.auth.site, 'featurePicker', this.props.auth)) {
2767
+ if (Session$4.validateAccess(this.props.auth.site, "featurePicker", this.props.auth)) {
2837
2768
  sectionItems.push({
2838
- type: 'navItem',
2839
- text: 'Feature Configuration',
2840
- icon: 'settings',
2769
+ type: "navItem",
2770
+ text: "Feature Configuration",
2771
+ icon: "settings",
2841
2772
  isFontAwesome: false,
2842
- selected: this.state.selectedSection === 'config',
2773
+ selected: this.state.selectedSection === "config",
2843
2774
  onClick: () => {
2844
2775
  this.setState({
2845
- selectedSection: 'config'
2776
+ selectedSection: "config"
2846
2777
  });
2847
2778
  }
2848
2779
  });
@@ -2860,14 +2791,16 @@ class RequestsHub extends Component {
2860
2791
  });
2861
2792
  }
2862
2793
  renderRight() {
2863
- if (this.state.selectedSection === 'requestTypes') {
2794
+ if (this.state.selectedSection === "requestTypes") {
2864
2795
  return /*#__PURE__*/jsx(JobTypes$1, {
2865
2796
  onNew: this.onAddRequestType
2866
2797
  });
2867
- } else if (this.state.selectedSection === 'config') {
2798
+ } else if (this.state.selectedSection === "config") {
2868
2799
  return /*#__PURE__*/jsx(Configuration$1, {});
2869
2800
  }
2870
- return /*#__PURE__*/jsx(JobList$1, {});
2801
+ return /*#__PURE__*/jsx(JobList$1, {
2802
+ source: this.state.allList
2803
+ });
2871
2804
  }
2872
2805
  render() {
2873
2806
  return /*#__PURE__*/jsxs("div", {
@@ -2884,21 +2817,21 @@ class RequestsHub extends Component {
2884
2817
  }
2885
2818
  var styles$5 = {
2886
2819
  sideBarTitleSection: {
2887
- lineHeight: '40px',
2820
+ lineHeight: "40px",
2888
2821
  marginTop: 30,
2889
2822
  marginBottom: 30,
2890
2823
  paddingLeft: 24,
2891
2824
  paddingRight: 24
2892
2825
  },
2893
2826
  sideBarSection: {
2894
- weight: '100%',
2827
+ weight: "100%",
2895
2828
  minWidth: 200,
2896
2829
  padding: 32,
2897
2830
  paddingLeft: 24,
2898
- cursor: 'pointer',
2899
- display: 'flex',
2900
- flexDirection: 'column',
2901
- justifyContent: 'center'
2831
+ cursor: "pointer",
2832
+ display: "flex",
2833
+ flexDirection: "column",
2834
+ justifyContent: "center"
2902
2835
  },
2903
2836
  spinner: {
2904
2837
  fontSize: 32,
@@ -2910,19 +2843,22 @@ var mapStateToProps$4 = state => {
2910
2843
  auth
2911
2844
  } = state;
2912
2845
  return {
2846
+ jobs: state[values.reducerKey].jobs,
2913
2847
  auth,
2914
2848
  strings: state.strings && state.strings.config || {}
2915
2849
  };
2916
2850
  };
2917
- var RequestsHub$1 = connect(mapStateToProps$4, {})(withRouter(RequestsHub));
2851
+ var RequestsHub$1 = connect(mapStateToProps$4, {
2852
+ jobsLoaded
2853
+ })(withRouter(RequestsHub));
2918
2854
 
2919
- function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2920
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2855
+ function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2856
+ function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2921
2857
  var {
2922
2858
  Apis: Apis$1,
2923
- Helper: Helper$2,
2859
+ Helper: Helper$3,
2924
2860
  Session: Session$3,
2925
- Colours: Colours$1,
2861
+ Colours: Colours$2,
2926
2862
  Components: Components$3
2927
2863
  } = PlussCore;
2928
2864
  var IMAGE_SIZE_NOTE = 72;
@@ -3006,7 +2942,7 @@ class Job extends Component {
3006
2942
  var statusType = statusTypes.find(s => s.text === status);
3007
2943
  if (!statusType) {
3008
2944
  var defaultStatus = statusTypes.find(s => s.category === STATUS_NOT_ACTIONED);
3009
- statusType = _objectSpread$4(_objectSpread$4({}, defaultStatus), {}, {
2945
+ statusType = _objectSpread$5(_objectSpread$5({}, defaultStatus), {}, {
3010
2946
  text: status
3011
2947
  });
3012
2948
  }
@@ -3201,7 +3137,7 @@ class Job extends Component {
3201
3137
  }
3202
3138
  maintenanceActions.deleteNote(this.state.jobId, n.Id);
3203
3139
  var newNotes = _.filter(this.state.job.Notes, note => note.Id !== n.Id);
3204
- var newJob = _objectSpread$4({}, this.state.job);
3140
+ var newJob = _objectSpread$5({}, this.state.job);
3205
3141
  newJob.Notes = newNotes;
3206
3142
  this.setState({
3207
3143
  job: newJob,
@@ -3286,7 +3222,7 @@ class Job extends Component {
3286
3222
  _defineProperty(this, "onSelectPriority", /*#__PURE__*/function () {
3287
3223
  var _ref0 = _asyncToGenerator(function* (priority) {
3288
3224
  _this.setState({
3289
- job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
3225
+ job: _objectSpread$5(_objectSpread$5({}, _this.state.job), {}, {
3290
3226
  priority
3291
3227
  }),
3292
3228
  priorityChangerOpen: false
@@ -3316,7 +3252,7 @@ class Job extends Component {
3316
3252
  _defineProperty(this, "onSelectStatus", /*#__PURE__*/function () {
3317
3253
  var _ref1 = _asyncToGenerator(function* (status) {
3318
3254
  _this.setState({
3319
- job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
3255
+ job: _objectSpread$5(_objectSpread$5({}, _this.state.job), {}, {
3320
3256
  status: status
3321
3257
  }),
3322
3258
  statusChangerOpen: false
@@ -3339,7 +3275,7 @@ class Job extends Component {
3339
3275
  };
3340
3276
  }());
3341
3277
  this.state = {
3342
- jobId: Helper$2.safeReadParams(props, "jobId") ? props.match.params.jobId : null,
3278
+ jobId: Helper$3.safeReadParams(props, "jobId") ? props.match.params.jobId : null,
3343
3279
  job: null,
3344
3280
  showingSelector: false,
3345
3281
  updating: false,
@@ -3531,9 +3467,9 @@ class Job extends Component {
3531
3467
  children: [/*#__PURE__*/jsx("div", {
3532
3468
  className: "commentReply_button".concat(!_.isEmpty(this.state.commentInput) ? " commentReply_button-active" : ""),
3533
3469
  onClick: this.onAddComment,
3534
- children: /*#__PURE__*/jsx(FontAwesome, {
3470
+ children: /*#__PURE__*/jsx(Icon, {
3535
3471
  className: "commentReply_icon",
3536
- name: "paper-plane-o"
3472
+ icon: "paper-plane"
3537
3473
  })
3538
3474
  }), /*#__PURE__*/jsx(Textarea, {
3539
3475
  id: "commentInput",
@@ -3560,7 +3496,7 @@ class Job extends Component {
3560
3496
  children: /*#__PURE__*/jsx("div", {
3561
3497
  className: "imageGrid_image",
3562
3498
  style: {
3563
- backgroundImage: "url('".concat(Helper$2.get1400(image), "')"),
3499
+ backgroundImage: "url('".concat(Helper$3.get1400(image), "')"),
3564
3500
  width: size,
3565
3501
  height: size
3566
3502
  }
@@ -3656,7 +3592,7 @@ class Job extends Component {
3656
3592
  } = this.state.job;
3657
3593
  var hasCustomFields = customFields && customFields.length > 0;
3658
3594
  return /*#__PURE__*/jsxs("div", {
3659
- style: {
3595
+ iconStyle: {
3660
3596
  paddingBottom: 40
3661
3597
  },
3662
3598
  children: [/*#__PURE__*/jsxs("div", {
@@ -3804,9 +3740,9 @@ class Job extends Component {
3804
3740
  className: "maintenanceNote",
3805
3741
  children: [/*#__PURE__*/jsxs("div", {
3806
3742
  className: "maintenanceNote_top",
3807
- children: [this.props.auth && this.props.auth.user && this.props.auth.user.Id === note.User.id && /*#__PURE__*/jsx(Components$3.SVGIcon, {
3808
- colour: Colours$1.COLOUR_DUSK_LIGHT,
3809
- icon: "more15",
3743
+ children: [this.props.auth && this.props.auth.user && this.props.auth.user.Id === note.User.id && /*#__PURE__*/jsx(Icon, {
3744
+ colour: Colours$2.COLOUR_DUSK_LIGHT,
3745
+ icon: "ellipsis-vertical",
3810
3746
  className: "maintenanceNote_moreIcon",
3811
3747
  onClick: () => this.onOpenNoteMenu(index)
3812
3748
  }), /*#__PURE__*/jsx("p", {
@@ -3825,7 +3761,7 @@ class Job extends Component {
3825
3761
  })]
3826
3762
  }), /*#__PURE__*/jsx("p", {
3827
3763
  className: "maintenanceNote_text",
3828
- children: Helper$2.toParagraphed(note.Note)
3764
+ children: Helper$3.toParagraphed(note.Note)
3829
3765
  }), note.Attachments.map((a, i) => this.renderAttachment(a, i)), note.Images && note.Images.length > 0 ? this.renderImageGrid(note.Images, IMAGE_SIZE_NOTE) : null]
3830
3766
  })]
3831
3767
  }, index);
@@ -3869,7 +3805,7 @@ class Job extends Component {
3869
3805
  }), /*#__PURE__*/jsx("div", {
3870
3806
  className: "statusLabel statusLabel-large statusLabel-full",
3871
3807
  style: {
3872
- backgroundColor: Colours$1.COLOUR_DUSK
3808
+ backgroundColor: Colours$2.COLOUR_DUSK
3873
3809
  },
3874
3810
  children: /*#__PURE__*/jsxs("span", {
3875
3811
  className: "statusLabel_text",
@@ -3880,7 +3816,7 @@ class Job extends Component {
3880
3816
  }
3881
3817
  renderExternalSyncEntry(e, i) {
3882
3818
  var isSuccess = e.EntryType === "ExternalIDSet";
3883
- var backgroundColor = isSuccess ? Colours$1.COLOUR_GREEN : Colours$1.COLOUR_RED; // Green for success, red for failure
3819
+ var backgroundColor = isSuccess ? Colours$2.COLOUR_GREEN : Colours$2.COLOUR_RED; // Green for success, red for failure
3884
3820
 
3885
3821
  return /*#__PURE__*/jsxs("div", {
3886
3822
  className: "ticketHistoryEntry",
@@ -3943,20 +3879,22 @@ class Job extends Component {
3943
3879
 
3944
3880
  // Show spinner while retrying
3945
3881
  if (retryingSync) {
3946
- return /*#__PURE__*/jsx(FontAwesome, {
3882
+ return /*#__PURE__*/jsx(Icon, {
3947
3883
  style: {
3948
3884
  fontSize: 20,
3949
- color: Colours$1.COLOUR_DUSK_LIGHT,
3885
+ color: Colours$2.COLOUR_DUSK_LIGHT,
3950
3886
  marginLeft: 8
3951
3887
  },
3952
- name: "spinner fa-pulse fa-fw"
3888
+ icon: "spinner",
3889
+ pulse: true,
3890
+ fixedWidth: true
3953
3891
  });
3954
3892
  }
3955
3893
  return /*#__PURE__*/jsx("div", {
3956
3894
  className: "statusLabel pointer",
3957
3895
  onClick: this.onRetrySync,
3958
3896
  style: {
3959
- backgroundColor: Colours$1.COLOUR_RED,
3897
+ backgroundColor: Colours$2.COLOUR_RED,
3960
3898
  marginLeft: 8
3961
3899
  },
3962
3900
  children: /*#__PURE__*/jsx("span", {
@@ -3975,11 +3913,11 @@ class Job extends Component {
3975
3913
  if (retrySyncError) {
3976
3914
  return /*#__PURE__*/jsxs(Components$3.Text, {
3977
3915
  type: "body",
3978
- children: [/*#__PURE__*/jsx(FontAwesome, {
3916
+ children: [/*#__PURE__*/jsx(Icon, {
3979
3917
  className: "userStatusIcon",
3980
- name: "times-circle",
3918
+ icon: "circle-xmark",
3981
3919
  style: {
3982
- color: Colours$1.COLOUR_RED
3920
+ color: Colours$2.COLOUR_RED
3983
3921
  }
3984
3922
  }), " ", retrySyncError]
3985
3923
  });
@@ -3989,11 +3927,11 @@ class Job extends Component {
3989
3927
  if (retrySyncInitiated) {
3990
3928
  return /*#__PURE__*/jsxs(Components$3.Text, {
3991
3929
  type: "body",
3992
- children: [/*#__PURE__*/jsx(FontAwesome, {
3930
+ children: [/*#__PURE__*/jsx(Icon, {
3993
3931
  className: "userStatusIcon",
3994
- name: "check-circle",
3932
+ icon: "circle-check",
3995
3933
  style: {
3996
- color: Colours$1.COLOUR_GREEN
3934
+ color: Colours$2.COLOUR_GREEN
3997
3935
  }
3998
3936
  }), " ", "Sync retry initiated. Check back shortly for results."]
3999
3937
  });
@@ -4003,11 +3941,11 @@ class Job extends Component {
4003
3941
  if (this.hasSyncFailureWithoutSuccess()) {
4004
3942
  return /*#__PURE__*/jsxs(Components$3.Text, {
4005
3943
  type: "body",
4006
- children: [/*#__PURE__*/jsx(FontAwesome, {
3944
+ children: [/*#__PURE__*/jsx(Icon, {
4007
3945
  className: "userStatusIcon",
4008
- name: "times-circle",
3946
+ icon: "circle-xmark",
4009
3947
  style: {
4010
- color: Colours$1.COLOUR_RED
3948
+ color: Colours$2.COLOUR_RED
4011
3949
  }
4012
3950
  }), " ", "External sync failed. Use the retry button to attempt again."]
4013
3951
  });
@@ -4067,11 +4005,11 @@ class Job extends Component {
4067
4005
  } = this.state;
4068
4006
  if (!job || !job.history) return null;
4069
4007
  var source = _.sortBy([...job.history.map(e => {
4070
- return _objectSpread$4(_objectSpread$4({}, e), {}, {
4008
+ return _objectSpread$5(_objectSpread$5({}, e), {}, {
4071
4009
  EntryType: e.EntryType || "status"
4072
4010
  });
4073
4011
  }), ...(job.Notes || []).map(e => {
4074
- return _objectSpread$4(_objectSpread$4({}, e), {}, {
4012
+ return _objectSpread$5(_objectSpread$5({}, e), {}, {
4075
4013
  timestamp: e.Timestamp,
4076
4014
  EntryType: "note"
4077
4015
  });
@@ -4146,9 +4084,11 @@ class Job extends Component {
4146
4084
  hasPadding: true,
4147
4085
  children: /*#__PURE__*/jsx("div", {
4148
4086
  className: "flex flex-center-row",
4149
- children: /*#__PURE__*/jsx(FontAwesome, {
4087
+ children: /*#__PURE__*/jsx(Icon, {
4150
4088
  className: "spinner",
4151
- name: "spinner fa-pulse fa-fw"
4089
+ icon: "spinner",
4090
+ pulse: true,
4091
+ fixedWidth: true
4152
4092
  })
4153
4093
  })
4154
4094
  });
@@ -4194,9 +4134,9 @@ class Job extends Component {
4194
4134
  onClick: () => {
4195
4135
  this.attachmentInput.click();
4196
4136
  },
4197
- children: [/*#__PURE__*/jsx(FontAwesome, {
4137
+ children: [/*#__PURE__*/jsx(Icon, {
4198
4138
  className: "iconTextButton_icon",
4199
- name: "paperclip"
4139
+ icon: "paperclip"
4200
4140
  }), /*#__PURE__*/jsx("p", {
4201
4141
  className: "iconTextButton_text",
4202
4142
  children: "Add Attachment"
@@ -4219,22 +4159,24 @@ class Job extends Component {
4219
4159
  if (this.state.confirmingAssignee) {
4220
4160
  content = /*#__PURE__*/jsx("div", {
4221
4161
  className: "flex flex-center-row",
4222
- children: /*#__PURE__*/jsx(FontAwesome, {
4162
+ children: /*#__PURE__*/jsx(Icon, {
4223
4163
  className: "spinner",
4224
- name: "spinner fa-pulse fa-fw"
4164
+ icon: "spinner",
4165
+ pulse: true,
4166
+ fixedWidth: true
4225
4167
  })
4226
4168
  });
4227
4169
  } else if (this.state.selectedAssignee) {
4228
4170
  content = /*#__PURE__*/jsx("div", {
4229
4171
  children: /*#__PURE__*/jsx(Components$3.UserListing, {
4230
4172
  user: this.state.selectedAssignee,
4231
- rightContent: /*#__PURE__*/jsx(Components$3.SVGIcon, {
4173
+ rightContent: /*#__PURE__*/jsx(Icon, {
4232
4174
  className: "removeIcon",
4233
- icon: "close",
4175
+ icon: "xmark",
4234
4176
  onClick: () => {
4235
4177
  this.onSelectAssignee();
4236
4178
  },
4237
- colour: Colours$1.COLOUR_DUSK
4179
+ colour: Colours$2.COLOUR_DUSK
4238
4180
  })
4239
4181
  }, this.state.selectedAssignee.id)
4240
4182
  });
@@ -4321,14 +4263,14 @@ var Job$1 = connect(mapStateToProps$3, {
4321
4263
  jobStatusesUpdate
4322
4264
  })(withRouter(Job));
4323
4265
 
4324
- function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4325
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4266
+ function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4267
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4326
4268
  var {
4327
4269
  Actions,
4328
4270
  Components: Components$2,
4329
- Helper: Helper$1,
4271
+ Helper: Helper$2,
4330
4272
  Session: Session$2,
4331
- Colours,
4273
+ Colours: Colours$1,
4332
4274
  Apis
4333
4275
  } = PlussCore;
4334
4276
  class AddJob extends Component {
@@ -4347,7 +4289,7 @@ class AddJob extends Component {
4347
4289
  type,
4348
4290
  customFields
4349
4291
  } = res.data;
4350
- _this.setState(_objectSpread$3(_objectSpread$3({}, res.data), {}, {
4292
+ _this.setState(_objectSpread$4(_objectSpread$4({}, res.data), {}, {
4351
4293
  prevType: type,
4352
4294
  prevCustomFileds: customFields,
4353
4295
  type,
@@ -4595,7 +4537,7 @@ class AddJob extends Component {
4595
4537
  event.target.value = "";
4596
4538
  });
4597
4539
  _defineProperty(this, "onToggleDatePicker", qId => {
4598
- var showDate = _objectSpread$3({}, this.state.showDate);
4540
+ var showDate = _objectSpread$4({}, this.state.showDate);
4599
4541
  showDate[qId] = !showDate[qId];
4600
4542
  this.setState({
4601
4543
  showDate
@@ -4684,7 +4626,7 @@ class AddJob extends Component {
4684
4626
  if (_.isNil(answer) || _.isEmpty(answer)) return true;
4685
4627
  switch (type) {
4686
4628
  case "email":
4687
- return Helper$1.isEmail(answer);
4629
+ return Helper$2.isEmail(answer);
4688
4630
  case "date":
4689
4631
  return moment(answer, "YYYY-MM-DD", true).isValid();
4690
4632
  case "time":
@@ -4705,7 +4647,7 @@ class AddJob extends Component {
4705
4647
  this.customImageInputs = {};
4706
4648
  this.customDocumentInputs = {};
4707
4649
  this.state = {
4708
- jobId: Helper$1.safeReadParams(this.props, "jobId") ? this.props.match.params.jobId : null,
4650
+ jobId: Helper$2.safeReadParams(this.props, "jobId") ? this.props.match.params.jobId : null,
4709
4651
  job: null,
4710
4652
  showingSelector: false,
4711
4653
  updating: false,
@@ -4764,9 +4706,9 @@ class AddJob extends Component {
4764
4706
  } = this.state;
4765
4707
  return types.map(ev => {
4766
4708
  if (ev != null) {
4767
- return /*#__PURE__*/jsx(DropdownItem, {
4709
+ return /*#__PURE__*/jsx(MenuItem, {
4768
4710
  eventKey: ev.typeName,
4769
- ive: type === ev.typeName,
4711
+ active: type === ev.typeName,
4770
4712
  children: ev.typeName
4771
4713
  }, ev.typeName);
4772
4714
  }
@@ -5022,7 +4964,7 @@ class AddJob extends Component {
5022
4964
  className: "inputRequired "
5023
4965
  }) : null, /*#__PURE__*/jsxs("div", {
5024
4966
  className: "visitorSignIn_question",
5025
- style: {
4967
+ iconStyle: {
5026
4968
  flex: 1
5027
4969
  },
5028
4970
  children: [/*#__PURE__*/jsx("div", {
@@ -5072,7 +5014,7 @@ class AddJob extends Component {
5072
5014
  case "staticText":
5073
5015
  return /*#__PURE__*/jsx("p", {
5074
5016
  className: "visitorSignIn_text-staticText",
5075
- children: Helper$1.toParagraphed(field.label, {
5017
+ children: Helper$2.toParagraphed(field.label, {
5076
5018
  marginTop: 10
5077
5019
  })
5078
5020
  }, fieldId);
@@ -5090,9 +5032,9 @@ class AddJob extends Component {
5090
5032
  errorMessage: "Not a valid date",
5091
5033
  alwaysShowLabel: true,
5092
5034
  readOnly: true,
5093
- rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Components$2.SVGIcon, {
5094
- colour: Colours.COLOUR_DUSK_LIGHT,
5095
- icon: "close",
5035
+ rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Icon, {
5036
+ colour: Colours$1.COLOUR_DUSK_LIGHT,
5037
+ icon: "xmark",
5096
5038
  className: "timepicker_clear",
5097
5039
  onClick: () => this.onChangeDateAnswer(fieldId, undefined, false)
5098
5040
  })
@@ -5123,9 +5065,9 @@ class AddJob extends Component {
5123
5065
  width: "100%"
5124
5066
  }
5125
5067
  }),
5126
- rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Components$2.SVGIcon, {
5127
- colour: Colours.COLOUR_DUSK_LIGHT,
5128
- icon: "close",
5068
+ rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/jsx(Icon, {
5069
+ colour: Colours$1.COLOUR_DUSK_LIGHT,
5070
+ icon: "xmark",
5129
5071
  className: "timepicker_clear",
5130
5072
  onClick: () => this.onChangeTimeAnswer(fieldId, undefined)
5131
5073
  })
@@ -5139,7 +5081,7 @@ class AddJob extends Component {
5139
5081
  className: "inputRequired "
5140
5082
  }) : null, /*#__PURE__*/jsxs("div", {
5141
5083
  className: "visitorSignIn_question",
5142
- style: {
5084
+ iconStyle: {
5143
5085
  flex: 1
5144
5086
  },
5145
5087
  children: [/*#__PURE__*/jsx(Components$2.Text, {
@@ -5162,7 +5104,7 @@ class AddJob extends Component {
5162
5104
  className: "inputRequired "
5163
5105
  }) : null, /*#__PURE__*/jsxs("div", {
5164
5106
  className: "visitorSignIn_question",
5165
- style: {
5107
+ iconStyle: {
5166
5108
  flex: 1
5167
5109
  },
5168
5110
  children: [/*#__PURE__*/jsx(Components$2.Text, {
@@ -5184,9 +5126,9 @@ class AddJob extends Component {
5184
5126
  }), /*#__PURE__*/jsxs("div", {
5185
5127
  className: "iconTextButton marginBottom-16",
5186
5128
  onClick: () => this.customDocumentInputs[fieldId].click(),
5187
- children: [/*#__PURE__*/jsx(FontAwesome, {
5129
+ children: [/*#__PURE__*/jsx(Icon, {
5188
5130
  className: "iconTextButton_icon",
5189
- name: "paperclip"
5131
+ icon: "paperclip"
5190
5132
  }), /*#__PURE__*/jsx("p", {
5191
5133
  className: "iconTextButton_text",
5192
5134
  children: "Add Attachment"
@@ -5214,7 +5156,7 @@ class AddJob extends Component {
5214
5156
  customFields
5215
5157
  } = this.state;
5216
5158
  return /*#__PURE__*/jsx("div", {
5217
- style: {
5159
+ iconStyle: {
5218
5160
  marginBottom: 15
5219
5161
  },
5220
5162
  children: /*#__PURE__*/jsxs("div", {
@@ -5249,7 +5191,7 @@ class AddJob extends Component {
5249
5191
  return this.state.showWarnings && _.isEmpty(this.state.room);
5250
5192
  }
5251
5193
  }), /*#__PURE__*/jsxs("div", {
5252
- style: {
5194
+ iconStyle: {
5253
5195
  marginBottom: 15
5254
5196
  },
5255
5197
  children: [/*#__PURE__*/jsx(Components$2.Text, {
@@ -5349,7 +5291,7 @@ var mapStateToProps$2 = state => {
5349
5291
  return {
5350
5292
  auth,
5351
5293
  strings: state.strings && state.strings.config || {},
5352
- optionOnlyForResidents: Helper$1.getSiteSettingFromState(state, values.optionOnlyForResidents)
5294
+ optionOnlyForResidents: Helper$2.getSiteSettingFromState(state, values.optionOnlyForResidents)
5353
5295
  };
5354
5296
  };
5355
5297
  var AddJob$1 = connect(mapStateToProps$2, {
@@ -5361,14 +5303,14 @@ var AddJob$1 = connect(mapStateToProps$2, {
5361
5303
  var {
5362
5304
  Components: Components$1,
5363
5305
  Session: Session$1,
5364
- Helper
5306
+ Helper: Helper$1
5365
5307
  } = PlussCore;
5366
5308
  var DEFAULT_FIELD = {
5367
- type: 'text',
5368
- label: '',
5309
+ type: "text",
5310
+ label: "",
5369
5311
  mandatory: false,
5370
5312
  isTitle: false,
5371
- values: ['']
5313
+ values: [""]
5372
5314
  };
5373
5315
  class AddJobType extends Component {
5374
5316
  constructor(props) {
@@ -5395,18 +5337,18 @@ class AddJobType extends Component {
5395
5337
  customFields: customFields || [_.cloneDeep(DEFAULT_FIELD)]
5396
5338
  });
5397
5339
  } catch (error) {
5398
- console.error('getJobType', error);
5340
+ console.error("getJobType", error);
5399
5341
  }
5400
5342
  }));
5401
5343
  _defineProperty(this, "getFieldTypeTitle", type => {
5402
5344
  var fieldType = this.fieldTypes.find(f => f.Key === type);
5403
- return fieldType ? fieldType.Title : '';
5345
+ return fieldType ? fieldType.Title : "";
5404
5346
  });
5405
5347
  _defineProperty(this, "validateEmail", () => {
5406
5348
  var {
5407
5349
  jobTypeEmail
5408
5350
  } = this.state;
5409
- return !_.isEmpty(jobTypeEmail) && Helper.isEmail(jobTypeEmail);
5351
+ return !_.isEmpty(jobTypeEmail) && Helper$1.isEmail(jobTypeEmail);
5410
5352
  });
5411
5353
  _defineProperty(this, "isJobTypeValid", () => {
5412
5354
  var {
@@ -5421,7 +5363,7 @@ class AddJobType extends Component {
5421
5363
  });
5422
5364
  _defineProperty(this, "onHandleChange", event => {
5423
5365
  var stateChange = {};
5424
- stateChange[event.target.getAttribute('id')] = event.target.value;
5366
+ stateChange[event.target.getAttribute("id")] = event.target.value;
5425
5367
  this.setState(stateChange);
5426
5368
  });
5427
5369
  _defineProperty(this, "onFieldTypeChanged", (fieldIndex, key) => {
@@ -5483,7 +5425,7 @@ class AddJobType extends Component {
5483
5425
  });
5484
5426
  _defineProperty(this, "onAddNewOption", fieldIndex => {
5485
5427
  var customFields = [...this.state.customFields];
5486
- customFields[fieldIndex].values.push('');
5428
+ customFields[fieldIndex].values.push("");
5487
5429
  this.setState({
5488
5430
  customFields
5489
5431
  });
@@ -5559,59 +5501,59 @@ class AddJobType extends Component {
5559
5501
  success: true
5560
5502
  });
5561
5503
  } catch (error) {
5562
- console.error('onSave', error);
5504
+ console.error("onSave", error);
5563
5505
  _this.setState({
5564
5506
  submitting: false
5565
5507
  });
5566
- alert('Something went wrong with the request. Please try again.');
5508
+ alert("Something went wrong with the request. Please try again.");
5567
5509
  }
5568
5510
  }));
5569
5511
  });
5570
5512
  this.fieldTypes = [{
5571
- Title: 'Text Input',
5572
- Key: 'text'
5513
+ Title: "Text Input",
5514
+ Key: "text"
5573
5515
  }, {
5574
- Title: 'Email Input',
5575
- Key: 'email'
5516
+ Title: "Email Input",
5517
+ Key: "email"
5576
5518
  }, {
5577
- Title: 'Phone Input',
5578
- Key: 'phone'
5519
+ Title: "Phone Input",
5520
+ Key: "phone"
5579
5521
  }, {
5580
- Title: 'Date Input',
5581
- Key: 'date'
5522
+ Title: "Date Input",
5523
+ Key: "date"
5582
5524
  }, {
5583
- Title: 'Time Input',
5584
- Key: 'time'
5525
+ Title: "Time Input",
5526
+ Key: "time"
5585
5527
  }, {
5586
- Title: 'Image Input',
5587
- Key: 'image'
5528
+ Title: "Image Input",
5529
+ Key: "image"
5588
5530
  },
5589
5531
  // {
5590
5532
  // Title: 'Document Input',
5591
5533
  // Key: 'document',
5592
5534
  // },
5593
5535
  {
5594
- Title: 'Yes/No Question',
5595
- Key: 'yn'
5536
+ Title: "Yes/No Question",
5537
+ Key: "yn"
5596
5538
  }, {
5597
- Title: 'Multiple Choice',
5598
- Key: 'multichoice'
5539
+ Title: "Multiple Choice",
5540
+ Key: "multichoice"
5599
5541
  }, {
5600
- Title: 'Checkboxes',
5601
- Key: 'checkbox'
5542
+ Title: "Checkboxes",
5543
+ Key: "checkbox"
5602
5544
  }, {
5603
- Title: 'Title Text',
5604
- Key: 'staticTitle'
5545
+ Title: "Title Text",
5546
+ Key: "staticTitle"
5605
5547
  }, {
5606
- Title: 'Paragraph Text',
5607
- Key: 'staticText'
5548
+ Title: "Paragraph Text",
5549
+ Key: "staticText"
5608
5550
  }];
5609
5551
  this.state = {
5610
5552
  loading: false,
5611
- jobTypeId: Helper.safeReadParams(this.props, 'jobTypeId') ? this.props.match.params.jobTypeId : null,
5612
- jobTypeName: '',
5613
- jobTypeEmail: '',
5614
- jobTypeDescription: '',
5553
+ jobTypeId: Helper$1.safeReadParams(this.props, "jobTypeId") ? this.props.match.params.jobTypeId : null,
5554
+ jobTypeName: "",
5555
+ jobTypeEmail: "",
5556
+ jobTypeDescription: "",
5615
5557
  hasCustomFields: false,
5616
5558
  customFields: [_.cloneDeep(DEFAULT_FIELD)],
5617
5559
  jobTypeLevel: 1,
@@ -5647,23 +5589,23 @@ class AddJobType extends Component {
5647
5589
  mandatory,
5648
5590
  isTitle
5649
5591
  } = field;
5650
- if (['staticTitle', 'staticText'].includes(type)) return;
5592
+ if (["staticTitle", "staticText"].includes(type)) return;
5651
5593
  if (_.isEmpty(label)) {
5652
5594
  missingLabel = true;
5653
- } else if (_.isEmpty(type) || (type === 'multichoice' || type === 'checkbox') && (!values || values.length < 2 || !values.every(value => !_.isEmpty(value)))) {
5595
+ } else if (_.isEmpty(type) || (type === "multichoice" || type === "checkbox") && (!values || values.length < 2 || !values.every(value => !_.isEmpty(value)))) {
5654
5596
  warnings.push("'".concat(label, "' is incomplete"));
5655
5597
  }
5656
5598
  if (mandatory) hasMandatoryField = true;
5657
5599
  if (isTitle) titleFieldCount += 1;
5658
5600
  });
5659
5601
  if (missingLabel) {
5660
- warnings.push('All inputs must have a label');
5602
+ warnings.push("All inputs must have a label");
5661
5603
  }
5662
5604
  if (!hasMandatoryField) {
5663
- warnings.push('There must be at least one required input');
5605
+ warnings.push("There must be at least one required input");
5664
5606
  }
5665
5607
  if (titleFieldCount > 1) {
5666
- warnings.push('Only one required input can be selected as title for the request');
5608
+ warnings.push("Only one required input can be selected as title for the request");
5667
5609
  }
5668
5610
  }
5669
5611
  this.setState({
@@ -5697,7 +5639,7 @@ class AddJobType extends Component {
5697
5639
  children: [/*#__PURE__*/jsxs(Components$1.Text, {
5698
5640
  type: "formTitleLarge",
5699
5641
  className: "marginBottom-24",
5700
- children: [!jobTypeId ? 'New' : 'Edit', " ", values.textJobType]
5642
+ children: [!jobTypeId ? "New" : "Edit", " ", values.textJobType]
5701
5643
  }), /*#__PURE__*/jsx(Components$1.GenericInput, {
5702
5644
  id: "jobTypeName",
5703
5645
  type: "text",
@@ -5737,13 +5679,13 @@ class AddJobType extends Component {
5737
5679
  label: "Do you want to create a custom form for this ".concat("".concat(values.textJobType), "?"),
5738
5680
  isActive: hasCustomFields,
5739
5681
  options: [{
5740
- Label: 'Yes',
5682
+ Label: "Yes",
5741
5683
  Value: true,
5742
5684
  onChange: () => this.setState({
5743
5685
  hasCustomFields: true
5744
5686
  })
5745
5687
  }, {
5746
- Label: 'No',
5688
+ Label: "No",
5747
5689
  Value: false,
5748
5690
  onChange: () => this.setState({
5749
5691
  hasCustomFields: false
@@ -5773,14 +5715,14 @@ class AddJobType extends Component {
5773
5715
  className: "fieldInner",
5774
5716
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5775
5717
  id: "fieldLabel".concat(fieldIndex),
5776
- className: 'textInput',
5777
- placeholder: 'Type your label here (required)',
5718
+ className: "textInput",
5719
+ placeholder: "Type your label here (required)",
5778
5720
  value: field.label,
5779
5721
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5780
5722
  }), /*#__PURE__*/jsx(Components$1.GenericInput, {
5781
5723
  id: "fieldPlaceHolder".concat(fieldIndex),
5782
- className: 'placeHolderInput',
5783
- placeholder: 'Insert placeholder (optional)',
5724
+ className: "placeHolderInput",
5725
+ placeholder: "Insert placeholder (optional)",
5784
5726
  value: field.placeHolder,
5785
5727
  onChange: e => this.onFieldPlaceHolderChanged(fieldIndex, e)
5786
5728
  }), this.renderOptionalCheckBox(field, fieldIndex), this.renderTitleCheckBox(field, fieldIndex)]
@@ -5791,8 +5733,8 @@ class AddJobType extends Component {
5791
5733
  className: "fieldInner",
5792
5734
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5793
5735
  id: "fieldLabel".concat(fieldIndex),
5794
- className: 'textInput',
5795
- placeholder: 'Type your label here (required)',
5736
+ className: "textInput",
5737
+ placeholder: "Type your label here (required)",
5796
5738
  value: field.label,
5797
5739
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5798
5740
  }), this.renderOptionalCheckBox(field, fieldIndex), this.renderTitleCheckBox(field, fieldIndex)]
@@ -5803,8 +5745,8 @@ class AddJobType extends Component {
5803
5745
  className: "fieldInner",
5804
5746
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5805
5747
  id: "fieldLabel".concat(fieldIndex),
5806
- className: 'textInput',
5807
- placeholder: 'Type your label here (required)',
5748
+ className: "textInput",
5749
+ placeholder: "Type your label here (required)",
5808
5750
  value: field.label,
5809
5751
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5810
5752
  }), this.renderOptionalCheckBox(field, fieldIndex), this.renderTitleCheckBox(field, fieldIndex)]
@@ -5815,8 +5757,8 @@ class AddJobType extends Component {
5815
5757
  className: "fieldInner",
5816
5758
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5817
5759
  id: "fieldLabel".concat(fieldIndex),
5818
- className: 'textInput',
5819
- placeholder: 'Type your label here (required)',
5760
+ className: "textInput",
5761
+ placeholder: "Type your label here (required)",
5820
5762
  value: field.label,
5821
5763
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5822
5764
  }), this.renderOptionalCheckBox(field, fieldIndex)]
@@ -5827,8 +5769,8 @@ class AddJobType extends Component {
5827
5769
  className: "fieldInner",
5828
5770
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5829
5771
  id: "fieldLabel".concat(fieldIndex),
5830
- className: 'textInput',
5831
- placeholder: 'Type your label here (required)',
5772
+ className: "textInput",
5773
+ placeholder: "Type your label here (required)",
5832
5774
  value: field.label,
5833
5775
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5834
5776
  }), this.renderOptionalCheckBox(field, fieldIndex)]
@@ -5839,8 +5781,8 @@ class AddJobType extends Component {
5839
5781
  className: "fieldInner",
5840
5782
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5841
5783
  id: "fieldLabel".concat(fieldIndex),
5842
- className: 'textInput',
5843
- placeholder: 'Type your label here (required)',
5784
+ className: "textInput",
5785
+ placeholder: "Type your label here (required)",
5844
5786
  value: field.label,
5845
5787
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5846
5788
  }), /*#__PURE__*/jsxs(Table, {
@@ -5856,7 +5798,7 @@ class AddJobType extends Component {
5856
5798
  })]
5857
5799
  })
5858
5800
  }), /*#__PURE__*/jsx("tbody", {
5859
- children: ['Yes', 'No'].map((value, optionIndex) => {
5801
+ children: ["Yes", "No"].map((value, optionIndex) => {
5860
5802
  return /*#__PURE__*/jsxs("tr", {
5861
5803
  className: "option",
5862
5804
  children: [/*#__PURE__*/jsx("td", {
@@ -5886,8 +5828,8 @@ class AddJobType extends Component {
5886
5828
  className: "fieldInner",
5887
5829
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5888
5830
  id: "fieldLabel".concat(fieldIndex),
5889
- className: 'textInput',
5890
- placeholder: 'Type your label here (required)',
5831
+ className: "textInput",
5832
+ placeholder: "Type your label here (required)",
5891
5833
  value: field.label,
5892
5834
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5893
5835
  }), /*#__PURE__*/jsxs(Table, {
@@ -5917,15 +5859,15 @@ class AddJobType extends Component {
5917
5859
  }), /*#__PURE__*/jsx("td", {
5918
5860
  children: /*#__PURE__*/jsx(Components$1.GenericInput, {
5919
5861
  id: "fieldOption".concat(optionIndex),
5920
- placeholder: 'Enter option',
5862
+ placeholder: "Enter option",
5921
5863
  value: value,
5922
5864
  onChange: e => this.onFieldOptionChanged(fieldIndex, optionIndex, e)
5923
5865
  })
5924
5866
  }), /*#__PURE__*/jsx("td", {
5925
5867
  children: customFields[fieldIndex].values.length > 1 ? /*#__PURE__*/jsx("div", {
5926
5868
  onClick: () => this.onRemoveOption(fieldIndex, optionIndex),
5927
- children: /*#__PURE__*/jsx(FontAwesome, {
5928
- name: "minus-circle",
5869
+ children: /*#__PURE__*/jsx(Icon, {
5870
+ icon: "circle-minus",
5929
5871
  className: "cornerCancelButton_icon"
5930
5872
  })
5931
5873
  }) : null
@@ -5936,9 +5878,9 @@ class AddJobType extends Component {
5936
5878
  }), /*#__PURE__*/jsxs("div", {
5937
5879
  className: "clearfix addoption optionAdd marginBottom-10",
5938
5880
  onClick: () => this.onAddNewOption(fieldIndex),
5939
- children: [/*#__PURE__*/jsx(Components$1.P60Icon, {
5881
+ children: [/*#__PURE__*/jsx(Icon, {
5940
5882
  className: "addoption_plus",
5941
- icon: "add-circle"
5883
+ icon: "circle-plus"
5942
5884
  }), /*#__PURE__*/jsx("div", {
5943
5885
  className: "fillSpace",
5944
5886
  children: /*#__PURE__*/jsx("p", {
@@ -5957,8 +5899,8 @@ class AddJobType extends Component {
5957
5899
  className: "fieldInner",
5958
5900
  children: [/*#__PURE__*/jsx(Components$1.GenericInput, {
5959
5901
  id: "fieldLabel".concat(fieldIndex),
5960
- className: 'textInput',
5961
- placeholder: 'Type your label here (required)',
5902
+ className: "textInput",
5903
+ placeholder: "Type your label here (required)",
5962
5904
  value: field.label,
5963
5905
  onChange: e => this.onFieldLabelChanged(fieldIndex, e)
5964
5906
  }), /*#__PURE__*/jsxs(Table, {
@@ -5988,15 +5930,15 @@ class AddJobType extends Component {
5988
5930
  }), /*#__PURE__*/jsx("td", {
5989
5931
  children: /*#__PURE__*/jsx(Components$1.GenericInput, {
5990
5932
  id: "fieldOption".concat(optionIndex),
5991
- placeholder: 'Enter option',
5933
+ placeholder: "Enter option",
5992
5934
  value: value,
5993
5935
  onChange: e => this.onFieldOptionChanged(fieldIndex, optionIndex, e)
5994
5936
  })
5995
5937
  }), /*#__PURE__*/jsx("td", {
5996
5938
  children: customFields[fieldIndex].values.length > 1 ? /*#__PURE__*/jsx("div", {
5997
5939
  onClick: () => this.onRemoveOption(fieldIndex, optionIndex),
5998
- children: /*#__PURE__*/jsx(FontAwesome, {
5999
- name: "minus-circle",
5940
+ children: /*#__PURE__*/jsx(Icon, {
5941
+ icon: "circle-minus",
6000
5942
  className: "cornerCancelButton_icon"
6001
5943
  })
6002
5944
  }) : null
@@ -6007,9 +5949,9 @@ class AddJobType extends Component {
6007
5949
  }), /*#__PURE__*/jsxs("div", {
6008
5950
  className: "clearfix addoption optionAdd marginBottom-10",
6009
5951
  onClick: () => this.onAddNewOption(fieldIndex),
6010
- children: [/*#__PURE__*/jsx(Components$1.P60Icon, {
5952
+ children: [/*#__PURE__*/jsx(Icon, {
6011
5953
  className: "addoption_plus",
6012
- icon: "add-circle"
5954
+ icon: "circle-plus"
6013
5955
  }), /*#__PURE__*/jsx("div", {
6014
5956
  className: "fillSpace",
6015
5957
  children: /*#__PURE__*/jsx("p", {
@@ -6050,27 +5992,27 @@ class AddJobType extends Component {
6050
5992
  } = this.state;
6051
5993
  var renderFieldContent = () => {
6052
5994
  switch (field.type) {
6053
- case 'text':
6054
- case 'email':
6055
- case 'phone':
5995
+ case "text":
5996
+ case "email":
5997
+ case "phone":
6056
5998
  return this.renderFieldText(field, fieldIndex);
6057
- case 'date':
5999
+ case "date":
6058
6000
  return this.renderFieldDate(field, fieldIndex);
6059
- case 'time':
6001
+ case "time":
6060
6002
  return this.renderFieldTime(field, fieldIndex);
6061
- case 'image':
6003
+ case "image":
6062
6004
  return this.renderFieldImage(field, fieldIndex);
6063
- case 'document':
6005
+ case "document":
6064
6006
  return this.renderFieldDocument(field, fieldIndex);
6065
- case 'yn':
6007
+ case "yn":
6066
6008
  return this.renderFieldYesNo(field, fieldIndex);
6067
- case 'multichoice':
6009
+ case "multichoice":
6068
6010
  return this.renderFieldMultiple(field, fieldIndex);
6069
- case 'checkbox':
6011
+ case "checkbox":
6070
6012
  return this.renderFieldCheckbox(field, fieldIndex);
6071
- case 'staticTitle':
6013
+ case "staticTitle":
6072
6014
  return this.renderFieldStaticTitle(field, fieldIndex);
6073
- case 'staticText':
6015
+ case "staticText":
6074
6016
  return this.renderFieldStaticText(field, fieldIndex);
6075
6017
  default:
6076
6018
  return null;
@@ -6116,15 +6058,15 @@ class AddJobType extends Component {
6116
6058
  children: [fieldIndex > 0 ? /*#__PURE__*/jsx("div", {
6117
6059
  className: "circle",
6118
6060
  onClick: () => this.onMoveFieldPrev(fieldIndex),
6119
- children: /*#__PURE__*/jsx(FontAwesome, {
6120
- name: "angle-up",
6061
+ children: /*#__PURE__*/jsx(Icon, {
6062
+ icon: "angle-up",
6121
6063
  className: "icon"
6122
6064
  })
6123
6065
  }) : null, fieldIndex < customFields.length - 1 ? /*#__PURE__*/jsx("div", {
6124
6066
  className: "circle",
6125
6067
  onClick: () => this.onMoveFieldNext(fieldIndex),
6126
- children: /*#__PURE__*/jsx(FontAwesome, {
6127
- name: "angle-down",
6068
+ children: /*#__PURE__*/jsx(Icon, {
6069
+ icon: "angle-down",
6128
6070
  className: "icon"
6129
6071
  })
6130
6072
  }) : null]
@@ -6144,7 +6086,7 @@ class AddJobType extends Component {
6144
6086
  type: "bodyLarge",
6145
6087
  className: "marginBottom-24 paddingLeft-40",
6146
6088
  style: {
6147
- color: Colours$3.COLOUR_LIGHTGREY
6089
+ color: Colours$4.COLOUR_LIGHTGREY
6148
6090
  },
6149
6091
  children: "By default, the form submission title will be the name of the person submitting the form. You can choose to select a different field to use as the title for the form submission."
6150
6092
  }), /*#__PURE__*/jsxs("div", {
@@ -6152,9 +6094,9 @@ class AddJobType extends Component {
6152
6094
  children: [customFields.map((field, fieldIndex) => this.renderField(field, fieldIndex)), /*#__PURE__*/jsxs("div", {
6153
6095
  className: "clearfix addoption addField",
6154
6096
  onClick: () => this.onAddNewField(),
6155
- children: [/*#__PURE__*/jsx(Components$1.P60Icon, {
6097
+ children: [/*#__PURE__*/jsx(Icon, {
6156
6098
  className: "addoption_plus",
6157
- icon: "add-circle"
6099
+ icon: "circle-plus"
6158
6100
  }), /*#__PURE__*/jsx("div", {
6159
6101
  className: "fillSpace",
6160
6102
  children: /*#__PURE__*/jsx("p", {
@@ -6175,10 +6117,10 @@ class AddJobType extends Component {
6175
6117
  return /*#__PURE__*/jsxs("div", {
6176
6118
  className: "padding-60 paddingVertical-8 text-bodyLarge",
6177
6119
  style: {
6178
- color: Colours$3.COLOUR_RED
6120
+ color: Colours$4.COLOUR_RED
6179
6121
  },
6180
6122
  children: ["To save the form", /*#__PURE__*/jsx("ul", {
6181
- style: {
6123
+ iconStyle: {
6182
6124
  padding: 0,
6183
6125
  paddingLeft: 16
6184
6126
  },
@@ -6195,11 +6137,11 @@ class AddJobType extends Component {
6195
6137
  } = this.state;
6196
6138
  if (!success) return null;
6197
6139
  return /*#__PURE__*/jsx(Components$1.SuccessPopup, {
6198
- text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? 'added' : 'edited'),
6140
+ text: "".concat("".concat(values.textJobType), " has been ", !jobTypeId ? "added" : "edited"),
6199
6141
  buttons: [{
6200
- type: 'outlined',
6142
+ type: "outlined",
6201
6143
  onClick: this.onBack,
6202
- text: 'Go to home'
6144
+ text: "Go to home"
6203
6145
  }]
6204
6146
  });
6205
6147
  }
@@ -6262,10 +6204,14 @@ var AddJobType$1 = connect(mapStateToProps$1, {
6262
6204
  jobTypesUpdate
6263
6205
  })(withRouter(AddJobType));
6264
6206
 
6207
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6208
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6265
6209
  var {
6266
6210
  Analytics: Analytics$1,
6267
6211
  Session,
6268
- Components
6212
+ Components,
6213
+ Helper,
6214
+ Colours
6269
6215
  } = PlussCore;
6270
6216
  var getInitialState = () => ({
6271
6217
  requests: 0,
@@ -6285,10 +6231,21 @@ var AnalyticsHub = _ref => {
6285
6231
  auth,
6286
6232
  prevText,
6287
6233
  dayCount,
6288
- strings
6234
+ strings,
6235
+ userType,
6236
+ userCategory,
6237
+ selectedSites
6289
6238
  } = _ref;
6290
6239
  var [analyticsData, setAnalyticsData] = useState(getInitialState());
6291
6240
  var [isExportOpen, setIsExportOpen] = useState(false);
6241
+ var [failedSites, setFailedSites] = useState([]);
6242
+ var [comparisonData, setComparisonData] = useState({
6243
+ requests: [],
6244
+ completedRequests: [],
6245
+ comments: [],
6246
+ isLoading: true
6247
+ });
6248
+ var comparisonMode = selectedSites && selectedSites.length > 1;
6292
6249
  var hasAccess = Session.validateAccess(auth.site, values.permissionMaintenanceTracking, auth);
6293
6250
  if (!hasAccess) {
6294
6251
  return null;
@@ -6300,55 +6257,140 @@ var AnalyticsHub = _ref => {
6300
6257
  return strings.sideNav[key];
6301
6258
  })();
6302
6259
  var exportColumns = [{
6303
- label: 'Select All',
6304
- key: ''
6305
- }, {
6306
- label: 'Start Date',
6307
- key: 'startDate'
6260
+ label: "Select All",
6261
+ key: ""
6262
+ }, ...(comparisonMode ? [{
6263
+ label: "Site",
6264
+ key: "site"
6265
+ }] : []), {
6266
+ label: "Start Date",
6267
+ key: "startDate"
6308
6268
  }, {
6309
- label: 'End Date',
6310
- key: 'endDate'
6269
+ label: "End Date",
6270
+ key: "endDate"
6311
6271
  }, {
6312
6272
  label: "".concat(values.textSingularName, "s"),
6313
- key: 'requests'
6273
+ key: "requests"
6314
6274
  }, {
6315
6275
  label: "Completed ".concat(values.textSingularName, "s"),
6316
- key: 'completedRequests'
6276
+ key: "completedRequests"
6317
6277
  }, {
6318
- label: 'Comments',
6319
- key: 'comments'
6278
+ label: "Comments",
6279
+ key: "comments"
6320
6280
  }];
6321
6281
  useEffect(() => {
6322
6282
  getData();
6323
- }, [startTime, endTime]);
6283
+ }, [startTime, endTime, userType, userCategory, selectedSites]);
6324
6284
  var getData = /*#__PURE__*/function () {
6325
6285
  var _ref2 = _asyncToGenerator(function* () {
6326
- setAnalyticsData(getInitialState());
6327
- // Load analytics data here using startTime and endTime
6328
- var timeDifference = endTime - startTime;
6329
- var [currentStatsResponse, prevStatsResponse] = yield Promise.all([analyticsActions.getAggregateEntityStats(auth.site, values.analyticsKey, startTime, endTime, true), analyticsActions.getAggregateEntityStats(auth.site, values.analyticsKey, startTime - timeDifference, startTime, true)]);
6330
- var data = {
6331
- requests: Analytics$1.countActivities(currentStatsResponse.data, 'Request', 'total'),
6332
- prevRequests: Analytics$1.countActivities(prevStatsResponse.data, 'Request', 'total'),
6333
- completedRequests: Analytics$1.countActivities(currentStatsResponse.data, 'RequestCompleted', 'unique'),
6334
- prevCompletedRequests: Analytics$1.countActivities(prevStatsResponse.data, 'RequestCompleted', 'unique'),
6335
- comments: Analytics$1.countActivities(currentStatsResponse.data, 'Comment', 'total'),
6336
- prevComments: Analytics$1.countActivities(prevStatsResponse.data, 'Comment', 'total'),
6337
- isLoading: false
6338
- };
6339
- setAnalyticsData(data);
6286
+ try {
6287
+ setFailedSites([]);
6288
+ if (comparisonMode) {
6289
+ setComparisonData({
6290
+ requests: [],
6291
+ completedRequests: [],
6292
+ comments: [],
6293
+ isLoading: true
6294
+ });
6295
+ var multiSiteResultsObj = yield Analytics$1.fetchMultiSiteData(selectedSites, /*#__PURE__*/function () {
6296
+ var _ref3 = _asyncToGenerator(function* (site) {
6297
+ var {
6298
+ data
6299
+ } = yield analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
6300
+ userType,
6301
+ userCategory
6302
+ });
6303
+ return data;
6304
+ });
6305
+ return function (_x) {
6306
+ return _ref3.apply(this, arguments);
6307
+ };
6308
+ }());
6309
+ var roles = auth.user.Roles;
6310
+ var failed = Object.entries(multiSiteResultsObj).filter(_ref4 => {
6311
+ var [, data] = _ref4;
6312
+ return data === null;
6313
+ }).map(_ref5 => {
6314
+ var [site] = _ref5;
6315
+ return Helper.getSiteNameFromRoles(site, roles);
6316
+ });
6317
+ setFailedSites(failed);
6318
+ var multiSiteResults = Object.entries(multiSiteResultsObj).filter(_ref6 => {
6319
+ var [, data] = _ref6;
6320
+ return data !== null;
6321
+ }).map(_ref7 => {
6322
+ var [site, data] = _ref7;
6323
+ return {
6324
+ site,
6325
+ data
6326
+ };
6327
+ });
6328
+ var buildComparison = (activityKey, countType) => multiSiteResults.map(result => ({
6329
+ name: Helper.getSiteNameFromRoles(result.site, roles),
6330
+ value: Analytics$1.countActivities(result.data, activityKey, countType)
6331
+ }));
6332
+ setComparisonData({
6333
+ requests: buildComparison("Request", "total"),
6334
+ completedRequests: buildComparison("RequestCompleted", "unique"),
6335
+ comments: buildComparison("Comment", "total"),
6336
+ isLoading: false
6337
+ });
6338
+ } else {
6339
+ setAnalyticsData(getInitialState());
6340
+ var site = selectedSites && selectedSites.length === 1 ? selectedSites[0] : auth.site;
6341
+ var timeDifference = endTime - startTime;
6342
+ var [currentStatsResponse, prevStatsResponse] = yield Promise.all([analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime, endTime, true, {
6343
+ userType,
6344
+ userCategory
6345
+ }), analyticsActions.getAggregateEntityStats(site, values.analyticsKey, startTime - timeDifference, startTime, true, {
6346
+ userType,
6347
+ userCategory
6348
+ })]);
6349
+ var data = {
6350
+ requests: Analytics$1.countActivities(currentStatsResponse.data, "Request", "total"),
6351
+ prevRequests: Analytics$1.countActivities(prevStatsResponse.data, "Request", "total"),
6352
+ completedRequests: Analytics$1.countActivities(currentStatsResponse.data, "RequestCompleted", "unique"),
6353
+ prevCompletedRequests: Analytics$1.countActivities(prevStatsResponse.data, "RequestCompleted", "unique"),
6354
+ comments: Analytics$1.countActivities(currentStatsResponse.data, "Comment", "total"),
6355
+ prevComments: Analytics$1.countActivities(prevStatsResponse.data, "Comment", "total"),
6356
+ isLoading: false
6357
+ };
6358
+ setAnalyticsData(data);
6359
+ }
6360
+ } catch (err) {
6361
+ if (comparisonMode) {
6362
+ setComparisonData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
6363
+ isLoading: false
6364
+ }));
6365
+ } else {
6366
+ setAnalyticsData(prev => _objectSpread$3(_objectSpread$3({}, prev), {}, {
6367
+ isLoading: false
6368
+ }));
6369
+ }
6370
+ }
6340
6371
  });
6341
6372
  return function getData() {
6342
6373
  return _ref2.apply(this, arguments);
6343
6374
  };
6344
6375
  }();
6345
6376
  var isReadyToOpenCSV = () => {
6346
- return !analyticsData.isLoading;
6377
+ return comparisonMode ? !comparisonData.isLoading : !analyticsData.isLoading;
6347
6378
  };
6348
6379
  var getExportSource = () => {
6380
+ if (comparisonMode) {
6381
+ var sites = comparisonData.requests || [];
6382
+ return sites.map((site, i) => ({
6383
+ site: site.name,
6384
+ startDate: moment(startTime + 1).format("D-MM-YYYY"),
6385
+ endDate: moment(endTime).format("D-MM-YYYY"),
6386
+ requests: site.value,
6387
+ completedRequests: comparisonData.completedRequests[i] && comparisonData.completedRequests[i].value || 0,
6388
+ comments: comparisonData.comments[i] && comparisonData.comments[i].value || 0
6389
+ }));
6390
+ }
6349
6391
  return [{
6350
- startDate: moment(startTime + 1).format('D-MM-YYYY'),
6351
- endDate: moment(endTime).format('D-MM-YYYY'),
6392
+ startDate: moment(startTime + 1).format("D-MM-YYYY"),
6393
+ endDate: moment(endTime).format("D-MM-YYYY"),
6352
6394
  requests: analyticsData.requests,
6353
6395
  completedRequests: analyticsData.completedRequests,
6354
6396
  comments: analyticsData.comments
@@ -6359,13 +6401,14 @@ var AnalyticsHub = _ref => {
6359
6401
  return null;
6360
6402
  }
6361
6403
  var source = getExportSource();
6404
+ var filterSuffix = [userType, userCategory].filter(Boolean).map(f => f.toLowerCase().replace(/\s+/g, "-")).join("_");
6362
6405
  return /*#__PURE__*/jsx(Components.ExportCsvPopup, {
6363
6406
  onClose: () => {
6364
6407
  setIsExportOpen(false);
6365
6408
  },
6366
6409
  columns: exportColumns,
6367
6410
  source: source,
6368
- filename: "".concat(values.analyticsKey, "analytics_").concat(source[0].startDate, "_").concat(source[0].endDate, ".csv")
6411
+ filename: "".concat(values.analyticsKey, "analytics").concat(comparisonMode ? "_comparison" : "").concat(filterSuffix ? "_".concat(filterSuffix) : "", "_").concat(source[0].startDate, "_").concat(source[0].endDate, ".csv")
6369
6412
  });
6370
6413
  };
6371
6414
  return /*#__PURE__*/jsxs("div", {
@@ -6383,36 +6426,76 @@ var AnalyticsHub = _ref => {
6383
6426
  setIsExportOpen(true);
6384
6427
  },
6385
6428
  isActive: isReadyToOpenCSV(),
6386
- leftIcon: "file-code-o",
6429
+ leftIcon: "file-code",
6387
6430
  children: "Export CSV"
6388
6431
  })]
6389
- }), /*#__PURE__*/jsxs("div", {
6432
+ }), failedSites.length > 0 && /*#__PURE__*/jsxs(Components.Text, {
6433
+ type: "help",
6434
+ style: {
6435
+ color: Colours.COLOUR_RED,
6436
+ marginTop: 8
6437
+ },
6438
+ children: ["Data unavailable for: ", failedSites.join(", ")]
6439
+ }), /*#__PURE__*/jsx("div", {
6390
6440
  className: "analyticsSection dashboardSection_content",
6391
- children: [/*#__PURE__*/jsx(Components.StatBox, {
6392
- title: "".concat(featureTitle, " Requests"),
6393
- icon: faWrench,
6394
- value: analyticsData.requests,
6395
- previousValue: analyticsData.prevRequests,
6396
- prevText: prevText,
6397
- viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount),
6398
- isLoading: analyticsData.isLoading
6399
- }), /*#__PURE__*/jsx(Components.StatBox, {
6400
- title: "Completed ".concat(featureTitle, " Requests"),
6401
- icon: faCircleCheck,
6402
- value: analyticsData.completedRequests,
6403
- previousValue: analyticsData.prevCompletedRequests,
6404
- prevText: prevText,
6405
- viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount),
6406
- isLoading: analyticsData.isLoading
6407
- }), /*#__PURE__*/jsx(Components.StatBox, {
6408
- title: "".concat(featureTitle, " Comments"),
6409
- icon: faComment,
6410
- value: analyticsData.comments,
6411
- previousValue: analyticsData.prevComments,
6412
- prevText: prevText,
6413
- viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount),
6414
- isLoading: analyticsData.isLoading
6415
- })]
6441
+ children: (() => {
6442
+ var chartSuffix = [selectedSites && selectedSites.length > 0 ? "&sites=".concat(selectedSites.join(",")) : "", userType ? "&userType=".concat(encodeURIComponent(userType)) : "", userCategory ? "&userCategory=".concat(encodeURIComponent(userCategory)) : ""].join("");
6443
+ if (comparisonMode) {
6444
+ return /*#__PURE__*/jsxs("div", {
6445
+ style: {
6446
+ display: "flex",
6447
+ flexDirection: "column",
6448
+ gap: 16
6449
+ },
6450
+ children: [/*#__PURE__*/jsx(Components.ComparisonStatBox, {
6451
+ title: "".concat(featureTitle, " Requests"),
6452
+ data: comparisonData.requests,
6453
+ prevText: prevText,
6454
+ viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
6455
+ isLoading: comparisonData.isLoading
6456
+ }), /*#__PURE__*/jsx(Components.ComparisonStatBox, {
6457
+ title: "Completed ".concat(featureTitle, " Requests"),
6458
+ data: comparisonData.completedRequests,
6459
+ prevText: prevText,
6460
+ viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
6461
+ isLoading: comparisonData.isLoading
6462
+ }), /*#__PURE__*/jsx(Components.ComparisonStatBox, {
6463
+ title: "".concat(featureTitle, " Comments"),
6464
+ data: comparisonData.comments,
6465
+ prevText: prevText,
6466
+ viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
6467
+ isLoading: comparisonData.isLoading
6468
+ })]
6469
+ });
6470
+ }
6471
+ return /*#__PURE__*/jsxs(Fragment, {
6472
+ children: [/*#__PURE__*/jsx(Components.StatBox, {
6473
+ title: "".concat(featureTitle, " Requests"),
6474
+ icon: "wrench",
6475
+ value: analyticsData.requests,
6476
+ previousValue: analyticsData.prevRequests,
6477
+ prevText: prevText,
6478
+ viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Request&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
6479
+ isLoading: analyticsData.isLoading
6480
+ }), /*#__PURE__*/jsx(Components.StatBox, {
6481
+ title: "Completed ".concat(featureTitle, " Requests"),
6482
+ icon: "circle-check",
6483
+ value: analyticsData.completedRequests,
6484
+ previousValue: analyticsData.prevCompletedRequests,
6485
+ prevText: prevText,
6486
+ viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=RequestCompleted&countType=unique&dayCount=").concat(dayCount).concat(chartSuffix),
6487
+ isLoading: analyticsData.isLoading
6488
+ }), /*#__PURE__*/jsx(Components.StatBox, {
6489
+ title: "".concat(featureTitle, " Comments"),
6490
+ icon: "comment",
6491
+ value: analyticsData.comments,
6492
+ previousValue: analyticsData.prevComments,
6493
+ prevText: prevText,
6494
+ viewGraphLink: "/chart?entity=".concat(values.analyticsKey, "&startTime=").concat(startTime, "&endTime=").concat(endTime, "&key=Comment&countType=total&dayCount=").concat(dayCount).concat(chartSuffix),
6495
+ isLoading: analyticsData.isLoading
6496
+ })]
6497
+ });
6498
+ })()
6416
6499
  })]
6417
6500
  });
6418
6501
  };
@@ -6445,19 +6528,15 @@ var MaintenanceReducer = (function () {
6445
6528
  loading: true
6446
6529
  });
6447
6530
  case JOBS_LOADED:
6531
+ var result = _.unionWith(action.payload, state.jobs, (v1, v2) => {
6532
+ return v1 != null && v2 != null && v1.id === v2.id;
6533
+ });
6448
6534
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
6449
- jobs: action.payload.map(job => _objectSpread$2({
6535
+ jobs: result.map(job => _objectSpread$2({
6450
6536
  title: job.title || job.description
6451
6537
  }, job)),
6452
6538
  loading: false
6453
6539
  });
6454
- case JOBS_ADDED:
6455
- var added = _.unionWith(action.payload.map(job => _objectSpread$2({
6456
- title: job.title || job.description
6457
- }, job)), state.jobs, (v1, v2) => v1 != null && v2 != null && v1.id === v2.id);
6458
- return _objectSpread$2(_objectSpread$2({}, state), {}, {
6459
- jobs: added
6460
- });
6461
6540
  case JOBS_REMOVED:
6462
6541
  var index = _.findIndex(state.jobs, event => {
6463
6542
  return event != null && event.id === action.payload;
@@ -6478,7 +6557,7 @@ var MaintenanceReducer = (function () {
6478
6557
  jobtypes
6479
6558
  });
6480
6559
  case JOBS_STATUSES_LOADED:
6481
- var jobstatuses = _.orderBy(action.payload, 'order', 'asc');
6560
+ var jobstatuses = _.orderBy(action.payload, "order", "asc");
6482
6561
  return _objectSpread$2(_objectSpread$2({}, state), {}, {
6483
6562
  jobstatuses
6484
6563
  });
@@ -6511,7 +6590,7 @@ class ActivityText extends Component {
6511
6590
  className: clickableClasses,
6512
6591
  children: _.truncate(data.Data.title || data.Data.description, {
6513
6592
  length: 30,
6514
- separator: '...'
6593
+ separator: "..."
6515
6594
  })
6516
6595
  })]
6517
6596
  });
@@ -6526,7 +6605,7 @@ class ActivityText extends Component {
6526
6605
  className: clickableClasses,
6527
6606
  children: _.truncate(data.Data.title || data.Data.description, {
6528
6607
  length: 30,
6529
- separator: '...'
6608
+ separator: "..."
6530
6609
  })
6531
6610
  })]
6532
6611
  });
@@ -6541,7 +6620,7 @@ class ActivityText extends Component {
6541
6620
  className: clickableClasses,
6542
6621
  children: _.truncate(data.Data.title || data.Data.description, {
6543
6622
  length: 30,
6544
- separator: '...'
6623
+ separator: "..."
6545
6624
  })
6546
6625
  })]
6547
6626
  });
@@ -6555,7 +6634,7 @@ class ActivityText extends Component {
6555
6634
  className: highlightedClasses,
6556
6635
  children: _.truncate(data.Data.title || data.Data.description, {
6557
6636
  length: 30,
6558
- separator: '...'
6637
+ separator: "..."
6559
6638
  })
6560
6639
  })]
6561
6640
  });
@@ -6597,9 +6676,9 @@ class ViewFull extends Component {
6597
6676
  }
6598
6677
  var styles$2 = {
6599
6678
  image: {
6600
- width: '100%',
6601
- height: '100%',
6602
- objectFit: 'contain'
6679
+ width: "100%",
6680
+ height: "100%",
6681
+ objectFit: "contain"
6603
6682
  }
6604
6683
  };
6605
6684
 
@@ -6633,10 +6712,10 @@ class PreviewWidget extends Component {
6633
6712
  }
6634
6713
  var styles$1 = {
6635
6714
  container: {
6636
- position: 'relative'
6715
+ position: "relative"
6637
6716
  },
6638
6717
  image: {
6639
- width: '100%'
6718
+ width: "100%"
6640
6719
  }
6641
6720
  };
6642
6721
 
@@ -6669,10 +6748,10 @@ class PreviewFull extends Component {
6669
6748
  }
6670
6749
  var styles = {
6671
6750
  container: {
6672
- position: 'relative'
6751
+ position: "relative"
6673
6752
  },
6674
6753
  image: {
6675
- width: '100%'
6754
+ width: "100%"
6676
6755
  }
6677
6756
  };
6678
6757